diff --git a/docs/.gitignore b/docs/.gitignore index 018b04a695e1c7daf3092c070fe381a5176f2b57..8016a41470cf2e984f7f172c4e97104518a8fe0c 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -7,7 +7,6 @@ tezos-client.html /api/tezos-admin-client.html /api/tezos-signer.html -/ithaca/rpc.rst /jakarta/rpc.rst /kathmandu/rpc.rst /alpha/rpc.rst diff --git a/docs/Makefile b/docs/Makefile index 2bcc1932175d8fbaa6a4a37170d722209ba2e308..ad1822eb962f4dd09f98969d80c3627766ff7bba 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -13,17 +13,15 @@ P2PDOCEXE = $(TOPBUILDDIR)/docs/$(DOCGENDIR)/p2p_doc.exe RPCDOCEXE = $(TOPBUILDDIR)/docs/$(DOCGENDIR)/rpc_doc.exe ERRDOCEXE = $(TOPBUILDDIR)/docs/$(DOCERRORDIR)/error_doc.exe -NAMED_PROTOS = ithaca jakarta kathmandu +NAMED_PROTOS = jakarta kathmandu PROTOCOLS = $(NAMED_PROTOS) alpha # The following variables names are lowercase, so their names can be computed # from the names of the corresponding protocol directories -ithaca_long = Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A jakarta_long = PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY kathmandu_long = PtKathmaHPSjL3WDmUCJP7iHBsUix65HdAgSeVacukogRK6hum6 alpha_long = ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK -ithaca_short = 012-Psithaca jakarta_short = 013-PtJakart kathmandu_short = 014-PtKathma alpha_short = alpha @@ -99,8 +97,7 @@ redirectcheck: html # - on the active protocol using its numeric name (not the "active" symlink) # - on each other protocol including alpha, also checking label defs (option -l) xrefscheck: - $(CHECKXREFS) ithaca - $(CHECKXREFS) -l jakarta + $(CHECKXREFS) jakarta $(CHECKXREFS) -l kathmandu $(CHECKXREFS) -l alpha @@ -114,7 +111,8 @@ scriptsindoccheck: scripts/test_doc_scripts.sh install-opam-scratch scripts/test_doc_scripts.sh install-opam-bionic scripts/test_doc_scripts.sh install-opam-focal - scripts/test_doc_scripts.sh compile-sources-buster + scripts/test_doc_scripts.sh compile-release-sources-buster + scripts/test_doc_scripts.sh compile-master-sources-buster # build dune targets together to avoid concurrent dunes docexes: main @@ -155,7 +153,7 @@ html: api/errors.rst developer/metrics.csv user/node-config.json \ rpc p2p manuals install-dependencies (echo ':orphan:'; echo ''; cat ../CHANGES.rst) > CHANGES-dev.rst @$(SPHINXBUILD) -b html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) - @ln -s active "$(BUILDDIR)/ithaca" || true + @ln -s active "$(BUILDDIR)/jakarta" || true # pylint does not support pyproject.toml configuration for now # It is configured by ./.pylint.rc @@ -198,5 +196,5 @@ lint: pylint pycodestyle lint_black clean: @-rm -Rf "$(BUILDDIR)" linkcheck - @-rm -Rf api/errors.rst developer/metrics.csv user/node-config.json active/rpc.rst ithaca/rpc.rst jakarta/rpc.rst kathmandu/rpc.rst alpha/rpc.rst shell/rpc.rst shell/p2p_api.rst user/default-acl.json CHANGES-dev.rst - @-rm -Rf api/tezos-*.html api/tezos-*.txt active/tezos-*.html ithaca/tezos-*.html jakarta/tezos-*.html kathmandu/tezos-*.html alpha/tezos-*.html + @-rm -Rf api/errors.rst developer/metrics.csv user/node-config.json active/rpc.rst jakarta/rpc.rst kathmandu/rpc.rst alpha/rpc.rst shell/rpc.rst shell/p2p_api.rst user/default-acl.json CHANGES-dev.rst + @-rm -Rf api/tezos-*.html api/tezos-*.txt active/tezos-*.html jakarta/tezos-*.html kathmandu/tezos-*.html alpha/tezos-*.html diff --git a/docs/_redirects b/docs/_redirects index 580c3518887fc910fae7580d995fab5b8eb33408..2b9a3de4e86417541f4ceb9cda88b34879ab082f 100644 --- a/docs/_redirects +++ b/docs/_redirects @@ -45,6 +45,22 @@ /012/timelock.html /active/timelock.html 301 /012/token_management.html /active/token_management.html 301 /012/voting.html /active/voting.html 301 +/013/cli-commands.html /active/cli-commands.html 301 +/013/consensus.html /active/consensus.html 301 +/013/global_constants.html /active/global_constants.html 301 +/013/glossary.html /active/glossary.html 301 +/013/liquidity_baking.html /active/liquidity_baking.html 301 +/013/michelson.html /active/michelson.html 301 +/013/plugins.html /active/plugins.html 301 +/013/precheck.html /active/precheck.html 301 +/013/proof_of_stake.html /active/proof_of_stake.html 301 +/013/protocol.html /active/protocol.html 301 +/013/protocol_overview.html /active/protocol_overview.html 301 +/013/sapling.html /active/sapling.html 301 +/013/timelock.html /active/timelock.html 301 +/013/token_management.html /active/token_management.html 301 +/013/transaction_rollups.html /active/transaction_rollups.html 301 +/013/voting.html /active/voting.html 301 /api/cli-commands.html /shell/cli-commands.html 301 /api/rpc.html /shell/rpc.html 301 /developer/sapling.html /active/sapling.html 301 diff --git a/docs/active b/docs/active index eb0e60cf467012f1cb748b1792ef6065b1f8816d..a0c60a3f240686f75d3527e8d29b39ec2c5615c1 120000 --- a/docs/active +++ b/docs/active @@ -1 +1 @@ -ithaca \ No newline at end of file +jakarta \ No newline at end of file diff --git a/docs/alpha/consensus.rst b/docs/alpha/consensus.rst index b21248fce8651b0302a8bb331fe0a8bcb7866565..6b972a00eb330ae4912c36cb8ae3fc0911fc4382 100644 --- a/docs/alpha/consensus.rst +++ b/docs/alpha/consensus.rst @@ -138,6 +138,8 @@ should be taken at round 0, meaning that the time between blocks would be :math:`round\_duration(0)` seconds i.e., parameter ``MINIMAL_BLOCK_DELAY``. +.. _active_stake_alpha: + Validator selection: staking balance, active stake, and frozen deposits ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/alpha/glossary.rst b/docs/alpha/glossary.rst index cd46eea651a5e4b201613aa95b09313746050874..48a9419c6ff294a477e2296b25cf15776faaf73e 100644 --- a/docs/alpha/glossary.rst +++ b/docs/alpha/glossary.rst @@ -147,6 +147,8 @@ _`Round` the round's corresponding time span. Baking_ outside of one's designated round results in an invalid block_. +.. _glossary_roll_alpha: + _`Roll` An amount of tez (e.g., 6000ꜩ) serving as a minimal amount for a delegate to have baking_ and voting rights in a cycle_. However, diff --git a/docs/api/ithaca-mempool-openapi.json b/docs/api/ithaca-mempool-openapi.json deleted file mode 100644 index bbf8ab5730d55e25f2ccbca773aafa0bebb36d96..0000000000000000000000000000000000000000 --- a/docs/api/ithaca-mempool-openapi.json +++ /dev/null @@ -1,2365 +0,0 @@ -{ - "openapi": "3.0.0", - "info": { - "title": "Tezos RPC", - "description": "Tezos client RPC API.", - "version": "12.0~rc2" - }, - "paths": { - "/ban_operation": { - "post": { - "description": "Remove an operation from the mempool if present, reverting its effect if it was applied. Add it to the set of banned operations to prevent it from being fetched/processed/injected in the future. Note: If the baker has already received the operation, then it's necessary to restart it to flush the operation from it.", - "requestBody": { - "content": { - "application/json": { - "schema": { - "title": "A Tezos operation ID (Base58Check-encoded)", - "oneOf": [ - { - "$ref": "#/components/schemas/unistring" - } - ] - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": {} - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/filter": { - "get": { - "description": "Get the configuration of the mempool filter. The minimal_fees are in mutez. Each field minimal_nanotez_per_xxx is a rational number given as a numerator and a denominator, e.g. \"minimal_nanotez_per_gas_unit\": [ \"100\", \"1\" ].", - "parameters": [ - { - "name": "include_default", - "in": "query", - "description": "Show fields equal to their default value (set by default)", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": {} - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - }, - "post": { - "description": "Set the configuration of the mempool filter. **If any of the fields is absent from the input JSON, then it is set to the default value for this field (i.e. its value in the default configuration), even if it previously had a different value.** If the input JSON does not describe a valid configuration, then the configuration is left unchanged. Also return the new configuration (which may differ from the input if it had omitted fields or was invalid). You may call [./tezos-client rpc get '/chains/main/mempool/filter?include_default=true'] to see an example of JSON describing a valid configuration.", - "requestBody": { - "content": { - "application/json": { - "schema": {} - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": {} - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/monitor_operations": { - "get": { - "description": "Monitor the mempool operations.", - "parameters": [ - { - "name": "applied", - "in": "query", - "description": "Include applied operations (set by default)", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "refused", - "in": "query", - "description": "Include refused operations", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "outdated", - "in": "query", - "description": "Include outdated operations", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "branch_refused", - "in": "query", - "description": "Include branch refused operations", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "branch_delayed", - "in": "query", - "description": "Include branch delayed operations (set by default)", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "description": "An operation's shell header.", - "type": "object", - "properties": { - "hash": { - "$ref": "#/components/schemas/Operation_hash" - }, - "protocol": { - "type": "string", - "enum": [ - "Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A" - ] - }, - "branch": { - "$ref": "#/components/schemas/block_hash" - }, - "contents": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.operation.alpha.contents" - } - }, - "signature": { - "$ref": "#/components/schemas/Signature" - }, - "error": { - "$ref": "#/components/schemas/error_opt" - } - }, - "required": [ - "hash", - "protocol", - "branch", - "contents", - "signature" - ] - } - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/pending_operations": { - "get": { - "description": "List the prevalidated operations.", - "parameters": [ - { - "name": "version", - "in": "query", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "title": "new_encoding_pending_operations", - "type": "object", - "properties": { - "applied": { - "type": "array", - "items": { - "description": "An operation's shell header.", - "type": "object", - "properties": { - "hash": { - "$ref": "#/components/schemas/Operation_hash" - }, - "branch": { - "$ref": "#/components/schemas/block_hash" - }, - "contents": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.operation.alpha.contents" - } - }, - "signature": { - "$ref": "#/components/schemas/Signature" - } - }, - "required": [ - "hash", - "branch", - "contents", - "signature" - ] - } - }, - "refused": { - "type": "array", - "items": { - "description": "An operation's shell header.", - "type": "object", - "properties": { - "hash": { - "$ref": "#/components/schemas/Operation_hash" - }, - "protocol": { - "type": "string", - "enum": [ - "Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A" - ] - }, - "branch": { - "$ref": "#/components/schemas/block_hash" - }, - "contents": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.operation.alpha.contents" - } - }, - "signature": { - "$ref": "#/components/schemas/Signature" - }, - "error": { - "$ref": "#/components/schemas/error" - } - }, - "required": [ - "hash", - "protocol", - "branch", - "contents", - "signature", - "error" - ] - } - }, - "outdated": { - "type": "array", - "items": { - "description": "An operation's shell header.", - "type": "object", - "properties": { - "hash": { - "$ref": "#/components/schemas/Operation_hash" - }, - "protocol": { - "type": "string", - "enum": [ - "Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A" - ] - }, - "branch": { - "$ref": "#/components/schemas/block_hash" - }, - "contents": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.operation.alpha.contents" - } - }, - "signature": { - "$ref": "#/components/schemas/Signature" - }, - "error": { - "$ref": "#/components/schemas/error" - } - }, - "required": [ - "hash", - "protocol", - "branch", - "contents", - "signature", - "error" - ] - } - }, - "branch_refused": { - "type": "array", - "items": { - "description": "An operation's shell header.", - "type": "object", - "properties": { - "hash": { - "$ref": "#/components/schemas/Operation_hash" - }, - "protocol": { - "type": "string", - "enum": [ - "Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A" - ] - }, - "branch": { - "$ref": "#/components/schemas/block_hash" - }, - "contents": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.operation.alpha.contents" - } - }, - "signature": { - "$ref": "#/components/schemas/Signature" - }, - "error": { - "$ref": "#/components/schemas/error" - } - }, - "required": [ - "hash", - "protocol", - "branch", - "contents", - "signature", - "error" - ] - } - }, - "branch_delayed": { - "type": "array", - "items": { - "description": "An operation's shell header.", - "type": "object", - "properties": { - "hash": { - "$ref": "#/components/schemas/Operation_hash" - }, - "protocol": { - "type": "string", - "enum": [ - "Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A" - ] - }, - "branch": { - "$ref": "#/components/schemas/block_hash" - }, - "contents": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.operation.alpha.contents" - } - }, - "signature": { - "$ref": "#/components/schemas/Signature" - }, - "error": { - "$ref": "#/components/schemas/error" - } - }, - "required": [ - "hash", - "protocol", - "branch", - "contents", - "signature", - "error" - ] - } - }, - "unprocessed": { - "type": "array", - "items": { - "description": "An operation's shell header.", - "type": "object", - "properties": { - "hash": { - "$ref": "#/components/schemas/Operation_hash" - }, - "protocol": { - "type": "string", - "enum": [ - "Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A" - ] - }, - "branch": { - "$ref": "#/components/schemas/block_hash" - }, - "contents": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.operation.alpha.contents" - } - }, - "signature": { - "$ref": "#/components/schemas/Signature" - } - }, - "required": [ - "hash", - "protocol", - "branch", - "contents", - "signature" - ] - } - } - }, - "required": [ - "applied", - "refused", - "outdated", - "branch_refused", - "branch_delayed", - "unprocessed" - ] - }, - { - "title": "old_encoding_pending_operations", - "type": "object", - "properties": { - "applied": { - "type": "array", - "items": { - "description": "An operation's shell header.", - "type": "object", - "properties": { - "hash": { - "$ref": "#/components/schemas/Operation_hash" - }, - "branch": { - "$ref": "#/components/schemas/block_hash" - }, - "contents": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.operation.alpha.contents" - } - }, - "signature": { - "$ref": "#/components/schemas/Signature" - } - }, - "required": [ - "hash", - "branch", - "contents", - "signature" - ] - } - }, - "refused": { - "type": "array", - "items": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/Operation_hash" - }, - { - "description": "An operation's shell header.", - "type": "object", - "properties": { - "protocol": { - "type": "string", - "enum": [ - "Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A" - ] - }, - "branch": { - "$ref": "#/components/schemas/block_hash" - }, - "contents": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.operation.alpha.contents" - } - }, - "signature": { - "$ref": "#/components/schemas/Signature" - }, - "error": { - "$ref": "#/components/schemas/error" - } - }, - "required": [ - "protocol", - "branch", - "contents", - "signature", - "error" - ] - } - ] - } - } - }, - "outdated": { - "type": "array", - "items": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/Operation_hash" - }, - { - "description": "An operation's shell header.", - "type": "object", - "properties": { - "protocol": { - "type": "string", - "enum": [ - "Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A" - ] - }, - "branch": { - "$ref": "#/components/schemas/block_hash" - }, - "contents": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.operation.alpha.contents" - } - }, - "signature": { - "$ref": "#/components/schemas/Signature" - }, - "error": { - "$ref": "#/components/schemas/error" - } - }, - "required": [ - "protocol", - "branch", - "contents", - "signature", - "error" - ] - } - ] - } - } - }, - "branch_refused": { - "type": "array", - "items": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/Operation_hash" - }, - { - "description": "An operation's shell header.", - "type": "object", - "properties": { - "protocol": { - "type": "string", - "enum": [ - "Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A" - ] - }, - "branch": { - "$ref": "#/components/schemas/block_hash" - }, - "contents": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.operation.alpha.contents" - } - }, - "signature": { - "$ref": "#/components/schemas/Signature" - }, - "error": { - "$ref": "#/components/schemas/error" - } - }, - "required": [ - "protocol", - "branch", - "contents", - "signature", - "error" - ] - } - ] - } - } - }, - "branch_delayed": { - "type": "array", - "items": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/Operation_hash" - }, - { - "description": "An operation's shell header.", - "type": "object", - "properties": { - "protocol": { - "type": "string", - "enum": [ - "Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A" - ] - }, - "branch": { - "$ref": "#/components/schemas/block_hash" - }, - "contents": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.operation.alpha.contents" - } - }, - "signature": { - "$ref": "#/components/schemas/Signature" - }, - "error": { - "$ref": "#/components/schemas/error" - } - }, - "required": [ - "protocol", - "branch", - "contents", - "signature", - "error" - ] - } - ] - } - } - }, - "unprocessed": { - "type": "array", - "items": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/Operation_hash" - }, - { - "$ref": "#/components/schemas/next_operation" - } - ] - } - } - } - }, - "required": [ - "applied", - "refused", - "outdated", - "branch_refused", - "branch_delayed", - "unprocessed" - ] - } - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/request_operations": { - "post": { - "description": "Request the operations of our peers or a specific peer if specified via a query parameter.", - "parameters": [ - { - "name": "peer_id", - "in": "query", - "description": "A cryptographic node identity (Base58Check-encoded)", - "required": false, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": {} - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": {} - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/unban_all_operations": { - "post": { - "description": "Clear the set of banned operations.", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": {} - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": {} - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/unban_operation": { - "post": { - "description": "Remove an operation from the set of banned operations (nothing happens if it was not banned).", - "requestBody": { - "content": { - "application/json": { - "schema": { - "title": "A Tezos operation ID (Base58Check-encoded)", - "oneOf": [ - { - "$ref": "#/components/schemas/unistring" - } - ] - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": {} - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - } - }, - "components": { - "schemas": { - "012-Psithaca.block_header.alpha.full_header": { - "title": "Shell header", - "description": "Block header's shell-related content. It contains information such as the block level, its predecessor and timestamp.", - "type": "object", - "properties": { - "level": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "proto": { - "type": "integer", - "minimum": 0, - "maximum": 255 - }, - "predecessor": { - "$ref": "#/components/schemas/block_hash" - }, - "timestamp": { - "$ref": "#/components/schemas/timestamp.protocol" - }, - "validation_pass": { - "type": "integer", - "minimum": 0, - "maximum": 255 - }, - "operations_hash": { - "$ref": "#/components/schemas/Operation_list_list_hash" - }, - "fitness": { - "$ref": "#/components/schemas/fitness" - }, - "context": { - "$ref": "#/components/schemas/Context_hash" - }, - "payload_hash": { - "$ref": "#/components/schemas/value_hash" - }, - "payload_round": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "proof_of_work_nonce": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - }, - "seed_nonce_hash": { - "$ref": "#/components/schemas/cycle_nonce" - }, - "liquidity_baking_escape_vote": { - "type": "boolean" - }, - "signature": { - "$ref": "#/components/schemas/Signature" - } - }, - "required": [ - "level", - "proto", - "predecessor", - "timestamp", - "validation_pass", - "operations_hash", - "fitness", - "context", - "payload_hash", - "payload_round", - "proof_of_work_nonce", - "liquidity_baking_escape_vote", - "signature" - ] - }, - "012-Psithaca.contract_id": { - "title": "A contract handle", - "description": "A contract notation as given to an RPC or inside scripts. Can be a base58 implicit contract hash or a base58 originated contract hash.", - "oneOf": [ - { - "$ref": "#/components/schemas/unistring" - } - ] - }, - "012-Psithaca.entrypoint": { - "title": "entrypoint", - "description": "Named entrypoint to a Michelson smart contract", - "oneOf": [ - { - "title": "default", - "type": "string", - "enum": [ - "default" - ] - }, - { - "title": "root", - "type": "string", - "enum": [ - "root" - ] - }, - { - "title": "do", - "type": "string", - "enum": [ - "do" - ] - }, - { - "title": "set_delegate", - "type": "string", - "enum": [ - "set_delegate" - ] - }, - { - "title": "remove_delegate", - "type": "string", - "enum": [ - "remove_delegate" - ] - }, - { - "title": "named", - "type": "string" - } - ] - }, - "012-Psithaca.inlined.endorsement": { - "description": "An operation's shell header.", - "type": "object", - "properties": { - "branch": { - "$ref": "#/components/schemas/block_hash" - }, - "operations": { - "$ref": "#/components/schemas/012-Psithaca.inlined.endorsement_mempool.contents" - }, - "signature": { - "$ref": "#/components/schemas/Signature" - } - }, - "required": [ - "branch", - "operations" - ] - }, - "012-Psithaca.inlined.endorsement_mempool.contents": { - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "endorsement" - ] - }, - "slot": { - "type": "integer", - "minimum": 0, - "maximum": 65535 - }, - "level": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "round": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "block_payload_hash": { - "$ref": "#/components/schemas/value_hash" - } - }, - "required": [ - "kind", - "slot", - "level", - "round", - "block_payload_hash" - ] - }, - "012-Psithaca.inlined.preendorsement": { - "description": "An operation's shell header.", - "type": "object", - "properties": { - "branch": { - "$ref": "#/components/schemas/block_hash" - }, - "operations": { - "$ref": "#/components/schemas/012-Psithaca.inlined.preendorsement.contents" - }, - "signature": { - "$ref": "#/components/schemas/Signature" - } - }, - "required": [ - "branch", - "operations" - ] - }, - "012-Psithaca.inlined.preendorsement.contents": { - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "preendorsement" - ] - }, - "slot": { - "type": "integer", - "minimum": 0, - "maximum": 65535 - }, - "level": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "round": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "block_payload_hash": { - "$ref": "#/components/schemas/value_hash" - } - }, - "required": [ - "kind", - "slot", - "level", - "round", - "block_payload_hash" - ] - }, - "012-Psithaca.michelson.v1.primitives": { - "type": "string", - "enum": [ - "ABS", - "IF", - "SENDER", - "NEVER", - "False", - "DUG", - "DIG", - "chest_key", - "BLAKE2B", - "list", - "bls12_381_g1", - "Pair", - "INT", - "nat", - "never", - "storage", - "SIZE", - "view", - "SHA256", - "AND", - "VIEW", - "bytes", - "NIL", - "map", - "SUB", - "SAPLING_EMPTY_STATE", - "CHECK_SIGNATURE", - "VOTING_POWER", - "operation", - "MAP", - "option", - "bls12_381_fr", - "ADD", - "IMPLICIT_ACCOUNT", - "SHA512", - "int", - "LSL", - "bls12_381_g2", - "ticket", - "sapling_transaction", - "COMPARE", - "SWAP", - "STEPS_TO_QUOTA", - "DROP", - "pair", - "BALANCE", - "CONCAT", - "MUL", - "FAILWITH", - "Elt", - "lambda", - "OR", - "DIP", - "MEM", - "ITER", - "key_hash", - "XOR", - "Some", - "parameter", - "address", - "EMPTY_MAP", - "None", - "TRANSFER_TOKENS", - "or", - "AMOUNT", - "signature", - "SHA3", - "string", - "CHAIN_ID", - "HASH_KEY", - "IF_LEFT", - "CREATE_ACCOUNT", - "LT", - "TOTAL_VOTING_POWER", - "UNPACK", - "READ_TICKET", - "SELF_ADDRESS", - "timestamp", - "SET_DELEGATE", - "LE", - "SOURCE", - "CREATE_CONTRACT", - "Unit", - "SAPLING_VERIFY_UPDATE", - "NONE", - "CONTRACT", - "GE", - "SOME", - "key", - "SELF", - "set", - "CAR", - "NOT", - "unit", - "CDR", - "LOOP_LEFT", - "PAIRING_CHECK", - "RIGHT", - "LEFT", - "CAST", - "True", - "Right", - "PACK", - "IF_CONS", - "KECCAK", - "chest", - "UNIT", - "EMPTY_SET", - "NEQ", - "LAMBDA", - "mutez", - "TICKET", - "LOOP", - "Left", - "contract", - "LSR", - "EMPTY_BIG_MAP", - "sapling_state", - "JOIN_TICKETS", - "LEVEL", - "UNPAIR", - "SPLIT_TICKET", - "PUSH", - "big_map", - "GT", - "chain_id", - "constant", - "NOW", - "IF_NONE", - "PAIR", - "GET_AND_UPDATE", - "UPDATE", - "ISNAT", - "RENAME", - "OPEN_CHEST", - "EDIV", - "EQ", - "ADDRESS", - "bool", - "EXEC", - "GET", - "NEG", - "SLICE", - "DUP", - "CONS", - "APPLY", - "SUB_MUTEZ", - "code" - ] - }, - "012-Psithaca.mutez": { - "$ref": "#/components/schemas/positive_bignum" - }, - "012-Psithaca.operation.alpha.contents": { - "oneOf": [ - { - "title": "Endorsement", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "endorsement" - ] - }, - "slot": { - "type": "integer", - "minimum": 0, - "maximum": 65535 - }, - "level": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "round": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "block_payload_hash": { - "$ref": "#/components/schemas/value_hash" - } - }, - "required": [ - "kind", - "slot", - "level", - "round", - "block_payload_hash" - ] - }, - { - "title": "Preendorsement", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "preendorsement" - ] - }, - "slot": { - "type": "integer", - "minimum": 0, - "maximum": 65535 - }, - "level": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "round": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "block_payload_hash": { - "$ref": "#/components/schemas/value_hash" - } - }, - "required": [ - "kind", - "slot", - "level", - "round", - "block_payload_hash" - ] - }, - { - "title": "Seed_nonce_revelation", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "seed_nonce_revelation" - ] - }, - "level": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "nonce": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "kind", - "level", - "nonce" - ] - }, - { - "title": "Double_endorsement_evidence", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "double_endorsement_evidence" - ] - }, - "op1": { - "$ref": "#/components/schemas/012-Psithaca.inlined.endorsement" - }, - "op2": { - "$ref": "#/components/schemas/012-Psithaca.inlined.endorsement" - } - }, - "required": [ - "kind", - "op1", - "op2" - ] - }, - { - "title": "Double_preendorsement_evidence", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "double_preendorsement_evidence" - ] - }, - "op1": { - "$ref": "#/components/schemas/012-Psithaca.inlined.preendorsement" - }, - "op2": { - "$ref": "#/components/schemas/012-Psithaca.inlined.preendorsement" - } - }, - "required": [ - "kind", - "op1", - "op2" - ] - }, - { - "title": "Double_baking_evidence", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "double_baking_evidence" - ] - }, - "bh1": { - "$ref": "#/components/schemas/012-Psithaca.block_header.alpha.full_header" - }, - "bh2": { - "$ref": "#/components/schemas/012-Psithaca.block_header.alpha.full_header" - } - }, - "required": [ - "kind", - "bh1", - "bh2" - ] - }, - { - "title": "Activate_account", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "activate_account" - ] - }, - "pkh": { - "$ref": "#/components/schemas/Ed25519.Public_key_hash" - }, - "secret": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "kind", - "pkh", - "secret" - ] - }, - { - "title": "Proposals", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "proposals" - ] - }, - "source": { - "$ref": "#/components/schemas/Signature.Public_key_hash" - }, - "period": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "proposals": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Protocol_hash" - } - } - }, - "required": [ - "kind", - "source", - "period", - "proposals" - ] - }, - { - "title": "Ballot", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "ballot" - ] - }, - "source": { - "$ref": "#/components/schemas/Signature.Public_key_hash" - }, - "period": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "proposal": { - "$ref": "#/components/schemas/Protocol_hash" - }, - "ballot": { - "type": "string", - "enum": [ - "nay", - "yay", - "pass" - ] - } - }, - "required": [ - "kind", - "source", - "period", - "proposal", - "ballot" - ] - }, - { - "title": "Reveal", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "reveal" - ] - }, - "source": { - "$ref": "#/components/schemas/Signature.Public_key_hash" - }, - "fee": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "counter": { - "$ref": "#/components/schemas/positive_bignum" - }, - "gas_limit": { - "$ref": "#/components/schemas/positive_bignum" - }, - "storage_limit": { - "$ref": "#/components/schemas/positive_bignum" - }, - "public_key": { - "$ref": "#/components/schemas/Signature.Public_key" - } - }, - "required": [ - "kind", - "source", - "fee", - "counter", - "gas_limit", - "storage_limit", - "public_key" - ] - }, - { - "title": "Transaction", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "transaction" - ] - }, - "source": { - "$ref": "#/components/schemas/Signature.Public_key_hash" - }, - "fee": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "counter": { - "$ref": "#/components/schemas/positive_bignum" - }, - "gas_limit": { - "$ref": "#/components/schemas/positive_bignum" - }, - "storage_limit": { - "$ref": "#/components/schemas/positive_bignum" - }, - "amount": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "destination": { - "$ref": "#/components/schemas/012-Psithaca.contract_id" - }, - "parameters": { - "type": "object", - "properties": { - "entrypoint": { - "$ref": "#/components/schemas/012-Psithaca.entrypoint" - }, - "value": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - } - }, - "required": [ - "entrypoint", - "value" - ] - } - }, - "required": [ - "kind", - "source", - "fee", - "counter", - "gas_limit", - "storage_limit", - "amount", - "destination" - ] - }, - { - "title": "Origination", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "origination" - ] - }, - "source": { - "$ref": "#/components/schemas/Signature.Public_key_hash" - }, - "fee": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "counter": { - "$ref": "#/components/schemas/positive_bignum" - }, - "gas_limit": { - "$ref": "#/components/schemas/positive_bignum" - }, - "storage_limit": { - "$ref": "#/components/schemas/positive_bignum" - }, - "balance": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "delegate": { - "$ref": "#/components/schemas/Signature.Public_key_hash" - }, - "script": { - "$ref": "#/components/schemas/012-Psithaca.scripted.contracts" - } - }, - "required": [ - "kind", - "source", - "fee", - "counter", - "gas_limit", - "storage_limit", - "balance", - "script" - ] - }, - { - "title": "Delegation", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "delegation" - ] - }, - "source": { - "$ref": "#/components/schemas/Signature.Public_key_hash" - }, - "fee": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "counter": { - "$ref": "#/components/schemas/positive_bignum" - }, - "gas_limit": { - "$ref": "#/components/schemas/positive_bignum" - }, - "storage_limit": { - "$ref": "#/components/schemas/positive_bignum" - }, - "delegate": { - "$ref": "#/components/schemas/Signature.Public_key_hash" - } - }, - "required": [ - "kind", - "source", - "fee", - "counter", - "gas_limit", - "storage_limit" - ] - }, - { - "title": "Set_deposits_limit", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "set_deposits_limit" - ] - }, - "source": { - "$ref": "#/components/schemas/Signature.Public_key_hash" - }, - "fee": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "counter": { - "$ref": "#/components/schemas/positive_bignum" - }, - "gas_limit": { - "$ref": "#/components/schemas/positive_bignum" - }, - "storage_limit": { - "$ref": "#/components/schemas/positive_bignum" - }, - "limit": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - } - }, - "required": [ - "kind", - "source", - "fee", - "counter", - "gas_limit", - "storage_limit" - ] - }, - { - "title": "Failing_noop", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "failing_noop" - ] - }, - "arbitrary": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "kind", - "arbitrary" - ] - }, - { - "title": "Register_global_constant", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "register_global_constant" - ] - }, - "source": { - "$ref": "#/components/schemas/Signature.Public_key_hash" - }, - "fee": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "counter": { - "$ref": "#/components/schemas/positive_bignum" - }, - "gas_limit": { - "$ref": "#/components/schemas/positive_bignum" - }, - "storage_limit": { - "$ref": "#/components/schemas/positive_bignum" - }, - "value": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - } - }, - "required": [ - "kind", - "source", - "fee", - "counter", - "gas_limit", - "storage_limit", - "value" - ] - } - ] - }, - "012-Psithaca.scripted.contracts": { - "type": "object", - "properties": { - "code": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - "storage": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - } - }, - "required": [ - "code", - "storage" - ] - }, - "Context_hash": { - "title": "A hash of context (Base58Check-encoded)", - "oneOf": [ - { - "$ref": "#/components/schemas/unistring" - } - ] - }, - "Ed25519.Public_key_hash": { - "title": "An Ed25519 public key hash (Base58Check-encoded)", - "oneOf": [ - { - "$ref": "#/components/schemas/unistring" - } - ] - }, - "Operation_hash": { - "title": "A Tezos operation ID (Base58Check-encoded)", - "oneOf": [ - { - "$ref": "#/components/schemas/unistring" - } - ] - }, - "Operation_list_list_hash": { - "title": "A list of list of operations (Base58Check-encoded)", - "oneOf": [ - { - "$ref": "#/components/schemas/unistring" - } - ] - }, - "Protocol_hash": { - "title": "A Tezos protocol ID (Base58Check-encoded)", - "oneOf": [ - { - "$ref": "#/components/schemas/unistring" - } - ] - }, - "Signature": { - "title": "A Ed25519, Secp256k1 or P256 signature (Base58Check-encoded)", - "oneOf": [ - { - "$ref": "#/components/schemas/unistring" - } - ] - }, - "Signature.Public_key": { - "title": "A Ed25519, Secp256k1, or P256 public key (Base58Check-encoded)", - "oneOf": [ - { - "$ref": "#/components/schemas/unistring" - } - ] - }, - "Signature.Public_key_hash": { - "title": "A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded)", - "oneOf": [ - { - "$ref": "#/components/schemas/unistring" - } - ] - }, - "bignum": { - "title": "Big number", - "description": "Decimal representation of a big number", - "type": "string" - }, - "block_hash": { - "title": "A block identifier (Base58Check-encoded)", - "oneOf": [ - { - "$ref": "#/components/schemas/unistring" - } - ] - }, - "cycle_nonce": { - "title": "A nonce hash (Base58Check-encoded)", - "oneOf": [ - { - "$ref": "#/components/schemas/unistring" - } - ] - }, - "error": { - "description": "The full list of errors is available with the global RPC `GET errors`" - }, - "error_opt": { - "description": "An optional error-trace (None indicates no error). The full list of errors is available with the global RPC `GET errors`" - }, - "fitness": { - "title": "Block fitness", - "description": "The fitness, or score, of a block, that allow the Tezos to decide which chain is the best. A fitness value is a list of byte sequences. They are compared as follows: shortest lists are smaller; lists of the same length are compared according to the lexicographical order.", - "type": "array", - "items": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "micheline.012-Psithaca.michelson_v1.expression": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - "next_operation": { - "description": "An operation's shell header.", - "type": "object", - "properties": { - "protocol": { - "type": "string", - "enum": [ - "Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A" - ] - }, - "branch": { - "$ref": "#/components/schemas/block_hash" - }, - "contents": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.operation.alpha.contents" - } - }, - "signature": { - "$ref": "#/components/schemas/Signature" - } - }, - "required": [ - "protocol", - "branch", - "contents", - "signature" - ] - }, - "positive_bignum": { - "title": "Positive big number", - "description": "Decimal representation of a positive big number", - "type": "string" - }, - "timestamp.protocol": { - "description": "A timestamp as seen by the protocol: second-level precision, epoch based.", - "oneOf": [ - { - "$ref": "#/components/schemas/unistring" - } - ] - }, - "unistring": { - "title": "Universal string representation", - "description": "Either a plain UTF8 string, or a sequence of bytes for strings that contain invalid byte sequences.", - "oneOf": [ - { - "type": "string" - }, - { - "type": "object", - "properties": { - "invalid_utf8_string": { - "type": "array", - "items": { - "type": "integer", - "minimum": 0, - "maximum": 255 - } - } - }, - "required": [ - "invalid_utf8_string" - ] - } - ] - }, - "value_hash": { - "title": "Hash of a consensus value (Base58Check-encoded)", - "oneOf": [ - { - "$ref": "#/components/schemas/unistring" - } - ] - } - } - } -} diff --git a/docs/api/ithaca-openapi.json b/docs/api/ithaca-openapi.json deleted file mode 100644 index 790ca843cf1e45f7d5c31e892f3a9eab3b628f3c..0000000000000000000000000000000000000000 --- a/docs/api/ithaca-openapi.json +++ /dev/null @@ -1,18601 +0,0 @@ -{ - "openapi": "3.0.0", - "info": { - "title": "Tezos RPC", - "description": "Tezos client RPC API.", - "version": "12.0~rc2" - }, - "paths": { - "/": { - "get": { - "description": "All the information about a block. The associated metadata may not be present depending on the history mode and block's distance from the head.", - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "protocol": { - "type": "string", - "enum": [ - "ProtoGenesisGenesisGenesisGenesisGenesisGenesk612im" - ] - }, - "chain_id": { - "$ref": "#/components/schemas/Chain_id" - }, - "hash": { - "$ref": "#/components/schemas/block_hash" - }, - "header": { - "$ref": "#/components/schemas/raw_block_header" - }, - "metadata": { - "$ref": "#/components/schemas/block_header_metadata" - }, - "operations": { - "type": "array", - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/operation" - } - } - } - }, - "required": [ - "protocol", - "chain_id", - "hash", - "header", - "operations" - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/context/big_maps/{big_map_id}": { - "get": { - "description": "Get the (optionally paginated) list of values in a big map. Order of values is unspecified, but is guaranteed to be consistent.", - "parameters": [ - { - "name": "big_map_id", - "in": "path", - "description": "A big map identifier", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "offset", - "in": "query", - "description": "A non-negative integer (greater than or equal to 0). Skip the first [offset] values. Useful in combination with [length] for pagination.", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "length", - "in": "query", - "description": "A non-negative integer (greater than or equal to 0). Only retrieve [length] values. Useful in combination with [offset] for pagination.", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - } - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/context/big_maps/{big_map_id}/{script_expr}": { - "get": { - "description": "Access the value associated with a key in a big map.", - "parameters": [ - { - "name": "big_map_id", - "in": "path", - "description": "A big map identifier", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "script_expr", - "in": "path", - "description": "script_expr (Base58Check-encoded)", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/context/big_maps/{big_map_id}/{script_expr}/normalized": { - "post": { - "description": "Access the value associated with a key in a big map, normalize the output using the requested unparsing mode.", - "parameters": [ - { - "name": "big_map_id", - "in": "path", - "description": "A big map identifier", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "script_expr", - "in": "path", - "description": "script_expr (Base58Check-encoded)", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "unparsing_mode": { - "oneOf": [ - { - "title": "Readable", - "type": "string", - "enum": [ - "Readable" - ] - }, - { - "title": "Optimized", - "type": "string", - "enum": [ - "Optimized" - ] - }, - { - "title": "Optimized_legacy", - "type": "string", - "enum": [ - "Optimized_legacy" - ] - } - ] - } - }, - "required": [ - "unparsing_mode" - ] - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/context/cache/contracts/all": { - "get": { - "description": "Return the list of cached contracts", - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/012-Psithaca.contract_id" - }, - { - "type": "integer", - "minimum": -1073741824, - "maximum": 1073741823 - } - ] - } - } - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/context/cache/contracts/rank": { - "post": { - "description": "Return the number of cached contracts older than the provided contract", - "requestBody": { - "content": { - "application/json": { - "schema": { - "title": "A contract handle", - "description": "A contract notation as given to an RPC or inside scripts. Can be a base58 implicit contract hash or a base58 originated contract hash.", - "oneOf": [ - { - "$ref": "#/components/schemas/unistring" - } - ] - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "nullable": true, - "oneOf": [ - { - "title": "Some", - "type": "integer", - "minimum": -1073741824, - "maximum": 1073741823 - } - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/context/cache/contracts/size": { - "get": { - "description": "Return the size of the contract cache", - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "integer", - "minimum": -1073741824, - "maximum": 1073741823 - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/context/cache/contracts/size_limit": { - "get": { - "description": "Return the size limit of the contract cache", - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "integer", - "minimum": -1073741824, - "maximum": 1073741823 - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/context/constants": { - "get": { - "description": "All constants", - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "proof_of_work_nonce_size": { - "type": "integer", - "minimum": 0, - "maximum": 255 - }, - "nonce_length": { - "type": "integer", - "minimum": 0, - "maximum": 255 - }, - "max_anon_ops_per_block": { - "type": "integer", - "minimum": 0, - "maximum": 255 - }, - "max_operation_data_length": { - "type": "integer", - "minimum": -1073741824, - "maximum": 1073741823 - }, - "max_proposals_per_delegate": { - "type": "integer", - "minimum": 0, - "maximum": 255 - }, - "max_micheline_node_count": { - "type": "integer", - "minimum": -1073741824, - "maximum": 1073741823 - }, - "max_micheline_bytes_limit": { - "type": "integer", - "minimum": -1073741824, - "maximum": 1073741823 - }, - "max_allowed_global_constants_depth": { - "type": "integer", - "minimum": -1073741824, - "maximum": 1073741823 - }, - "cache_layout": { - "type": "array", - "items": { - "$ref": "#/components/schemas/int64" - } - }, - "michelson_maximum_type_size": { - "type": "integer", - "minimum": 0, - "maximum": 65535 - }, - "preserved_cycles": { - "type": "integer", - "minimum": 0, - "maximum": 255 - }, - "blocks_per_cycle": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "blocks_per_commitment": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "blocks_per_stake_snapshot": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "blocks_per_voting_period": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "hard_gas_limit_per_operation": { - "$ref": "#/components/schemas/bignum" - }, - "hard_gas_limit_per_block": { - "$ref": "#/components/schemas/bignum" - }, - "proof_of_work_threshold": { - "$ref": "#/components/schemas/int64" - }, - "tokens_per_roll": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "seed_nonce_revelation_tip": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "origination_size": { - "type": "integer", - "minimum": -1073741824, - "maximum": 1073741823 - }, - "baking_reward_fixed_portion": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "baking_reward_bonus_per_slot": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "endorsing_reward_per_slot": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "cost_per_byte": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "hard_storage_limit_per_operation": { - "$ref": "#/components/schemas/bignum" - }, - "quorum_min": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "quorum_max": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "min_proposal_quorum": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "liquidity_baking_subsidy": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "liquidity_baking_sunset_level": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "liquidity_baking_escape_ema_threshold": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "max_operations_time_to_live": { - "type": "integer", - "minimum": -32768, - "maximum": 32767 - }, - "minimal_block_delay": { - "$ref": "#/components/schemas/int64" - }, - "delay_increment_per_round": { - "$ref": "#/components/schemas/int64" - }, - "consensus_committee_size": { - "type": "integer", - "minimum": -1073741824, - "maximum": 1073741823 - }, - "consensus_threshold": { - "type": "integer", - "minimum": -1073741824, - "maximum": 1073741823 - }, - "minimal_participation_ratio": { - "type": "object", - "properties": { - "numerator": { - "type": "integer", - "minimum": 0, - "maximum": 65535 - }, - "denominator": { - "type": "integer", - "minimum": 0, - "maximum": 65535 - } - }, - "required": [ - "numerator", - "denominator" - ] - }, - "max_slashing_period": { - "type": "integer", - "minimum": -1073741824, - "maximum": 1073741823 - }, - "frozen_deposits_percentage": { - "type": "integer", - "minimum": -1073741824, - "maximum": 1073741823 - }, - "double_baking_punishment": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "ratio_of_frozen_deposits_slashed_per_double_endorsement": { - "type": "object", - "properties": { - "numerator": { - "type": "integer", - "minimum": 0, - "maximum": 65535 - }, - "denominator": { - "type": "integer", - "minimum": 0, - "maximum": 65535 - } - }, - "required": [ - "numerator", - "denominator" - ] - }, - "delegate_selection": { - "oneOf": [ - { - "title": "Random_delegate_selection", - "type": "string", - "enum": [ - "random" - ] - }, - { - "title": "Round_robin_over_delegates", - "type": "array", - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Signature.Public_key" - } - } - } - ] - } - }, - "required": [ - "proof_of_work_nonce_size", - "nonce_length", - "max_anon_ops_per_block", - "max_operation_data_length", - "max_proposals_per_delegate", - "max_micheline_node_count", - "max_micheline_bytes_limit", - "max_allowed_global_constants_depth", - "cache_layout", - "michelson_maximum_type_size", - "preserved_cycles", - "blocks_per_cycle", - "blocks_per_commitment", - "blocks_per_stake_snapshot", - "blocks_per_voting_period", - "hard_gas_limit_per_operation", - "hard_gas_limit_per_block", - "proof_of_work_threshold", - "tokens_per_roll", - "seed_nonce_revelation_tip", - "origination_size", - "baking_reward_fixed_portion", - "baking_reward_bonus_per_slot", - "endorsing_reward_per_slot", - "cost_per_byte", - "hard_storage_limit_per_operation", - "quorum_min", - "quorum_max", - "min_proposal_quorum", - "liquidity_baking_subsidy", - "liquidity_baking_sunset_level", - "liquidity_baking_escape_ema_threshold", - "max_operations_time_to_live", - "minimal_block_delay", - "delay_increment_per_round", - "consensus_committee_size", - "consensus_threshold", - "minimal_participation_ratio", - "max_slashing_period", - "frozen_deposits_percentage", - "double_baking_punishment", - "ratio_of_frozen_deposits_slashed_per_double_endorsement" - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/context/constants/errors": { - "get": { - "description": "Schema for all the RPC errors from this protocol version", - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": {} - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/context/contracts": { - "get": { - "description": "All existing contracts (including non-empty default contracts).", - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.contract_id" - } - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/context/contracts/{contract_id}": { - "get": { - "description": "Access the complete status of a contract.", - "parameters": [ - { - "name": "contract_id", - "in": "path", - "description": "A contract identifier encoded in b58check.", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "balance": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "delegate": { - "$ref": "#/components/schemas/Signature.Public_key_hash" - }, - "script": { - "$ref": "#/components/schemas/012-Psithaca.scripted.contracts" - }, - "counter": { - "$ref": "#/components/schemas/positive_bignum" - } - }, - "required": [ - "balance" - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/context/contracts/{contract_id}/balance": { - "get": { - "description": "Access the balance of a contract.", - "parameters": [ - { - "name": "contract_id", - "in": "path", - "description": "A contract identifier encoded in b58check.", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/positive_bignum" - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/context/contracts/{contract_id}/big_map_get": { - "post": { - "description": "Access the value associated with a key in a big map of the contract (deprecated).", - "parameters": [ - { - "name": "contract_id", - "in": "path", - "description": "A contract identifier encoded in b58check.", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "key": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - "type": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - } - }, - "required": [ - "key", - "type" - ] - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "nullable": true, - "oneOf": [ - { - "title": "Some", - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - } - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/context/contracts/{contract_id}/counter": { - "get": { - "description": "Access the counter of a contract, if any.", - "parameters": [ - { - "name": "contract_id", - "in": "path", - "description": "A contract identifier encoded in b58check.", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "title": "Big number", - "description": "Decimal representation of a big number", - "type": "string" - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/context/contracts/{contract_id}/delegate": { - "get": { - "description": "Access the delegate of a contract, if any.", - "parameters": [ - { - "name": "contract_id", - "in": "path", - "description": "A contract identifier encoded in b58check.", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "title": "A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded)", - "oneOf": [ - { - "$ref": "#/components/schemas/unistring" - } - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/context/contracts/{contract_id}/entrypoints": { - "get": { - "description": "Return the list of entrypoints of the contract", - "parameters": [ - { - "name": "contract_id", - "in": "path", - "description": "A contract identifier encoded in b58check.", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "unreachable": { - "type": "array", - "items": { - "type": "object", - "properties": { - "path": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - } - } - }, - "required": [ - "path" - ] - } - }, - "entrypoints": { - "type": "object", - "properties": {}, - "additionalProperties": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - } - } - }, - "required": [ - "entrypoints" - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/context/contracts/{contract_id}/entrypoints/{string}": { - "get": { - "description": "Return the type of the given entrypoint of the contract", - "parameters": [ - { - "name": "contract_id", - "in": "path", - "description": "A contract identifier encoded in b58check.", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "string", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/context/contracts/{contract_id}/manager_key": { - "get": { - "description": "Access the manager of a contract.", - "parameters": [ - { - "name": "contract_id", - "in": "path", - "description": "A contract identifier encoded in b58check.", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "nullable": true, - "oneOf": [ - { - "title": "Some", - "oneOf": [ - { - "$ref": "#/components/schemas/Signature.Public_key" - } - ] - } - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/context/contracts/{contract_id}/script": { - "get": { - "description": "Access the code and data of the contract.", - "parameters": [ - { - "name": "contract_id", - "in": "path", - "description": "A contract identifier encoded in b58check.", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - "storage": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - } - }, - "required": [ - "code", - "storage" - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/context/contracts/{contract_id}/script/normalized": { - "post": { - "description": "Access the script of the contract and normalize it using the requested unparsing mode.", - "parameters": [ - { - "name": "contract_id", - "in": "path", - "description": "A contract identifier encoded in b58check.", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "unparsing_mode": { - "oneOf": [ - { - "title": "Readable", - "type": "string", - "enum": [ - "Readable" - ] - }, - { - "title": "Optimized", - "type": "string", - "enum": [ - "Optimized" - ] - }, - { - "title": "Optimized_legacy", - "type": "string", - "enum": [ - "Optimized_legacy" - ] - } - ] - } - }, - "required": [ - "unparsing_mode" - ] - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "nullable": true, - "oneOf": [ - { - "title": "Some", - "oneOf": [ - { - "$ref": "#/components/schemas/012-Psithaca.scripted.contracts" - } - ] - } - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/context/contracts/{contract_id}/single_sapling_get_diff": { - "get": { - "description": "Returns the root and a diff of a state starting from an optional offset which is zero by default.", - "parameters": [ - { - "name": "contract_id", - "in": "path", - "description": "A contract identifier encoded in b58check.", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "offset_commitment", - "in": "query", - "description": "Commitments and ciphertexts are returned from the specified offset up to the most recent.", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "offset_nullifier", - "in": "query", - "description": "Nullifiers are returned from the specified offset up to the most recent.", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "root": { - "$ref": "#/components/schemas/sapling.transaction.commitment_hash" - }, - "commitments_and_ciphertexts": { - "type": "array", - "items": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/sapling.transaction.commitment" - }, - { - "$ref": "#/components/schemas/sapling.transaction.ciphertext" - } - ] - } - } - }, - "nullifiers": { - "type": "array", - "items": { - "$ref": "#/components/schemas/sapling.transaction.nullifier" - } - } - }, - "required": [ - "root", - "commitments_and_ciphertexts", - "nullifiers" - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/context/contracts/{contract_id}/storage": { - "get": { - "description": "Access the data of the contract.", - "parameters": [ - { - "name": "contract_id", - "in": "path", - "description": "A contract identifier encoded in b58check.", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/context/contracts/{contract_id}/storage/normalized": { - "post": { - "description": "Access the data of the contract and normalize it using the requested unparsing mode.", - "parameters": [ - { - "name": "contract_id", - "in": "path", - "description": "A contract identifier encoded in b58check.", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "unparsing_mode": { - "oneOf": [ - { - "title": "Readable", - "type": "string", - "enum": [ - "Readable" - ] - }, - { - "title": "Optimized", - "type": "string", - "enum": [ - "Optimized" - ] - }, - { - "title": "Optimized_legacy", - "type": "string", - "enum": [ - "Optimized_legacy" - ] - } - ] - } - }, - "required": [ - "unparsing_mode" - ] - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "nullable": true, - "oneOf": [ - { - "title": "Some", - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - } - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/context/delegates": { - "get": { - "description": "Lists all registered delegates.", - "parameters": [ - { - "name": "active", - "in": "query", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "inactive", - "in": "query", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Signature.Public_key_hash" - } - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/context/delegates/{pkh}": { - "get": { - "description": "Everything about a delegate.", - "parameters": [ - { - "name": "pkh", - "in": "path", - "description": "A Secp256k1 of a Ed25519 public key hash (Base58Check-encoded)", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "full_balance": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "current_frozen_deposits": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "frozen_deposits": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "staking_balance": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "frozen_deposits_limit": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "delegated_contracts": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.contract_id" - } - }, - "delegated_balance": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "deactivated": { - "type": "boolean" - }, - "grace_period": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "voting_power": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - } - }, - "required": [ - "full_balance", - "current_frozen_deposits", - "frozen_deposits", - "staking_balance", - "delegated_contracts", - "delegated_balance", - "deactivated", - "grace_period", - "voting_power" - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/context/delegates/{pkh}/current_frozen_deposits": { - "get": { - "description": "Returns the current amount of the frozen deposits (in mutez).", - "parameters": [ - { - "name": "pkh", - "in": "path", - "description": "A Secp256k1 of a Ed25519 public key hash (Base58Check-encoded)", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/positive_bignum" - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/context/delegates/{pkh}/deactivated": { - "get": { - "description": "Tells whether the delegate is currently tagged as deactivated or not.", - "parameters": [ - { - "name": "pkh", - "in": "path", - "description": "A Secp256k1 of a Ed25519 public key hash (Base58Check-encoded)", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "boolean" - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/context/delegates/{pkh}/delegated_balance": { - "get": { - "description": "Returns the sum (in mutez) of all balances of all the contracts that delegate to a given delegate. This excludes the delegate's own balance and its frozen deposits.", - "parameters": [ - { - "name": "pkh", - "in": "path", - "description": "A Secp256k1 of a Ed25519 public key hash (Base58Check-encoded)", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/positive_bignum" - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/context/delegates/{pkh}/delegated_contracts": { - "get": { - "description": "Returns the list of contracts that delegate to a given delegate.", - "parameters": [ - { - "name": "pkh", - "in": "path", - "description": "A Secp256k1 of a Ed25519 public key hash (Base58Check-encoded)", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.contract_id" - } - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/context/delegates/{pkh}/frozen_deposits": { - "get": { - "description": "Returns the initial amount (that is, at the beginning of a cycle) of the frozen deposits (in mutez). This amount is the same as the current amount of the frozen deposits, unless the delegate has been punished.", - "parameters": [ - { - "name": "pkh", - "in": "path", - "description": "A Secp256k1 of a Ed25519 public key hash (Base58Check-encoded)", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/positive_bignum" - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/context/delegates/{pkh}/frozen_deposits_limit": { - "get": { - "description": "Returns the frozen deposits limit for the given delegate or none if no limit is set.", - "parameters": [ - { - "name": "pkh", - "in": "path", - "description": "A Secp256k1 of a Ed25519 public key hash (Base58Check-encoded)", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "nullable": true, - "oneOf": [ - { - "title": "Some", - "oneOf": [ - { - "$ref": "#/components/schemas/012-Psithaca.mutez" - } - ] - } - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/context/delegates/{pkh}/full_balance": { - "get": { - "description": "Returns the full balance (in mutez) of a given delegate, including the frozen deposits. It does not include its delegated balance.", - "parameters": [ - { - "name": "pkh", - "in": "path", - "description": "A Secp256k1 of a Ed25519 public key hash (Base58Check-encoded)", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/positive_bignum" - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/context/delegates/{pkh}/grace_period": { - "get": { - "description": "Returns the cycle by the end of which the delegate might be deactivated if she fails to execute any delegate action. A deactivated delegate might be reactivated (without loosing any stake) by simply re-registering as a delegate. For deactivated delegates, this value contains the cycle at which they were deactivated.", - "parameters": [ - { - "name": "pkh", - "in": "path", - "description": "A Secp256k1 of a Ed25519 public key hash (Base58Check-encoded)", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/context/delegates/{pkh}/participation": { - "get": { - "description": "Returns cycle and level participation information. In particular this indicates, in the field 'expected_cycle_activity', the number of slots the delegate is expected to have in the cycle based on its active stake. The field 'minimal_cycle_activity' indicates the minimal endorsing slots in the cycle required to get endorsing rewards. It is computed based on 'expected_cycle_activity. The fields 'missed_slots' and 'missed_levels' indicate the number of missed endorsing slots and missed levels (for endorsing) in the cycle so far. 'missed_slots' indicates the number of missed endorsing slots in the cycle so far. The field 'remaining_allowed_missed_slots' indicates the remaining amount of endorsing slots that can be missed in the cycle before forfeiting the rewards. Finally, 'expected_endorsing_rewards' indicates the endorsing rewards that will be distributed at the end of the cycle if activity at that point will be greater than the minimal required; if the activity is already known to be below the required minimum, then the rewards are zero.", - "parameters": [ - { - "name": "pkh", - "in": "path", - "description": "A Secp256k1 of a Ed25519 public key hash (Base58Check-encoded)", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "expected_cycle_activity": { - "type": "integer", - "minimum": -1073741824, - "maximum": 1073741823 - }, - "minimal_cycle_activity": { - "type": "integer", - "minimum": -1073741824, - "maximum": 1073741823 - }, - "missed_slots": { - "type": "integer", - "minimum": -1073741824, - "maximum": 1073741823 - }, - "missed_levels": { - "type": "integer", - "minimum": -1073741824, - "maximum": 1073741823 - }, - "remaining_allowed_missed_slots": { - "type": "integer", - "minimum": -1073741824, - "maximum": 1073741823 - }, - "expected_endorsing_rewards": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - } - }, - "required": [ - "expected_cycle_activity", - "minimal_cycle_activity", - "missed_slots", - "missed_levels", - "remaining_allowed_missed_slots", - "expected_endorsing_rewards" - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/context/delegates/{pkh}/staking_balance": { - "get": { - "description": "Returns the total amount of tokens (in mutez) delegated to a given delegate. This includes the balances of all the contracts that delegate to it, but also the balance of the delegate itself and its frozen deposits.", - "parameters": [ - { - "name": "pkh", - "in": "path", - "description": "A Secp256k1 of a Ed25519 public key hash (Base58Check-encoded)", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/positive_bignum" - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/context/delegates/{pkh}/voting_power": { - "get": { - "description": "The number of rolls in the vote listings for a given delegate", - "parameters": [ - { - "name": "pkh", - "in": "path", - "description": "A Secp256k1 of a Ed25519 public key hash (Base58Check-encoded)", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/context/liquidity_baking/cpmm_address": { - "get": { - "description": "Liquidity baking CPMM address", - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "title": "A contract handle", - "description": "A contract notation as given to an RPC or inside scripts. Can be a base58 implicit contract hash or a base58 originated contract hash.", - "oneOf": [ - { - "$ref": "#/components/schemas/unistring" - } - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/context/merkle_tree": { - "get": { - "description": "Returns the merkle tree of a piece of context.", - "parameters": [ - { - "name": "holey", - "in": "query", - "description": "Send only hashes, omit data of key", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "nullable": true, - "oneOf": [ - { - "title": "Some", - "type": "array", - "items": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/unistring" - }, - { - "oneOf": [ - { - "title": "Hash", - "type": "array", - "items": { - "oneOf": [ - { - "type": "boolean" - }, - { - "$ref": "#/components/schemas/unistring" - } - ] - } - }, - { - "title": "Data", - "nullable": true, - "oneOf": [ - { - "title": "Key", - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - }, - { - "title": "Dir", - "type": "object", - "properties": {}, - "additionalProperties": { - "$ref": "#/components/schemas/raw_context" - } - } - ] - }, - { - "title": "Continue", - "oneOf": [ - { - "$ref": "#/components/schemas/merkle_tree" - } - ] - } - ] - } - ] - } - } - } - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/context/nonces/{block_level}": { - "get": { - "description": "Info about the nonce of a previous block.", - "parameters": [ - { - "name": "block_level", - "in": "path", - "description": "A level integer", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "title": "Revealed", - "type": "object", - "properties": { - "nonce": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "nonce" - ] - }, - { - "title": "Missing", - "type": "object", - "properties": { - "hash": { - "$ref": "#/components/schemas/cycle_nonce" - } - }, - "required": [ - "hash" - ] - }, - { - "title": "Forgotten", - "type": "object", - "properties": {} - } - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/context/raw/bytes": { - "get": { - "description": "Returns the raw context.", - "parameters": [ - { - "name": "depth", - "in": "query", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "nullable": true, - "oneOf": [ - { - "title": "Key", - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - }, - { - "title": "Dir", - "type": "object", - "properties": {}, - "additionalProperties": { - "$ref": "#/components/schemas/raw_context" - } - } - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/context/sapling/{sapling_state_id}/get_diff": { - "get": { - "description": "Returns the root and a diff of a state starting from an optional offset which is zero by default.", - "parameters": [ - { - "name": "sapling_state_id", - "in": "path", - "description": "A sapling state identifier", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "offset_commitment", - "in": "query", - "description": "Commitments and ciphertexts are returned from the specified offset up to the most recent.", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "offset_nullifier", - "in": "query", - "description": "Nullifiers are returned from the specified offset up to the most recent.", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "root": { - "$ref": "#/components/schemas/sapling.transaction.commitment_hash" - }, - "commitments_and_ciphertexts": { - "type": "array", - "items": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/sapling.transaction.commitment" - }, - { - "$ref": "#/components/schemas/sapling.transaction.ciphertext" - } - ] - } - } - }, - "nullifiers": { - "type": "array", - "items": { - "$ref": "#/components/schemas/sapling.transaction.nullifier" - } - } - }, - "required": [ - "root", - "commitments_and_ciphertexts", - "nullifiers" - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/context/seed": { - "post": { - "description": "Seed of the cycle to which the block belongs.", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": {} - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/hash": { - "get": { - "description": "The block's hash, its unique identifier.", - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "title": "A block identifier (Base58Check-encoded)", - "oneOf": [ - { - "$ref": "#/components/schemas/unistring" - } - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/header": { - "get": { - "description": "The whole block header.", - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "title": "Shell header", - "description": "Block header's shell-related content. It contains information such as the block level, its predecessor and timestamp.", - "type": "object", - "properties": { - "protocol": { - "type": "string", - "enum": [ - "ProtoGenesisGenesisGenesisGenesisGenesisGenesk612im" - ] - }, - "chain_id": { - "$ref": "#/components/schemas/Chain_id" - }, - "hash": { - "$ref": "#/components/schemas/block_hash" - }, - "level": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "proto": { - "type": "integer", - "minimum": 0, - "maximum": 255 - }, - "predecessor": { - "$ref": "#/components/schemas/block_hash" - }, - "timestamp": { - "$ref": "#/components/schemas/timestamp.protocol" - }, - "validation_pass": { - "type": "integer", - "minimum": 0, - "maximum": 255 - }, - "operations_hash": { - "$ref": "#/components/schemas/Operation_list_list_hash" - }, - "fitness": { - "$ref": "#/components/schemas/fitness" - }, - "context": { - "$ref": "#/components/schemas/Context_hash" - }, - "content": { - "oneOf": [ - { - "title": "Activate", - "type": "object", - "properties": { - "command": { - "type": "string", - "enum": [ - "activate" - ] - }, - "hash": { - "$ref": "#/components/schemas/Protocol_hash" - }, - "fitness": { - "$ref": "#/components/schemas/fitness" - }, - "protocol_parameters": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "command", - "hash", - "fitness", - "protocol_parameters" - ] - }, - { - "title": "Activate_testchain", - "type": "object", - "properties": { - "command": { - "type": "string", - "enum": [ - "activate_testchain" - ] - }, - "hash": { - "$ref": "#/components/schemas/Protocol_hash" - }, - "fitness": { - "$ref": "#/components/schemas/fitness" - }, - "protocol_parameters": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - }, - "validity_time": { - "$ref": "#/components/schemas/int64" - } - }, - "required": [ - "command", - "hash", - "fitness", - "protocol_parameters", - "validity_time" - ] - } - ] - }, - "signature": { - "$ref": "#/components/schemas/Signature" - } - }, - "required": [ - "protocol", - "chain_id", - "hash", - "level", - "proto", - "predecessor", - "timestamp", - "validation_pass", - "operations_hash", - "fitness", - "context", - "content", - "signature" - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/header/protocol_data": { - "get": { - "description": "The version-specific fragment of the block header.", - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "protocol": { - "type": "string", - "enum": [ - "ProtoGenesisGenesisGenesisGenesisGenesisGenesk612im" - ] - }, - "content": { - "oneOf": [ - { - "title": "Activate", - "type": "object", - "properties": { - "command": { - "type": "string", - "enum": [ - "activate" - ] - }, - "hash": { - "$ref": "#/components/schemas/Protocol_hash" - }, - "fitness": { - "$ref": "#/components/schemas/fitness" - }, - "protocol_parameters": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "command", - "hash", - "fitness", - "protocol_parameters" - ] - }, - { - "title": "Activate_testchain", - "type": "object", - "properties": { - "command": { - "type": "string", - "enum": [ - "activate_testchain" - ] - }, - "hash": { - "$ref": "#/components/schemas/Protocol_hash" - }, - "fitness": { - "$ref": "#/components/schemas/fitness" - }, - "protocol_parameters": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - }, - "validity_time": { - "$ref": "#/components/schemas/int64" - } - }, - "required": [ - "command", - "hash", - "fitness", - "protocol_parameters", - "validity_time" - ] - } - ] - }, - "signature": { - "$ref": "#/components/schemas/Signature" - } - }, - "required": [ - "protocol", - "content", - "signature" - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/header/protocol_data/raw": { - "get": { - "description": "The version-specific fragment of the block header (unparsed).", - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/header/raw": { - "get": { - "description": "The whole block header (unparsed).", - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/header/shell": { - "get": { - "description": "The shell-specific fragment of the block header.", - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "title": "Shell header", - "description": "Block header's shell-related content. It contains information such as the block level, its predecessor and timestamp.", - "type": "object", - "properties": { - "level": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "proto": { - "type": "integer", - "minimum": 0, - "maximum": 255 - }, - "predecessor": { - "$ref": "#/components/schemas/block_hash" - }, - "timestamp": { - "$ref": "#/components/schemas/timestamp.protocol" - }, - "validation_pass": { - "type": "integer", - "minimum": 0, - "maximum": 255 - }, - "operations_hash": { - "$ref": "#/components/schemas/Operation_list_list_hash" - }, - "fitness": { - "$ref": "#/components/schemas/fitness" - }, - "context": { - "$ref": "#/components/schemas/Context_hash" - } - }, - "required": [ - "level", - "proto", - "predecessor", - "timestamp", - "validation_pass", - "operations_hash", - "fitness", - "context" - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/helpers/baking_rights": { - "get": { - "description": "Retrieves the list of delegates allowed to bake a block.\nBy default, it gives the best baking opportunities (in terms of rounds) for bakers that have at least one opportunity below the 64th round for the next block.\nParameters `level` and `cycle` can be used to specify the (valid) level(s) in the past or future at which the baking rights have to be returned.\nParameter `delegate` can be used to restrict the results to the given delegates. If parameter `all` is set, all the baking opportunities for each baker at each level are returned, instead of just the first one.\nReturns the list of baking opportunities up to round 64. Also returns the minimal timestamps that correspond to these opportunities. The timestamps are omitted for levels in the past, and are only estimates for levels higher that the next block's, based on the hypothesis that all predecessor blocks were baked at the first round.", - "parameters": [ - { - "name": "level", - "in": "query", - "description": "A level integer", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "cycle", - "in": "query", - "description": "A cycle integer", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "delegate", - "in": "query", - "description": "A Secp256k1 of a Ed25519 public key hash (Base58Check-encoded)", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "max_round", - "in": "query", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "all", - "in": "query", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "type": "object", - "properties": { - "level": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "delegate": { - "$ref": "#/components/schemas/Signature.Public_key_hash" - }, - "round": { - "type": "integer", - "minimum": 0, - "maximum": 65535 - }, - "estimated_time": { - "$ref": "#/components/schemas/timestamp.protocol" - } - }, - "required": [ - "level", - "delegate", - "round" - ] - } - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/helpers/complete/{prefix}": { - "get": { - "description": "Try to complete a prefix of a Base58Check-encoded data. This RPC is actually able to complete hashes of block, operations, public_keys and contracts.", - "parameters": [ - { - "name": "prefix", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/unistring" - } - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/helpers/current_level": { - "get": { - "description": "Returns the level of the interrogated block, or the one of a block located `offset` blocks after it in the chain. For instance, the next block if `offset` is 1. The offset cannot be negative.", - "parameters": [ - { - "name": "offset", - "in": "query", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "level": { - "description": "The level of the block relative to genesis. This is also the Shell's notion of level.", - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "level_position": { - "description": "The level of the block relative to the successor of the genesis block. More precisely, it is the position of the block relative to the block that starts the \"Alpha family\" of protocols, which includes all protocols except Genesis (that is, from 001 onwards).", - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "cycle": { - "description": "The current cycle's number. Note that cycles are a protocol-specific notion. As a result, the cycle number starts at 0 with the first block of the Alpha family of protocols.", - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "cycle_position": { - "description": "The current level of the block relative to the first block of the current cycle.", - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "expected_commitment": { - "description": "Tells whether the baker of this block has to commit a seed nonce hash.", - "type": "boolean" - } - }, - "required": [ - "level", - "level_position", - "cycle", - "cycle_position", - "expected_commitment" - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/helpers/endorsing_rights": { - "get": { - "description": "Retrieves the delegates allowed to endorse a block.\nBy default, it gives the endorsing power for delegates that have at least one endorsing slot for the next block.\nParameters `level` and `cycle` can be used to specify the (valid) level(s) in the past or future at which the endorsing rights have to be returned. Parameter `delegate` can be used to restrict the results to the given delegates.\nReturns the smallest endorsing slots and the endorsing power. Also returns the minimal timestamp that corresponds to endorsing at the given level. The timestamps are omitted for levels in the past, and are only estimates for levels higher that the next block's, based on the hypothesis that all predecessor blocks were baked at the first round.", - "parameters": [ - { - "name": "level", - "in": "query", - "description": "A level integer", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "cycle", - "in": "query", - "description": "A cycle integer", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "delegate", - "in": "query", - "description": "A Secp256k1 of a Ed25519 public key hash (Base58Check-encoded)", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "type": "object", - "properties": { - "level": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "delegates": { - "type": "array", - "items": { - "type": "object", - "properties": { - "delegate": { - "$ref": "#/components/schemas/Signature.Public_key_hash" - }, - "first_slot": { - "type": "integer", - "minimum": 0, - "maximum": 65535 - }, - "endorsing_power": { - "type": "integer", - "minimum": 0, - "maximum": 65535 - } - }, - "required": [ - "delegate", - "first_slot", - "endorsing_power" - ] - } - }, - "estimated_time": { - "$ref": "#/components/schemas/timestamp.protocol" - } - }, - "required": [ - "level", - "delegates" - ] - } - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/helpers/forge/operations": { - "post": { - "description": "Forge an operation", - "requestBody": { - "content": { - "application/json": { - "schema": { - "description": "An operation's shell header.", - "type": "object", - "properties": { - "branch": { - "$ref": "#/components/schemas/block_hash" - }, - "contents": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.operation.alpha.contents" - } - } - }, - "required": [ - "branch", - "contents" - ] - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/helpers/forge/protocol_data": { - "post": { - "description": "Forge the protocol-specific part of a block header", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "payload_hash": { - "$ref": "#/components/schemas/value_hash" - }, - "payload_round": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "nonce_hash": { - "$ref": "#/components/schemas/cycle_nonce" - }, - "proof_of_work_nonce": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - }, - "liquidity_baking_escape_vote": { - "type": "boolean" - } - }, - "required": [ - "payload_hash", - "payload_round" - ] - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "protocol_data": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "protocol_data" - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/helpers/forge_block_header": { - "post": { - "description": "Forge a block header", - "requestBody": { - "content": { - "application/json": { - "schema": { - "title": "Block header", - "description": "Block header. It contains both shell and protocol specific data.", - "type": "object", - "properties": { - "level": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "proto": { - "type": "integer", - "minimum": 0, - "maximum": 255 - }, - "predecessor": { - "$ref": "#/components/schemas/block_hash" - }, - "timestamp": { - "$ref": "#/components/schemas/timestamp.protocol" - }, - "validation_pass": { - "type": "integer", - "minimum": 0, - "maximum": 255 - }, - "operations_hash": { - "$ref": "#/components/schemas/Operation_list_list_hash" - }, - "fitness": { - "$ref": "#/components/schemas/fitness" - }, - "context": { - "$ref": "#/components/schemas/Context_hash" - }, - "protocol_data": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "level", - "proto", - "predecessor", - "timestamp", - "validation_pass", - "operations_hash", - "fitness", - "context", - "protocol_data" - ] - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "block": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "block" - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/helpers/levels_in_current_cycle": { - "get": { - "description": "Levels of a cycle", - "parameters": [ - { - "name": "offset", - "in": "query", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "first": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "last": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - } - }, - "required": [ - "first", - "last" - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/helpers/parse/block": { - "post": { - "description": "Parse a block", - "requestBody": { - "content": { - "application/json": { - "schema": { - "title": "Block header", - "description": "Block header. It contains both shell and protocol specific data.", - "type": "object", - "properties": { - "level": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "proto": { - "type": "integer", - "minimum": 0, - "maximum": 255 - }, - "predecessor": { - "$ref": "#/components/schemas/block_hash" - }, - "timestamp": { - "$ref": "#/components/schemas/timestamp.protocol" - }, - "validation_pass": { - "type": "integer", - "minimum": 0, - "maximum": 255 - }, - "operations_hash": { - "$ref": "#/components/schemas/Operation_list_list_hash" - }, - "fitness": { - "$ref": "#/components/schemas/fitness" - }, - "context": { - "$ref": "#/components/schemas/Context_hash" - }, - "protocol_data": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "level", - "proto", - "predecessor", - "timestamp", - "validation_pass", - "operations_hash", - "fitness", - "context", - "protocol_data" - ] - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "payload_hash": { - "$ref": "#/components/schemas/value_hash" - }, - "payload_round": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "proof_of_work_nonce": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - }, - "seed_nonce_hash": { - "$ref": "#/components/schemas/cycle_nonce" - }, - "liquidity_baking_escape_vote": { - "type": "boolean" - }, - "signature": { - "$ref": "#/components/schemas/Signature" - } - }, - "required": [ - "payload_hash", - "payload_round", - "proof_of_work_nonce", - "liquidity_baking_escape_vote", - "signature" - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/helpers/parse/operations": { - "post": { - "description": "Parse operations", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "operations": { - "type": "array", - "items": { - "$ref": "#/components/schemas/operation" - } - }, - "check_signature": { - "type": "boolean" - } - }, - "required": [ - "operations" - ] - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "description": "An operation's shell header.", - "type": "object", - "properties": { - "branch": { - "$ref": "#/components/schemas/block_hash" - }, - "contents": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.operation.alpha.contents" - } - }, - "signature": { - "$ref": "#/components/schemas/Signature" - } - }, - "required": [ - "branch", - "contents", - "signature" - ] - } - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/helpers/preapply/block": { - "post": { - "description": "Simulate the validation of a block that would contain the given operations and return the resulting fitness and context hash.", - "parameters": [ - { - "name": "sort", - "in": "query", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "timestamp", - "in": "query", - "description": "A date in seconds from epoch", - "required": false, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "protocol_data": { - "type": "object", - "properties": { - "protocol": { - "type": "string", - "enum": [ - "Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A" - ] - }, - "payload_hash": { - "$ref": "#/components/schemas/value_hash" - }, - "payload_round": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "proof_of_work_nonce": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - }, - "seed_nonce_hash": { - "$ref": "#/components/schemas/cycle_nonce" - }, - "liquidity_baking_escape_vote": { - "type": "boolean" - }, - "signature": { - "$ref": "#/components/schemas/Signature" - } - }, - "required": [ - "protocol", - "payload_hash", - "payload_round", - "proof_of_work_nonce", - "liquidity_baking_escape_vote", - "signature" - ] - }, - "operations": { - "type": "array", - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/next_operation" - } - } - } - }, - "required": [ - "protocol_data", - "operations" - ] - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "shell_header": { - "$ref": "#/components/schemas/block_header.shell" - }, - "operations": { - "type": "array", - "items": { - "type": "object", - "properties": { - "applied": { - "type": "array", - "items": { - "description": "An operation. The shell_header part indicates a block an operation is meant to apply on top of. The proto part is protocol-specific and appears as a binary blob.", - "type": "object", - "properties": { - "hash": { - "$ref": "#/components/schemas/Operation_hash" - }, - "branch": { - "$ref": "#/components/schemas/block_hash" - }, - "data": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "hash", - "branch", - "data" - ] - } - }, - "refused": { - "type": "array", - "items": { - "description": "An operation. The shell_header part indicates a block an operation is meant to apply on top of. The proto part is protocol-specific and appears as a binary blob.", - "type": "object", - "properties": { - "hash": { - "$ref": "#/components/schemas/Operation_hash" - }, - "branch": { - "$ref": "#/components/schemas/block_hash" - }, - "data": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - }, - "error": { - "$ref": "#/components/schemas/error" - } - }, - "required": [ - "hash", - "branch", - "data", - "error" - ] - } - }, - "outdated": { - "type": "array", - "items": { - "description": "An operation. The shell_header part indicates a block an operation is meant to apply on top of. The proto part is protocol-specific and appears as a binary blob.", - "type": "object", - "properties": { - "hash": { - "$ref": "#/components/schemas/Operation_hash" - }, - "branch": { - "$ref": "#/components/schemas/block_hash" - }, - "data": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - }, - "error": { - "$ref": "#/components/schemas/error" - } - }, - "required": [ - "hash", - "branch", - "data", - "error" - ] - } - }, - "branch_refused": { - "type": "array", - "items": { - "description": "An operation. The shell_header part indicates a block an operation is meant to apply on top of. The proto part is protocol-specific and appears as a binary blob.", - "type": "object", - "properties": { - "hash": { - "$ref": "#/components/schemas/Operation_hash" - }, - "branch": { - "$ref": "#/components/schemas/block_hash" - }, - "data": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - }, - "error": { - "$ref": "#/components/schemas/error" - } - }, - "required": [ - "hash", - "branch", - "data", - "error" - ] - } - }, - "branch_delayed": { - "type": "array", - "items": { - "description": "An operation. The shell_header part indicates a block an operation is meant to apply on top of. The proto part is protocol-specific and appears as a binary blob.", - "type": "object", - "properties": { - "hash": { - "$ref": "#/components/schemas/Operation_hash" - }, - "branch": { - "$ref": "#/components/schemas/block_hash" - }, - "data": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - }, - "error": { - "$ref": "#/components/schemas/error" - } - }, - "required": [ - "hash", - "branch", - "data", - "error" - ] - } - } - }, - "required": [ - "applied", - "refused", - "outdated", - "branch_refused", - "branch_delayed" - ] - } - } - }, - "required": [ - "shell_header", - "operations" - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/helpers/preapply/operations": { - "post": { - "description": "Simulate the validation of an operation.", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/next_operation" - } - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.operation.alpha.operation_with_metadata" - } - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/helpers/round": { - "get": { - "description": "Returns the round of the interrogated block, or the one of a block located `offset` blocks after in the chain (or before when negative). For instance, the next block if `offset` is 1.", - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/helpers/scripts/entrypoint": { - "post": { - "description": "Return the type of the given entrypoint", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "script": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - "entrypoint": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "script" - ] - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "entrypoint_type": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - } - }, - "required": [ - "entrypoint_type" - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/helpers/scripts/entrypoints": { - "post": { - "description": "Return the list of entrypoints of the given script", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "script": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - } - }, - "required": [ - "script" - ] - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "unreachable": { - "type": "array", - "items": { - "type": "object", - "properties": { - "path": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - } - } - }, - "required": [ - "path" - ] - } - }, - "entrypoints": { - "type": "object", - "properties": {}, - "additionalProperties": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - } - } - }, - "required": [ - "entrypoints" - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/helpers/scripts/normalize_data": { - "post": { - "description": "Normalizes some data expression using the requested unparsing mode", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - "type": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - "unparsing_mode": { - "oneOf": [ - { - "title": "Readable", - "type": "string", - "enum": [ - "Readable" - ] - }, - { - "title": "Optimized", - "type": "string", - "enum": [ - "Optimized" - ] - }, - { - "title": "Optimized_legacy", - "type": "string", - "enum": [ - "Optimized_legacy" - ] - } - ] - }, - "legacy": { - "type": "boolean" - } - }, - "required": [ - "data", - "type", - "unparsing_mode" - ] - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "normalized": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - } - }, - "required": [ - "normalized" - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/helpers/scripts/normalize_script": { - "post": { - "description": "Normalizes a Michelson script using the requested unparsing mode", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "script": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - "unparsing_mode": { - "oneOf": [ - { - "title": "Readable", - "type": "string", - "enum": [ - "Readable" - ] - }, - { - "title": "Optimized", - "type": "string", - "enum": [ - "Optimized" - ] - }, - { - "title": "Optimized_legacy", - "type": "string", - "enum": [ - "Optimized_legacy" - ] - } - ] - } - }, - "required": [ - "script", - "unparsing_mode" - ] - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "normalized": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - } - }, - "required": [ - "normalized" - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/helpers/scripts/normalize_type": { - "post": { - "description": "Normalizes some Michelson type by expanding `pair a b c` as `pair a (pair b c)", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "type": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - } - }, - "required": [ - "type" - ] - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "normalized": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - } - }, - "required": [ - "normalized" - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/helpers/scripts/pack_data": { - "post": { - "description": "Computes the serialized version of some data expression using the same algorithm as script instruction PACK", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - "type": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - "gas": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "data", - "type" - ] - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "packed": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - }, - "gas": { - "oneOf": [ - { - "title": "Limited", - "oneOf": [ - { - "$ref": "#/components/schemas/bignum" - } - ] - }, - { - "title": "Unaccounted", - "type": "string", - "enum": [ - "unaccounted" - ] - } - ] - } - }, - "required": [ - "packed", - "gas" - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/helpers/scripts/run_code": { - "post": { - "description": "Run a piece of code in the current context", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "script": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - "storage": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - "input": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - "amount": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "balance": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "chain_id": { - "$ref": "#/components/schemas/Chain_id" - }, - "source": { - "$ref": "#/components/schemas/012-Psithaca.contract_id" - }, - "payer": { - "$ref": "#/components/schemas/012-Psithaca.contract_id" - }, - "gas": { - "$ref": "#/components/schemas/bignum" - }, - "entrypoint": { - "$ref": "#/components/schemas/unistring" - }, - "unparsing_mode": { - "oneOf": [ - { - "title": "Readable", - "type": "string", - "enum": [ - "Readable" - ] - }, - { - "title": "Optimized", - "type": "string", - "enum": [ - "Optimized" - ] - }, - { - "title": "Optimized_legacy", - "type": "string", - "enum": [ - "Optimized_legacy" - ] - } - ] - }, - "now": { - "$ref": "#/components/schemas/bignum" - }, - "level": { - "$ref": "#/components/schemas/positive_bignum" - } - }, - "required": [ - "script", - "storage", - "input", - "amount", - "balance", - "chain_id" - ] - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "storage": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - "operations": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.operation.alpha.internal_operation" - } - }, - "big_map_diff": { - "type": "array", - "items": { - "oneOf": [ - { - "title": "update", - "type": "object", - "properties": { - "action": { - "type": "string", - "enum": [ - "update" - ] - }, - "big_map": { - "$ref": "#/components/schemas/bignum" - }, - "key_hash": { - "$ref": "#/components/schemas/script_expr" - }, - "key": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - "value": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - } - }, - "required": [ - "action", - "big_map", - "key_hash", - "key" - ] - }, - { - "title": "remove", - "type": "object", - "properties": { - "action": { - "type": "string", - "enum": [ - "remove" - ] - }, - "big_map": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "action", - "big_map" - ] - }, - { - "title": "copy", - "type": "object", - "properties": { - "action": { - "type": "string", - "enum": [ - "copy" - ] - }, - "source_big_map": { - "$ref": "#/components/schemas/bignum" - }, - "destination_big_map": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "action", - "source_big_map", - "destination_big_map" - ] - }, - { - "title": "alloc", - "type": "object", - "properties": { - "action": { - "type": "string", - "enum": [ - "alloc" - ] - }, - "big_map": { - "$ref": "#/components/schemas/bignum" - }, - "key_type": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - "value_type": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - } - }, - "required": [ - "action", - "big_map", - "key_type", - "value_type" - ] - } - ] - } - }, - "lazy_storage_diff": { - "$ref": "#/components/schemas/012-Psithaca.lazy_storage_diff" - } - }, - "required": [ - "storage", - "operations" - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/helpers/scripts/run_operation": { - "post": { - "description": "Run an operation without signature checks", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "operation": { - "description": "An operation's shell header.", - "type": "object", - "properties": { - "branch": { - "$ref": "#/components/schemas/block_hash" - }, - "contents": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.operation.alpha.contents" - } - }, - "signature": { - "$ref": "#/components/schemas/Signature" - } - }, - "required": [ - "branch", - "contents", - "signature" - ] - }, - "chain_id": { - "$ref": "#/components/schemas/Chain_id" - } - }, - "required": [ - "operation", - "chain_id" - ] - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "title": "Operation_with_metadata", - "type": "object", - "properties": { - "contents": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.operation.alpha.operation_contents_and_result" - } - }, - "signature": { - "$ref": "#/components/schemas/Signature" - } - }, - "required": [ - "contents" - ] - }, - { - "title": "Operation_without_metadata", - "type": "object", - "properties": { - "contents": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.operation.alpha.contents" - } - }, - "signature": { - "$ref": "#/components/schemas/Signature" - } - }, - "required": [ - "contents" - ] - } - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/helpers/scripts/run_view": { - "post": { - "description": "Simulate a call to a view following the TZIP-4 standard. See https://gitlab.com/tzip/tzip/-/blob/master/proposals/tzip-4/tzip-4.md#view-entrypoints.", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "contract": { - "$ref": "#/components/schemas/012-Psithaca.contract_id" - }, - "entrypoint": { - "$ref": "#/components/schemas/unistring" - }, - "input": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - "chain_id": { - "$ref": "#/components/schemas/Chain_id" - }, - "source": { - "$ref": "#/components/schemas/012-Psithaca.contract_id" - }, - "payer": { - "$ref": "#/components/schemas/012-Psithaca.contract_id" - }, - "gas": { - "$ref": "#/components/schemas/bignum" - }, - "unparsing_mode": { - "oneOf": [ - { - "title": "Readable", - "type": "string", - "enum": [ - "Readable" - ] - }, - { - "title": "Optimized", - "type": "string", - "enum": [ - "Optimized" - ] - }, - { - "title": "Optimized_legacy", - "type": "string", - "enum": [ - "Optimized_legacy" - ] - } - ] - }, - "now": { - "$ref": "#/components/schemas/bignum" - }, - "level": { - "$ref": "#/components/schemas/positive_bignum" - } - }, - "required": [ - "contract", - "entrypoint", - "input", - "chain_id", - "unparsing_mode" - ] - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - } - }, - "required": [ - "data" - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/helpers/scripts/script_size": { - "post": { - "description": "Compute the size of a script in the current context", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "program": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - "storage": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - "gas": { - "$ref": "#/components/schemas/bignum" - }, - "legacy": { - "type": "boolean" - } - }, - "required": [ - "program", - "storage" - ] - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "script_size": { - "type": "integer", - "minimum": -1073741824, - "maximum": 1073741823 - } - }, - "required": [ - "script_size" - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/helpers/scripts/simulate_operation": { - "post": { - "description": "Simulate an operation", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "operation": { - "description": "An operation's shell header.", - "type": "object", - "properties": { - "branch": { - "$ref": "#/components/schemas/block_hash" - }, - "contents": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.operation.alpha.contents" - } - }, - "signature": { - "$ref": "#/components/schemas/Signature" - } - }, - "required": [ - "branch", - "contents", - "signature" - ] - }, - "chain_id": { - "$ref": "#/components/schemas/Chain_id" - }, - "latency": { - "type": "integer", - "minimum": -32768, - "maximum": 32767 - } - }, - "required": [ - "operation", - "chain_id" - ] - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "title": "Operation_with_metadata", - "type": "object", - "properties": { - "contents": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.operation.alpha.operation_contents_and_result" - } - }, - "signature": { - "$ref": "#/components/schemas/Signature" - } - }, - "required": [ - "contents" - ] - }, - { - "title": "Operation_without_metadata", - "type": "object", - "properties": { - "contents": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.operation.alpha.contents" - } - }, - "signature": { - "$ref": "#/components/schemas/Signature" - } - }, - "required": [ - "contents" - ] - } - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/helpers/scripts/trace_code": { - "post": { - "description": "Run a piece of code in the current context, keeping a trace", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "script": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - "storage": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - "input": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - "amount": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "balance": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "chain_id": { - "$ref": "#/components/schemas/Chain_id" - }, - "source": { - "$ref": "#/components/schemas/012-Psithaca.contract_id" - }, - "payer": { - "$ref": "#/components/schemas/012-Psithaca.contract_id" - }, - "gas": { - "$ref": "#/components/schemas/bignum" - }, - "entrypoint": { - "$ref": "#/components/schemas/unistring" - }, - "unparsing_mode": { - "oneOf": [ - { - "title": "Readable", - "type": "string", - "enum": [ - "Readable" - ] - }, - { - "title": "Optimized", - "type": "string", - "enum": [ - "Optimized" - ] - }, - { - "title": "Optimized_legacy", - "type": "string", - "enum": [ - "Optimized_legacy" - ] - } - ] - }, - "now": { - "$ref": "#/components/schemas/bignum" - }, - "level": { - "$ref": "#/components/schemas/positive_bignum" - } - }, - "required": [ - "script", - "storage", - "input", - "amount", - "balance", - "chain_id" - ] - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "storage": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - "operations": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.operation.alpha.internal_operation" - } - }, - "trace": { - "$ref": "#/components/schemas/012-Psithaca.scripted.trace" - }, - "big_map_diff": { - "type": "array", - "items": { - "oneOf": [ - { - "title": "update", - "type": "object", - "properties": { - "action": { - "type": "string", - "enum": [ - "update" - ] - }, - "big_map": { - "$ref": "#/components/schemas/bignum" - }, - "key_hash": { - "$ref": "#/components/schemas/script_expr" - }, - "key": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - "value": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - } - }, - "required": [ - "action", - "big_map", - "key_hash", - "key" - ] - }, - { - "title": "remove", - "type": "object", - "properties": { - "action": { - "type": "string", - "enum": [ - "remove" - ] - }, - "big_map": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "action", - "big_map" - ] - }, - { - "title": "copy", - "type": "object", - "properties": { - "action": { - "type": "string", - "enum": [ - "copy" - ] - }, - "source_big_map": { - "$ref": "#/components/schemas/bignum" - }, - "destination_big_map": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "action", - "source_big_map", - "destination_big_map" - ] - }, - { - "title": "alloc", - "type": "object", - "properties": { - "action": { - "type": "string", - "enum": [ - "alloc" - ] - }, - "big_map": { - "$ref": "#/components/schemas/bignum" - }, - "key_type": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - "value_type": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - } - }, - "required": [ - "action", - "big_map", - "key_type", - "value_type" - ] - } - ] - } - }, - "lazy_storage_diff": { - "$ref": "#/components/schemas/012-Psithaca.lazy_storage_diff" - } - }, - "required": [ - "storage", - "operations", - "trace" - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/helpers/scripts/typecheck_code": { - "post": { - "description": "Typecheck a piece of code in the current context", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "program": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - "gas": { - "$ref": "#/components/schemas/bignum" - }, - "legacy": { - "type": "boolean" - }, - "show_types": { - "type": "boolean" - } - }, - "required": [ - "program" - ] - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "type_map": { - "type": "array", - "items": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/micheline.location" - }, - "stack_before": { - "type": "array", - "items": { - "type": "array", - "items": { - "oneOf": [ - { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - { - "type": "array", - "items": { - "$ref": "#/components/schemas/unistring" - } - } - ] - } - } - }, - "stack_after": { - "type": "array", - "items": { - "type": "array", - "items": { - "oneOf": [ - { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - { - "type": "array", - "items": { - "$ref": "#/components/schemas/unistring" - } - } - ] - } - } - } - }, - "required": [ - "location", - "stack_before", - "stack_after" - ] - } - }, - "gas": { - "oneOf": [ - { - "title": "Limited", - "oneOf": [ - { - "$ref": "#/components/schemas/bignum" - } - ] - }, - { - "title": "Unaccounted", - "type": "string", - "enum": [ - "unaccounted" - ] - } - ] - } - }, - "required": [ - "type_map", - "gas" - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/helpers/scripts/typecheck_data": { - "post": { - "description": "Check that some data expression is well formed and of a given type in the current context", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - "type": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - "gas": { - "$ref": "#/components/schemas/bignum" - }, - "legacy": { - "type": "boolean" - } - }, - "required": [ - "data", - "type" - ] - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "gas": { - "oneOf": [ - { - "title": "Limited", - "oneOf": [ - { - "$ref": "#/components/schemas/bignum" - } - ] - }, - { - "title": "Unaccounted", - "type": "string", - "enum": [ - "unaccounted" - ] - } - ] - } - }, - "required": [ - "gas" - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/helpers/validators": { - "get": { - "description": "Retrieves the delegates allowed to endorse a block.\nBy default, it gives the endorsing slots for delegates that have at least one in the next block.\nParameter `level` can be used to specify the (valid) level(s) in the past or future at which the endorsement rights have to be returned. Parameter `delegate` can be used to restrict the results to the given delegates.\nReturns the list of endorsing slots. Also returns the minimal timestamps that correspond to these slots. The timestamps are omitted for levels in the past, and are only estimates for levels later that the next block, based on the hypothesis that all predecessor blocks were baked at the first round.", - "parameters": [ - { - "name": "level", - "in": "query", - "description": "A level integer", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "delegate", - "in": "query", - "description": "A Secp256k1 of a Ed25519 public key hash (Base58Check-encoded)", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "type": "object", - "properties": { - "level": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "delegate": { - "$ref": "#/components/schemas/Signature.Public_key_hash" - }, - "slots": { - "type": "array", - "items": { - "type": "integer", - "minimum": 0, - "maximum": 65535 - } - } - }, - "required": [ - "level", - "delegate", - "slots" - ] - } - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/live_blocks": { - "get": { - "description": "List the ancestors of the given block which, if referred to as the branch in an operation header, are recent enough for that operation to be included in the current block.", - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/block_hash" - } - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/metadata": { - "get": { - "description": "All the metadata associated to the block.", - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "protocol": { - "type": "string", - "enum": [ - "ProtoGenesisGenesisGenesisGenesisGenesisGenesk612im" - ] - }, - "next_protocol": { - "type": "string", - "enum": [ - "Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A" - ] - }, - "test_chain_status": { - "$ref": "#/components/schemas/test_chain_status" - }, - "max_operations_ttl": { - "type": "integer", - "minimum": -1073741824, - "maximum": 1073741823 - }, - "max_operation_data_length": { - "type": "integer", - "minimum": -1073741824, - "maximum": 1073741823 - }, - "max_block_header_length": { - "type": "integer", - "minimum": -1073741824, - "maximum": 1073741823 - }, - "max_operation_list_length": { - "type": "array", - "items": { - "type": "object", - "properties": { - "max_size": { - "type": "integer", - "minimum": -1073741824, - "maximum": 1073741823 - }, - "max_op": { - "type": "integer", - "minimum": -1073741824, - "maximum": 1073741823 - } - }, - "required": [ - "max_size" - ] - } - } - }, - "required": [ - "protocol", - "next_protocol", - "test_chain_status", - "max_operations_ttl", - "max_operation_data_length", - "max_block_header_length", - "max_operation_list_length" - ], - "additionalProperties": {} - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/metadata_hash": { - "get": { - "description": "Hash of the metadata associated to the block. This is only set on blocks starting from environment V1.", - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "title": "A Tezos block metadata ID (Base58Check-encoded)", - "oneOf": [ - { - "$ref": "#/components/schemas/unistring" - } - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/operation_hashes": { - "get": { - "description": "The hashes of all the operations included in the block.", - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Operation_hash" - } - } - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/operation_hashes/{list_offset}": { - "get": { - "description": "All the operations included in `n-th` validation pass of the block.", - "parameters": [ - { - "name": "list_offset", - "in": "path", - "description": "Index `n` of the requested validation pass.", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Operation_hash" - } - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/operation_hashes/{list_offset}/{operation_offset}": { - "get": { - "description": "The hash of then `m-th` operation in the `n-th` validation pass of the block.", - "parameters": [ - { - "name": "list_offset", - "in": "path", - "description": "Index `n` of the requested validation pass.", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "operation_offset", - "in": "path", - "description": "Index `m` of the requested operation in its validation pass.", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "title": "A Tezos operation ID (Base58Check-encoded)", - "oneOf": [ - { - "$ref": "#/components/schemas/unistring" - } - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/operation_metadata_hashes": { - "get": { - "description": "The hashes of all the operation metadata included in the block. This is only set on blocks starting from environment V1.", - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Operation_metadata_hash" - } - } - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/operation_metadata_hashes/{list_offset}": { - "get": { - "description": "All the operation metadata included in `n-th` validation pass of the block. This is only set on blocks starting from environment V1.", - "parameters": [ - { - "name": "list_offset", - "in": "path", - "description": "Index `n` of the requested validation pass.", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Operation_metadata_hash" - } - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/operation_metadata_hashes/{list_offset}/{operation_offset}": { - "get": { - "description": "The hash of then `m-th` operation metadata in the `n-th` validation pass of the block. This is only set on blocks starting from environment V1.", - "parameters": [ - { - "name": "list_offset", - "in": "path", - "description": "Index `n` of the requested validation pass.", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "operation_offset", - "in": "path", - "description": "Index `m` of the requested operation in its validation pass.", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "title": "A Tezos operation metadata ID (Base58Check-encoded)", - "oneOf": [ - { - "$ref": "#/components/schemas/unistring" - } - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/operations": { - "get": { - "description": "All the operations included in the block.", - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/operation" - } - } - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/operations/{list_offset}": { - "get": { - "description": "All the operations included in `n-th` validation pass of the block.", - "parameters": [ - { - "name": "list_offset", - "in": "path", - "description": "Index `n` of the requested validation pass.", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/operation" - } - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/operations/{list_offset}/{operation_offset}": { - "get": { - "description": "The `m-th` operation in the `n-th` validation pass of the block.", - "parameters": [ - { - "name": "list_offset", - "in": "path", - "description": "Index `n` of the requested validation pass.", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "operation_offset", - "in": "path", - "description": "Index `m` of the requested operation in its validation pass.", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "description": "An operation's shell header.", - "type": "object", - "properties": { - "protocol": { - "type": "string", - "enum": [ - "ProtoGenesisGenesisGenesisGenesisGenesisGenesk612im" - ] - }, - "chain_id": { - "$ref": "#/components/schemas/Chain_id" - }, - "hash": { - "$ref": "#/components/schemas/Operation_hash" - }, - "branch": { - "$ref": "#/components/schemas/block_hash" - } - }, - "required": [ - "protocol", - "chain_id", - "hash", - "branch" - ], - "additionalProperties": {} - }, - { - "description": "An operation's shell header.", - "type": "object", - "properties": { - "protocol": { - "type": "string", - "enum": [ - "ProtoGenesisGenesisGenesisGenesisGenesisGenesk612im" - ] - }, - "chain_id": { - "$ref": "#/components/schemas/Chain_id" - }, - "hash": { - "$ref": "#/components/schemas/Operation_hash" - }, - "branch": { - "$ref": "#/components/schemas/block_hash" - } - }, - "required": [ - "protocol", - "chain_id", - "hash", - "branch" - ], - "additionalProperties": {} - } - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/operations_metadata_hash": { - "get": { - "description": "The root hash of the operations metadata from the block. This is only set on blocks starting from environment V1.", - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "title": "A list of list of operation metadata (Base58Check-encoded)", - "oneOf": [ - { - "$ref": "#/components/schemas/unistring" - } - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/protocols": { - "get": { - "description": "Current and next protocol.", - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "protocol": { - "$ref": "#/components/schemas/Protocol_hash" - }, - "next_protocol": { - "$ref": "#/components/schemas/Protocol_hash" - } - }, - "required": [ - "protocol", - "next_protocol" - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/votes/ballot_list": { - "get": { - "description": "Ballots casted so far during a voting period.", - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "type": "object", - "properties": { - "pkh": { - "$ref": "#/components/schemas/Signature.Public_key_hash" - }, - "ballot": { - "type": "string", - "enum": [ - "nay", - "yay", - "pass" - ] - } - }, - "required": [ - "pkh", - "ballot" - ] - } - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/votes/ballots": { - "get": { - "description": "Sum of ballots casted so far during a voting period.", - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "yay": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "nay": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "pass": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - } - }, - "required": [ - "yay", - "nay", - "pass" - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/votes/current_period": { - "get": { - "description": "Returns the voting period (index, kind, starting position) and related information (position, remaining) of the interrogated block.", - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "voting_period": { - "description": "The voting period to which the block belongs.", - "type": "object", - "properties": { - "index": { - "description": "The voting period's index. Starts at 0 with the first block of the Alpha family of protocols.", - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "kind": { - "description": "One of the several kinds of periods in the voting procedure.", - "oneOf": [ - { - "title": "Proposal", - "type": "string", - "enum": [ - "proposal" - ] - }, - { - "title": "exploration", - "type": "string", - "enum": [ - "exploration" - ] - }, - { - "title": "Cooldown", - "type": "string", - "enum": [ - "cooldown" - ] - }, - { - "title": "Promotion", - "type": "string", - "enum": [ - "promotion" - ] - }, - { - "title": "Adoption", - "type": "string", - "enum": [ - "adoption" - ] - } - ] - }, - "start_position": { - "description": "The relative position of the first level of the period with respect to the first level of the Alpha family of protocols.", - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - } - }, - "required": [ - "index", - "kind", - "start_position" - ] - }, - "position": { - "description": "The position of the block within the voting period.", - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "remaining": { - "description": "The number of blocks remaining till the end of the voting period.", - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - } - }, - "required": [ - "voting_period", - "position", - "remaining" - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/votes/current_proposal": { - "get": { - "description": "Current proposal under evaluation.", - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "nullable": true, - "oneOf": [ - { - "title": "Some", - "oneOf": [ - { - "$ref": "#/components/schemas/Protocol_hash" - } - ] - } - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/votes/current_quorum": { - "get": { - "description": "Current expected quorum.", - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/votes/listings": { - "get": { - "description": "List of delegates with their voting weight, in number of rolls.", - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "type": "object", - "properties": { - "pkh": { - "$ref": "#/components/schemas/Signature.Public_key_hash" - }, - "rolls": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - } - }, - "required": [ - "pkh", - "rolls" - ] - } - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/votes/proposals": { - "get": { - "description": "List of proposals with number of supporters.", - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/Protocol_hash" - }, - { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - } - ] - } - } - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/votes/successor_period": { - "get": { - "description": "Returns the voting period (index, kind, starting position) and related information (position, remaining) of the next block.Useful to craft operations that will be valid in the next block.", - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "voting_period": { - "description": "The voting period to which the block belongs.", - "type": "object", - "properties": { - "index": { - "description": "The voting period's index. Starts at 0 with the first block of the Alpha family of protocols.", - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "kind": { - "description": "One of the several kinds of periods in the voting procedure.", - "oneOf": [ - { - "title": "Proposal", - "type": "string", - "enum": [ - "proposal" - ] - }, - { - "title": "exploration", - "type": "string", - "enum": [ - "exploration" - ] - }, - { - "title": "Cooldown", - "type": "string", - "enum": [ - "cooldown" - ] - }, - { - "title": "Promotion", - "type": "string", - "enum": [ - "promotion" - ] - }, - { - "title": "Adoption", - "type": "string", - "enum": [ - "adoption" - ] - } - ] - }, - "start_position": { - "description": "The relative position of the first level of the period with respect to the first level of the Alpha family of protocols.", - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - } - }, - "required": [ - "index", - "kind", - "start_position" - ] - }, - "position": { - "description": "The position of the block within the voting period.", - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "remaining": { - "description": "The number of blocks remaining till the end of the voting period.", - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - } - }, - "required": [ - "voting_period", - "position", - "remaining" - ] - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - }, - "/votes/total_voting_power": { - "get": { - "description": "Total number of rolls for the delegates in the voting listings.", - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "description": "The full list of errors is available with the global RPC `GET errors`" - } - } - } - } - } - } - } - }, - "components": { - "schemas": { - "012-Psithaca.big_map_id": { - "title": "Big map identifier", - "description": "A big map identifier", - "oneOf": [ - { - "$ref": "#/components/schemas/bignum" - } - ] - }, - "012-Psithaca.block_header.alpha.full_header": { - "title": "Shell header", - "description": "Block header's shell-related content. It contains information such as the block level, its predecessor and timestamp.", - "type": "object", - "properties": { - "level": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "proto": { - "type": "integer", - "minimum": 0, - "maximum": 255 - }, - "predecessor": { - "$ref": "#/components/schemas/block_hash" - }, - "timestamp": { - "$ref": "#/components/schemas/timestamp.protocol" - }, - "validation_pass": { - "type": "integer", - "minimum": 0, - "maximum": 255 - }, - "operations_hash": { - "$ref": "#/components/schemas/Operation_list_list_hash" - }, - "fitness": { - "$ref": "#/components/schemas/fitness" - }, - "context": { - "$ref": "#/components/schemas/Context_hash" - }, - "payload_hash": { - "$ref": "#/components/schemas/value_hash" - }, - "payload_round": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "proof_of_work_nonce": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - }, - "seed_nonce_hash": { - "$ref": "#/components/schemas/cycle_nonce" - }, - "liquidity_baking_escape_vote": { - "type": "boolean" - }, - "signature": { - "$ref": "#/components/schemas/Signature" - } - }, - "required": [ - "level", - "proto", - "predecessor", - "timestamp", - "validation_pass", - "operations_hash", - "fitness", - "context", - "payload_hash", - "payload_round", - "proof_of_work_nonce", - "liquidity_baking_escape_vote", - "signature" - ] - }, - "012-Psithaca.contract_id": { - "title": "A contract handle", - "description": "A contract notation as given to an RPC or inside scripts. Can be a base58 implicit contract hash or a base58 originated contract hash.", - "oneOf": [ - { - "$ref": "#/components/schemas/unistring" - } - ] - }, - "012-Psithaca.entrypoint": { - "title": "entrypoint", - "description": "Named entrypoint to a Michelson smart contract", - "oneOf": [ - { - "title": "default", - "type": "string", - "enum": [ - "default" - ] - }, - { - "title": "root", - "type": "string", - "enum": [ - "root" - ] - }, - { - "title": "do", - "type": "string", - "enum": [ - "do" - ] - }, - { - "title": "set_delegate", - "type": "string", - "enum": [ - "set_delegate" - ] - }, - { - "title": "remove_delegate", - "type": "string", - "enum": [ - "remove_delegate" - ] - }, - { - "title": "named", - "type": "string" - } - ] - }, - "012-Psithaca.error": { - "description": "The full list of RPC errors would be too long to include.\nIt is available at RPC `/errors` (GET).\nErrors specific to protocol Alpha have an id that starts with `proto.alpha`." - }, - "012-Psithaca.inlined.endorsement": { - "description": "An operation's shell header.", - "type": "object", - "properties": { - "branch": { - "$ref": "#/components/schemas/block_hash" - }, - "operations": { - "$ref": "#/components/schemas/012-Psithaca.inlined.endorsement_mempool.contents" - }, - "signature": { - "$ref": "#/components/schemas/Signature" - } - }, - "required": [ - "branch", - "operations" - ] - }, - "012-Psithaca.inlined.endorsement_mempool.contents": { - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "endorsement" - ] - }, - "slot": { - "type": "integer", - "minimum": 0, - "maximum": 65535 - }, - "level": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "round": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "block_payload_hash": { - "$ref": "#/components/schemas/value_hash" - } - }, - "required": [ - "kind", - "slot", - "level", - "round", - "block_payload_hash" - ] - }, - "012-Psithaca.inlined.preendorsement": { - "description": "An operation's shell header.", - "type": "object", - "properties": { - "branch": { - "$ref": "#/components/schemas/block_hash" - }, - "operations": { - "$ref": "#/components/schemas/012-Psithaca.inlined.preendorsement.contents" - }, - "signature": { - "$ref": "#/components/schemas/Signature" - } - }, - "required": [ - "branch", - "operations" - ] - }, - "012-Psithaca.inlined.preendorsement.contents": { - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "preendorsement" - ] - }, - "slot": { - "type": "integer", - "minimum": 0, - "maximum": 65535 - }, - "level": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "round": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "block_payload_hash": { - "$ref": "#/components/schemas/value_hash" - } - }, - "required": [ - "kind", - "slot", - "level", - "round", - "block_payload_hash" - ] - }, - "012-Psithaca.lazy_storage_diff": { - "type": "array", - "items": { - "oneOf": [ - { - "title": "big_map", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "big_map" - ] - }, - "id": { - "$ref": "#/components/schemas/012-Psithaca.big_map_id" - }, - "diff": { - "oneOf": [ - { - "title": "update", - "type": "object", - "properties": { - "action": { - "type": "string", - "enum": [ - "update" - ] - }, - "updates": { - "type": "array", - "items": { - "type": "object", - "properties": { - "key_hash": { - "$ref": "#/components/schemas/script_expr" - }, - "key": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - "value": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - } - }, - "required": [ - "key_hash", - "key" - ] - } - } - }, - "required": [ - "action", - "updates" - ] - }, - { - "title": "remove", - "type": "object", - "properties": { - "action": { - "type": "string", - "enum": [ - "remove" - ] - } - }, - "required": [ - "action" - ] - }, - { - "title": "copy", - "type": "object", - "properties": { - "action": { - "type": "string", - "enum": [ - "copy" - ] - }, - "source": { - "$ref": "#/components/schemas/012-Psithaca.big_map_id" - }, - "updates": { - "type": "array", - "items": { - "type": "object", - "properties": { - "key_hash": { - "$ref": "#/components/schemas/script_expr" - }, - "key": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - "value": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - } - }, - "required": [ - "key_hash", - "key" - ] - } - } - }, - "required": [ - "action", - "source", - "updates" - ] - }, - { - "title": "alloc", - "type": "object", - "properties": { - "action": { - "type": "string", - "enum": [ - "alloc" - ] - }, - "updates": { - "type": "array", - "items": { - "type": "object", - "properties": { - "key_hash": { - "$ref": "#/components/schemas/script_expr" - }, - "key": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - "value": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - } - }, - "required": [ - "key_hash", - "key" - ] - } - }, - "key_type": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - "value_type": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - } - }, - "required": [ - "action", - "updates", - "key_type", - "value_type" - ] - } - ] - } - }, - "required": [ - "kind", - "id", - "diff" - ] - }, - { - "title": "sapling_state", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "sapling_state" - ] - }, - "id": { - "$ref": "#/components/schemas/012-Psithaca.sapling_state_id" - }, - "diff": { - "oneOf": [ - { - "title": "update", - "type": "object", - "properties": { - "action": { - "type": "string", - "enum": [ - "update" - ] - }, - "updates": { - "type": "object", - "properties": { - "commitments_and_ciphertexts": { - "type": "array", - "items": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/sapling.transaction.commitment" - }, - { - "$ref": "#/components/schemas/sapling.transaction.ciphertext" - } - ] - } - } - }, - "nullifiers": { - "type": "array", - "items": { - "$ref": "#/components/schemas/sapling.transaction.nullifier" - } - } - }, - "required": [ - "commitments_and_ciphertexts", - "nullifiers" - ] - } - }, - "required": [ - "action", - "updates" - ] - }, - { - "title": "remove", - "type": "object", - "properties": { - "action": { - "type": "string", - "enum": [ - "remove" - ] - } - }, - "required": [ - "action" - ] - }, - { - "title": "copy", - "type": "object", - "properties": { - "action": { - "type": "string", - "enum": [ - "copy" - ] - }, - "source": { - "$ref": "#/components/schemas/012-Psithaca.sapling_state_id" - }, - "updates": { - "type": "object", - "properties": { - "commitments_and_ciphertexts": { - "type": "array", - "items": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/sapling.transaction.commitment" - }, - { - "$ref": "#/components/schemas/sapling.transaction.ciphertext" - } - ] - } - } - }, - "nullifiers": { - "type": "array", - "items": { - "$ref": "#/components/schemas/sapling.transaction.nullifier" - } - } - }, - "required": [ - "commitments_and_ciphertexts", - "nullifiers" - ] - } - }, - "required": [ - "action", - "source", - "updates" - ] - }, - { - "title": "alloc", - "type": "object", - "properties": { - "action": { - "type": "string", - "enum": [ - "alloc" - ] - }, - "updates": { - "type": "object", - "properties": { - "commitments_and_ciphertexts": { - "type": "array", - "items": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/sapling.transaction.commitment" - }, - { - "$ref": "#/components/schemas/sapling.transaction.ciphertext" - } - ] - } - } - }, - "nullifiers": { - "type": "array", - "items": { - "$ref": "#/components/schemas/sapling.transaction.nullifier" - } - } - }, - "required": [ - "commitments_and_ciphertexts", - "nullifiers" - ] - }, - "memo_size": { - "type": "integer", - "minimum": 0, - "maximum": 65535 - } - }, - "required": [ - "action", - "updates", - "memo_size" - ] - } - ] - } - }, - "required": [ - "kind", - "id", - "diff" - ] - } - ] - } - }, - "012-Psithaca.michelson.v1.primitives": { - "type": "string", - "enum": [ - "ABS", - "IF", - "SENDER", - "NEVER", - "False", - "DUG", - "DIG", - "chest_key", - "BLAKE2B", - "list", - "bls12_381_g1", - "Pair", - "INT", - "nat", - "never", - "storage", - "SIZE", - "view", - "SHA256", - "AND", - "VIEW", - "bytes", - "NIL", - "map", - "SUB", - "SAPLING_EMPTY_STATE", - "CHECK_SIGNATURE", - "VOTING_POWER", - "operation", - "MAP", - "option", - "bls12_381_fr", - "ADD", - "IMPLICIT_ACCOUNT", - "SHA512", - "int", - "LSL", - "bls12_381_g2", - "ticket", - "sapling_transaction", - "COMPARE", - "SWAP", - "STEPS_TO_QUOTA", - "DROP", - "pair", - "BALANCE", - "CONCAT", - "MUL", - "FAILWITH", - "Elt", - "lambda", - "OR", - "DIP", - "MEM", - "ITER", - "key_hash", - "XOR", - "Some", - "parameter", - "address", - "EMPTY_MAP", - "None", - "TRANSFER_TOKENS", - "or", - "AMOUNT", - "signature", - "SHA3", - "string", - "CHAIN_ID", - "HASH_KEY", - "IF_LEFT", - "CREATE_ACCOUNT", - "LT", - "TOTAL_VOTING_POWER", - "UNPACK", - "READ_TICKET", - "SELF_ADDRESS", - "timestamp", - "SET_DELEGATE", - "LE", - "SOURCE", - "CREATE_CONTRACT", - "Unit", - "SAPLING_VERIFY_UPDATE", - "NONE", - "CONTRACT", - "GE", - "SOME", - "key", - "SELF", - "set", - "CAR", - "NOT", - "unit", - "CDR", - "LOOP_LEFT", - "PAIRING_CHECK", - "RIGHT", - "LEFT", - "CAST", - "True", - "Right", - "PACK", - "IF_CONS", - "KECCAK", - "chest", - "UNIT", - "EMPTY_SET", - "NEQ", - "LAMBDA", - "mutez", - "TICKET", - "LOOP", - "Left", - "contract", - "LSR", - "EMPTY_BIG_MAP", - "sapling_state", - "JOIN_TICKETS", - "LEVEL", - "UNPAIR", - "SPLIT_TICKET", - "PUSH", - "big_map", - "GT", - "chain_id", - "constant", - "NOW", - "IF_NONE", - "PAIR", - "GET_AND_UPDATE", - "UPDATE", - "ISNAT", - "RENAME", - "OPEN_CHEST", - "EDIV", - "EQ", - "ADDRESS", - "bool", - "EXEC", - "GET", - "NEG", - "SLICE", - "DUP", - "CONS", - "APPLY", - "SUB_MUTEZ", - "code" - ] - }, - "012-Psithaca.mutez": { - "$ref": "#/components/schemas/positive_bignum" - }, - "012-Psithaca.operation.alpha.contents": { - "oneOf": [ - { - "title": "Endorsement", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "endorsement" - ] - }, - "slot": { - "type": "integer", - "minimum": 0, - "maximum": 65535 - }, - "level": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "round": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "block_payload_hash": { - "$ref": "#/components/schemas/value_hash" - } - }, - "required": [ - "kind", - "slot", - "level", - "round", - "block_payload_hash" - ] - }, - { - "title": "Preendorsement", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "preendorsement" - ] - }, - "slot": { - "type": "integer", - "minimum": 0, - "maximum": 65535 - }, - "level": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "round": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "block_payload_hash": { - "$ref": "#/components/schemas/value_hash" - } - }, - "required": [ - "kind", - "slot", - "level", - "round", - "block_payload_hash" - ] - }, - { - "title": "Seed_nonce_revelation", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "seed_nonce_revelation" - ] - }, - "level": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "nonce": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "kind", - "level", - "nonce" - ] - }, - { - "title": "Double_endorsement_evidence", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "double_endorsement_evidence" - ] - }, - "op1": { - "$ref": "#/components/schemas/012-Psithaca.inlined.endorsement" - }, - "op2": { - "$ref": "#/components/schemas/012-Psithaca.inlined.endorsement" - } - }, - "required": [ - "kind", - "op1", - "op2" - ] - }, - { - "title": "Double_preendorsement_evidence", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "double_preendorsement_evidence" - ] - }, - "op1": { - "$ref": "#/components/schemas/012-Psithaca.inlined.preendorsement" - }, - "op2": { - "$ref": "#/components/schemas/012-Psithaca.inlined.preendorsement" - } - }, - "required": [ - "kind", - "op1", - "op2" - ] - }, - { - "title": "Double_baking_evidence", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "double_baking_evidence" - ] - }, - "bh1": { - "$ref": "#/components/schemas/012-Psithaca.block_header.alpha.full_header" - }, - "bh2": { - "$ref": "#/components/schemas/012-Psithaca.block_header.alpha.full_header" - } - }, - "required": [ - "kind", - "bh1", - "bh2" - ] - }, - { - "title": "Activate_account", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "activate_account" - ] - }, - "pkh": { - "$ref": "#/components/schemas/Ed25519.Public_key_hash" - }, - "secret": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "kind", - "pkh", - "secret" - ] - }, - { - "title": "Proposals", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "proposals" - ] - }, - "source": { - "$ref": "#/components/schemas/Signature.Public_key_hash" - }, - "period": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "proposals": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Protocol_hash" - } - } - }, - "required": [ - "kind", - "source", - "period", - "proposals" - ] - }, - { - "title": "Ballot", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "ballot" - ] - }, - "source": { - "$ref": "#/components/schemas/Signature.Public_key_hash" - }, - "period": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "proposal": { - "$ref": "#/components/schemas/Protocol_hash" - }, - "ballot": { - "type": "string", - "enum": [ - "nay", - "yay", - "pass" - ] - } - }, - "required": [ - "kind", - "source", - "period", - "proposal", - "ballot" - ] - }, - { - "title": "Reveal", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "reveal" - ] - }, - "source": { - "$ref": "#/components/schemas/Signature.Public_key_hash" - }, - "fee": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "counter": { - "$ref": "#/components/schemas/positive_bignum" - }, - "gas_limit": { - "$ref": "#/components/schemas/positive_bignum" - }, - "storage_limit": { - "$ref": "#/components/schemas/positive_bignum" - }, - "public_key": { - "$ref": "#/components/schemas/Signature.Public_key" - } - }, - "required": [ - "kind", - "source", - "fee", - "counter", - "gas_limit", - "storage_limit", - "public_key" - ] - }, - { - "title": "Transaction", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "transaction" - ] - }, - "source": { - "$ref": "#/components/schemas/Signature.Public_key_hash" - }, - "fee": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "counter": { - "$ref": "#/components/schemas/positive_bignum" - }, - "gas_limit": { - "$ref": "#/components/schemas/positive_bignum" - }, - "storage_limit": { - "$ref": "#/components/schemas/positive_bignum" - }, - "amount": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "destination": { - "$ref": "#/components/schemas/012-Psithaca.contract_id" - }, - "parameters": { - "type": "object", - "properties": { - "entrypoint": { - "$ref": "#/components/schemas/012-Psithaca.entrypoint" - }, - "value": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - } - }, - "required": [ - "entrypoint", - "value" - ] - } - }, - "required": [ - "kind", - "source", - "fee", - "counter", - "gas_limit", - "storage_limit", - "amount", - "destination" - ] - }, - { - "title": "Origination", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "origination" - ] - }, - "source": { - "$ref": "#/components/schemas/Signature.Public_key_hash" - }, - "fee": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "counter": { - "$ref": "#/components/schemas/positive_bignum" - }, - "gas_limit": { - "$ref": "#/components/schemas/positive_bignum" - }, - "storage_limit": { - "$ref": "#/components/schemas/positive_bignum" - }, - "balance": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "delegate": { - "$ref": "#/components/schemas/Signature.Public_key_hash" - }, - "script": { - "$ref": "#/components/schemas/012-Psithaca.scripted.contracts" - } - }, - "required": [ - "kind", - "source", - "fee", - "counter", - "gas_limit", - "storage_limit", - "balance", - "script" - ] - }, - { - "title": "Delegation", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "delegation" - ] - }, - "source": { - "$ref": "#/components/schemas/Signature.Public_key_hash" - }, - "fee": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "counter": { - "$ref": "#/components/schemas/positive_bignum" - }, - "gas_limit": { - "$ref": "#/components/schemas/positive_bignum" - }, - "storage_limit": { - "$ref": "#/components/schemas/positive_bignum" - }, - "delegate": { - "$ref": "#/components/schemas/Signature.Public_key_hash" - } - }, - "required": [ - "kind", - "source", - "fee", - "counter", - "gas_limit", - "storage_limit" - ] - }, - { - "title": "Set_deposits_limit", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "set_deposits_limit" - ] - }, - "source": { - "$ref": "#/components/schemas/Signature.Public_key_hash" - }, - "fee": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "counter": { - "$ref": "#/components/schemas/positive_bignum" - }, - "gas_limit": { - "$ref": "#/components/schemas/positive_bignum" - }, - "storage_limit": { - "$ref": "#/components/schemas/positive_bignum" - }, - "limit": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - } - }, - "required": [ - "kind", - "source", - "fee", - "counter", - "gas_limit", - "storage_limit" - ] - }, - { - "title": "Failing_noop", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "failing_noop" - ] - }, - "arbitrary": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "kind", - "arbitrary" - ] - }, - { - "title": "Register_global_constant", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "register_global_constant" - ] - }, - "source": { - "$ref": "#/components/schemas/Signature.Public_key_hash" - }, - "fee": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "counter": { - "$ref": "#/components/schemas/positive_bignum" - }, - "gas_limit": { - "$ref": "#/components/schemas/positive_bignum" - }, - "storage_limit": { - "$ref": "#/components/schemas/positive_bignum" - }, - "value": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - } - }, - "required": [ - "kind", - "source", - "fee", - "counter", - "gas_limit", - "storage_limit", - "value" - ] - } - ] - }, - "012-Psithaca.operation.alpha.internal_operation": { - "oneOf": [ - { - "title": "Reveal", - "type": "object", - "properties": { - "source": { - "$ref": "#/components/schemas/012-Psithaca.contract_id" - }, - "nonce": { - "type": "integer", - "minimum": 0, - "maximum": 65535 - }, - "kind": { - "type": "string", - "enum": [ - "reveal" - ] - }, - "public_key": { - "$ref": "#/components/schemas/Signature.Public_key" - } - }, - "required": [ - "source", - "nonce", - "kind", - "public_key" - ] - }, - { - "title": "Transaction", - "type": "object", - "properties": { - "source": { - "$ref": "#/components/schemas/012-Psithaca.contract_id" - }, - "nonce": { - "type": "integer", - "minimum": 0, - "maximum": 65535 - }, - "kind": { - "type": "string", - "enum": [ - "transaction" - ] - }, - "amount": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "destination": { - "$ref": "#/components/schemas/012-Psithaca.contract_id" - }, - "parameters": { - "type": "object", - "properties": { - "entrypoint": { - "$ref": "#/components/schemas/012-Psithaca.entrypoint" - }, - "value": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - } - }, - "required": [ - "entrypoint", - "value" - ] - } - }, - "required": [ - "source", - "nonce", - "kind", - "amount", - "destination" - ] - }, - { - "title": "Origination", - "type": "object", - "properties": { - "source": { - "$ref": "#/components/schemas/012-Psithaca.contract_id" - }, - "nonce": { - "type": "integer", - "minimum": 0, - "maximum": 65535 - }, - "kind": { - "type": "string", - "enum": [ - "origination" - ] - }, - "balance": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "delegate": { - "$ref": "#/components/schemas/Signature.Public_key_hash" - }, - "script": { - "$ref": "#/components/schemas/012-Psithaca.scripted.contracts" - } - }, - "required": [ - "source", - "nonce", - "kind", - "balance", - "script" - ] - }, - { - "title": "Delegation", - "type": "object", - "properties": { - "source": { - "$ref": "#/components/schemas/012-Psithaca.contract_id" - }, - "nonce": { - "type": "integer", - "minimum": 0, - "maximum": 65535 - }, - "kind": { - "type": "string", - "enum": [ - "delegation" - ] - }, - "delegate": { - "$ref": "#/components/schemas/Signature.Public_key_hash" - } - }, - "required": [ - "source", - "nonce", - "kind" - ] - }, - { - "title": "Register_global_constant", - "type": "object", - "properties": { - "source": { - "$ref": "#/components/schemas/012-Psithaca.contract_id" - }, - "nonce": { - "type": "integer", - "minimum": 0, - "maximum": 65535 - }, - "kind": { - "type": "string", - "enum": [ - "register_global_constant" - ] - }, - "value": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - } - }, - "required": [ - "source", - "nonce", - "kind", - "value" - ] - }, - { - "title": "Set_deposits_limit", - "type": "object", - "properties": { - "source": { - "$ref": "#/components/schemas/012-Psithaca.contract_id" - }, - "nonce": { - "type": "integer", - "minimum": 0, - "maximum": 65535 - }, - "kind": { - "type": "string", - "enum": [ - "set_deposits_limit" - ] - }, - "limit": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - } - }, - "required": [ - "source", - "nonce", - "kind" - ] - } - ] - }, - "012-Psithaca.operation.alpha.internal_operation_result": { - "oneOf": [ - { - "title": "reveal", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "reveal" - ] - }, - "source": { - "$ref": "#/components/schemas/012-Psithaca.contract_id" - }, - "nonce": { - "type": "integer", - "minimum": 0, - "maximum": 65535 - }, - "public_key": { - "$ref": "#/components/schemas/Signature.Public_key" - }, - "result": { - "$ref": "#/components/schemas/012-Psithaca.operation.alpha.operation_result.reveal" - } - }, - "required": [ - "kind", - "source", - "nonce", - "public_key", - "result" - ] - }, - { - "title": "transaction", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "transaction" - ] - }, - "source": { - "$ref": "#/components/schemas/012-Psithaca.contract_id" - }, - "nonce": { - "type": "integer", - "minimum": 0, - "maximum": 65535 - }, - "amount": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "destination": { - "$ref": "#/components/schemas/012-Psithaca.contract_id" - }, - "parameters": { - "type": "object", - "properties": { - "entrypoint": { - "$ref": "#/components/schemas/012-Psithaca.entrypoint" - }, - "value": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - } - }, - "required": [ - "entrypoint", - "value" - ] - }, - "result": { - "$ref": "#/components/schemas/012-Psithaca.operation.alpha.operation_result.transaction" - } - }, - "required": [ - "kind", - "source", - "nonce", - "amount", - "destination", - "result" - ] - }, - { - "title": "origination", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "origination" - ] - }, - "source": { - "$ref": "#/components/schemas/012-Psithaca.contract_id" - }, - "nonce": { - "type": "integer", - "minimum": 0, - "maximum": 65535 - }, - "balance": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "delegate": { - "$ref": "#/components/schemas/Signature.Public_key_hash" - }, - "script": { - "$ref": "#/components/schemas/012-Psithaca.scripted.contracts" - }, - "result": { - "$ref": "#/components/schemas/012-Psithaca.operation.alpha.operation_result.origination" - } - }, - "required": [ - "kind", - "source", - "nonce", - "balance", - "script", - "result" - ] - }, - { - "title": "delegation", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "delegation" - ] - }, - "source": { - "$ref": "#/components/schemas/012-Psithaca.contract_id" - }, - "nonce": { - "type": "integer", - "minimum": 0, - "maximum": 65535 - }, - "delegate": { - "$ref": "#/components/schemas/Signature.Public_key_hash" - }, - "result": { - "$ref": "#/components/schemas/012-Psithaca.operation.alpha.operation_result.delegation" - } - }, - "required": [ - "kind", - "source", - "nonce", - "result" - ] - }, - { - "title": "register_global_constant", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "register_global_constant" - ] - }, - "source": { - "$ref": "#/components/schemas/012-Psithaca.contract_id" - }, - "nonce": { - "type": "integer", - "minimum": 0, - "maximum": 65535 - }, - "value": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - "result": { - "$ref": "#/components/schemas/012-Psithaca.operation.alpha.operation_result.register_global_constant" - } - }, - "required": [ - "kind", - "source", - "nonce", - "value", - "result" - ] - }, - { - "title": "set_deposits_limit", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "set_deposits_limit" - ] - }, - "source": { - "$ref": "#/components/schemas/012-Psithaca.contract_id" - }, - "nonce": { - "type": "integer", - "minimum": 0, - "maximum": 65535 - }, - "limit": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "result": { - "$ref": "#/components/schemas/012-Psithaca.operation.alpha.operation_result.set_deposits_limit" - } - }, - "required": [ - "kind", - "source", - "nonce", - "result" - ] - } - ] - }, - "012-Psithaca.operation.alpha.operation_contents_and_result": { - "oneOf": [ - { - "title": "Seed_nonce_revelation", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "seed_nonce_revelation" - ] - }, - "level": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "nonce": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - }, - "metadata": { - "type": "object", - "properties": { - "balance_updates": { - "$ref": "#/components/schemas/012-Psithaca.operation_metadata.alpha.balance_updates" - } - }, - "required": [ - "balance_updates" - ] - } - }, - "required": [ - "kind", - "level", - "nonce", - "metadata" - ] - }, - { - "title": "Endorsement", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "endorsement" - ] - }, - "slot": { - "type": "integer", - "minimum": 0, - "maximum": 65535 - }, - "level": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "round": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "block_payload_hash": { - "$ref": "#/components/schemas/value_hash" - }, - "metadata": { - "type": "object", - "properties": { - "balance_updates": { - "$ref": "#/components/schemas/012-Psithaca.operation_metadata.alpha.balance_updates" - }, - "delegate": { - "$ref": "#/components/schemas/Signature.Public_key_hash" - }, - "endorsement_power": { - "type": "integer", - "minimum": -1073741824, - "maximum": 1073741823 - } - }, - "required": [ - "balance_updates", - "delegate", - "endorsement_power" - ] - } - }, - "required": [ - "kind", - "slot", - "level", - "round", - "block_payload_hash", - "metadata" - ] - }, - { - "title": "Preendorsement", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "preendorsement" - ] - }, - "slot": { - "type": "integer", - "minimum": 0, - "maximum": 65535 - }, - "level": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "round": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "block_payload_hash": { - "$ref": "#/components/schemas/value_hash" - }, - "metadata": { - "type": "object", - "properties": { - "balance_updates": { - "$ref": "#/components/schemas/012-Psithaca.operation_metadata.alpha.balance_updates" - }, - "delegate": { - "$ref": "#/components/schemas/Signature.Public_key_hash" - }, - "preendorsement_power": { - "type": "integer", - "minimum": -1073741824, - "maximum": 1073741823 - } - }, - "required": [ - "balance_updates", - "delegate", - "preendorsement_power" - ] - } - }, - "required": [ - "kind", - "slot", - "level", - "round", - "block_payload_hash", - "metadata" - ] - }, - { - "title": "Double_preendorsement_evidence", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "double_preendorsement_evidence" - ] - }, - "op1": { - "$ref": "#/components/schemas/012-Psithaca.inlined.preendorsement" - }, - "op2": { - "$ref": "#/components/schemas/012-Psithaca.inlined.preendorsement" - }, - "metadata": { - "type": "object", - "properties": { - "balance_updates": { - "$ref": "#/components/schemas/012-Psithaca.operation_metadata.alpha.balance_updates" - } - }, - "required": [ - "balance_updates" - ] - } - }, - "required": [ - "kind", - "op1", - "op2", - "metadata" - ] - }, - { - "title": "Double_endorsement_evidence", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "double_endorsement_evidence" - ] - }, - "op1": { - "$ref": "#/components/schemas/012-Psithaca.inlined.endorsement" - }, - "op2": { - "$ref": "#/components/schemas/012-Psithaca.inlined.endorsement" - }, - "metadata": { - "type": "object", - "properties": { - "balance_updates": { - "$ref": "#/components/schemas/012-Psithaca.operation_metadata.alpha.balance_updates" - } - }, - "required": [ - "balance_updates" - ] - } - }, - "required": [ - "kind", - "op1", - "op2", - "metadata" - ] - }, - { - "title": "Double_baking_evidence", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "double_baking_evidence" - ] - }, - "bh1": { - "$ref": "#/components/schemas/012-Psithaca.block_header.alpha.full_header" - }, - "bh2": { - "$ref": "#/components/schemas/012-Psithaca.block_header.alpha.full_header" - }, - "metadata": { - "type": "object", - "properties": { - "balance_updates": { - "$ref": "#/components/schemas/012-Psithaca.operation_metadata.alpha.balance_updates" - } - }, - "required": [ - "balance_updates" - ] - } - }, - "required": [ - "kind", - "bh1", - "bh2", - "metadata" - ] - }, - { - "title": "Activate_account", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "activate_account" - ] - }, - "pkh": { - "$ref": "#/components/schemas/Ed25519.Public_key_hash" - }, - "secret": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - }, - "metadata": { - "type": "object", - "properties": { - "balance_updates": { - "$ref": "#/components/schemas/012-Psithaca.operation_metadata.alpha.balance_updates" - } - }, - "required": [ - "balance_updates" - ] - } - }, - "required": [ - "kind", - "pkh", - "secret", - "metadata" - ] - }, - { - "title": "Proposals", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "proposals" - ] - }, - "source": { - "$ref": "#/components/schemas/Signature.Public_key_hash" - }, - "period": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "proposals": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Protocol_hash" - } - }, - "metadata": { - "type": "object", - "properties": {} - } - }, - "required": [ - "kind", - "source", - "period", - "proposals", - "metadata" - ] - }, - { - "title": "Ballot", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "ballot" - ] - }, - "source": { - "$ref": "#/components/schemas/Signature.Public_key_hash" - }, - "period": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "proposal": { - "$ref": "#/components/schemas/Protocol_hash" - }, - "ballot": { - "type": "string", - "enum": [ - "nay", - "yay", - "pass" - ] - }, - "metadata": { - "type": "object", - "properties": {} - } - }, - "required": [ - "kind", - "source", - "period", - "proposal", - "ballot", - "metadata" - ] - }, - { - "title": "Reveal", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "reveal" - ] - }, - "source": { - "$ref": "#/components/schemas/Signature.Public_key_hash" - }, - "fee": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "counter": { - "$ref": "#/components/schemas/positive_bignum" - }, - "gas_limit": { - "$ref": "#/components/schemas/positive_bignum" - }, - "storage_limit": { - "$ref": "#/components/schemas/positive_bignum" - }, - "public_key": { - "$ref": "#/components/schemas/Signature.Public_key" - }, - "metadata": { - "type": "object", - "properties": { - "balance_updates": { - "$ref": "#/components/schemas/012-Psithaca.operation_metadata.alpha.balance_updates" - }, - "operation_result": { - "$ref": "#/components/schemas/012-Psithaca.operation.alpha.operation_result.reveal" - }, - "internal_operation_results": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.operation.alpha.internal_operation_result" - } - } - }, - "required": [ - "balance_updates", - "operation_result" - ] - } - }, - "required": [ - "kind", - "source", - "fee", - "counter", - "gas_limit", - "storage_limit", - "public_key", - "metadata" - ] - }, - { - "title": "Transaction", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "transaction" - ] - }, - "source": { - "$ref": "#/components/schemas/Signature.Public_key_hash" - }, - "fee": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "counter": { - "$ref": "#/components/schemas/positive_bignum" - }, - "gas_limit": { - "$ref": "#/components/schemas/positive_bignum" - }, - "storage_limit": { - "$ref": "#/components/schemas/positive_bignum" - }, - "amount": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "destination": { - "$ref": "#/components/schemas/012-Psithaca.contract_id" - }, - "parameters": { - "type": "object", - "properties": { - "entrypoint": { - "$ref": "#/components/schemas/012-Psithaca.entrypoint" - }, - "value": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - } - }, - "required": [ - "entrypoint", - "value" - ] - }, - "metadata": { - "type": "object", - "properties": { - "balance_updates": { - "$ref": "#/components/schemas/012-Psithaca.operation_metadata.alpha.balance_updates" - }, - "operation_result": { - "$ref": "#/components/schemas/012-Psithaca.operation.alpha.operation_result.transaction" - }, - "internal_operation_results": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.operation.alpha.internal_operation_result" - } - } - }, - "required": [ - "balance_updates", - "operation_result" - ] - } - }, - "required": [ - "kind", - "source", - "fee", - "counter", - "gas_limit", - "storage_limit", - "amount", - "destination", - "metadata" - ] - }, - { - "title": "Origination", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "origination" - ] - }, - "source": { - "$ref": "#/components/schemas/Signature.Public_key_hash" - }, - "fee": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "counter": { - "$ref": "#/components/schemas/positive_bignum" - }, - "gas_limit": { - "$ref": "#/components/schemas/positive_bignum" - }, - "storage_limit": { - "$ref": "#/components/schemas/positive_bignum" - }, - "balance": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "delegate": { - "$ref": "#/components/schemas/Signature.Public_key_hash" - }, - "script": { - "$ref": "#/components/schemas/012-Psithaca.scripted.contracts" - }, - "metadata": { - "type": "object", - "properties": { - "balance_updates": { - "$ref": "#/components/schemas/012-Psithaca.operation_metadata.alpha.balance_updates" - }, - "operation_result": { - "$ref": "#/components/schemas/012-Psithaca.operation.alpha.operation_result.origination" - }, - "internal_operation_results": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.operation.alpha.internal_operation_result" - } - } - }, - "required": [ - "balance_updates", - "operation_result" - ] - } - }, - "required": [ - "kind", - "source", - "fee", - "counter", - "gas_limit", - "storage_limit", - "balance", - "script", - "metadata" - ] - }, - { - "title": "Delegation", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "delegation" - ] - }, - "source": { - "$ref": "#/components/schemas/Signature.Public_key_hash" - }, - "fee": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "counter": { - "$ref": "#/components/schemas/positive_bignum" - }, - "gas_limit": { - "$ref": "#/components/schemas/positive_bignum" - }, - "storage_limit": { - "$ref": "#/components/schemas/positive_bignum" - }, - "delegate": { - "$ref": "#/components/schemas/Signature.Public_key_hash" - }, - "metadata": { - "type": "object", - "properties": { - "balance_updates": { - "$ref": "#/components/schemas/012-Psithaca.operation_metadata.alpha.balance_updates" - }, - "operation_result": { - "$ref": "#/components/schemas/012-Psithaca.operation.alpha.operation_result.delegation" - }, - "internal_operation_results": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.operation.alpha.internal_operation_result" - } - } - }, - "required": [ - "balance_updates", - "operation_result" - ] - } - }, - "required": [ - "kind", - "source", - "fee", - "counter", - "gas_limit", - "storage_limit", - "metadata" - ] - }, - { - "title": "Register_global_constant", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "register_global_constant" - ] - }, - "source": { - "$ref": "#/components/schemas/Signature.Public_key_hash" - }, - "fee": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "counter": { - "$ref": "#/components/schemas/positive_bignum" - }, - "gas_limit": { - "$ref": "#/components/schemas/positive_bignum" - }, - "storage_limit": { - "$ref": "#/components/schemas/positive_bignum" - }, - "value": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - "metadata": { - "type": "object", - "properties": { - "balance_updates": { - "$ref": "#/components/schemas/012-Psithaca.operation_metadata.alpha.balance_updates" - }, - "operation_result": { - "$ref": "#/components/schemas/012-Psithaca.operation.alpha.operation_result.register_global_constant" - }, - "internal_operation_results": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.operation.alpha.internal_operation_result" - } - } - }, - "required": [ - "balance_updates", - "operation_result" - ] - } - }, - "required": [ - "kind", - "source", - "fee", - "counter", - "gas_limit", - "storage_limit", - "value", - "metadata" - ] - }, - { - "title": "Set_deposits_limit", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "set_deposits_limit" - ] - }, - "source": { - "$ref": "#/components/schemas/Signature.Public_key_hash" - }, - "fee": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "counter": { - "$ref": "#/components/schemas/positive_bignum" - }, - "gas_limit": { - "$ref": "#/components/schemas/positive_bignum" - }, - "storage_limit": { - "$ref": "#/components/schemas/positive_bignum" - }, - "limit": { - "$ref": "#/components/schemas/012-Psithaca.mutez" - }, - "metadata": { - "type": "object", - "properties": { - "balance_updates": { - "$ref": "#/components/schemas/012-Psithaca.operation_metadata.alpha.balance_updates" - }, - "operation_result": { - "$ref": "#/components/schemas/012-Psithaca.operation.alpha.operation_result.set_deposits_limit" - }, - "internal_operation_results": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.operation.alpha.internal_operation_result" - } - } - }, - "required": [ - "balance_updates", - "operation_result" - ] - } - }, - "required": [ - "kind", - "source", - "fee", - "counter", - "gas_limit", - "storage_limit", - "metadata" - ] - } - ] - }, - "012-Psithaca.operation.alpha.operation_result.delegation": { - "oneOf": [ - { - "title": "Applied", - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": [ - "applied" - ] - }, - "consumed_gas": { - "$ref": "#/components/schemas/positive_bignum" - }, - "consumed_milligas": { - "$ref": "#/components/schemas/positive_bignum" - } - }, - "required": [ - "status" - ] - }, - { - "title": "Failed", - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": [ - "failed" - ] - }, - "errors": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.error" - } - } - }, - "required": [ - "status", - "errors" - ] - }, - { - "title": "Skipped", - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": [ - "skipped" - ] - } - }, - "required": [ - "status" - ] - }, - { - "title": "Backtracked", - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": [ - "backtracked" - ] - }, - "errors": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.error" - } - }, - "consumed_gas": { - "$ref": "#/components/schemas/positive_bignum" - }, - "consumed_milligas": { - "$ref": "#/components/schemas/positive_bignum" - } - }, - "required": [ - "status" - ] - } - ] - }, - "012-Psithaca.operation.alpha.operation_result.origination": { - "oneOf": [ - { - "title": "Applied", - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": [ - "applied" - ] - }, - "big_map_diff": { - "type": "array", - "items": { - "oneOf": [ - { - "title": "update", - "type": "object", - "properties": { - "action": { - "type": "string", - "enum": [ - "update" - ] - }, - "big_map": { - "$ref": "#/components/schemas/bignum" - }, - "key_hash": { - "$ref": "#/components/schemas/script_expr" - }, - "key": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - "value": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - } - }, - "required": [ - "action", - "big_map", - "key_hash", - "key" - ] - }, - { - "title": "remove", - "type": "object", - "properties": { - "action": { - "type": "string", - "enum": [ - "remove" - ] - }, - "big_map": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "action", - "big_map" - ] - }, - { - "title": "copy", - "type": "object", - "properties": { - "action": { - "type": "string", - "enum": [ - "copy" - ] - }, - "source_big_map": { - "$ref": "#/components/schemas/bignum" - }, - "destination_big_map": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "action", - "source_big_map", - "destination_big_map" - ] - }, - { - "title": "alloc", - "type": "object", - "properties": { - "action": { - "type": "string", - "enum": [ - "alloc" - ] - }, - "big_map": { - "$ref": "#/components/schemas/bignum" - }, - "key_type": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - "value_type": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - } - }, - "required": [ - "action", - "big_map", - "key_type", - "value_type" - ] - } - ] - } - }, - "balance_updates": { - "$ref": "#/components/schemas/012-Psithaca.operation_metadata.alpha.balance_updates" - }, - "originated_contracts": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.contract_id" - } - }, - "consumed_gas": { - "$ref": "#/components/schemas/positive_bignum" - }, - "consumed_milligas": { - "$ref": "#/components/schemas/positive_bignum" - }, - "storage_size": { - "$ref": "#/components/schemas/bignum" - }, - "paid_storage_size_diff": { - "$ref": "#/components/schemas/bignum" - }, - "lazy_storage_diff": { - "$ref": "#/components/schemas/012-Psithaca.lazy_storage_diff" - } - }, - "required": [ - "status" - ] - }, - { - "title": "Failed", - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": [ - "failed" - ] - }, - "errors": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.error" - } - } - }, - "required": [ - "status", - "errors" - ] - }, - { - "title": "Skipped", - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": [ - "skipped" - ] - } - }, - "required": [ - "status" - ] - }, - { - "title": "Backtracked", - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": [ - "backtracked" - ] - }, - "errors": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.error" - } - }, - "big_map_diff": { - "type": "array", - "items": { - "oneOf": [ - { - "title": "update", - "type": "object", - "properties": { - "action": { - "type": "string", - "enum": [ - "update" - ] - }, - "big_map": { - "$ref": "#/components/schemas/bignum" - }, - "key_hash": { - "$ref": "#/components/schemas/script_expr" - }, - "key": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - "value": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - } - }, - "required": [ - "action", - "big_map", - "key_hash", - "key" - ] - }, - { - "title": "remove", - "type": "object", - "properties": { - "action": { - "type": "string", - "enum": [ - "remove" - ] - }, - "big_map": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "action", - "big_map" - ] - }, - { - "title": "copy", - "type": "object", - "properties": { - "action": { - "type": "string", - "enum": [ - "copy" - ] - }, - "source_big_map": { - "$ref": "#/components/schemas/bignum" - }, - "destination_big_map": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "action", - "source_big_map", - "destination_big_map" - ] - }, - { - "title": "alloc", - "type": "object", - "properties": { - "action": { - "type": "string", - "enum": [ - "alloc" - ] - }, - "big_map": { - "$ref": "#/components/schemas/bignum" - }, - "key_type": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - "value_type": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - } - }, - "required": [ - "action", - "big_map", - "key_type", - "value_type" - ] - } - ] - } - }, - "balance_updates": { - "$ref": "#/components/schemas/012-Psithaca.operation_metadata.alpha.balance_updates" - }, - "originated_contracts": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.contract_id" - } - }, - "consumed_gas": { - "$ref": "#/components/schemas/positive_bignum" - }, - "consumed_milligas": { - "$ref": "#/components/schemas/positive_bignum" - }, - "storage_size": { - "$ref": "#/components/schemas/bignum" - }, - "paid_storage_size_diff": { - "$ref": "#/components/schemas/bignum" - }, - "lazy_storage_diff": { - "$ref": "#/components/schemas/012-Psithaca.lazy_storage_diff" - } - }, - "required": [ - "status" - ] - } - ] - }, - "012-Psithaca.operation.alpha.operation_result.register_global_constant": { - "oneOf": [ - { - "title": "Applied", - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": [ - "applied" - ] - }, - "balance_updates": { - "$ref": "#/components/schemas/012-Psithaca.operation_metadata.alpha.balance_updates" - }, - "consumed_gas": { - "$ref": "#/components/schemas/positive_bignum" - }, - "storage_size": { - "$ref": "#/components/schemas/bignum" - }, - "global_address": { - "$ref": "#/components/schemas/script_expr" - } - }, - "required": [ - "status", - "balance_updates", - "consumed_gas", - "storage_size", - "global_address" - ] - }, - { - "title": "Failed", - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": [ - "failed" - ] - }, - "errors": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.error" - } - } - }, - "required": [ - "status", - "errors" - ] - }, - { - "title": "Skipped", - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": [ - "skipped" - ] - } - }, - "required": [ - "status" - ] - }, - { - "title": "Backtracked", - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": [ - "backtracked" - ] - }, - "errors": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.error" - } - }, - "balance_updates": { - "$ref": "#/components/schemas/012-Psithaca.operation_metadata.alpha.balance_updates" - }, - "consumed_gas": { - "$ref": "#/components/schemas/positive_bignum" - }, - "storage_size": { - "$ref": "#/components/schemas/bignum" - }, - "global_address": { - "$ref": "#/components/schemas/script_expr" - } - }, - "required": [ - "status", - "balance_updates", - "consumed_gas", - "storage_size", - "global_address" - ] - } - ] - }, - "012-Psithaca.operation.alpha.operation_result.reveal": { - "oneOf": [ - { - "title": "Applied", - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": [ - "applied" - ] - }, - "consumed_gas": { - "$ref": "#/components/schemas/positive_bignum" - }, - "consumed_milligas": { - "$ref": "#/components/schemas/positive_bignum" - } - }, - "required": [ - "status" - ] - }, - { - "title": "Failed", - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": [ - "failed" - ] - }, - "errors": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.error" - } - } - }, - "required": [ - "status", - "errors" - ] - }, - { - "title": "Skipped", - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": [ - "skipped" - ] - } - }, - "required": [ - "status" - ] - }, - { - "title": "Backtracked", - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": [ - "backtracked" - ] - }, - "errors": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.error" - } - }, - "consumed_gas": { - "$ref": "#/components/schemas/positive_bignum" - }, - "consumed_milligas": { - "$ref": "#/components/schemas/positive_bignum" - } - }, - "required": [ - "status" - ] - } - ] - }, - "012-Psithaca.operation.alpha.operation_result.set_deposits_limit": { - "oneOf": [ - { - "title": "Applied", - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": [ - "applied" - ] - }, - "consumed_gas": { - "$ref": "#/components/schemas/positive_bignum" - }, - "consumed_milligas": { - "$ref": "#/components/schemas/positive_bignum" - } - }, - "required": [ - "status" - ] - }, - { - "title": "Failed", - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": [ - "failed" - ] - }, - "errors": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.error" - } - } - }, - "required": [ - "status", - "errors" - ] - }, - { - "title": "Skipped", - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": [ - "skipped" - ] - } - }, - "required": [ - "status" - ] - }, - { - "title": "Backtracked", - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": [ - "backtracked" - ] - }, - "errors": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.error" - } - }, - "consumed_gas": { - "$ref": "#/components/schemas/positive_bignum" - }, - "consumed_milligas": { - "$ref": "#/components/schemas/positive_bignum" - } - }, - "required": [ - "status" - ] - } - ] - }, - "012-Psithaca.operation.alpha.operation_result.transaction": { - "oneOf": [ - { - "title": "Applied", - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": [ - "applied" - ] - }, - "storage": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - "big_map_diff": { - "type": "array", - "items": { - "oneOf": [ - { - "title": "update", - "type": "object", - "properties": { - "action": { - "type": "string", - "enum": [ - "update" - ] - }, - "big_map": { - "$ref": "#/components/schemas/bignum" - }, - "key_hash": { - "$ref": "#/components/schemas/script_expr" - }, - "key": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - "value": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - } - }, - "required": [ - "action", - "big_map", - "key_hash", - "key" - ] - }, - { - "title": "remove", - "type": "object", - "properties": { - "action": { - "type": "string", - "enum": [ - "remove" - ] - }, - "big_map": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "action", - "big_map" - ] - }, - { - "title": "copy", - "type": "object", - "properties": { - "action": { - "type": "string", - "enum": [ - "copy" - ] - }, - "source_big_map": { - "$ref": "#/components/schemas/bignum" - }, - "destination_big_map": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "action", - "source_big_map", - "destination_big_map" - ] - }, - { - "title": "alloc", - "type": "object", - "properties": { - "action": { - "type": "string", - "enum": [ - "alloc" - ] - }, - "big_map": { - "$ref": "#/components/schemas/bignum" - }, - "key_type": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - "value_type": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - } - }, - "required": [ - "action", - "big_map", - "key_type", - "value_type" - ] - } - ] - } - }, - "balance_updates": { - "$ref": "#/components/schemas/012-Psithaca.operation_metadata.alpha.balance_updates" - }, - "originated_contracts": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.contract_id" - } - }, - "consumed_gas": { - "$ref": "#/components/schemas/positive_bignum" - }, - "consumed_milligas": { - "$ref": "#/components/schemas/positive_bignum" - }, - "storage_size": { - "$ref": "#/components/schemas/bignum" - }, - "paid_storage_size_diff": { - "$ref": "#/components/schemas/bignum" - }, - "allocated_destination_contract": { - "type": "boolean" - }, - "lazy_storage_diff": { - "$ref": "#/components/schemas/012-Psithaca.lazy_storage_diff" - } - }, - "required": [ - "status" - ] - }, - { - "title": "Failed", - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": [ - "failed" - ] - }, - "errors": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.error" - } - } - }, - "required": [ - "status", - "errors" - ] - }, - { - "title": "Skipped", - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": [ - "skipped" - ] - } - }, - "required": [ - "status" - ] - }, - { - "title": "Backtracked", - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": [ - "backtracked" - ] - }, - "errors": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.error" - } - }, - "storage": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - "big_map_diff": { - "type": "array", - "items": { - "oneOf": [ - { - "title": "update", - "type": "object", - "properties": { - "action": { - "type": "string", - "enum": [ - "update" - ] - }, - "big_map": { - "$ref": "#/components/schemas/bignum" - }, - "key_hash": { - "$ref": "#/components/schemas/script_expr" - }, - "key": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - "value": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - } - }, - "required": [ - "action", - "big_map", - "key_hash", - "key" - ] - }, - { - "title": "remove", - "type": "object", - "properties": { - "action": { - "type": "string", - "enum": [ - "remove" - ] - }, - "big_map": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "action", - "big_map" - ] - }, - { - "title": "copy", - "type": "object", - "properties": { - "action": { - "type": "string", - "enum": [ - "copy" - ] - }, - "source_big_map": { - "$ref": "#/components/schemas/bignum" - }, - "destination_big_map": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "action", - "source_big_map", - "destination_big_map" - ] - }, - { - "title": "alloc", - "type": "object", - "properties": { - "action": { - "type": "string", - "enum": [ - "alloc" - ] - }, - "big_map": { - "$ref": "#/components/schemas/bignum" - }, - "key_type": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - "value_type": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - } - }, - "required": [ - "action", - "big_map", - "key_type", - "value_type" - ] - } - ] - } - }, - "balance_updates": { - "$ref": "#/components/schemas/012-Psithaca.operation_metadata.alpha.balance_updates" - }, - "originated_contracts": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.contract_id" - } - }, - "consumed_gas": { - "$ref": "#/components/schemas/positive_bignum" - }, - "consumed_milligas": { - "$ref": "#/components/schemas/positive_bignum" - }, - "storage_size": { - "$ref": "#/components/schemas/bignum" - }, - "paid_storage_size_diff": { - "$ref": "#/components/schemas/bignum" - }, - "allocated_destination_contract": { - "type": "boolean" - }, - "lazy_storage_diff": { - "$ref": "#/components/schemas/012-Psithaca.lazy_storage_diff" - } - }, - "required": [ - "status" - ] - } - ] - }, - "012-Psithaca.operation.alpha.operation_with_metadata": { - "oneOf": [ - { - "title": "Operation_with_metadata", - "type": "object", - "properties": { - "contents": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.operation.alpha.operation_contents_and_result" - } - }, - "signature": { - "$ref": "#/components/schemas/Signature" - } - }, - "required": [ - "contents" - ] - }, - { - "title": "Operation_without_metadata", - "type": "object", - "properties": { - "contents": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.operation.alpha.contents" - } - }, - "signature": { - "$ref": "#/components/schemas/Signature" - } - }, - "required": [ - "contents" - ] - } - ] - }, - "012-Psithaca.operation_metadata.alpha.balance_updates": { - "type": "array", - "items": { - "oneOf": [ - { - "title": "Contract", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "contract" - ] - }, - "contract": { - "$ref": "#/components/schemas/012-Psithaca.contract_id" - }, - "change": { - "$ref": "#/components/schemas/int64" - }, - "origin": { - "oneOf": [ - { - "title": "Block_application", - "type": "string", - "enum": [ - "block" - ] - }, - { - "title": "Protocol_migration", - "type": "string", - "enum": [ - "migration" - ] - }, - { - "title": "Subsidy", - "type": "string", - "enum": [ - "subsidy" - ] - }, - { - "title": "Simulation", - "type": "string", - "enum": [ - "simulation" - ] - } - ] - } - }, - "required": [ - "kind", - "contract", - "change", - "origin" - ] - }, - { - "title": "Legacy_rewards", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "freezer" - ] - }, - "category": { - "type": "string", - "enum": [ - "legacy_rewards" - ] - }, - "delegate": { - "$ref": "#/components/schemas/Signature.Public_key_hash" - }, - "cycle": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "change": { - "$ref": "#/components/schemas/int64" - }, - "origin": { - "oneOf": [ - { - "title": "Block_application", - "type": "string", - "enum": [ - "block" - ] - }, - { - "title": "Protocol_migration", - "type": "string", - "enum": [ - "migration" - ] - }, - { - "title": "Subsidy", - "type": "string", - "enum": [ - "subsidy" - ] - }, - { - "title": "Simulation", - "type": "string", - "enum": [ - "simulation" - ] - } - ] - } - }, - "required": [ - "kind", - "category", - "delegate", - "cycle", - "change", - "origin" - ] - }, - { - "title": "Block_fees", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "accumulator" - ] - }, - "category": { - "type": "string", - "enum": [ - "block fees" - ] - }, - "change": { - "$ref": "#/components/schemas/int64" - }, - "origin": { - "oneOf": [ - { - "title": "Block_application", - "type": "string", - "enum": [ - "block" - ] - }, - { - "title": "Protocol_migration", - "type": "string", - "enum": [ - "migration" - ] - }, - { - "title": "Subsidy", - "type": "string", - "enum": [ - "subsidy" - ] - }, - { - "title": "Simulation", - "type": "string", - "enum": [ - "simulation" - ] - } - ] - } - }, - "required": [ - "kind", - "category", - "change", - "origin" - ] - }, - { - "title": "Legacy_deposits", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "freezer" - ] - }, - "category": { - "type": "string", - "enum": [ - "legacy_deposits" - ] - }, - "delegate": { - "$ref": "#/components/schemas/Signature.Public_key_hash" - }, - "cycle": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "change": { - "$ref": "#/components/schemas/int64" - }, - "origin": { - "oneOf": [ - { - "title": "Block_application", - "type": "string", - "enum": [ - "block" - ] - }, - { - "title": "Protocol_migration", - "type": "string", - "enum": [ - "migration" - ] - }, - { - "title": "Subsidy", - "type": "string", - "enum": [ - "subsidy" - ] - }, - { - "title": "Simulation", - "type": "string", - "enum": [ - "simulation" - ] - } - ] - } - }, - "required": [ - "kind", - "category", - "delegate", - "cycle", - "change", - "origin" - ] - }, - { - "title": "Deposits", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "freezer" - ] - }, - "category": { - "type": "string", - "enum": [ - "deposits" - ] - }, - "delegate": { - "$ref": "#/components/schemas/Signature.Public_key_hash" - }, - "change": { - "$ref": "#/components/schemas/int64" - }, - "origin": { - "oneOf": [ - { - "title": "Block_application", - "type": "string", - "enum": [ - "block" - ] - }, - { - "title": "Protocol_migration", - "type": "string", - "enum": [ - "migration" - ] - }, - { - "title": "Subsidy", - "type": "string", - "enum": [ - "subsidy" - ] - }, - { - "title": "Simulation", - "type": "string", - "enum": [ - "simulation" - ] - } - ] - } - }, - "required": [ - "kind", - "category", - "delegate", - "change", - "origin" - ] - }, - { - "title": "Nonce_revelation_rewards", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "minted" - ] - }, - "category": { - "type": "string", - "enum": [ - "nonce revelation rewards" - ] - }, - "change": { - "$ref": "#/components/schemas/int64" - }, - "origin": { - "oneOf": [ - { - "title": "Block_application", - "type": "string", - "enum": [ - "block" - ] - }, - { - "title": "Protocol_migration", - "type": "string", - "enum": [ - "migration" - ] - }, - { - "title": "Subsidy", - "type": "string", - "enum": [ - "subsidy" - ] - }, - { - "title": "Simulation", - "type": "string", - "enum": [ - "simulation" - ] - } - ] - } - }, - "required": [ - "kind", - "category", - "change", - "origin" - ] - }, - { - "title": "Double_signing_evidence_rewards", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "minted" - ] - }, - "category": { - "type": "string", - "enum": [ - "double signing evidence rewards" - ] - }, - "change": { - "$ref": "#/components/schemas/int64" - }, - "origin": { - "oneOf": [ - { - "title": "Block_application", - "type": "string", - "enum": [ - "block" - ] - }, - { - "title": "Protocol_migration", - "type": "string", - "enum": [ - "migration" - ] - }, - { - "title": "Subsidy", - "type": "string", - "enum": [ - "subsidy" - ] - }, - { - "title": "Simulation", - "type": "string", - "enum": [ - "simulation" - ] - } - ] - } - }, - "required": [ - "kind", - "category", - "change", - "origin" - ] - }, - { - "title": "Endorsing_rewards", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "minted" - ] - }, - "category": { - "type": "string", - "enum": [ - "endorsing rewards" - ] - }, - "change": { - "$ref": "#/components/schemas/int64" - }, - "origin": { - "oneOf": [ - { - "title": "Block_application", - "type": "string", - "enum": [ - "block" - ] - }, - { - "title": "Protocol_migration", - "type": "string", - "enum": [ - "migration" - ] - }, - { - "title": "Subsidy", - "type": "string", - "enum": [ - "subsidy" - ] - }, - { - "title": "Simulation", - "type": "string", - "enum": [ - "simulation" - ] - } - ] - } - }, - "required": [ - "kind", - "category", - "change", - "origin" - ] - }, - { - "title": "Baking_rewards", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "minted" - ] - }, - "category": { - "type": "string", - "enum": [ - "baking rewards" - ] - }, - "change": { - "$ref": "#/components/schemas/int64" - }, - "origin": { - "oneOf": [ - { - "title": "Block_application", - "type": "string", - "enum": [ - "block" - ] - }, - { - "title": "Protocol_migration", - "type": "string", - "enum": [ - "migration" - ] - }, - { - "title": "Subsidy", - "type": "string", - "enum": [ - "subsidy" - ] - }, - { - "title": "Simulation", - "type": "string", - "enum": [ - "simulation" - ] - } - ] - } - }, - "required": [ - "kind", - "category", - "change", - "origin" - ] - }, - { - "title": "Baking_bonuses", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "minted" - ] - }, - "category": { - "type": "string", - "enum": [ - "baking bonuses" - ] - }, - "change": { - "$ref": "#/components/schemas/int64" - }, - "origin": { - "oneOf": [ - { - "title": "Block_application", - "type": "string", - "enum": [ - "block" - ] - }, - { - "title": "Protocol_migration", - "type": "string", - "enum": [ - "migration" - ] - }, - { - "title": "Subsidy", - "type": "string", - "enum": [ - "subsidy" - ] - }, - { - "title": "Simulation", - "type": "string", - "enum": [ - "simulation" - ] - } - ] - } - }, - "required": [ - "kind", - "category", - "change", - "origin" - ] - }, - { - "title": "Legacy_fees", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "freezer" - ] - }, - "category": { - "type": "string", - "enum": [ - "legacy_fees" - ] - }, - "delegate": { - "$ref": "#/components/schemas/Signature.Public_key_hash" - }, - "cycle": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "change": { - "$ref": "#/components/schemas/int64" - }, - "origin": { - "oneOf": [ - { - "title": "Block_application", - "type": "string", - "enum": [ - "block" - ] - }, - { - "title": "Protocol_migration", - "type": "string", - "enum": [ - "migration" - ] - }, - { - "title": "Subsidy", - "type": "string", - "enum": [ - "subsidy" - ] - }, - { - "title": "Simulation", - "type": "string", - "enum": [ - "simulation" - ] - } - ] - } - }, - "required": [ - "kind", - "category", - "delegate", - "cycle", - "change", - "origin" - ] - }, - { - "title": "Storage_fees", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "burned" - ] - }, - "category": { - "type": "string", - "enum": [ - "storage fees" - ] - }, - "change": { - "$ref": "#/components/schemas/int64" - }, - "origin": { - "oneOf": [ - { - "title": "Block_application", - "type": "string", - "enum": [ - "block" - ] - }, - { - "title": "Protocol_migration", - "type": "string", - "enum": [ - "migration" - ] - }, - { - "title": "Subsidy", - "type": "string", - "enum": [ - "subsidy" - ] - }, - { - "title": "Simulation", - "type": "string", - "enum": [ - "simulation" - ] - } - ] - } - }, - "required": [ - "kind", - "category", - "change", - "origin" - ] - }, - { - "title": "Double_signing_punishments", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "burned" - ] - }, - "category": { - "type": "string", - "enum": [ - "punishments" - ] - }, - "change": { - "$ref": "#/components/schemas/int64" - }, - "origin": { - "oneOf": [ - { - "title": "Block_application", - "type": "string", - "enum": [ - "block" - ] - }, - { - "title": "Protocol_migration", - "type": "string", - "enum": [ - "migration" - ] - }, - { - "title": "Subsidy", - "type": "string", - "enum": [ - "subsidy" - ] - }, - { - "title": "Simulation", - "type": "string", - "enum": [ - "simulation" - ] - } - ] - } - }, - "required": [ - "kind", - "category", - "change", - "origin" - ] - }, - { - "title": "Lost_endorsing_rewards", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "burned" - ] - }, - "category": { - "type": "string", - "enum": [ - "lost endorsing rewards" - ] - }, - "delegate": { - "$ref": "#/components/schemas/Signature.Public_key_hash" - }, - "participation": { - "type": "boolean" - }, - "revelation": { - "type": "boolean" - }, - "change": { - "$ref": "#/components/schemas/int64" - }, - "origin": { - "oneOf": [ - { - "title": "Block_application", - "type": "string", - "enum": [ - "block" - ] - }, - { - "title": "Protocol_migration", - "type": "string", - "enum": [ - "migration" - ] - }, - { - "title": "Subsidy", - "type": "string", - "enum": [ - "subsidy" - ] - }, - { - "title": "Simulation", - "type": "string", - "enum": [ - "simulation" - ] - } - ] - } - }, - "required": [ - "kind", - "category", - "delegate", - "participation", - "revelation", - "change", - "origin" - ] - }, - { - "title": "Liquidity_baking_subsidies", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "minted" - ] - }, - "category": { - "type": "string", - "enum": [ - "subsidy" - ] - }, - "change": { - "$ref": "#/components/schemas/int64" - }, - "origin": { - "oneOf": [ - { - "title": "Block_application", - "type": "string", - "enum": [ - "block" - ] - }, - { - "title": "Protocol_migration", - "type": "string", - "enum": [ - "migration" - ] - }, - { - "title": "Subsidy", - "type": "string", - "enum": [ - "subsidy" - ] - }, - { - "title": "Simulation", - "type": "string", - "enum": [ - "simulation" - ] - } - ] - } - }, - "required": [ - "kind", - "category", - "change", - "origin" - ] - }, - { - "title": "Burned", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "burned" - ] - }, - "category": { - "type": "string", - "enum": [ - "burned" - ] - }, - "change": { - "$ref": "#/components/schemas/int64" - }, - "origin": { - "oneOf": [ - { - "title": "Block_application", - "type": "string", - "enum": [ - "block" - ] - }, - { - "title": "Protocol_migration", - "type": "string", - "enum": [ - "migration" - ] - }, - { - "title": "Subsidy", - "type": "string", - "enum": [ - "subsidy" - ] - }, - { - "title": "Simulation", - "type": "string", - "enum": [ - "simulation" - ] - } - ] - } - }, - "required": [ - "kind", - "category", - "change", - "origin" - ] - }, - { - "title": "Commitments", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "commitment" - ] - }, - "category": { - "type": "string", - "enum": [ - "commitment" - ] - }, - "committer": { - "$ref": "#/components/schemas/Blinded public key hash" - }, - "change": { - "$ref": "#/components/schemas/int64" - }, - "origin": { - "oneOf": [ - { - "title": "Block_application", - "type": "string", - "enum": [ - "block" - ] - }, - { - "title": "Protocol_migration", - "type": "string", - "enum": [ - "migration" - ] - }, - { - "title": "Subsidy", - "type": "string", - "enum": [ - "subsidy" - ] - }, - { - "title": "Simulation", - "type": "string", - "enum": [ - "simulation" - ] - } - ] - } - }, - "required": [ - "kind", - "category", - "committer", - "change", - "origin" - ] - }, - { - "title": "Bootstrap", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "minted" - ] - }, - "category": { - "type": "string", - "enum": [ - "bootstrap" - ] - }, - "change": { - "$ref": "#/components/schemas/int64" - }, - "origin": { - "oneOf": [ - { - "title": "Block_application", - "type": "string", - "enum": [ - "block" - ] - }, - { - "title": "Protocol_migration", - "type": "string", - "enum": [ - "migration" - ] - }, - { - "title": "Subsidy", - "type": "string", - "enum": [ - "subsidy" - ] - }, - { - "title": "Simulation", - "type": "string", - "enum": [ - "simulation" - ] - } - ] - } - }, - "required": [ - "kind", - "category", - "change", - "origin" - ] - }, - { - "title": "Invoice", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "minted" - ] - }, - "category": { - "type": "string", - "enum": [ - "invoice" - ] - }, - "change": { - "$ref": "#/components/schemas/int64" - }, - "origin": { - "oneOf": [ - { - "title": "Block_application", - "type": "string", - "enum": [ - "block" - ] - }, - { - "title": "Protocol_migration", - "type": "string", - "enum": [ - "migration" - ] - }, - { - "title": "Subsidy", - "type": "string", - "enum": [ - "subsidy" - ] - }, - { - "title": "Simulation", - "type": "string", - "enum": [ - "simulation" - ] - } - ] - } - }, - "required": [ - "kind", - "category", - "change", - "origin" - ] - }, - { - "title": "Initial_commitments", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "minted" - ] - }, - "category": { - "type": "string", - "enum": [ - "commitment" - ] - }, - "change": { - "$ref": "#/components/schemas/int64" - }, - "origin": { - "oneOf": [ - { - "title": "Block_application", - "type": "string", - "enum": [ - "block" - ] - }, - { - "title": "Protocol_migration", - "type": "string", - "enum": [ - "migration" - ] - }, - { - "title": "Subsidy", - "type": "string", - "enum": [ - "subsidy" - ] - }, - { - "title": "Simulation", - "type": "string", - "enum": [ - "simulation" - ] - } - ] - } - }, - "required": [ - "kind", - "category", - "change", - "origin" - ] - }, - { - "title": "Minted", - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "minted" - ] - }, - "category": { - "type": "string", - "enum": [ - "minted" - ] - }, - "change": { - "$ref": "#/components/schemas/int64" - }, - "origin": { - "oneOf": [ - { - "title": "Block_application", - "type": "string", - "enum": [ - "block" - ] - }, - { - "title": "Protocol_migration", - "type": "string", - "enum": [ - "migration" - ] - }, - { - "title": "Subsidy", - "type": "string", - "enum": [ - "subsidy" - ] - }, - { - "title": "Simulation", - "type": "string", - "enum": [ - "simulation" - ] - } - ] - } - }, - "required": [ - "kind", - "category", - "change", - "origin" - ] - } - ] - } - }, - "012-Psithaca.sapling_state_id": { - "title": "Sapling state identifier", - "description": "A sapling state identifier", - "oneOf": [ - { - "$ref": "#/components/schemas/bignum" - } - ] - }, - "012-Psithaca.scripted.contracts": { - "type": "object", - "properties": { - "code": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - "storage": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - } - }, - "required": [ - "code", - "storage" - ] - }, - "012-Psithaca.scripted.trace": { - "type": "array", - "items": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/micheline.location" - }, - "gas": { - "oneOf": [ - { - "title": "Limited", - "oneOf": [ - { - "$ref": "#/components/schemas/bignum" - } - ] - }, - { - "title": "Unaccounted", - "type": "string", - "enum": [ - "unaccounted" - ] - } - ] - }, - "stack": { - "type": "array", - "items": { - "type": "object", - "properties": { - "item": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - "annot": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "item" - ] - } - } - }, - "required": [ - "location", - "gas", - "stack" - ] - } - }, - "Blinded public key hash": { - "title": "A blinded public key hash (Base58Check-encoded)", - "oneOf": [ - { - "$ref": "#/components/schemas/unistring" - } - ] - }, - "Chain_id": { - "title": "Network identifier (Base58Check-encoded)", - "oneOf": [ - { - "$ref": "#/components/schemas/unistring" - } - ] - }, - "Context_hash": { - "title": "A hash of context (Base58Check-encoded)", - "oneOf": [ - { - "$ref": "#/components/schemas/unistring" - } - ] - }, - "Ed25519.Public_key_hash": { - "title": "An Ed25519 public key hash (Base58Check-encoded)", - "oneOf": [ - { - "$ref": "#/components/schemas/unistring" - } - ] - }, - "Operation_hash": { - "title": "A Tezos operation ID (Base58Check-encoded)", - "oneOf": [ - { - "$ref": "#/components/schemas/unistring" - } - ] - }, - "Operation_list_list_hash": { - "title": "A list of list of operations (Base58Check-encoded)", - "oneOf": [ - { - "$ref": "#/components/schemas/unistring" - } - ] - }, - "Operation_metadata_hash": { - "title": "A Tezos operation metadata ID (Base58Check-encoded)", - "oneOf": [ - { - "$ref": "#/components/schemas/unistring" - } - ] - }, - "Protocol_hash": { - "title": "A Tezos protocol ID (Base58Check-encoded)", - "oneOf": [ - { - "$ref": "#/components/schemas/unistring" - } - ] - }, - "Signature": { - "title": "A Ed25519, Secp256k1 or P256 signature (Base58Check-encoded)", - "oneOf": [ - { - "$ref": "#/components/schemas/unistring" - } - ] - }, - "Signature.Public_key": { - "title": "A Ed25519, Secp256k1, or P256 public key (Base58Check-encoded)", - "oneOf": [ - { - "$ref": "#/components/schemas/unistring" - } - ] - }, - "Signature.Public_key_hash": { - "title": "A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded)", - "oneOf": [ - { - "$ref": "#/components/schemas/unistring" - } - ] - }, - "bignum": { - "title": "Big number", - "description": "Decimal representation of a big number", - "type": "string" - }, - "block_hash": { - "title": "A block identifier (Base58Check-encoded)", - "oneOf": [ - { - "$ref": "#/components/schemas/unistring" - } - ] - }, - "block_header.shell": { - "title": "Shell header", - "description": "Block header's shell-related content. It contains information such as the block level, its predecessor and timestamp.", - "type": "object", - "properties": { - "level": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "proto": { - "type": "integer", - "minimum": 0, - "maximum": 255 - }, - "predecessor": { - "$ref": "#/components/schemas/block_hash" - }, - "timestamp": { - "$ref": "#/components/schemas/timestamp.protocol" - }, - "validation_pass": { - "type": "integer", - "minimum": 0, - "maximum": 255 - }, - "operations_hash": { - "$ref": "#/components/schemas/Operation_list_list_hash" - }, - "fitness": { - "$ref": "#/components/schemas/fitness" - }, - "context": { - "$ref": "#/components/schemas/Context_hash" - } - }, - "required": [ - "level", - "proto", - "predecessor", - "timestamp", - "validation_pass", - "operations_hash", - "fitness", - "context" - ] - }, - "block_header_metadata": { - "type": "object", - "properties": { - "protocol": { - "type": "string", - "enum": [ - "ProtoGenesisGenesisGenesisGenesisGenesisGenesk612im" - ] - }, - "next_protocol": { - "type": "string", - "enum": [ - "Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A" - ] - }, - "test_chain_status": { - "$ref": "#/components/schemas/test_chain_status" - }, - "max_operations_ttl": { - "type": "integer", - "minimum": -1073741824, - "maximum": 1073741823 - }, - "max_operation_data_length": { - "type": "integer", - "minimum": -1073741824, - "maximum": 1073741823 - }, - "max_block_header_length": { - "type": "integer", - "minimum": -1073741824, - "maximum": 1073741823 - }, - "max_operation_list_length": { - "type": "array", - "items": { - "type": "object", - "properties": { - "max_size": { - "type": "integer", - "minimum": -1073741824, - "maximum": 1073741823 - }, - "max_op": { - "type": "integer", - "minimum": -1073741824, - "maximum": 1073741823 - } - }, - "required": [ - "max_size" - ] - } - } - }, - "required": [ - "protocol", - "next_protocol", - "test_chain_status", - "max_operations_ttl", - "max_operation_data_length", - "max_block_header_length", - "max_operation_list_length" - ], - "additionalProperties": {} - }, - "cycle_nonce": { - "title": "A nonce hash (Base58Check-encoded)", - "oneOf": [ - { - "$ref": "#/components/schemas/unistring" - } - ] - }, - "error": { - "description": "The full list of errors is available with the global RPC `GET errors`" - }, - "fitness": { - "title": "Block fitness", - "description": "The fitness, or score, of a block, that allow the Tezos to decide which chain is the best. A fitness value is a list of byte sequences. They are compared as follows: shortest lists are smaller; lists of the same length are compared according to the lexicographical order.", - "type": "array", - "items": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "int64": { - "title": "64 bit integers", - "description": "Decimal representation of 64 bit integers", - "type": "string" - }, - "merkle_tree": { - "type": "array", - "items": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/unistring" - }, - { - "oneOf": [ - { - "title": "Hash", - "type": "array", - "items": { - "oneOf": [ - { - "type": "boolean" - }, - { - "$ref": "#/components/schemas/unistring" - } - ] - } - }, - { - "title": "Data", - "nullable": true, - "oneOf": [ - { - "title": "Key", - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - }, - { - "title": "Dir", - "type": "object", - "properties": {}, - "additionalProperties": { - "$ref": "#/components/schemas/raw_context" - } - } - ] - }, - { - "title": "Continue", - "oneOf": [ - { - "$ref": "#/components/schemas/merkle_tree" - } - ] - } - ] - } - ] - } - } - }, - "micheline.012-Psithaca.michelson_v1.expression": { - "oneOf": [ - { - "title": "Int", - "type": "object", - "properties": { - "int": { - "$ref": "#/components/schemas/bignum" - } - }, - "required": [ - "int" - ] - }, - { - "title": "String", - "type": "object", - "properties": { - "string": { - "$ref": "#/components/schemas/unistring" - } - }, - "required": [ - "string" - ] - }, - { - "title": "Bytes", - "type": "object", - "properties": { - "bytes": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "bytes" - ] - }, - { - "title": "Sequence", - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - { - "title": "Prim__generic", - "description": "Generic primitive (any number of args with or without annotations)", - "type": "object", - "properties": { - "prim": { - "$ref": "#/components/schemas/012-Psithaca.michelson.v1.primitives" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/components/schemas/micheline.012-Psithaca.michelson_v1.expression" - } - }, - "annots": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "prim" - ] - } - ] - }, - "micheline.location": { - "title": "Canonical location in a Micheline expression", - "description": "The location of a node in a Micheline expression tree in prefix order, with zero being the root and adding one for every basic node, sequence and primitive application.", - "type": "integer", - "minimum": -1073741824, - "maximum": 1073741823 - }, - "next_operation": { - "description": "An operation's shell header.", - "type": "object", - "properties": { - "protocol": { - "type": "string", - "enum": [ - "Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A" - ] - }, - "branch": { - "$ref": "#/components/schemas/block_hash" - }, - "contents": { - "type": "array", - "items": { - "$ref": "#/components/schemas/012-Psithaca.operation.alpha.contents" - } - }, - "signature": { - "$ref": "#/components/schemas/Signature" - } - }, - "required": [ - "protocol", - "branch", - "contents", - "signature" - ] - }, - "operation": { - "oneOf": [ - { - "description": "An operation's shell header.", - "type": "object", - "properties": { - "protocol": { - "type": "string", - "enum": [ - "ProtoGenesisGenesisGenesisGenesisGenesisGenesk612im" - ] - }, - "chain_id": { - "$ref": "#/components/schemas/Chain_id" - }, - "hash": { - "$ref": "#/components/schemas/Operation_hash" - }, - "branch": { - "$ref": "#/components/schemas/block_hash" - } - }, - "required": [ - "protocol", - "chain_id", - "hash", - "branch" - ], - "additionalProperties": {} - }, - { - "description": "An operation's shell header.", - "type": "object", - "properties": { - "protocol": { - "type": "string", - "enum": [ - "ProtoGenesisGenesisGenesisGenesisGenesisGenesk612im" - ] - }, - "chain_id": { - "$ref": "#/components/schemas/Chain_id" - }, - "hash": { - "$ref": "#/components/schemas/Operation_hash" - }, - "branch": { - "$ref": "#/components/schemas/block_hash" - } - }, - "required": [ - "protocol", - "chain_id", - "hash", - "branch" - ], - "additionalProperties": {} - } - ] - }, - "positive_bignum": { - "title": "Positive big number", - "description": "Decimal representation of a positive big number", - "type": "string" - }, - "raw_block_header": { - "title": "Shell header", - "description": "Block header's shell-related content. It contains information such as the block level, its predecessor and timestamp.", - "type": "object", - "properties": { - "level": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "proto": { - "type": "integer", - "minimum": 0, - "maximum": 255 - }, - "predecessor": { - "$ref": "#/components/schemas/block_hash" - }, - "timestamp": { - "$ref": "#/components/schemas/timestamp.protocol" - }, - "validation_pass": { - "type": "integer", - "minimum": 0, - "maximum": 255 - }, - "operations_hash": { - "$ref": "#/components/schemas/Operation_list_list_hash" - }, - "fitness": { - "$ref": "#/components/schemas/fitness" - }, - "context": { - "$ref": "#/components/schemas/Context_hash" - }, - "content": { - "oneOf": [ - { - "title": "Activate", - "type": "object", - "properties": { - "command": { - "type": "string", - "enum": [ - "activate" - ] - }, - "hash": { - "$ref": "#/components/schemas/Protocol_hash" - }, - "fitness": { - "$ref": "#/components/schemas/fitness" - }, - "protocol_parameters": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "command", - "hash", - "fitness", - "protocol_parameters" - ] - }, - { - "title": "Activate_testchain", - "type": "object", - "properties": { - "command": { - "type": "string", - "enum": [ - "activate_testchain" - ] - }, - "hash": { - "$ref": "#/components/schemas/Protocol_hash" - }, - "fitness": { - "$ref": "#/components/schemas/fitness" - }, - "protocol_parameters": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - }, - "validity_time": { - "$ref": "#/components/schemas/int64" - } - }, - "required": [ - "command", - "hash", - "fitness", - "protocol_parameters", - "validity_time" - ] - } - ] - }, - "signature": { - "$ref": "#/components/schemas/Signature" - } - }, - "required": [ - "level", - "proto", - "predecessor", - "timestamp", - "validation_pass", - "operations_hash", - "fitness", - "context", - "content", - "signature" - ] - }, - "raw_context": { - "nullable": true, - "oneOf": [ - { - "title": "Key", - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - }, - { - "title": "Dir", - "type": "object", - "properties": {}, - "additionalProperties": { - "$ref": "#/components/schemas/raw_context" - } - } - ] - }, - "sapling.DH.epk": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - }, - "sapling.transaction.ciphertext": { - "type": "object", - "properties": { - "cv": { - "$ref": "#/components/schemas/sapling.transaction.commitment_value" - }, - "epk": { - "$ref": "#/components/schemas/sapling.DH.epk" - }, - "payload_enc": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - }, - "nonce_enc": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - }, - "payload_out": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - }, - "nonce_out": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "cv", - "epk", - "payload_enc", - "nonce_enc", - "payload_out", - "nonce_out" - ] - }, - "sapling.transaction.commitment": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - }, - "sapling.transaction.commitment_hash": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - }, - "sapling.transaction.commitment_value": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - }, - "sapling.transaction.nullifier": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - }, - "script_expr": { - "title": "A script expression ID (Base58Check-encoded)", - "oneOf": [ - { - "$ref": "#/components/schemas/unistring" - } - ] - }, - "test_chain_status": { - "description": "The status of the test chain: not_running (there is no test chain at the moment), forking (the test chain is being setup), running (the test chain is running).", - "oneOf": [ - { - "title": "Not_running", - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": [ - "not_running" - ] - } - }, - "required": [ - "status" - ] - }, - { - "title": "Forking", - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": [ - "forking" - ] - }, - "protocol": { - "$ref": "#/components/schemas/Protocol_hash" - }, - "expiration": { - "$ref": "#/components/schemas/timestamp.protocol" - } - }, - "required": [ - "status", - "protocol", - "expiration" - ] - }, - { - "title": "Running", - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": [ - "running" - ] - }, - "chain_id": { - "$ref": "#/components/schemas/Chain_id" - }, - "genesis": { - "$ref": "#/components/schemas/block_hash" - }, - "protocol": { - "$ref": "#/components/schemas/Protocol_hash" - }, - "expiration": { - "$ref": "#/components/schemas/timestamp.protocol" - } - }, - "required": [ - "status", - "chain_id", - "genesis", - "protocol", - "expiration" - ] - } - ] - }, - "timestamp.protocol": { - "description": "A timestamp as seen by the protocol: second-level precision, epoch based.", - "oneOf": [ - { - "$ref": "#/components/schemas/unistring" - } - ] - }, - "unistring": { - "title": "Universal string representation", - "description": "Either a plain UTF8 string, or a sequence of bytes for strings that contain invalid byte sequences.", - "oneOf": [ - { - "type": "string" - }, - { - "type": "object", - "properties": { - "invalid_utf8_string": { - "type": "array", - "items": { - "type": "integer", - "minimum": 0, - "maximum": 255 - } - } - }, - "required": [ - "invalid_utf8_string" - ] - } - ] - }, - "value_hash": { - "title": "Hash of a consensus value (Base58Check-encoded)", - "oneOf": [ - { - "$ref": "#/components/schemas/unistring" - } - ] - } - } - } -} diff --git a/docs/api/openapi.rst b/docs/api/openapi.rst index ff67e9b709bf38dcc83ad578fafe752ee3f03a01..1fafad07e8479a4f1b1f1917160560f74968bf40 100644 --- a/docs/api/openapi.rst +++ b/docs/api/openapi.rst @@ -49,19 +49,6 @@ Their OpenAPI specification can be found at: .. TODO tezos/tezos#2170: add/remove section(s) -Ithaca RPCs ------------ - -The OpenAPI specification for RPCs which are specific to the Ithaca (``Psithaca``) -protocol can be found at: - -- `ithaca-openapi.json (version 12.0~rc2) `_ - -The OpenAPI specification for RPCs which are related to the mempool -and specific to the Ithaca protocol can be found at: - -- `ithaca-mempool-openapi.json (version 12.0~rc2) `_ - Jakarta RPCs ------------ diff --git a/docs/conf.py b/docs/conf.py index eb38e090414fdbbaec471973754811595581bce6..21b4414a2a40602022e240d195f6ac3e4f436de0 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -87,7 +87,7 @@ exclude_patterns = [ 'Thumbs.db', '.DS_Store', 'doc_gen', - 'ithaca', + 'jakarta', ] # TODO tezos/tezos#2170: exclude the active protocol 'NNN' above diff --git a/docs/developer/merkle-proof-encoding-formats.rst b/docs/developer/merkle-proof-encoding-formats.rst index 0662d84be5c90d09fe940ce65e61b0a50a7cdfda..56642deb04947c9c1c4a93cbf2d40c984b21d46a 100644 --- a/docs/developer/merkle-proof-encoding-formats.rst +++ b/docs/developer/merkle-proof-encoding-formats.rst @@ -4,7 +4,7 @@ Merkle Proof Encoding Formats A Merkle proof is a datum which demonstrates that a `Merkle tree `_ has a given value. Typically a Merkle root and a subtree of a Merkle tree are used as a Merkle proof. Verification is done by computing the Merkle root and checking it is the same as the given hash. -In Octez, Merkle proofs are used for Optimistic Rollups (see :doc:`../jakarta/transaction_rollups`) in the event +In Octez, Merkle proofs are used for Optimistic Rollups (see :doc:`../active/transaction_rollups`) in the event an invalid hash is submitted from a layer 2 node to layer 1. An honest layer 2 node can then present a Merkle proof to demonstrate that the previously submitted hash is in fact fraudulent. diff --git a/docs/doc_gen/dune b/docs/doc_gen/dune index e1c6e8e2b3cc12c3b2c96e696b660de7394bc7e7..c42364bbb9a632221baf101c81875ec6e9e40f2a 100644 --- a/docs/doc_gen/dune +++ b/docs/doc_gen/dune @@ -7,7 +7,6 @@ tezos-rpc-http-server tezos-protocol-updater ; TODO tezos/tezos#2170: adapt next line(s) - tezos-embedded-protocol-012-Psithaca tezos-embedded-protocol-013-PtJakart tezos-embedded-protocol-014-PtKathma tezos-embedded-protocol-alpha diff --git a/docs/doc_gen/rpc_doc.ml b/docs/doc_gen/rpc_doc.ml index a08ff288159b5fe665ed2b70c9a133aa8930dd39..00638fb1573a184f4b832d736b4c90dcfba0f8db 100644 --- a/docs/doc_gen/rpc_doc.ml +++ b/docs/doc_gen/rpc_doc.ml @@ -33,10 +33,6 @@ let protocols = Some "/include/rpc_introduction.rst.inc", "ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK" ); (* TODO tezos/tezos#2170: adapt rest of this list *) - ( "ithaca", - "Ithaca", - Some "/include/rpc_introduction.rst.inc", - "Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A" ); ( "jakarta", "Jakarta", Some "/include/rpc_introduction.rst.inc", diff --git a/docs/index.rst b/docs/index.rst index 9b27ed7df41bad05864bcd6573f29ed9bd6b5d6c..690e3d47b7e9e05dc4eb09d3155ca2b7d7745c92 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -149,22 +149,13 @@ in the :ref:`introduction `. .. toctree:: :maxdepth: 2 - :caption: Ithaca Protocol doc: + :caption: Jakarta Protocol doc: active/protocol active/glossary active/cli-commands active/rpc -.. toctree:: - :maxdepth: 2 - :caption: Jakarta Protocol doc: - - jakarta/protocol - jakarta/glossary - jakarta/cli-commands - jakarta/rpc - .. toctree:: :maxdepth: 2 :caption: kathmandu Kathmandu Protocol doc: diff --git a/docs/introduction/howtoget.rst b/docs/introduction/howtoget.rst index 624f1557732e41b5b6d9258b2059c68ea804485b..8f322cad71aa4fbc462d870d39291444cc697600 100644 --- a/docs/introduction/howtoget.rst +++ b/docs/introduction/howtoget.rst @@ -154,7 +154,7 @@ An example Docker Compose script is provided in :src:`scripts/docker/docker-compose-generic.yml`. It launches a node, a baker, and an accuser for protocol Alpha. You can adapt it to run the baker and accuser for other protocols -by replacing all instances of ``alpha`` to e.g. ``012-Psithaca`` for Ithaca. +by replacing all instances of ``alpha`` to e.g. ``013-PtJakart`` for Jakarta. Replacing the value of the ``PROTOCOL`` environment variable is enough but you may want to update the ``hostname`` and the container name too. diff --git a/docs/introduction/howtorun.rst b/docs/introduction/howtorun.rst index c8fbf9e98fada5bff65853915763a58152bcb624..433d73da868b30153a9aaa5fa3c586ba740dbe74 100644 --- a/docs/introduction/howtorun.rst +++ b/docs/introduction/howtorun.rst @@ -96,7 +96,7 @@ consensus are not roll-based, they are based on the actual, non-approximated sta Delegates are required to freeze around 10% of their active stake into a security deposit (more precisely, it's 10% of the maximum active stake during the last 7 cycles). A delegate is -:ref:`slashed`, that is, it looses funds from its +:ref:`slashed`, that is, it looses funds from its security deposits when it misbehaves by double-signing. The funds in the security deposit come from the delegate's account. In case a delegate is over-delegated (that is, its own balance does not cover @@ -222,14 +222,14 @@ If you are running the baker Docker image, you can watch the baker logs with docker ps If your container is running, its name will appear in the last column. -For instance, if the name is ``mainnet_baker-012-Psithaca_1``, you can +For instance, if the name is ``mainnet_baker-013-PtJakart_1``, you can view recent logs with:: - docker logs mainnet_baker-012-Psithaca_1 + docker logs mainnet_baker-013-PtJakart_1 If you want to keep watching logs, use ``-f``:: - docker logs mainnet_baker-012-Psithaca_1 -f + docker logs mainnet_baker-013-PtJakart_1 -f This allows you to know if you baked. You should see lines such as:: diff --git a/docs/introduction/howtouse.rst b/docs/introduction/howtouse.rst index 855a1e72b0bf409d2ec42091d0df0e2147f3dd98..a228576d5edd9421f1bbed6cabd77bfa9796698e 100644 --- a/docs/introduction/howtouse.rst +++ b/docs/introduction/howtouse.rst @@ -29,8 +29,8 @@ After a successful compilation, you should have the following binaries: The daemons other than the node are suffixed with the name of the protocol they are bound to, and up to some version, also by its number. -For instance, ``tezos-baker-012-Psithaca`` is the baker -for the Ithaca protocol, and ``tezos-baker-alpha`` is the baker +For instance, ``tezos-baker-013-PtJakart`` is the baker +for the Jakarta protocol, and ``tezos-baker-alpha`` is the baker of the development protocol. The ``tezos-node`` daemon is not suffixed by any protocol name, because it is independent of the economic protocol. See also the `Node's Protocol`_ section below. diff --git a/docs/introduction/install-bin-fedora.sh b/docs/introduction/install-bin-fedora.sh index f0b25a4d008ad31979d867c524b9adeac586cb3a..2a44b55898a9bc7e3691f449d81249bf60c7c000 100755 --- a/docs/introduction/install-bin-fedora.sh +++ b/docs/introduction/install-bin-fedora.sh @@ -31,10 +31,10 @@ dnf install -y dnf-plugins-core dnf copr enable -y $REPO && dnf update -y dnf install -y tezos-client dnf install -y tezos-node -dnf install -y tezos-baker-012-Psithaca -dnf install -y tezos-accuser-012-Psithaca +dnf install -y tezos-baker-013-PtJakart +dnf install -y tezos-accuser-013-PtJakart # [test executables] tezos-client --version tezos-node --version -tezos-baker-012-Psithaca --version -tezos-accuser-012-Psithaca --version +tezos-baker-013-PtJakart --version +tezos-accuser-013-PtJakart --version diff --git a/docs/introduction/install-bin-ubuntu.sh b/docs/introduction/install-bin-ubuntu.sh index c07474f62437e437928248d408dd90ee8cde77c1..f7e3adfaa957d81e74e6c542929b2c3a937091a6 100755 --- a/docs/introduction/install-bin-ubuntu.sh +++ b/docs/introduction/install-bin-ubuntu.sh @@ -33,10 +33,10 @@ apt-get install -y software-properties-common ` to learn how to find out their values. -Ithacanet -========= - -- Built-in network alias: ``ithacanet`` (see :ref:`builtin_networks`) - - * Available from version 12.0~rc1 but 12.0~rc2 updated it to refer - to the second version of Ithacanet which runs ``Psithaca2`` instead - of ``PsiThaCa``. - -Ithacanet is a test network which ran the Ithaca protocol and which was reset -to run on the Ithaca2 protocol. -Ithacanet will run until Ithaca2 is replaced by another protocol on Mainnet. - -On Ithacanet, some constants differ from Mainnet. -This results in a faster chain than Mainnet. -See :ref:`protocol constants ` to learn how to find out their values. - Future Networks =============== @@ -78,9 +61,32 @@ test network until either P is rejected or activated. If P is rejected, P-net wi end, unless P is immediately re-submitted for injection. If, however, P is activated, the previous test network will end and P-net will continue on its own. +.. _ghostnet: + +Ghostnet +======== + +Ghostnet is a long running, centrally managed test network designed to follow (in fact, anticipate!) Tezos Mainnet protocol upgrades. +Indeed, Ghostnet generally updates to the same protocol as Mainnet a few hours or days before the Mainnet itself. + +Ghostnet was previously known as :ref:`ithacanet`, the testchain for the Ithaca protocol. + +See also +======== + +An external description of the various test networks available can be found on https://teztnets.xyz/. + Old Networks ============ +.. _ithacanet: + +Ithacanet +--------- + +Ithacanet was a test network running the Ithaca protocol. +Following the activation of the Jakarta protocol replacing Ithaca on Mainnet, +Ithacanet was converted to :ref:`ghostnet` on June 28, 2022. Hangzhounet ----------- diff --git a/docs/ithaca/cli-commands.rst b/docs/ithaca/cli-commands.rst deleted file mode 100644 index b0bd85e7aa6ae40c5a28e07856f021dc0877d329..0000000000000000000000000000000000000000 --- a/docs/ithaca/cli-commands.rst +++ /dev/null @@ -1,44 +0,0 @@ -********************** -Command Line Interface -********************** - -This document is a prettier output of the documentation produced by -the command ``man`` of the different Tezos binaries. You can obtain similar pages -using shell commands such as (:ref:`indicating the appropriate protocol `): - -:: - - tezos-client -protocol man -verbosity 3 - -The rest of this page documents the protocol-dependent tools. -The protocol-independent tools are documented :doc:`here <../shell/cli-commands>`. - - -.. _client_manual: -.. _client_manual_ithaca: - -Client manual -============= - -.. raw:: html - :file: tezos-client.html - - -.. _baker_manual: -.. _baker_manual_ithaca: - -Baker manual -============ - -.. raw:: html - :file: tezos-baker.html - - -.. _accuser_manual: -.. _accuser_manual_ithaca: - -Accuser manual -============== - -.. raw:: html - :file: tezos-accuser.html diff --git a/docs/ithaca/consensus.rst b/docs/ithaca/consensus.rst deleted file mode 100644 index 695c48f461c25430462999db42c3dbb68652f0dc..0000000000000000000000000000000000000000 --- a/docs/ithaca/consensus.rst +++ /dev/null @@ -1,507 +0,0 @@ -The consensus algorithm -======================= - -This document provides a high-level description of Tenderbake, the Tezos -:doc:`proof-of-stake` consensus algorithm. - -History -------- - -Before Tenderbake, there was -`Emmy* `_, -a Nakamoto-style consensus consisting of a series of improvements of the one in -the `Tezos whitepaper `_. - -Emmy*, like any Nakamoto-style consensus algorithm (such as `Bitcoin -`_ or `Ouroboros -`_), offers *probabilistic* -finality: forks of arbitrary length are possible but they collapse -with a probability that increases rapidly with fork length. - -`Tenderbake `_ instead, like any classic -BFT-style consensus algorithm (such as -`PBFT `_ or -`Tendermint `_), offers *deterministic* -finality: a block that has just been appended to the chain of some node is known -to be final once it has two additional blocks on top of it, regardless of -network latency. - - -Overview --------- - -The starting point for Tenderbake is -`Tendermint `_, the first classic-style algorithm -for blockchains. - -Tenderbake adapts Tendermint to the Tezos blockchain, but the adjustments -required are -`substantive `_: - -* Tenderbake is tailored to match the Tezos architecture by using only - communication primitives and network assumptions which Tezos supports. -* Tenderbake makes weaker network assumptions than Tendermint, at the price of - adding the extra assumption that participants have loosely synchronized clocks - — which is fine, because Tezos already uses them. - -The design of Tenderbake and its rationale are described at -length in the `technical report `_ and in a -`Nomadic Labs's blog -post `_. Here we -only provide a user/developer perspective. - -.. _tb_validator: -.. _tb_validator_ithaca: - -Tenderbake is executed for each new block level by a "committee" whose members -are called *validators*, which are delegates selected at random based on their -stake, in the same way as endorsers are selected in Emmy*. We let -``CONSENSUS_COMMITTEE_SIZE`` be the number of validator :ref:`slots` per level. -Furthermore, we use ``CONSENSUS_THRESHOLD`` to denote two thirds of ``CONSENSUS_COMMITTEE_SIZE``. - -For each level, Tenderbake proceeds in rounds. Each *round* represents an -attempt by the validators to agree on the content of the block for the current -level, that is, on the sequence of non-consensus operations the block contains. -We call this sequence the block's *payload*. - -Each round has an associated duration. Round durations are set to increase so -that for any possible message delay, there is a round that is sufficiently long -for all required messages to be exchanged. -Round durations depend on protocol parameters ``MINIMAL_BLOCK_DELAY`` and ``DELAY_INCREMENT_PER_ROUND``. -These parameters specify round durations as follows: - -.. math:: - - round\_duration(0) &= minimal\_block\_delay \\ - round\_duration(r+1) &= round\_duration(r) + delay\_increment\_per\_round \\ - & = minimal\_block\_delay + (r + 1) * delay\_increment\_per\_round - -Round durations thus increase linearly with ``DELAY_INCREMENT_PER_ROUND``. - -Schematically, a round consists in the following steps: - -.. _candidate_block: -.. _candidate_block_ithaca: - - -* a validator designated for that round injects a *candidate block* (representing a proposal) and consensus operations (representing votes) into the node to which it is attached, which then -* diffuses those blocks and consensus operations to other nodes of the network, and thus -* communicates them to the validators attached to those nodes, to carry out voting on which block to accept. - -.. _quorum: -.. _quorum_ithaca: - -Unlike Emmy*, Tenderbake has `two types of -votes `_: -before endorsing a block ``b``, a validator preendorses ``b``. Furthermore, -to be able to endorse, a validator must have observed a preendorsement *quorum*, that is a -set of preendorsements from validators having at least ``CONSENSUS_THRESHOLD`` validator slots. Similarly, to be able to decide, a validator must have observed an endorsement quorum, that is, a set of endorsements from validators having at least ``CONSENSUS_THRESHOLD`` validator slots. The -endorsement quorum for a block ``b`` is included in a block ``b'`` on top of ``b``, -serving as a certification that ``b`` has been agreed upon. -We also say that block ``b'`` confirms block ``b``. - -The validator's whose turn is to inject a candidate block at a given round is -called the *proposer* at that round. Proposers in Tenderbake are selected -similarly to bakers in Emmy*: the proposer at round ``r`` is the -validator who has the validator slot ``r``. A proposer who has observed a -preendorsement quorum for a candidate block in a previous round, is required to propose a block with -the same *payload* as -the initial block. We talk about a *re-proposal* in this case. - - -.. _finality: -.. _finality_ithaca: - -Transaction and block finality -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -A transaction is final as soon as the block including it has a confirmation (that is, a block on top of it). -Indeed, as hinted above, a block contains the certification (that is, the endorsement quorum) for the previous -payload. Thanks to the endorsement quorum, Tenderbake guarantees **transaction finality -after 1 confirmation**. - -It may be possible that different validators decide at different rounds, though on the same payload. The blocks at these different rounds differ precisely because they contain, in the header, as part of the block fitness, -the round at which they were proposed. -Among these "candidate" blocks, the block with the smallest round has the highest fitness and so it will be the one decided. -Consequently, to agree on a block, that is, on both the payload and the header, Tenderbake needs one more -confirmation, and thus guarantees -**block finality after 2 confirmations**. - -Time between blocks -~~~~~~~~~~~~~~~~~~~~~~~ - -The time between blocks represents the difference between the timestamps of the blocks. The timestamp of a block is given by the beginning of the round at which the block has been agreed upon. Thus, the time between blocks depends on the round at which decisions are taken. For -example, if the decision at the previous level was taken at round 4 and at the current level at round 2, then the current block's delay relative to -its predecessor, is :math:`round\_duration(4) + round\_duration(0) + round\_duration(1)`. -The general case is as follows, say that the decision at the previous -level is taken at round ``m`` and the decision at the current level is -taken at round ``n``, then the current block's delay relative to its -predecessor is :math:`round\_duration(m) + \sum_{i=0}^{n-1} round\_duration(i)`. -We note that, under -normal network conditions, and with active and compliant validators, decisions -should be taken at round 0, meaning that the time between blocks would be -:math:`round\_duration(0)` seconds i.e., parameter ``MINIMAL_BLOCK_DELAY``. - -.. _active_stake: - -Validator selection: staking balance, active stake, and frozen deposits -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Validator selection is based on the stake, as in Emmy*, with the exception that -it is based on the delegate's *active stake* instead of its *staking -balance*. Let us first (re)define these and related concepts. - -- The *(maximal) staking balance* of a delegate is its full balance (i.e. all the tokens owned by the delegate) plus the - balances of all accounts that have delegated to it. - It must be at least ``TOKENS_PER_ROLL`` tez, otherwise the delegate cannot be selected as a validator. -- The *active stake* of a delegate is the amount of tez with which - it participates in consensus. It is at most its - staking balance. We explain below how it is computed. -- The *frozen deposit* represents a percentage ``FROZEN_DEPOSIT_PERCENTAGE`` - of the maximum active stake during the last ``PRESERVED_CYCLES + MAX_SLASHING_PERIOD``. This amount - represents the delegate's skin in the game: in the case that the - delegate behaves badly, its frozen deposit is partly slashed (see - :ref:`slashing_ithaca`). Taking the maximum over an - interval of cycles (instead of just considering the active stake at - the cycle where the bad action can occur) allows to avoid situations - where a malicious delegate empties its accounts between the time when - rights are attributed and the time when the deposit is frozen. The frozen deposits are updated at the end of each cycle. -- The *spendable balance* of a delegate is its full balance - minus the frozen deposits. - -We state next the RPCs which allow to retrieve these types of balances, and also some invariants about them -(Note that these are just invariants, not definitions; for -instance, the frozen deposits are computed in terms of the full balance, -not the other way around.): - -- ``delegated balance`` represents the total amount of tokens delegated by others to a - given delegate; it excludes the delegate's full balance; it is obtained - with ``../context/delegates//delegated_balance`` -- ``staking balance = full balance + delegated balance``; it is obtained with - ``../context/delegates//staking_balance`` -- ``full balance = spendable balance + frozen deposit``; it is obtained with - ``../context/delegates//full_balance`` -- ``frozen deposit`` is obtained with ``../context/delegates//frozen_deposits`` -- ``spendable balance`` is obtained with ``../context/contracts//balance`` - -Delegates can set an upper limit to their frozen deposits with the -command ``tezos-client set deposits limit for to -``, and unset this limit with the command ``tezos-client -unset deposits limit for ``. These commands are implemented -using a new manager operation ``Set_deposits_limit``. When emitting such a -command in cycle ``c``, it affects the active stake for cycles starting -with ``c + PRESERVED_CYCLES + 1``; the new active stake is -taken into account when computing the frozen deposit for cycle ``c+1`` -already, however the user may see an update to its frozen deposit at -cycle ``c + PRESERVED_CYCLES + MAX_SLASHING_PERIOD`` at the -latest (because up to that cycle the frozen deposit also depends on the -active stake at cycles before cycle ``c+1``). - -The active stake is computed ``PRESERVED_CYCLES`` in advance: at -the end of cycle ``c`` for cycle ``c + 1 + PRESERVED_CYCLES`` (as in Emmy*), -before updating the delegates' :ref:`activity status`. - -.. - This entails that a delegate which was participating until cycle ``c - - 1`` and is no longer participating in cycle ``c`, - will lose its rights from cycle - ``c + 2 * PRESERVED_CYCLES + 2`` onwards -- at the end of cycle ``c + - PRESERVED_CYCLES``, the rights for cycle ``c + 2 * - PRESERVED_CYCLES + 1`` are computed, and only then is the delegate - declared passive. Here "participation" means *having baked a final - block* or *having a preendorsement or endorsement included in a final - block*. - -Intuitively, the active stake is set to 10 times the delegate's chosen frozen -deposit limit, without going beyond its available staking balance, -nor its maximum staking capacity (determined by its full balance). -More precisely, the active stake is the minimum between: - -- the delegate's staking balance, and -- 10 times the delegate's *deposit cap*, i.e. ``deposit_cap * 100 / deposit_percentage``. If the delegate has not set a frozen deposit limit, ``deposit_cap`` is its full balance. Otherwise ``deposit_cap`` is the minimum between its full balance and the frozen deposit limit set by the delegate. - -Let's take some examples. Say that the full balance of a delegate is ``1000`` tez. -Then its theoretical maximum staking balance is -``10000`` tez. The following table lists some scenarios (assuming for -simplicity no changes in the delegate's full and staking balances -during the last 8 cycles). - -.. list-table:: - :widths: 20 20 20 20 20 - :header-rows: 1 - - * - Staking balance - - Frozen deposit limit - - Active stake - - Frozen deposit - - Spendable balance - * - 9000 - - -- - - 9000 - - 900 - - 100 - * - 12000 - - -- - - 10000 - - 1000 - - 0 - * - 9000 - - 400 - - 4000 - - 400 - - 600 - * - 12000 - - 400 - - 4000 - - 400 - - 600 - -We note in passing that this new schema basically solves the main -problem of over-delegation: a delegate will not fail anymore to bake -and endorse because of an insufficient balance to pay the -deposit. However, a delegate can still be over-delegated, and it will be -rewarded based on its active stake, not on its staking balance. - -Economic Incentives -~~~~~~~~~~~~~~~~~~~ - -As Emmy*, Tenderbake rewards participation in consensus and punishes bad -behavior. Notable changes however are as follows: - -* Fees and baking rewards go to the payload producer, the one who selected the - transactions to be included in the block (and was the first to propose a - block with that payload). In case of re-proposal, the payload producer might - be different from the block proposer, the baker who injects the block. -* Including extra endorsements, that is, more than the minimal required to - obtain a quorum, is rewarded with a bonus. -* Endorsing rewards are shared equally among all validators. Participation above - a minimal threshold per cycle is however required. -* Deposits are no longer frozen and unfrozen, instead a percentage of the active stake is always locked. -* Validators are rewarded instantaneously for baking blocks and including extra endorsements, and not at the end of the cycle like in Emmy*. -* At the end of a cycle ``c``, the following actions happen: - - - the selection of the consensus committee cycle ``c + PRESERVED_CYCLES``, based on the current active stake distribution, - - the distribution of endorsing rewards, - - the adjustment of frozen deposits. - - -Fees -^^^^ - -The fees associated to the transactions included in a block go to the payload -producer. This is only natural given that this is the validator that selects the -transactions to be included; see `an in-depth blog -post `_ for further motivation. - -The payload producer is usually the same delegate as the block -proposer (that is, the one that signs and injects the block): that's -always true for blocks at round 0; however, in case of re-proposals -this is not necessarily the case (see the algorithm description above). - -Fees are given to the payload producer immediately, that is, they are -already reflected in the blockchain state obtained after applying the injected -block. - -Rewards -^^^^^^^ - -There are three kinds of rewards: baking rewards, endorsing rewards, and a bonus for including extra endorsements. - -The baking rewards are treated in the same way as fees: they go to the *payload* -producer and are distributed immediately. - -To encourage fairness and participation, the *block* proposer receives -a bonus for the extra endorsements it includes in the block. -The bonus is proportional to the number of -validator slots above the threshold of ``CONSENSUS_COMMITTEE_SIZE * 2 / 3`` that -the included endorsements represent. The bonus is also distributed -immediately. - -The endorsing rewards are distributed at the end of the cycle. -The endorsing reward may be received even if not all of the validator's endorsements are included in a block and is proportional to the validator's active stake (in other words, to its *expected* number of validator slots, and not its actual number of slots). -However, two conditions must be met: - - - the validator has revealed its nonce, and - - the validator has been present during the cycle. - -Not giving rewards in case of missing revelations is not new as it is :ref:`adapted` -from Emmy*. -The second condition is new. We say that a delegate is *present* during a cycle -if the endorsing power (that is, the number of validator slots at the -corresponding level) of all the endorsements included by the delegate during the -cycle represents at least ``MINIMAL_PARTICIPATION_RATIO`` of the delegate's expected number of -validator slots for the current cycle (which is ``BLOCKS_PER_CYCLE * -CONSENSUS_COMMITTEE_SIZE * active_stake / total_active_stake``). - -Regarding the concrete values for rewards, we first fix the total reward per -level, call it ``total_rewards``, to ``80 / blocks_per_minute`` tez. -Assuming ``blocks_per_minute = 2``, ``total_rewards`` is 40 tez. -We define: - -- ``BAKING_REWARD_FIXED_PORTION := baking_reward_ratio * total_rewards`` -- ``bonus := (1 - baking_reward_ratio) * bonus_ratio * total_rewards`` is the max bonus -- ``endorsing_reward := (1 - baking_reward_ratio) * (1 - bonus_ratio) * total_rewards`` - -where: - -- ``baking_reward_ratio`` to ``1 / 4``, -- ``bonus_ratio`` to ``1 / 3``. - -Thus, we obtain ``BAKING_REWARD_FIXED_PORTION = 10`` tez, -(maximum) ``bonus = 10`` tez, and ``endorsing_rewards = 20`` tez. -The bonus per additional endorsement slot is in turn ``bonus / -(CONSENSUS_COMMITTEE_SIZE / 3)`` (because there are at most -``CONSENSUS_COMMITTEE_SIZE / 3`` validator slots corresponding to the -additional endorsements included in a block). The rewards per -endorsement slot are ``endorsing_rewards / CONSENSUS_COMMITTEE_SIZE``. -Assuming ``CONSENSUS_COMMITTEE_SIZE = 7000``, we obtain a bonus per slot of -``10 / (7000 / 3) = 0.004286`` tez and an endorsing -rewards per slot of ``20 / 7000 = 0.002857`` tez. - -Let's take an example. Say a block has round 1, is proposed by -delegate B, and contains the payload from round 0 produced by delegate -A. Also, B includes endorsements with endorsing power ``5251``. Then A receives -the fees and 10 tez (the ``BAKING_REWARD_FIXED_PORTION``) as a reward for -producing the block's payload. Concerning the bonus, given that -``CONSENSUS_COMMITTEE_SIZE = 7000``, the minimum required validator slots is ``4667``, and there are ``2333 = 7000 - 4667`` additional validator slots. -Therefore B receives the bonus ``(5251 - 4667) * 0.004286 = 2.503`` tez. (Note -that B only included endorsements corresponding to 584 = 5251 - 4667 additional validator slots, about a quarter of the -maximum 2333 extra endorsements it could have theoretically included.) Finally, consider some -delegate C, whose active stake at some cycle is 5% of the total stake. Note that -his expected number of validator slots for that cycle is ``5/100 * 8192 * 7000 = -2,867,200`` slots. Assume also that the endorsing power of C's endorsements -included during that cycle has been ``3,123,456`` slots. Given that this number is -bigger than the minimum required (``2,867,200 * 2 / 3``), it receives an endorsing -reward of ``2,867,200 * 0.002857 = 8191.59`` tez for that cycle. - -.. _slashing: -.. _slashing_ithaca: - -Slashing -^^^^^^^^ - -Like in Emmy*, not revealing nonces and double signing are punishable. If a -validator does not reveal its nonce by the end of the cycle, it does not receive -its endorsing rewards. If a validator double signs, that is, it double bakes -(which means signing different blocks at the same level and same round) or -it double (pre)endorses (which means voting on two different proposals at the -same level and round), the frozen deposit is slashed. The slashed amount for double baking -is ``DOUBLE_BAKING_PUNISHMENT``. The slashed amount for double (pre)endorsing is -a fixed percentage ``RATIO_OF_FROZEN_DEPOSITS_SLASHED_PER_DOUBLE_ENDORSEMENT`` -of the frozen deposit. The payload producer that includes the misbehavior -evidence is rewarded half of the slashed amount. - -The evidence for double signing at a given level can be collected by any -:ref:`accuser` and included as an *accusation* operation in a block -for a period of ``MAX_SLASHING_PERIOD``. - -We note that selfish baking is not an issue in Tenderbake: say we are at round -``r`` and the validator which is proposer at round ``r+1`` does not (pre)endorse -at round ``r`` in the hope that the block at round ``r`` is not agreed upon and -its turn comes to propose at round ``r+1``. Under the assumption that the -correct validators have more than two thirds of the total stake, these correct -validators have sufficient power for agreement to be reached, thus the lack of -participation of a selfish baker does not have an impact. - -.. _cs_constants: -.. _cs_constants_ithaca: - -Consensus related protocol parameters -------------------------------------- - -.. list-table:: - :widths: 55 25 - :header-rows: 1 - - * - Parameter name - - Parameter value - * - ``CONSENSUS_COMMITTEE_SIZE`` - - 7000 - * - ``CONSENSUS_THRESHOLD`` - - ``ceil(2 * CONSENSUS_COMMITTEE_SIZE / 3)`` = 4667 - * - ``MINIMAL_BLOCK_DELAY`` - - 30s - * - ``DELAY_INCREMENT_PER_ROUND`` - - 15s - * - ``MINIMAL_PARTICIPATION_RATIO`` - - 2/3 - * - ``FROZEN_DEPOSITS_PERCENTAGE`` - - 10 - * - ``MAX_SLASHING_PERIOD`` - - 2 cycles - * - ``DOUBLE_BAKING_PUNISHMENT`` - - 640 tez - * - ``RATIO_OF_FROZEN_DEPOSITS_SLASHED_PER_DOUBLE_ENDORSEMENT`` - - 1/2 - * - ``BAKING_REWARD_FIXED_PORTION`` - - 10 tez - * - ``BAKING_REWARD_BONUS_PER_SLOT`` - - ``bonus / (CONSENSUS_COMMITTEE_SIZE / 3)`` = 0.004286 tez - * - ``ENDORSING_REWARD_PER_SLOT`` - - ``endorsing_reward / CONSENSUS_COMMITTEE_SIZE`` = 0.002857 tez - - -.. _shell_proto_revisit: -.. _shell_proto_revisit_ithaca: - -Shell-protocol interaction revisited ------------------------------------- - -:ref:`Recall` that, for the shell to interact with the economic protocol, two notions are defined abstractly at the level of the shell and made concrete at the level of the consensus protocol. -Namely, these two notions are the protocol-specific header and the fitness. -As in Emmy*, the protocol-specific header contains the fields: - -- ``signature``: a digital signature of the shell and protocol headers (excluding the signature itself) -- ``seed_nonce_hash``: a commitment to :ref:`a random number`, used to generate entropy on the chain -- ``proof_of_work_nonce``: a nonce used to pass a low-difficulty proof-of-work for the block, as a spam prevention measure -- ``liquidity_baking_escape_vote``: :ref:`a flag` that requests ending the subsidy. - -There are two additional fields: ``payload_hash`` and ``payload_round`` which are needed for establishing if a block is :ref:`final`. - -.. _fitness: -.. _fitness_ithaca: - -The fitness is given by the tuple ``(version, level, locked_round, - predecessor_round - 1, round)``. -The current version of the fitness is 2 (version 0 was used by Emmy, and version 1 by Emmy+ and Emmy*). -The fitness encapsulates more information than in Emmy* because Tenderbake is more complex: recall that blocks at the last level only represent :ref:`candidate blocks`. -In Emmy*, only the level mattered. -But in Tenderbake, we need to, for instance, allow for new blocks at the same level to be accepted by nodes. -Therefore the fitness also includes the block's round (as the fifth component). -Furthermore, we also allow to change the predecessor block when it has a :ref:`smaller round`. -Therefore the fitness also includes the opposite of predecessor block's round as the forth component (the predecessor is taken for technical reasons). -Finally, to (partially) enforce :ref:`the rule on -re-proposals`, the fitness also includes, as the third -component, the round at which a preendorsement quorum was observed by -the baker, if any (this component can therefore be empty). By the way, -preendorsements are present in a block if and only if the locked round -component is non-empty and if so, the locked round has to match the -round of the included preendorsements. - -Next, we provide two examples of fitness values: -``02::00001000::::ffffffff::00000000`` and -``02::00001000::00000000::fffffffe::00000001`` (in the hexadecimal -format that one may observe in the node's logs). These two values have -the following components: - -- the 1st component, ``02``, is the fitness version; -- the 2nd component, ``00001000``, is the block's level (level 4096); -- the 3rd component is the block's locked round: empty in the first case, 0 in the second; -- the 4th component is the round of the predecessor block, here 0 in the first case and 1 in the second case; -- the 5th component is the block's round: 0 in the first case, 1 in the second case. - -We recall (see :ref:`shell_header`) that the fitness is, from the -shell's perspective, a sequence of sequences of unsigned bytes and -comparison is done first by the length of the sequence and then -lexicographically (both for the outer sequence, and for each of the -inner sequences). So the first fitness is smaller than the second one, -because of the third component, the empty bitstring being smaller than -any other bitstring. - - - -Further External Resources --------------------------- - -* Tenderbake `report `_ -* Tenderbake `blog post `_. -* Tenderbake `tzip `_. diff --git a/docs/ithaca/global_constants.rst b/docs/ithaca/global_constants.rst deleted file mode 100644 index 9b8286f906b59bdf722aee25834e6c6a0bbeb968..0000000000000000000000000000000000000000 --- a/docs/ithaca/global_constants.rst +++ /dev/null @@ -1,141 +0,0 @@ -Global Constants -================ - -The size limit for :doc:`Michelson ` contracts is quite small, limited to 60 -kilobytes as of Granada protocol. Global constants are a feature added -in Hangzhou protocol that enables the re-use of user-defined Micheline chunks in Michelson scripts, allowing -for larger and more complex contracts on the chain. It works in the -following way: - -- Fragments of Michelson code (written in the :doc:`Micheline format <../shell/micheline>`) are - registered on the chain via a new operation - ``register_global_constant``. An example expression might be the - integer ``999`` or the lambda expression ``{ PUSH int 999; ADD }`` -- Included in the receipt of the operation is a hash of the expression - registered. For example the hash ``999`` is - ``expruQN5r2umbZVHy6WynYM8f71F8zS4AERz9bugF8UkPBEqrHLuU8``. -- Constants can be referenced inside a Michelson script with the new - primitive ``constant``. For example, we could write a lambda - equivalent to the one above like so: - ``{ PUSH int (constant "expruQN5r2umbZVHy6WynYM8f71F8zS4AERz9bugF8UkPBEqrHLuU8"); ADD }`` - -Global Constant Registration ----------------------------- - -The new ``register_global_constant`` operation includes an object with a -single key ``"value"``, the value of which is the Micheline expression -to be registered. - -You can submit this operation conveniently through a new :doc:`tezos-client ` command. -For example, the command: - -.. code:: sh - - tezos-client register global constant "999" from bootstrap1 --burn-cap 0.017 - -would result in the output: - -:: - - Node is bootstrapped. - Estimated gas: 1440 units (will add 100 for safety) - Estimated storage: 68 bytes added (will add 20 for safety) - Operation successfully injected in the node. - Operation hash is 'onsFknW5iWa6eiTYqAghY4peQZ7JYQUJg5fR8MwAQkMKjXfNqGf' - NOT waiting for the operation to be included. - Use command - tezos-client wait for onsFknW5iWa6eiTYqAghY4peQZ7JYQUJg5fR8MwAQkMKjXfNqGf to be included --confirmations 5 --branch BLockGenesisGenesisGenesisGenesisGenesisCCCCCeZiLHU - and/or an external block explorer to make sure that it has been included. - This sequence of operations was run: - Manager signed operations: - From: tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx - Fee to the baker: ꜩ0.000385 - Expected counter: 1 - Gas limit: 1540 - Storage limit: 88 bytes - Balance updates: - tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx ................ -ꜩ0.000385 - fees(the baker who will include this operation,0) ... +ꜩ0.000385 - Register Global: - Value: 999 - This global constant registration was successfully applied - Balance updates: - tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx ... -ꜩ0.017 - Consumed gas: 1440 - Storage size: 68 bytes - Global address: expruQN5r2umbZVHy6WynYM8f71F8zS4AERz9bugF8UkPBEqrHLuU8 - -As you can see, the address of the constant is returned in the operation -receipt in the field ``Global address``. This address is the Base58-encode Blake2b -hash of the binary serialization of the registered Micheline expression. -This means constants are content-addressable - given a particular Micheline -expression, you can always calculate its on-chain address and check if it’s registered. - -A few points about registering global constants: - -- Global constants may contain references to other constants; however, - any referenced constants must already be registered on the chain. As a - corollary, you cannot have cyclic references. -- Global constants are not type-checked before registration - any - valid Micheline expression may be registered. That said, attempting - to originate a contract that uses a constant in an ill-typed way will - fail. -- The total depth of the expression registered as a constant (after - expanding all constant references) may not exceed 10,000. -- The total number of nodes in the Micheline expression being - registered (after expanding all constant references) may not exceed - the ``max_micheline_node_count`` protocol constant. As of Hangzhou - this is 50,000. -- The total number of bytes in the Micheline expression being - registered (after expanding all constant references) may not exceed - the ``max_micheline_bytes_limit`` protocol constant. As of Hangzhou - this is 50,000. - -Originating a Contract that uses Global Constants -------------------------------------------------- - -A global constant can be referenced in Michelson scripts via the -primitive ``constant``, which accepts a single string argument, being -the hash of the expression to be referenced at runtime. This primitive -can be used to replace any Micheline node in the bodies of the -``parameter``, ``storage``, ``code``, or ``view`` fields of a Michelson script. For -example, we replace every instance of the type ``lambda unit unit`` and -value 999 with their respective hashes: - -.. code-block:: michelson - - parameter (constant "exprtYirrFwYKm6yKLzJNtYRbq49zedYq16BonRvMzHiwSbUekB9YL"); - storage (big_map int (constant "exprtYirrFwYKm6yKLzJNtYRbq49zedYq16BonRvMzHiwSbUekB9YL")); - code { - PUSH int (constant "expruQN5r2umbZVHy6WynYM8f71F8zS4AERz9bugF8UkPBEqrHLuU8"); - # - }; - -The full expansion of this contract would be: - -.. code-block:: michelson - - parameter (lambda unit unit); - storage (big_map int (lambda unit unit)); - code { - PUSH int 999; - # - }; - -During origination, all constants are expanded recursively. The -operation will fail if the resulting contract is ill-typed. Global -constant expansion consumes gas; thus, the operation may also fail due -to gas exhaustion. - -Global Constants at Runtime ---------------------------- - -Contracts that use global constants are semantically equivalent to the -contract with all constants expanded. - -Note that using the `UNPACK `__ -operation to deserialize a lambda which contains a reference to a global -constant is not supported. Similarly, originating a contract which contains -a reference to a global constant using the -`CREATE_CONTRACT `__ -instruction will also fail. diff --git a/docs/ithaca/glossary.rst b/docs/ithaca/glossary.rst deleted file mode 100644 index 7bef82b17baadaf7a862fab53d8e8845fa353101..0000000000000000000000000000000000000000 --- a/docs/ithaca/glossary.rst +++ /dev/null @@ -1,180 +0,0 @@ -Glossary -======== - -This glossary is divided in two sections, the first one concerns Tezos, and -the second one concerns the `economic protocol`_. The definitions in the latter -section may be different for other protocol versions. - -Tezos ------ - -.. include:: ../shell/glossary.rst.h - -Protocol --------- - -_`Accuser` - When a delegate_ attempts to inject several incompatible blocks (or when it tries - to abuse the network in another similar way), another delegate_ can make an - accusation: show evidence of attempted abuse. The delegate_ making the accusation - is the accuser. - - The accuser is awarded some funds from the security deposit of the accused. - - When using :ref:`Octez `, accusations are handled by the - accuser binary. - -_`Account` - An account is a unique identifier within the protocol. There are different - kinds of accounts (see `originated account`_ and `implicit account`_). - - In the context_, each account is associated with a balance (an amount of - tez available). - -_`Baker` - When a delegate_ creates a new block_, it is the baker of this block_. - Baking_ rights are distributed to different accounts based on their - available balance. Only a delegate_ with baking_ rights - is allowed to bake. - The baker selects transactions from the mempool_ to be included in the block_ it bakes. - - When using :ref:`Octez `, baking_ and other consensus actions are handled by the baker - binary. - -_`Baking`/_`endorsing rights` - A delegate_ is allowed to bake/endorse a block_ if it holds the - baking/endorsing right for that block_. At the start of a cycle_, - baking and endorsing rights are computed for all the block_ levels in the - cycle_, based on the proportion of the stake owned by each account. - - For each block_ level and block round_, there is exactly one account that is allowed to bake. - - When a block_ is created and propagated on the network, delegates that have - `endorsing rights`_ for the matching block_ level can emit an endorsement - operation_. - Endorsement operations_ are included in the next block_. - -_`Burn` - To ensure responsible use of the storage space on the public blockchain, - there are some costs charged to users for consuming storage. These - costs are burnt (i.e., the amount of tez is destroyed). For example, - a per-byte storage cost is burnt for increasing the storage space of a - smart contract; a fixed amount is burnt for allocating a new contract - (which consumes space by storing its address on the blockchain). - - See also `fee`_. - -_`Constants` - Protocols are parameterized by several parameters called protocol constants, which may vary from one protocol to another or from one network to another. - -_`Contract` - See account_. - -_`Cycle` - A cycle is a set of consecutive blocks. E.g., cycle 12 started at block_ - level 49152 and ended at block_ level 53248. - - Cycles are used as a unit of “time” in the block_ chain. For example, the - different phases in the amendment voting procedures are defined based on - cycles. - -_`Delegate` - An `implicit account`_ to which an account_ has delegated their - rights to participate in consensus (aka baking_ rights) and in - governance. - The delegate's rights are calculated based on its own tokens plus the sum of tokens - delegated to it. - -_`Delegation` - An operation_ in which an account_ balance is lent to a - delegate_. This increases the delegate_'s stake and consequently - its baking_ rights. The delegate_ does not control the funds from - the account_. - -_`Double signing` - When a baker_ signs two different blocks at the same level and same round, - it is called double baking. Double baking is detrimental to the network and might be - indicative of an attempt to double spend. - The same goes for signing two different endorsements at the same level and the same round. - As such, double signing is punished by the - network: an accuser_ can provide proof of the double signing to be awarded - part of the double signer's deposit. - -_`Fee` - To ensure responsible use of computation resources of other nodes, and also to encourage active participation in the consensus protocol, there are some - fees that users pay to bakers for including their operations in blocks. - For example, fees are paid to a baker for operations such as a transaction_ or a revelation of a public key. - - See also `burn`_. - -_`Gas` - A measure of the number of elementary operations_ performed during - the execution of a `smart contract`_. Gas is used to measure how - much computing power is used to execute a `smart contract`_. - -_`Implicit account` - An account_ that is linked to a public key. Contrary to a `smart - contract`_, an `Implicit account`_ cannot include a script and it - cannot reject incoming transactions. - - If registered, an `implicit account`_ can act as a delegate_. - - The address of an `implicit account`_ always starts with the - letters `tz` followed by `1`, `2` or `3` (depending on the - signature scheme) and finally the hash of the public key. - -.. _glossary_michelson: -.. _glossary_michelson_ithaca: - -Michelson - The built-in language used by a `smart contract`_. - -_`Operations` - The main operations in the protocol are transactions (to transfer funds - or to execute smart contracts), accusations, activations, delegations, - endorsements and originations. - -_`Originated account` - See `smart contract`_. - -_`Origination` - An operation_ to create a `smart contract`_. - -_`Round` - An attempt to reach consensus on a block at a given level. - A round is represented by an index, starting with 0. - Each round corresponds to a time span. - A baker_ with baking_ rights at a given round is only allowed to bake during - the round's corresponding time span. Baking_ outside of one's designated - round results in an invalid block_. - -.. _glossary_roll: - -_`Roll` - An amount of tez (e.g., 6000ꜩ) serving as a minimal amount for a - delegate to have baking_ and voting rights in a cycle_. A roll - also serves as a unit to determine delegates' voting rights in a - cycle_. However, rolls are not used as a unit for baking_ rights, - these are based on the actual, non-approximated stake. - -_`Smart contract` - Account_ which is associated to a :ref:`Michelson ` script. They are - created with an explicit origination_ operation and are therefore - sometimes called originated accounts. The address of a smart - contract always starts with the letters ``KT1``. - -_`Transaction` - An operation_ to transfer tez between two accounts, or to run the code of a - `smart contract`_. - -_`Voting period` - Any of the ``proposal``, ``exploration``, ``cooldown``, - ``promotion`` or ``adoption`` stages in the voting procedure when - amending the `economic protocol`_. - -_`Voting listings` - The list calculated at the beginning of each `voting period`_ that contains - the staking balance of each delegate_ that owns more - than one roll_ at that moment. For each delegate_, the voting listings - reflects the weight of the vote emitted by the delegate_ when amending the - `economic protocol`_. diff --git a/docs/ithaca/liquidity_baking.rst b/docs/ithaca/liquidity_baking.rst deleted file mode 100644 index d5b693a3e9bee82c21406e60635c78f04929edf1..0000000000000000000000000000000000000000 --- a/docs/ithaca/liquidity_baking.rst +++ /dev/null @@ -1,52 +0,0 @@ -Liquidity Baking -================ - -Liquidity baking incentivizes large amounts of decentralized liquidity provision between tez and tzBTC by minting a small amount of tez every block and depositing it inside of a constant product market making smart-contract. It includes an escape hatch mechanism as a contingency. - -Contracts -~~~~~~~~~ - -During activation of Granada protocol, a constant product market making (CPMM) Michelson contract has been deployed on the chain with address ``KT1TxqZ8QtKvLu3V3JH7Gx58n7Co8pgtpQU5`` as well as an associated liquidity token contract (LQT) with address ``KT1AafHA1C1vk959wvHWBispY9Y2f3fxBUUo``. - -.. warning:: - - while the CPMM and LQT contract originations provide an ``Origination_result``, the LQT contract contains two big maps not included in a `lazy_storage_diff` field. Indexers and other tooling may need manual updates to include these. - -The CPMM maintains a balance of ``a`` tez and ``b`` `tzBTC `_, where tzBTC is the `FA1.2 token `_ found at address ``KT1PWx2mnDueood7fEmfbBDKx1D9BAnnXitn``. The smart contract accepts deposits of ``da`` tez and returns ``db`` tzBTC (or vice versa) where the invariant ``(a + da * (1 - f - n)) * (b - db) = a b`` is preserved, and ``f`` and ``n`` are a fee and burn, set at 0.1% each. Calculations are done with precision of 1000, rounding down on division. - -To implement this contract, we use a fork of the open source code base used by `version two `_ of the "Dexter" project. The implementation of this contract has been `formally verified `_ against its functional specification. The contract code is modified in the following way: - -1. The fee is set to 0.1% only (the fee in Dexter v2 is set to 0.3%). Rationale: given the subsidy it is not necessary to charge a large fee and better to improve liquidity. -2. An additional 0.1% of every trade is burned by being transferred to the null implicit account. Rationale: this mechanism offsets inflation from the subsidy. The inflation is exactly balanced at a daily trade volume of 7.2 million tez. -3. The ability to set a delegate has been removed. Rationale: the subsidy means there is no need for a baker for that contract and having one would create an imbalance. -4. The ability to set a manager has been removed. Rationale: the only privilege of the Dexter manager is to set Dexter's delegate so this role is now unnecessary. - -The LIGO and Michelson code for these contracts, as well as detailed documentation, can be found on `the liquidity baking branch of the Dexter 2 repository `_. - -Subsidy -~~~~~~~ - -At every block in the chain, a small amount of tez is minted and credited to the CPMM contract, and the CPMM's ``%default`` entrypoint is called to update the ``xtz_pool`` balance in its storage. The amount that is minted and sent to the CPMM contract is 1/16th of the maximal rewards for a block; currently these rewards are 40 tez per block so the amount that is sent to the CPMM contract is 2.5 tez per block. - -So the credits to the CPMM contract can be accounted for by indexers, they are included in block metadata as a balance update with a new constructor for ``update_origin``, ``Subsidy``. - -As a safety precaution, the subsidy expires automatically at a given -level called the liquidity baking sunset level. The sunset level can -be renewed periodically by protocol amendment. - -.. _esc_hatch: -.. _esc_hatch_ithaca: - -Escape hatch -~~~~~~~~~~~~ - -In addition to the sunset mechanism, an escape hatch is included. At every block, the baker producing the block can choose to include a flag that requests ending the subsidy. The context maintains an exponential moving average of that flag calculated as such with integer arithmetic: - -``e[0] = 0`` -``e[n+1] = (1999 * e[n] // 2000) + (1000 if flag[n] else 0)`` - -If at any block ``e[n] >= 666667`` then it means that an exponential moving average with a window size on the order of two thousand blocks has had roughly at least a third of blocks demanding the end of the subsidy. If that is the case, the subsidy is permanently halted (though it can be reactivated by a protocol upgrade). - -For indicative purposes, if a fraction ``f`` of blocks start signalling the flag, the threshold is reached after roughly ``2*(log(1-1/(3f)) / log(0.999))`` blocks, about 812 blocks if everyone signals, 1079 blocks if 80% do, 1624 blocks if 60% do, 3590 blocks if 40% do, etc. Recall for comparison that assuming two blocks per minute there are 2880 blocks per day. - -The escape hatch can be invoked through a JSON file containing a vote that is repeatedly submitted on each baked block, e.g. ``tezos-baker run with local node ~/.tezos-node alice --votefile "per_block_votes.json"`` where ``per_block_votes.json`` contains just ``{"liquidity_baking_escape_vote": true}``. See also the :ref:`baker man page`. diff --git a/docs/ithaca/michelson.rst b/docs/ithaca/michelson.rst deleted file mode 100644 index c7e17a513cb049da678b6b5cc822094bdfe93a81..0000000000000000000000000000000000000000 --- a/docs/ithaca/michelson.rst +++ /dev/null @@ -1,3833 +0,0 @@ -Michelson: the language of Smart Contracts in Tezos -=================================================== - -This specification gives a detailed formal semantics of the Michelson -language and a short explanation of how smart contracts are executed -and interact in the blockchain. - -The language is stack-based, with high level data types and primitives, -and strict static type checking. Its design cherry picks traits from -several language families. Vigilant readers will notice direct -references to Forth, Scheme, ML and Cat. - -A Michelson program is a series of instructions that are run in -sequence: each instruction receives as input the stack resulting from the -previous instruction, and rewrites it for the next one. The stack -contains both immediate values and heap allocated structures. All values -are immutable and garbage collected. - -The types of the input and output stack are fixed and monomorphic, -and the program is typechecked before being introduced into the system. -No smart contract execution can fail because an instruction has been -executed on a stack of unexpected length or contents. - -This specification gives the complete instruction set, type system and -semantics of the language. It is meant as a precise reference manual, -not an easy introduction. Even though, some examples are provided at -the end of the document and can be read first or at the same time as -the specification. The document also starts with a less formal -explanation of the context: how Michelson code interacts with the -blockchain. - -Semantics of smart contracts and transactions ---------------------------------------------- - -The Tezos ledger currently has two types of accounts that can hold -tokens (and be the destinations of transactions). - - - An implicit account is a non programmable account, whose tokens - are spendable and delegatable by a public key. Its address is - directly the public key hash, and starts with ``tz1``, ``tz2`` or - ``tz3``. - - A smart contract is a programmable account. A transaction to such - an address can provide data, and can fail for reasons decided by - its Michelson code. Its address is a unique hash that depends on - the operation that led to its creation, and starts with ``KT1``. - -From Michelson, they are indistinguishable. A safe way to think about -this is to consider that implicit accounts are smart contracts that -always succeed to receive tokens, and does nothing else. - -Intra-transaction semantics -~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Alongside their tokens, smart contracts keep a piece of storage. Both -are ruled by a specific logic specified by a Michelson program. A -transaction to a smart contract will provide an input value and in -option some tokens, and in return, the smart contract can modify its -storage and transfer its tokens. - -The Michelson program receives as input a stack containing a single -pair whose first element is an input value and second element the -content of the storage space. It must return a stack containing a -single pair whose first element is the list of internal operations -that it wants to emit, and second element is the new contents of the -storage space. Alternatively, a Michelson program can fail, explicitly -using a specific opcode, or because something went wrong that could -not be caught by the type system (e.g. gas exhaustion). - -A bit of polymorphism can be used at contract level, with a -lightweight system of named entrypoints: instead of an input value, -the contract can be called with an entrypoint name and an argument, -and these two components are transformed automatically in a simple and -deterministic way to an input value. This feature is available both -for users and from Michelson code. See the dedicated section. - -Inter-transaction semantics -~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -An operation included in the blockchain is a sequence of "external -operations" signed as a whole by a source address. These operations -are of three kinds: - - - Transactions to transfer tokens to implicit accounts or tokens and - parameters to a smart contract (or, optionally, to a specified - entrypoint of a smart contract). - - Originations to create new smart contracts from its Michelson - source code, an initial amount of tokens transferred from the - source, and an initial storage contents. - - Delegations to assign the tokens of the source to the stake of - another implicit account (without transferring any tokens). - -Smart contracts can also emit "internal operations". These are run -in sequence after the external transaction completes, as in the -following schema for a sequence of two external operations. - -:: - - +------+----------------+-------+----------------+ - | op 1 | internal ops 1 | op 2 | internal ops 2 | - +------+----------------+-------+----------------+ - -Smart contracts called by internal transactions can in turn also emit -internal operation. The interpretation of the internal operations -of a given external operation uses a stack, as in the following -example, also with two external operations. - -:: - - +-----------+---------------+--------------------------+ - | executing | emissions | resulting stack | - +-----------+---------------+--------------------------+ - | op 1 | 1a, 1b, 1c | 1a, 1b, 1c | - | op 1a | 1ai, 1aj | 1ai, 1aj, 1b, 1c | - | op 1ai | | 1aj, 1b, 1c | - | op 1aj | | 1b, 1c | - | op 1b | 1bi | 1bi, 1c | - | op 1bi | | 1c | - | op 1c | | | - | op 2 | 2a, 2b | 2a, 2b | - | op 2a | 2ai | 2ai, 2b | - | op 2ai | 2ai1 | 2ai1, 2b | - | op 2ai1 | | 2b | - | op 2b | 2bi | 2bi | - | op 2bi | 2bi1 | 2bi1 | - | op 2bi1 | 2bi2 | 2bi2 | - | op 2bi2 | | | - +-----------+---------------+--------------------------+ - -Failures -~~~~~~~~ - -All transactions can fail for a few reasons, mostly: - - - Not enough tokens in the source to spend the specified amount. - - The script took too many execution steps. - - The script failed programmatically using the ``FAILWITH`` instruction. - -External transactions can also fail for these additional reasons: - - - The signature of the external operations was wrong. - - The code or initial storage in an origination did not typecheck. - - The parameter in a transfer did not typecheck. - - The destination did not exist. - - The specified entrypoint did not exist. - -All these errors cannot happen in internal transactions, as the type -system catches them at operation creation time. In particular, -Michelson has two types to talk about other accounts: ``address`` and -``contract t``. The ``address`` type merely gives the guarantee that -the value has the form of a Tezos address. The ``contract t`` type, on -the other hand, guarantees that the value is indeed a valid, existing -account whose parameter type is ``t``. To make a transaction from -Michelson, a value of type ``contract t`` must be provided, and the -type system checks that the argument to the transaction is indeed of -type ``t``. Hence, all transactions made from Michelson are well -formed by construction. - -In any case, when a failure happens, either total success or total -failure is guaranteed. If a transaction (internal or external) fails, -then the whole sequence fails and all the effects up to the failure -are reverted. These transactions can still be included in blocks, and -the transaction fees are given to the implicit account who baked the -block. - -Language semantics ------------------- - -This specification explains in a symbolic way the computation performed by the -Michelson interpreter on a given program and initial stack to produce -the corresponding resulting stack. The Michelson interpreter is a pure -function: it only builds a result stack from the elements of an initial -one, without affecting its environment. This semantics is then naturally -given in what is called a big step form: a symbolic definition of a -recursive reference interpreter. This definition takes the form of a -list of rules that cover all the possible inputs of the interpreter -(program and stack), and describe the computation of the corresponding -resulting stacks. - -Rules form and selection -~~~~~~~~~~~~~~~~~~~~~~~~ - -The rules have the main following form. - -:: - - > (syntax pattern) / (initial stack pattern) => (result stack pattern) - iff (conditions) - where (recursions) - and (more recursions) - -The left hand side of the ``=>`` sign is used for selecting the rule. -Given a program and an initial stack, one (and only one) rule can be -selected using the following process. First, the toplevel structure of -the program must match the syntax pattern. This is quite simple since -there are only a few non-trivial patterns to deal with instruction -sequences, and the rest is made of trivial patterns that match one -specific instruction. Then, the initial stack must match the initial -stack pattern. Finally, some rules add extra conditions over the values -in the stack that follow the ``iff`` keyword. Sometimes, several rules -may apply in a given context. In this case, the one that appears first -in this specification is to be selected. If no rule applies, the result -is equivalent to the one for the explicit ``FAILWITH`` instruction. This -case does not happen on well-typed programs, as explained in the next -section. - -The right hand side describes the result of the interpreter if the rule -applies. It consists in a stack pattern, whose parts are either -constants, or elements of the context (program and initial stack) that -have been named on the left hand side of the ``=>`` sign. - -Recursive rules (big step form) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Sometimes, the result of interpreting a program is derived from the -result of interpreting another one (as in conditionals or function -calls). In these cases, the rule contains a clause of the following -form. - -:: - - where (intermediate program) / (intermediate stack) => (partial result) - -This means that this rule applies in case interpreting the intermediate -state on the left gives the pattern on the right. - -The left hand sign of the ``=>`` sign is constructed from elements of -the initial state or other partial results, and the right hand side -identify parts that can be used to build the result stack of the rule. - -If the partial result pattern does not actually match the result of the -interpretation, then the result of the whole rule is equivalent to the -one for the explicit ``FAILWITH`` instruction. Again, this case does not -happen on well-typed programs, as explained in the next section. - -Format of patterns -~~~~~~~~~~~~~~~~~~ - -Code patterns are of one of the following syntactical forms. - -- ``INSTR`` (an uppercase identifier) is a simple instruction (e.g. - ``DROP``). -- ``INSTR (arg) ...`` is a compound instruction, whose arguments can be - code, data or type patterns (e.g. ``PUSH nat 3``). -- ``{ (instr) ; ... }`` is a possibly empty sequence of instructions, - (e.g. ``IF { SWAP ; DROP } { DROP }``), nested sequences can drop the - braces. -- ``name`` is a pattern that matches any program and names a part of - the matched program that can be used to build the result. -- ``_`` is a pattern that matches any instruction. - -Stack patterns are of one of the following syntactical forms. - -- ``[FAILED]`` is the special failed state. -- ``[]`` is the empty stack. -- ``(top) : (rest)`` is a stack whose top element is matched by the - data pattern ``(top)`` on the left, and whose remaining elements are - matched by the stack pattern ``(rest)`` on the right (e.g. - ``x : y : rest``). -- ``name`` is a pattern that matches any stack and names it in order to - use it to build the result. -- ``_`` is a pattern that matches any stack. - -Data patterns are of one of the following syntactical forms. - -- integer/natural number literals, (e.g. ``3``). -- string literals, (e.g. ``"contents"``). -- raw byte sequence literals (e.g. ``0xABCDEF42``). -- ``Tag`` (capitalized) is a symbolic constant, (e.g. ``Unit``, - ``True``, ``False``). -- ``(Tag (arg) ...)`` tagged constructed data, (e.g. ``(Pair 3 4)``). -- a code pattern for first class code values. -- ``name`` to name a value in order to use it to build the result. -- ``_`` to match any value. - -The domain of instruction names, symbolic constants and data -constructors is fixed by this specification. Michelson does not let the -programmer introduce its own types. - -Be aware that the syntax used in the specification may differ from -the :ref:`concrete syntax `. In particular -some instructions are annotated with types that are not present in the -concrete language because they are synthesized by the typechecker. - -Shortcuts -~~~~~~~~~ - -Sometimes, it is easier to think (and shorter to write) in terms of -program rewriting than in terms of big step semantics. When it is the -case, and when both are equivalents, we write rules of the form: - -:: - - p / S => S'' - where p' / S' => S'' - -using the following shortcut: - -:: - - p / S => p' / S' - -The concrete language also has some syntax sugar to group some common -sequences of operations as one. This is described in this specification -using a simple regular expression style recursive instruction rewriting. - -.. _michelson_type_system: -.. _michelson_type_system_ithaca: - -Introduction to the type system and notations ---------------------------------------------- - -This specification describes a type system for Michelson. To make things -clear, in particular to readers that are not accustomed to reading -formal programming language specifications, it does not give a -typechecking or inference algorithm. It only gives an intentional -definition of what we consider to be well-typed programs. For each -syntactical form, it describes the stacks that are considered well-typed -inputs, and the resulting outputs. - -The type system is sound, meaning that if a program can be given a type, -then if run on a well-typed input stack, the interpreter will never -apply an interpretation rule on a stack of unexpected length or -contents. Also, it will never reach a state where it cannot select an -appropriate rule to continue the execution. Well-typed programs do not -block, and do not go wrong. - -Type notations -~~~~~~~~~~~~~~ - -The specification introduces notations for the types of values, terms -and stacks. Apart from a subset of value types that appear in the form -of type annotations in some places throughout the language, it is -important to understand that this type language only exists in the -specification. - -A stack type can be written: - -- ``[]`` for the empty stack. -- ``(top) : (rest)`` for the stack whose first value has type ``(top)`` - and queue has stack type ``(rest)``. - -Instructions, programs and primitives of the language are also typed, -their types are written: - -:: - - (type of stack before) -> (type of stack after) - -The types of values in the stack are written: - -- ``identifier`` for a primitive data-type (e.g. ``bool``). -- ``identifier (arg)`` for a parametric data-type with one parameter - type ``(arg)`` (e.g. ``list nat``). -- ``identifier (arg) ...`` for a parametric data-type with several - parameters (e.g. ``map string int``). -- ``[ (type of stack before) -> (type of stack after) ]`` for a code - quotation, (e.g. ``[ int : int : [] -> int : [] ]``). -- ``lambda (arg) (ret)`` is a shortcut for - ``[ (arg) : [] -> (ret) : [] ]``. - -Meta type variables -~~~~~~~~~~~~~~~~~~~ - -The typing rules introduce meta type variables. To be clear, this has -nothing to do with polymorphism, which Michelson does not have. These -variables only live at the specification level, and are used to express -the consistency between the parts of the program. For instance, the -typing rule for the ``IF`` construct introduces meta variables to -express that both branches must have the same type. - -Here are the notations for meta type variables: - -- ``'a`` for a type variable. -- ``'A`` for a stack type variable. -- ``_`` for an anonymous type or stack type variable. - -Typing rules -~~~~~~~~~~~~ - -The system is syntax directed, meaning that it defines a single -typing rule for each syntax construct. A typing rule restricts the type -of input stacks that are authorized for this syntax construct, links the -output type to the input type, and links both of them to the -subexpressions when needed, using meta type variables. - -Typing rules are of the form: - -:: - - (syntax pattern) - :: (type of stack before) -> (type of stack after) [rule-name] - iff (premises) - -Where premises are typing requirements over subprograms or values in the -stack, both of the form ``(x) :: (type)``, meaning that value ``(x)`` -must have type ``(type)``. - -A program is shown well-typed if one can find an instance of a rule that -applies to the toplevel program expression, with all meta type variables -replaced by non variable type expressions, and of which all type -requirements in the premises can be proven well-typed in the same -manner. For the reader unfamiliar with formal type systems, this is -called building a typing derivation. - -Here is an example typing derivation on a small program that computes -``(x+5)*10`` for a given input ``x``, obtained by instantiating the -typing rules for instructions ``PUSH``, ``ADD`` and for the sequence, as -found in the next sections. When instantiating, we replace the ``iff`` -with ``by``. - -:: - - { PUSH nat 5 ; ADD ; PUSH nat 10 ; MUL } - :: [ nat : [] -> nat : [] ] - by { PUSH nat 5 ; ADD } - :: [ nat : [] -> nat : [] ] - by PUSH nat 5 - :: [ nat : [] -> nat : nat : [] ] - by 5 :: nat - and ADD - :: [ nat : nat : [] -> nat : [] ] - and { PUSH nat 10 ; MUL } - :: [ nat : [] -> nat : [] ] - by PUSH nat 10 - :: [ nat : [] -> nat : nat : [] ] - by 10 :: nat - and MUL - :: [ nat : nat : [] -> nat : [] ] - -Producing such a typing derivation can be done in a number of manners, -such as unification or abstract interpretation. In the implementation of -Michelson, this is done by performing a recursive symbolic evaluation of -the program on an abstract stack representing the input type provided by -the programmer, and checking that the resulting symbolic stack is -consistent with the expected result, also provided by the programmer. - -Side note -~~~~~~~~~ - -As with most type systems, it is incomplete. There are programs that -cannot be given a type in this type system, yet that would not go wrong -if executed. This is a necessary compromise to make the type system -usable. Also, it is important to remember that the implementation of -Michelson does not accept as many programs as the type system describes -as well-typed. This is because the implementation uses a simple single -pass typechecking algorithm, and does not handle any form of -polymorphism. - -Core data types and notations ------------------------------ - -- ``string``, ``nat``, ``int`` and ``bytes``: The core primitive - constant types. - -- ``bool``: The type for booleans whose values are ``True`` and - ``False``. - -- ``unit``: The type whose only value is ``Unit``, to use as a - placeholder when some result or parameter is not necessary. For - instance, when the only goal of a contract is to update its storage. - -- ``never``: The empty type. Since ``never`` has no inhabitant, no value of - this type is allowed to occur in a well-typed program. - -- ``list (t)``: A single, immutable, homogeneous linked list, whose - elements are of type ``(t)``, and that we write ``{}`` for the empty - list or ``{ first ; ... }``. In the semantics, we use chevrons to - denote a subsequence of elements. For instance: ``{ head ; }``. - -- ``pair (l) (r)``: A pair of values ``a`` and ``b`` of types ``(l)`` - and ``(r)``, that we write ``(Pair a b)``. - -- ``pair (t{1}) ... (t{n})`` with ``n > 2``: A shorthand for ``pair (t{1}) (pair (t{2}) ... (pair (t{n-1}) (t{n})) ...)``. - -- ``option (t)``: Optional value of type ``(t)`` that we write ``None`` - or ``(Some v)``. - -- ``or (l) (r)``: A union of two types: a value holding either a value - ``a`` of type ``(l)`` or a value ``b`` of type ``(r)``, that we write - ``(Left a)`` or ``(Right b)``. - -- ``set (t)``: Immutable sets of values of type ``(t)`` that we write as - lists ``{ item ; ... }``, of course with their elements unique, and - sorted. - -- ``map (k) (t)``: Immutable maps from keys of type ``(k)`` of values - of type ``(t)`` that we write ``{ Elt key value ; ... }``, with keys - sorted. - -- ``big_map (k) (t)``: Lazily deserialized maps from keys of type - ``(k)`` of values of type ``(t)``. - These maps should be used if you intend to store large amounts of data in a map. - Using ``big_map`` can reduce gas costs significantly compared to standard maps, as data is lazily deserialized. - Note however that individual operations on ``big_map`` have higher gas costs than those over standard maps. - A ``big_map`` also has a lower storage cost than a standard map of the same size, when large keys are used, since only the hash of each key is stored in a ``big_map``. - - A ``big_map`` cannot appear inside another ``big_map``. - See the section on :ref:`operations on big maps ` for a description of the syntax of values of type ``big_map (k) (t)`` and available operations. - -Core instructions ------------------ - -Control structures -~~~~~~~~~~~~~~~~~~ - -- ``FAILWITH``: Explicitly abort the current program. - -:: - - :: 'a : \_ -> \_ - -This special instruction aborts the current program exposing the top -element of the stack in its error message (first rule below). It makes -the output useless since all subsequent instructions will simply -ignore their usual semantics to propagate the failure up to the main -result (second rule below). Its type is thus completely generic. - -:: - - > FAILWITH / a : _ => [FAILED] - > _ / [FAILED] => [FAILED] - -- ``{}``: Empty sequence. - -:: - - :: 'A -> 'A - - > {} / SA => SA - -- ``{ I ; C }``: Sequence. - -:: - - :: 'A -> 'C - iff I :: [ 'A -> 'B ] - C :: [ 'B -> 'C ] - - > I ; C / SA => SC - where I / SA => SB - and C / SB => SC - -- ``IF bt bf``: Conditional branching. - -:: - - :: bool : 'A -> 'B - iff bt :: [ 'A -> 'B ] - bf :: [ 'A -> 'B ] - - > IF bt bf / True : S => bt / S - > IF bt bf / False : S => bf / S - -- ``LOOP body``: A generic loop. - -:: - - :: bool : 'A -> 'A - iff body :: [ 'A -> bool : 'A ] - - > LOOP body / True : S => body ; LOOP body / S - > LOOP body / False : S => S - -- ``LOOP_LEFT body``: A loop with an accumulator. - -:: - - :: (or 'a 'b) : 'A -> 'b : 'A - iff body :: [ 'a : 'A -> (or 'a 'b) : 'A ] - - > LOOP_LEFT body / (Left a) : S => body ; LOOP_LEFT body / a : S - > LOOP_LEFT body / (Right b) : S => b : S - -- ``DIP code``: Runs code protecting the top element of the stack. - -:: - - :: 'b : 'A -> 'b : 'C - iff code :: [ 'A -> 'C ] - - > DIP code / x : S => x : S' - where code / S => S' - -- ``DIP n code``: Runs code protecting the ``n`` topmost elements of - the stack. In particular, ``DIP 0 code`` is equivalent to ``code`` - and ``DIP 1 code`` is equivalent to ``DIP code``. - -:: - - :: 'a{1} : ... : 'a{n} : 'A -> 'a{1} : ... : 'a{n} : 'B - iff code :: [ 'A -> 'B ] - - > DIP n code / x{1} : ... : x{n} : S => x{1} : ... : x{n} : S' - where code / S => S' - -- ``EXEC``: Execute a function from the stack. - -:: - - :: 'a : lambda 'a 'b : 'C -> 'b : 'C - - > EXEC / a : f : S => r : S - where f / a : [] => r : [] - -- ``APPLY``: Partially apply a tuplified function from the stack. - Values that are not both pushable and storable - (values of type ``operation``, ``contract _`` and ``big map _ _``) - cannot be captured by ``APPLY`` (cannot appear in ``'a``). - -:: - - :: 'a : lambda (pair 'a 'b) 'c : 'C -> lambda 'b 'c : 'C - - > APPLY / a : f : S => { PUSH 'a a ; PAIR ; f } : S - -Stack operations -~~~~~~~~~~~~~~~~ - -- ``DROP``: Drop the top element of the stack. - -:: - - :: _ : 'A -> 'A - - > DROP / _ : S => S - -- ``DROP n``: Drop the `n` topmost elements of the stack. In - particular, ``DROP 0`` is a noop and ``DROP 1`` is equivalent to - ``DROP``. - -:: - - :: 'a{1} : ... : 'a{n} : 'A -> 'A - - > DROP n / x{1} : ... : x{n} : S => S - -- ``DUP``: Duplicate the top element of the stack. - -:: - - :: 'a : 'A -> 'a : 'a : 'A - - > DUP / x : S => x : x : S - -- ``DUP n``: Duplicate the N-th element of the stack. `DUP 1` is equivalent to `DUP`. `DUP 0` is rejected. - -:: - - DUP 1 :: 'a : 'A -> 'a : 'a : 'A - - DUP (n+1) :: 'a : 'A -> 'b : 'a : 'A - iff DUP n :: 'A -> 'b : 'A - - > DUP 1 / x : S => x : x : S - - > DUP (n+1) / x : S => y : x : S - iff DUP n / S => y : S - - -- ``SWAP``: Exchange the top two elements of the stack. - -:: - - :: 'a : 'b : 'A -> 'b : 'a : 'A - - > SWAP / x : y : S => y : x : S - -- ``DIG n``: Take the element at depth ``n`` of the stack and move it - on top. The element on top of the stack is at depth ``0`` so that - ``DIG 0`` is a no-op and ``DIG 1`` is equivalent to ``SWAP``. - -:: - - :: 'a{1} : ... : 'a{n} : 'b : 'A -> 'b : 'a{1} : ... : 'a{n} : 'A - - > DIG n / x{1} : ... : x{n} : y : S => y : x{1} : ... : x{n} : S - -- ``DUG n``: Place the element on top of the stack at depth ``n``. The - element on top of the stack is at depth ``0`` so that ``DUG 0`` is a - no-op and ``DUG 1`` is equivalent to ``SWAP``. - -:: - - :: 'b : 'a{1} : ... : 'a{n} : 'A -> 'a{1} : ... : 'a{n} : 'b : 'A - - > DUG n / y : x{1} : ... : x{n} : S => x{1} : ... : x{n} : y : S - -- ``PUSH 'a x``: Push a constant value of a given type onto the stack. - -:: - - :: 'A -> 'a : 'A - iff x :: 'a - - > PUSH 'a x / S => x : S - -- ``LAMBDA 'a 'b code``: Push a lambda with the given parameter type `'a` and return - type `'b` onto the stack. - -:: - - :: 'A -> (lambda 'a 'b) : 'A - - > LAMBDA _ _ code / S => code : S - -Generic comparison -~~~~~~~~~~~~~~~~~~ - -Comparison only works on a class of types that we call comparable. A -``COMPARE`` operation is defined in an ad hoc way for each comparable -type, but the result of compare is always an ``int``, which can in turn -be checked in a generic manner using the following combinators. The -result of ``COMPARE`` is ``0`` if the top two elements of the stack are -equal, negative if the first element in the stack is less than the -second, and positive otherwise. - -- ``EQ``: Checks that the top element of the stack is equal to zero. - -:: - - :: int : 'S -> bool : 'S - - > EQ / 0 : S => True : S - > EQ / v : S => False : S - iff v <> 0 - -- ``NEQ``: Checks that the top element of the stack is not equal to zero. - -:: - - :: int : 'S -> bool : 'S - - > NEQ / 0 : S => False : S - > NEQ / v : S => True : S - iff v <> 0 - -- ``LT``: Checks that the top element of the stack is less than zero. - -:: - - :: int : 'S -> bool : 'S - - > LT / v : S => True : S - iff v < 0 - > LT / v : S => False : S - iff v >= 0 - -- ``GT``: Checks that the top element of the stack is greater than zero. - -:: - - :: int : 'S -> bool : 'S - - > GT / v : S => C / True : S - iff v > 0 - > GT / v : S => C / False : S - iff v <= 0 - -- ``LE``: Checks that the top element of the stack is less than or equal to - zero. - -:: - - :: int : 'S -> bool : 'S - - > LE / v : S => True : S - iff v <= 0 - > LE / v : S => False : S - iff v > 0 - -- ``GE``: Checks that the top of the stack is greater than or equal to - zero. - -:: - - :: int : 'S -> bool : 'S - - > GE / v : S => True : S - iff v >= 0 - > GE / v : S => False : S - iff v < 0 - -Operations ----------- - -Operations on unit -~~~~~~~~~~~~~~~~~~ - -- ``UNIT``: Push a unit value onto the stack. - -:: - - :: 'A -> unit : 'A - - > UNIT / S => Unit : S - -- ``COMPARE``: Unit comparison - -:: - - :: unit : unit : 'S -> int : 'S - - > COMPARE / Unit : Unit : S => 0 : S - -Operations on type never -~~~~~~~~~~~~~~~~~~~~~~~~ - -The type ``never`` is the type of forbidden values. The most prominent -scenario in which ``never`` is used is when implementing a contract -template with no additional entrypoint. A contract template defines a set -of basic entrypoints, and its ``parameter`` declaration contains a type -variable for additional entrypoints in some branch of an union type, or -wrapped inside an option type. Letting this type variable be ``never`` in -a particular implementation indicates that the contract template has not -been extended, and turns the branch in the code that processes the -additional entrypoints into a forbidden branch. - -Values of type ``never`` cannot occur in a well-typed program. However, -they can be abstracted in the ``parameter`` declaration of a contract---or -by using the ``LAMBDA`` operation---thus indicating that the corresponding -branches in the code are forbidden. The type ``never`` also plays a role -when introducing values of union or option type with ``LEFT never``, -``RIGHT never``, or ``NONE never``. In such cases, the created values can -be inspected with the operations ``IF_LEFT``, ``IF_RIGHT``, or -``IF_NONE``, and the corresponding branches in the code are forbidden -branches. - -- ``NEVER``: Close a forbidden branch. - -:: - - :: never : 'A -> 'B - -- ``COMPARE``: Trivial comparison on type ``never`` - -:: - - :: never : never : 'S -> int : 'S - - -Operations on booleans -~~~~~~~~~~~~~~~~~~~~~~ - -- ``OR`` - -:: - - :: bool : bool : 'S -> bool : 'S - - > OR / x : y : S => (x | y) : S - -- ``AND`` - -:: - - :: bool : bool : 'S -> bool : 'S - - > AND / x : y : S => (x & y) : S - -- ``XOR`` - -:: - - :: bool : bool : 'S -> bool : 'S - - > XOR / x : y : S => (x ^ y) : S - -- ``NOT`` - -:: - - :: bool : 'S -> bool : 'S - - > NOT / x : S => ~x : S - -- ``COMPARE``: Boolean comparison - -:: - - :: bool : bool : 'S -> int : 'S - - > COMPARE / False : False : S => 0 : S - > COMPARE / False : True : S => -1 : S - > COMPARE / True : False : S => 1 : S - > COMPARE / True : True : S => 0 : S - -Operations on integers and natural numbers -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Integers and naturals are arbitrary-precision, meaning that the only size -limit is gas. - -- ``NEG`` - -:: - - :: int : 'S -> int : 'S - :: nat : 'S -> int : 'S - - > NEG / x : S => -x : S - -- ``ABS`` - -:: - - :: int : 'S -> nat : 'S - - > ABS / x : S => abs (x) : S - -- ``ISNAT`` - -:: - - :: int : 'S -> option nat : 'S - - > ISNAT / x : S => Some (x) : S - iff x >= 0 - - > ISNAT / x : S => None : S - iff x < 0 - -- ``INT`` - -:: - - :: nat : 'S -> int : 'S - - > INT / x : S => x : S - -- ``ADD`` - -:: - - :: int : int : 'S -> int : 'S - :: int : nat : 'S -> int : 'S - :: nat : int : 'S -> int : 'S - :: nat : nat : 'S -> nat : 'S - - > ADD / x : y : S => (x + y) : S - -- ``SUB`` - -:: - - :: int : int : 'S -> int : 'S - :: int : nat : 'S -> int : 'S - :: nat : int : 'S -> int : 'S - :: nat : nat : 'S -> int : 'S - - > SUB / x : y : S => (x - y) : S - -- ``MUL`` - -:: - - :: int : int : 'S -> int : 'S - :: int : nat : 'S -> int : 'S - :: nat : int : 'S -> int : 'S - :: nat : nat : 'S -> nat : 'S - - > MUL / x : y : S => (x * y) : S - -- ``EDIV``: Perform Euclidean division - -:: - - :: int : int : 'S -> option (pair int nat) : 'S - :: int : nat : 'S -> option (pair int nat) : 'S - :: nat : int : 'S -> option (pair int nat) : 'S - :: nat : nat : 'S -> option (pair nat nat) : 'S - - > EDIV / x : 0 : S => None : S - > EDIV / x : y : S => Some (Pair (x / y) (x % y)) : S - iff y <> 0 - -Bitwise logical operators are also available on unsigned integers. - -- ``OR`` - -:: - - :: nat : nat : 'S -> nat : 'S - - > OR / x : y : S => (x | y) : S - -- ``AND``: (also available when the top operand is signed) - -:: - - :: nat : nat : 'S -> nat : 'S - :: int : nat : 'S -> nat : 'S - - > AND / x : y : S => (x & y) : S - -- ``XOR`` - -:: - - :: nat : nat : 'S -> nat : 'S - - > XOR / x : y : S => (x ^ y) : S - -- ``NOT``: Two's complement - -:: - - :: nat : 'S -> int : 'S - :: int : 'S -> int : 'S - - > NOT / x : S => ~x : S - - -The return type of ``NOT`` is an ``int`` and not a ``nat``. This is -because the sign is also negated. The resulting integer is computed -using two's complement. For instance, the boolean negation of ``0`` is -``-1``. To get a natural back, a possibility is to use ``AND`` with an -unsigned mask afterwards. - - -- ``LSL`` - -:: - - :: nat : nat : 'S -> nat : 'S - - > LSL / x : s : S => (x << s) : S - iff s <= 256 - > LSL / x : s : S => [FAILED] - iff s > 256 - -- ``LSR`` - -:: - - :: nat : nat : 'S -> nat : 'S - - > LSR / x : s : S => (x >> s) : S - iff s <= 256 - > LSR / x : s : S => [FAILED] - iff s > 256 - -- ``COMPARE``: Integer/natural comparison - -:: - - :: int : int : 'S -> int : 'S - :: nat : nat : 'S -> int : 'S - - > COMPARE / x : y : S => -1 : S - iff x < y - > COMPARE / x : y : S => 0 : S - iff x = y - > COMPARE / x : y : S => 1 : S - iff x > y - -Operations on strings -~~~~~~~~~~~~~~~~~~~~~ - -Strings are mostly used for naming things without having to rely on -external ID databases. They are restricted to the printable subset of -7-bit ASCII, plus some escaped characters (see section on -constants). So what can be done is basically use string constants as -is, concatenate or splice them, and use them as keys. - - -- ``CONCAT``: String concatenation. - -:: - - :: string : string : 'S -> string : 'S - - > CONCAT / s : t : S => (s ^ t) : S - - :: string list : 'S -> string : 'S - - > CONCAT / {} : S => "" : S - > CONCAT / { s ; } : S => (s ^ r) : S - where CONCAT / { } : S => r : S - -- ``SIZE``: number of characters in a string. - -:: - - :: string : 'S -> nat : 'S - -- ``SLICE``: String access. - -:: - - :: nat : nat : string : 'S -> option string : 'S - - > SLICE / offset : length : s : S => Some ss : S - where ss is the substring of s at the given offset and of the given length - iff offset and (offset + length) are in bounds - > SLICE / offset : length : s : S => None : S - iff offset or (offset + length) are out of bounds - -- ``COMPARE``: Lexicographic comparison. - -:: - - :: string : string : 'S -> int : 'S - - > COMPARE / s : t : S => -1 : S - iff s < t - > COMPARE / s : t : S => 0 : S - iff s = t - > COMPARE / s : t : S => 1 : S - iff s > t - -Operations on pairs and right combs -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The type ``pair l r`` is the type of binary pairs composed of a left -element of type ``l`` and a right element of type ``r``. A value of -type ``pair l r`` is written ``Pair x y`` where ``x`` is a value of -type ``l`` and ``y`` is a value of type ``r``. - -To build tuples of length greater than 2, right combs have specific -optimized operations. For any ``n > 2``, the compact notations ``pair -t{0} t{1} ... t{n-2} t{n-1}`` is provided for the type of right combs -``pair t{0} (pair t{1} ... (pair t{n-2} t{n-1}) ...)``. Similarly, the -compact notation ``Pair x{0} x{1} ... x{n-2} x{n-1}`` is provided for -the right-comb value ``Pair x{0} (Pair x{1} ... (Pair x{n-2} x{n-1}) -...)``. Right-comb values can also be written using sequences; ``Pair -x{0} x{1} ... x{n-2} x{n-1}`` can be written ``{x{0}; x{1}; ...; x{n-2}; x{n-1}}``. - -- ``PAIR``: Build a binary pair from the stack's top two elements. - -:: - - :: 'a : 'b : 'S -> pair 'a 'b : 'S - - > PAIR / x : y : S => Pair x y : S - -- ``PAIR n``: Fold ``n`` values on the top of the stack in a right comb. - ``PAIR 0`` and ``PAIR 1`` are rejected. ``PAIR 2`` is equivalent to ``PAIR``. - -:: - - PAIR 2 :: 'a : 'b : 'S -> pair 'a 'b : 'S - PAIR (k+1) :: 'x : 'S -> pair 'x 'y : 'T - iff PAIR k :: 'S -> 'y : 'T - - Or equivalently, for n >= 2, - PAIR n :: 'a{0} : ... : 'a{n-1} : 'A -> pair 'a{0} ... 'a{n-1} : 'A - - > PAIR 2 / x : y : S => Pair x y : S - > PAIR (k+1) / x : S => Pair x y : T - iff PAIR k / S => y : T - - Or equivalently, for n >= 2, - > PAIR n / x{0} : ... : x{n-1} : S => Pair x{0} ... x{n-1} : S - -- ``UNPAIR``: Split a pair into its components. - -:: - - :: pair 'a 'b : 'S -> 'a : 'b : 'S - - > UNPAIR / Pair a b : S => a : b : S - - -- ``UNPAIR n``: Unfold ``n`` values from a right comb on the top of the stack. ``UNPAIR 0`` and ``UNPAIR 1`` are rejected. ``UNPAIR 2`` is equivalent to ``UNPAIR``. - -:: - - UNPAIR 2 :: pair 'a 'b : 'A -> 'a : 'b : 'A - UNPAIR (k+1) :: pair 'a 'b : 'A -> 'a : 'B - iff UNPAIR k :: 'b : 'A -> 'B - - Or equivalently, for n >= 2, - UNPAIR n :: pair 'a{0} ... 'a{n-1} : S -> 'a{0} : ... : 'a{n-1} : S - - > UNPAIR 2 / Pair x y : S => x : y : S - > UNPAIR (k+1) / Pair x y : SA => x : SB - iff UNPAIR k / y : SA => SB - - Or equivalently, for n >= 2, - > UNPAIR n / Pair x{0} ... x{n-1} : S => x{0} : ... : x{n-1} : S - -- ``CAR``: Access the left part of a pair. - -:: - - :: pair 'a _ : 'S -> 'a : 'S - - > CAR / Pair x _ : S => x : S - -- ``CDR``: Access the right part of a pair. - -:: - - :: pair _ 'b : 'S -> 'b : 'S - - > CDR / Pair _ y : S => y : S - -- ``GET k``: Access an element or a sub comb in a right comb. - - The nodes of a right comb of size ``n`` are canonically numbered as follows: - -:: - - 0 - / \ - 1 2 - / \ - 3 4 - / \ - 5 ... - 2n-2 - / \ - 2n-1 2n - - -Or in plain English: - - - The root is numbered with 0, - - The left child of the node numbered by ``k`` is numbered by ``k+1``, and - - The right child of the node numbered by ``k`` is numbered by ``k+2``. - -The ``GET k`` instruction accesses the node numbered by ``k``. In -particular, for a comb of size ``n``, the ``n-1`` first elements are -accessed by ``GET 1``, ``GET 3``, ..., and ``GET (2n-1)`` and the last -element is accessed by ``GET (2n)``. - -:: - - GET 0 :: 'a : 'S -> 'a : 'S - GET 1 :: pair 'x _ : 'S -> 'x : 'S - GET (k+2) :: pair _ 'y : 'S -> 'z : 'S - iff GET k :: 'y : 'S -> 'z : 'S - - Or equivalently, - GET 0 :: 'a : 'S -> 'a : 'S - GET (2k) :: pair 'a{0} ... 'a{k-1} 'a{k} : 'S -> 'a{k} : 'S - GET (2k+1) :: pair 'a{0} ... 'a{k} 'a{k+1} : 'S -> 'a{k} : 'S - - > GET 0 / x : S => x : S - > GET 1 / Pair x _ : S => x : S - > GET (k+2) / Pair _ y : S => GET k / y : S - - Or equivalently, - > GET 0 / x : S => x : S - > GET (2k) / Pair x{0} ... x{k-1} x{k} : 'S -> x{k} : 'S - > GET (2k+1) / Pair x{0} ... x{k} x{k+1} : 'S -> x{k} : 'S - - -- ``UPDATE k``: Update an element or a sub comb in a right comb. The topmost stack element is the new value to insert in the comb, the second stack element is the right comb to update. The meaning of ``k`` is the same as for the ``GET k`` instruction. - -:: - - UPDATE 0 :: 'a : 'b : 'S -> 'a : 'S - UPDATE 1 :: 'a2 : pair 'a1 'b : 'S -> pair 'a2 'b : 'S - UPDATE (k+2) :: 'c : pair 'a 'b1 : 'S -> pair 'a 'b2 : 'S - iff UPDATE k :: 'c : 'b1 : 'S -> 'b2 : 'S - - Or equivalently, - UPDATE 0 :: 'a : 'b : 'S -> 'a : 'S - UPDATE (2k) :: 'c : pair 'a{0} ... 'a{k-1} 'a{k} : 'S -> pair 'a{0} ... 'a{k-1} 'c : 'S - UPDATE (2k+1) :: 'c : pair 'a{0} ... 'a{k} 'a{k+1} : 'S -> pair 'a{0} ... 'a{k-1} 'c 'a{k+1} : 'S - - > UPDATE 0 / x : _ : S => x : S - > UPDATE 1 / x2 : Pair x1 y : S => Pair x2 y : S - > UPDATE (k+2) / z : Pair x y1 : S => Pair x y2 : S - iff UPDATE k / z : y1 : S => y2 : S - - Or equivalently, - > UPDATE 0 / x : _ : S => x : S - > UPDATE (2k) / z : Pair x{0} ... x{k-1} x{k} : 'S => Pair x{0} ... x{k-1} z : 'S - > UPDATE (2k+1) / z : Pair x{0} ... x{k-1} x{k} x{k+1} : 'S => Pair x{0} ... x{k-1} z x{k+1} : 'S - -- ``COMPARE``: Lexicographic comparison. - -:: - - :: pair 'a 'b : pair 'a 'b : 'S -> int : 'S - - > COMPARE / (Pair sa sb) : (Pair ta tb) : S => -1 : S - iff COMPARE / sa : ta : S => -1 : S - > COMPARE / (Pair sa sb) : (Pair ta tb) : S => 1 : S - iff COMPARE / sa : ta : S => 1 : S - > COMPARE / (Pair sa sb) : (Pair ta tb) : S => r : S - iff COMPARE / sa : ta : S => 0 : S - COMPARE / sb : tb : S => r : S - -Operations on sets -~~~~~~~~~~~~~~~~~~ - -- ``EMPTY_SET 'elt``: Build a new, empty set for elements of a given - type. - - The ``'elt`` type must be comparable (the ``COMPARE`` - primitive must be defined over it). - -:: - - :: 'S -> set 'elt : 'S - - > EMPTY_SET _ / S => {} : S - -- ``MEM``: Check for the presence of an element in a set. - -:: - - :: 'elt : set 'elt : 'S -> bool : 'S - - > MEM / x : {} : S => false : S - > MEM / x : { hd ; } : S => r : S - iff COMPARE / x : hd : [] => 1 : [] - where MEM / x : { } : S => r : S - > MEM / x : { hd ; } : S => true : S - iff COMPARE / x : hd : [] => 0 : [] - > MEM / x : { hd ; } : S => false : S - iff COMPARE / x : hd : [] => -1 : [] - -- ``UPDATE``: Inserts or removes an element in a set, replacing a - previous value. - -:: - - :: 'elt : bool : set 'elt : 'S -> set 'elt : 'S - - > UPDATE / x : false : {} : S => {} : S - > UPDATE / x : true : {} : S => { x } : S - > UPDATE / x : v : { hd ; } : S => { hd ; } : S - iff COMPARE / x : hd : [] => 1 : [] - where UPDATE / x : v : { } : S => { } : S - > UPDATE / x : false : { hd ; } : S => { } : S - iff COMPARE / x : hd : [] => 0 : [] - > UPDATE / x : true : { hd ; } : S => { hd ; } : S - iff COMPARE / x : hd : [] => 0 : [] - > UPDATE / x : false : { hd ; } : S => { hd ; } : S - iff COMPARE / x : hd : [] => -1 : [] - > UPDATE / x : true : { hd ; } : S => { x ; hd ; } : S - iff COMPARE / x : hd : [] => -1 : [] - -- ``ITER body``: Apply the body expression to each element of a set. - The body sequence has access to the stack. - -:: - - :: (set 'elt) : 'A -> 'A - iff body :: [ 'elt : 'A -> 'A ] - - > ITER body / {} : S => S - > ITER body / { hd ; } : S => ITER body / { } : S' - iff body / hd : S => S' - - -- ``SIZE``: Get the cardinality of the set. - -:: - - :: set 'elt : 'S -> nat : 'S - - > SIZE / {} : S => 0 : S - > SIZE / { _ ; } : S => 1 + s : S - where SIZE / { } : S => s : S - -Operations on maps -~~~~~~~~~~~~~~~~~~ - -- ``EMPTY_MAP 'key 'val``: Build a new, empty map from keys of a - given type to values of another given type. - - The ``'key`` type must be comparable (the ``COMPARE`` primitive must - be defined over it). - -:: - - :: 'S -> map 'key 'val : 'S - - > EMPTY_MAP _ _ / S => {} : S - - -- ``GET``: Access an element in a map, returns an optional value to be - checked with ``IF_SOME``. - -:: - - :: 'key : map 'key 'val : 'S -> option 'val : 'S - - > GET / x : {} : S => None : S - > GET / x : { Elt k v ; } : S => opt_y : S - iff COMPARE / x : k : [] => 1 : [] - where GET / x : { } : S => opt_y : S - > GET / x : { Elt k v ; } : S => Some v : S - iff COMPARE / x : k : [] => 0 : [] - > GET / x : { Elt k v ; } : S => None : S - iff COMPARE / x : k : [] => -1 : [] - -- ``MEM``: Check for the presence of a binding for a key in a map. - -:: - - :: 'key : map 'key 'val : 'S -> bool : 'S - - > MEM / x : {} : S => false : S - > MEM / x : { Elt k v ; } : S => r : S - iff COMPARE / x : k : [] => 1 : [] - where MEM / x : { } : S => r : S - > MEM / x : { Elt k v ; } : S => true : S - iff COMPARE / x : k : [] => 0 : [] - > MEM / x : { Elt k v ; } : S => false : S - iff COMPARE / x : k : [] => -1 : [] - -- ``UPDATE``: Assign or remove an element in a map. - -:: - - :: 'key : option 'val : map 'key 'val : 'S -> map 'key 'val : 'S - - > UPDATE / x : None : {} : S => {} : S - > UPDATE / x : Some y : {} : S => { Elt x y } : S - > UPDATE / x : opt_y : { Elt k v ; } : S => { Elt k v ; } : S - iff COMPARE / x : k : [] => 1 : [] - where UPDATE / x : opt_y : { } : S => { } : S - > UPDATE / x : None : { Elt k v ; } : S => { } : S - iff COMPARE / x : k : [] => 0 : [] - > UPDATE / x : Some y : { Elt k v ; } : S => { Elt k y ; } : S - iff COMPARE / x : k : [] => 0 : [] - > UPDATE / x : None : { Elt k v ; } : S => { Elt k v ; } : S - iff COMPARE / x : k : [] => -1 : [] - > UPDATE / x : Some y : { Elt k v ; } : S => { Elt x y ; Elt k v ; } : S - iff COMPARE / x : k : [] => -1 : [] - -- ``GET_AND_UPDATE``: A combination of the ``GET`` and ``UPDATE`` instructions. - -:: - - :: 'key : option 'val : map 'key 'val : 'S -> option 'val : map 'key 'val : 'S - -This instruction is similar to ``UPDATE`` but it also returns the -value that was previously stored in the ``map`` at the same key as -``GET`` would. - -:: - - > GET_AND_UPDATE / x : None : {} : S => None : {} : S - > GET_AND_UPDATE / x : Some y : {} : S => None : { Elt x y } : S - > GET_AND_UPDATE / x : opt_y : { Elt k v ; } : S => opt_y' : { Elt k v ; } : S - iff COMPARE / x : k : [] => 1 : [] - where GET_AND_UPDATE / x : opt_y : { } : S => opt_y' : { } : S - > GET_AND_UPDATE / x : None : { Elt k v ; } : S => Some v : { } : S - iff COMPARE / x : k : [] => 0 : [] - > GET_AND_UPDATE / x : Some y : { Elt k v ; } : S => Some v : { Elt k y ; } : S - iff COMPARE / x : k : [] => 0 : [] - > GET_AND_UPDATE / x : None : { Elt k v ; } : S => None : { Elt k v ; } : S - iff COMPARE / x : k : [] => -1 : [] - > GET_AND_UPDATE / x : Some y : { Elt k v ; } : S => None : { Elt x y ; Elt k v ; } : S - iff COMPARE / x : k : [] => -1 : [] - -- ``MAP body``: Apply the body expression to each element of a map. The - body sequence has access to the stack. - -:: - - :: (map 'key 'val) : 'A -> (map 'key 'b) : 'A - iff body :: [ (pair 'key 'val) : 'A -> 'b : 'A ] - - > MAP body / {} : S => {} : S - > MAP body / { Elt k v ; } : S => { Elt k v' ; } : S'' - where body / Pair k v : S => v' : S' - and MAP body / { } : S' => { } : S'' - -- ``ITER body``: Apply the body expression to each element of a map. - The body sequence has access to the stack. - -:: - - :: (map 'elt 'val) : 'A -> 'A - iff body :: [ (pair 'elt 'val : 'A) -> 'A ] - - > ITER body / {} : S => S - > ITER body / { Elt k v ; } : S => ITER body / { } : S' - iff body / (Pair k v) : S => S' - -- ``SIZE``: Get the cardinality of the map. - -:: - - :: map 'key 'val : 'S -> nat : 'S - - > SIZE / {} : S => 0 : S - > SIZE / { _ ; } : S => 1 + s : S - where SIZE / { } : S => s : S - - -Operations on ``big_maps`` -~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. _OperationsOnBigMaps: -.. _OperationsOnBigMaps_ithaca: - -Big maps have three possible representations. A map literal is always -a valid representation for a big map. Big maps can also be represented -by integers called big-map identifiers. Finally, big maps can be -represented as pairs of a big-map identifier (an integer) and a -big-map diff (written in the same syntax as a map whose values are -options). - -So for example, ``{ Elt "bar" True ; Elt "foo" False }``, ``42``, and -``Pair 42 { Elt "foo" (Some False) }`` are all valid representations -of type ``big_map string bool``. - -The behavior of big-map operations is the same as if they were normal -maps, except that under the hood, the elements are loaded and -deserialized on demand. - -- ``EMPTY_BIG_MAP 'key 'val``: Build a new, empty big map from keys of a - given type to values of another given type. - - The ``'key`` type must be comparable (the ``COMPARE`` primitive must - be defined over it). - -:: - - :: 'S -> map 'key 'val : 'S - -- ``GET``: Access an element in a ``big_map``, returns an optional value to be - checked with ``IF_SOME``. - -:: - - :: 'key : big_map 'key 'val : 'S -> option 'val : 'S - -- ``MEM``: Check for the presence of an element in a ``big_map``. - -:: - - :: 'key : big_map 'key 'val : 'S -> bool : 'S - -- ``UPDATE``: Assign or remove an element in a ``big_map``. - -:: - - :: 'key : option 'val : big_map 'key 'val : 'S -> big_map 'key 'val : 'S - - -- ``GET_AND_UPDATE``: A combination of the ``GET`` and ``UPDATE`` instructions. - -:: - - :: 'key : option 'val : big_map 'key 'val : 'S -> option 'val : big_map 'key 'val : 'S - -This instruction is similar to ``UPDATE`` but it also returns the -value that was previously stored in the ``big_map`` at the same key as -``GET`` would. - - -Operations on optional values -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -- ``SOME``: Pack a value as an optional value. - -:: - - :: 'a : 'S -> option 'a : 'S - - > SOME / v : S => (Some v) : S - -- ``NONE 'a``: The absent optional value. - -:: - - :: 'S -> option 'a : 'S - - > NONE / S => None : S - -- ``IF_NONE bt bf``: Inspect an optional value. - -:: - - :: option 'a : 'A -> 'B - iff bt :: [ 'A -> 'B] - bf :: [ 'a : 'A -> 'B] - - > IF_NONE bt bf / (None) : S => bt / S - > IF_NONE bt bf / (Some a) : S => bf / a : S - -- ``COMPARE``: Optional values comparison - -:: - - :: option 'a : option 'a : 'S -> int : 'S - - > COMPARE / None : None : S => 0 : S - > COMPARE / None : (Some _) : S => -1 : S - > COMPARE / (Some _) : None : S => 1 : S - > COMPARE / (Some a) : (Some b) : S => COMPARE / a : b : S - -- ``MAP body``: Apply the body expression to the value inside the option if there is one. - -:: - - :: option 'a : 'S -> option 'b : 'S - iff body :: [ 'a : 'S -> 'b : 'S ] - - > MAP body / None : S => None : S - > MAP body / (Some a) : S => (Some b) : S' - where body / a : S => b : S' - -Operations on unions -~~~~~~~~~~~~~~~~~~~~ - -- ``LEFT 'b``: Pack a value in a union (left case). - -:: - - :: 'a : 'S -> or 'a 'b : 'S - - > LEFT / v : S => (Left v) : S - -- ``RIGHT 'a``: Pack a value in a union (right case). - -:: - - :: 'b : 'S -> or 'a 'b : 'S - - > RIGHT / v : S => (Right v) : S - -- ``IF_LEFT bt bf``: Inspect a value of a union. - -:: - - :: or 'a 'b : 'A -> 'B - iff bt :: [ 'a : 'A -> 'B] - bf :: [ 'b : 'A -> 'B] - - > IF_LEFT bt bf / (Left a) : S => bt / a : S - > IF_LEFT bt bf / (Right b) : S => bf / b : S - -- ``COMPARE``: Unions comparison - -:: - - :: or 'a 'b : or 'a 'b : 'S -> int : 'S - - > COMPARE / (Left a) : (Left b) : S => COMPARE / a : b : S - > COMPARE / (Left _) : (Right _) : S => -1 : S - > COMPARE / (Right _) : (Left _) : S => 1 : S - > COMPARE / (Right a) : (Right b) : S => COMPARE / a : b : S - -Operations on lists -~~~~~~~~~~~~~~~~~~~ - -- ``CONS``: Prepend an element to a list. - -:: - - :: 'a : list 'a : 'S -> list 'a : 'S - - > CONS / a : { } : S => { a ; } : S - -- ``NIL 'a``: The empty list. - -:: - - :: 'S -> list 'a : 'S - - > NIL / S => {} : S - -- ``IF_CONS bt bf``: Inspect a list. - -:: - - :: list 'a : 'A -> 'B - iff bt :: [ 'a : list 'a : 'A -> 'B] - bf :: [ 'A -> 'B] - - > IF_CONS bt bf / { a ; } : S => bt / a : { } : S - > IF_CONS bt bf / {} : S => bf / S - -- ``MAP body``: Apply the body expression to each element of the list. - The body sequence has access to the stack. - -:: - - :: (list 'elt) : 'A -> (list 'b) : 'A - iff body :: [ 'elt : 'A -> 'b : 'A ] - - > MAP body / {} : S => {} : S - > MAP body / { a ; } : S => { b ; } : S'' - where body / a : S => b : S' - and MAP body / { } : S' => { } : S'' - -- ``SIZE``: Get the number of elements in the list. - -:: - - :: list 'elt : 'S -> nat : 'S - - > SIZE / { _ ; } : S => 1 + s : S - where SIZE / { } : S => s : S - > SIZE / {} : S => 0 : S - - -- ``ITER body``: Apply the body expression to each element of a list. - The body sequence has access to the stack. - -:: - - :: (list 'elt) : 'A -> 'A - iff body :: [ 'elt : 'A -> 'A ] - > ITER body / {} : S => S - > ITER body / { a ; } : S => ITER body / { } : S' - iff body / a : S => S' - - -Domain specific data types --------------------------- - -- ``timestamp``: Dates in the real world. - -- ``mutez``: A specific type for manipulating tokens. - -- ``address``: An untyped address (implicit account or smart contract). - -- ``contract 'param``: A contract, with the type of its code, - ``contract unit`` for implicit accounts. - -- ``operation``: An internal operation emitted by a contract. - -- ``key``: A public cryptographic key. - -- ``key_hash``: The hash of a public cryptographic key. - -- ``signature``: A cryptographic signature. - -- ``chain_id``: An identifier for a chain, used to distinguish the test and the main chains. - -- ``bls12_381_g1``, ``bls12_381_g2`` : Points on the BLS12-381 curves G\ :sub:`1`\ and G\ :sub:`2`\ , respectively. - -- ``bls12_381_fr`` : An element of the scalar field F\ :sub:`r`\ , used for scalar multiplication on the BLS12-381 curves G\ :sub:`1`\ and G\ :sub:`2`\ . - -- ``sapling_transaction ms``: A :doc:`Sapling ` transaction - -- ``sapling_state ms``: A :doc:`Sapling ` state - -- ``ticket (t)``: A ticket used to authenticate information of type ``(t)`` on-chain. - -- ``chest``: a timelocked chest containing bytes and information to open it. - see :doc:`Timelock ` . - -- ``chest_key``: used to open a chest, also contains a proof - to check the correctness of the opening. see :doc:`Timelock ` . - - -Domain specific operations --------------------------- - -Operations on timestamps -~~~~~~~~~~~~~~~~~~~~~~~~ - -Timestamps can be obtained by the ``NOW`` operation, or retrieved from -script parameters or globals. - -- ``ADD`` Increment / decrement a timestamp of the given number of - seconds. - -:: - - :: timestamp : int : 'S -> timestamp : 'S - :: int : timestamp : 'S -> timestamp : 'S - - > ADD / seconds : nat (t) : S => (seconds + t) : S - > ADD / nat (t) : seconds : S => (t + seconds) : S - -- ``SUB`` Subtract a number of seconds from a timestamp. - -:: - - :: timestamp : int : 'S -> timestamp : 'S - - > SUB / seconds : nat (t) : S => (seconds - t) : S - -- ``SUB`` Subtract two timestamps. - -:: - - :: timestamp : timestamp : 'S -> int : 'S - - > SUB / seconds(t1) : seconds(t2) : S => (t1 - t2) : S - -- ``COMPARE``: Timestamp comparison. - -:: - - :: timestamp : timestamp : 'S -> int : 'S - - > COMPARE / seconds(t1) : seconds(t2) : S => -1 : S - iff t1 < t2 - > COMPARE / seconds(t1) : seconds(t2) : S => 0 : S - iff t1 = t2 - > COMPARE / seconds(t1) : seconds(t2) : S => 1 : S - iff t1 > t2 - - -Operations on Mutez -~~~~~~~~~~~~~~~~~~~ - -Mutez (micro-Tez) are internally represented by a 64 bit signed -integers. There are restrictions to prevent creating a negative amount -of mutez. Operations are limited to prevent overflow and mixing them -with other numerical types by mistake. They are also mandatory checked -for under/overflows. - -- ``ADD`` - -:: - - :: mutez : mutez : 'S -> mutez : 'S - - > ADD / x : y : S => [FAILED] on overflow - > ADD / x : y : S => (x + y) : S - -- ``SUB_MUTEZ`` - -:: - - :: mutez : mutez : 'S -> option mutez : 'S - - > SUB_MUTEZ / x : y : S => None - iff x < y - > SUB_MUTEZ / x : y : S => Some (x - y) : S - -- ``MUL`` - -:: - - :: mutez : nat : 'S -> mutez : 'S - :: nat : mutez : 'S -> mutez : 'S - - > MUL / x : y : S => [FAILED] on overflow - > MUL / x : y : S => (x * y) : S - -- ``EDIV`` - -:: - - :: mutez : nat : 'S -> option (pair mutez mutez) : 'S - :: mutez : mutez : 'S -> option (pair nat mutez) : 'S - - > EDIV / x : 0 : S => None - > EDIV / x : y : S => Some (Pair (x / y) (x % y)) : S - iff y <> 0 - -- ``COMPARE``: Mutez comparison - -:: - - :: mutez : mutez : 'S -> int : 'S - - > COMPARE / x : y : S => -1 : S - iff x < y - > COMPARE / x : y : S => 0 : S - iff x = y - > COMPARE / x : y : S => 1 : S - iff x > y - -Operations on contracts -~~~~~~~~~~~~~~~~~~~~~~~ - -- ``CREATE_CONTRACT { storage 'g ; parameter 'p ; code ... }``: - Forge a new contract from a literal. - -:: - - :: option key_hash : mutez : 'g : 'S - -> operation : address : 'S - -Originate a contract based on a literal. The parameters are the -optional delegate, the initial amount taken from the current -contract, and the initial storage of the originated contract. -The contract is returned as a first class value (to be dropped, passed -as parameter or stored). The ``CONTRACT 'p`` instruction will fail -until it is actually originated. - -- ``TRANSFER_TOKENS``: Forge a transaction. - -:: - - :: 'p : mutez : contract 'p : 'S -> operation : 'S - -The parameter must be consistent with the one expected by the -contract, unit for an account. - -.. _MichelsonSetDelegate: -.. _MichelsonSetDelegate_ithaca: - -- ``SET_DELEGATE``: Set or withdraw the contract's delegation. - -:: - - :: option key_hash : 'S -> operation : 'S - -Using this instruction is the only way to modify the delegation of a -smart contract. If the parameter is ``None`` then the delegation of the -current contract is withdrawn; if it is ``Some kh`` where ``kh`` is the -key hash of a registered delegate that is not the current delegate of -the contract, then this operation sets the delegate of the contract to -this registered delegate. The operation fails if ``kh`` is the current -delegate of the contract or if ``kh`` is not a registered delegate. - -- ``BALANCE``: Push the current amount of mutez held by the executing - contract, including any mutez added by the calling transaction. - -:: - - :: 'S -> mutez : 'S - -- ``ADDRESS``: Cast the contract to its address. - -:: - - :: contract _ : 'S -> address : 'S - - > ADDRESS / addr : S => addr : S - -- ``CONTRACT 'p``: Cast the address to the given contract type if possible. - -:: - - :: address : 'S -> option (contract 'p) : 'S - - > CONTRACT / addr : S => Some addr : S - iff addr exists and is a contract of parameter type 'p - > CONTRACT / addr : S => Some addr : S - iff 'p = unit and addr is an implicit contract - > CONTRACT / addr : S => None : S - otherwise - -- ``SOURCE``: Push the contract that initiated the current - transaction, i.e. the contract that paid the fees and - storage cost, and whose manager signed the operation - that was sent on the blockchain. Note that since - ``TRANSFER_TOKENS`` instructions can be chained, - ``SOURCE`` and ``SENDER`` are not necessarily the same. - -:: - - :: 'S -> address : 'S - -- ``SENDER``: Push the contract that initiated the current - internal transaction. It may be the ``SOURCE``, but may - also be different if the source sent an order to an intermediate - smart contract, which then called the current contract. - -:: - - :: 'S -> address : 'S - -- ``SELF``: Push the current contract. - -:: - - :: 'S -> contract 'p : 'S - where contract 'p is the type of the current contract - -Note that ``SELF`` is forbidden in lambdas because it cannot be -type-checked; the type of the contract executing the lambda cannot be -known at the point of type-checking the lambda's body. - -- ``SELF_ADDRESS``: Push the address of the current contract. This is - equivalent to ``SELF; ADDRESS`` except that it is allowed in - lambdas. - -:: - - :: 'S -> address : 'S - -Note that ``SELF_ADDRESS`` inside a lambda returns the address of the -contract executing the lambda, which can be different from the address -of the contract in which the ``SELF_ADDRESS`` instruction is written. - -- ``AMOUNT``: Push the amount of the current transaction. - -:: - - :: 'S -> mutez : 'S - -- ``IMPLICIT_ACCOUNT``: Return a default contract with the given - public/private key pair. Any funds deposited in this contract can - immediately be spent by the holder of the private key. This contract - cannot execute Michelson code and will always exist on the - blockchain. - -:: - - :: key_hash : 'S -> contract unit : 'S - -- ``VOTING_POWER``: Return the voting power of a given contract. This voting power - coincides with the weight of the contract in the voting listings (i.e., the rolls - count) which is calculated at the beginning of every voting period. - -:: - - :: key_hash : 'S -> nat : 'S - -Special operations -~~~~~~~~~~~~~~~~~~ - -- ``NOW``: Push the minimal injection time for the current block, - namely the block whose validation triggered this execution. The - minimal injection time is 60 seconds after the timestamp of the - predecessor block. This value does not change during the execution - of the contract. - -:: - - :: 'S -> timestamp : 'S - -- ``CHAIN_ID``: Push the chain identifier. - -:: - - :: 'S -> chain_id : 'S - -- ``COMPARE``: Chain identifier comparison - -:: - - :: chain_id : chain_id : 'S -> int : 'S - - > COMPARE / x : y : S => -1 : S - iff x < y - > COMPARE / x : y : S => 0 : S - iff x = y - > COMPARE / x : y : S => 1 : S - iff x > y - -- ``LEVEL``: Push the level of the current transaction's block. - -:: - - :: 'S -> nat : 'S - -- ``TOTAL_VOTING_POWER``: Return the total voting power of all contracts. The total - voting power coincides with the sum of the rolls count of every contract in the voting - listings. The voting listings is calculated at the beginning of every voting period. - -:: - - :: 'S -> nat : 'S - -Operations on bytes -~~~~~~~~~~~~~~~~~~~ - -Bytes are used for serializing data, in order to check signatures and -compute hashes on them. They can also be used to incorporate data from -the wild and untyped outside world. - -- ``PACK``: Serializes a piece of data to its optimized - binary representation. - -:: - - :: 'a : 'S -> bytes : 'S - -- ``UNPACK 'a``: Deserializes a piece of data, if valid. - -:: - - :: bytes : 'S -> option 'a : 'S - -- ``CONCAT``: Byte sequence concatenation. - -:: - - :: bytes : bytes : 'S -> bytes : 'S - - > CONCAT / s : t : S => (s ^ t) : S - - :: bytes list : 'S -> bytes : 'S - - > CONCAT / {} : S => 0x : S - > CONCAT / { s ; } : S => (s ^ r) : S - where CONCAT / { } : S => r : S - -- ``SIZE``: size of a sequence of bytes. - -:: - - :: bytes : 'S -> nat : 'S - -- ``SLICE``: Bytes access. - -:: - - :: nat : nat : bytes : 'S -> option bytes : 'S - - > SLICE / offset : length : s : S => Some ss : S - where ss is the substring of s at the given offset and of the given length - iff offset and (offset + length) are in bounds - > SLICE / offset : length : s : S => None : S - iff offset or (offset + length) are out of bounds - -- ``COMPARE``: Lexicographic comparison. - -:: - - :: bytes : bytes : 'S -> int : 'S - - > COMPARE / s : t : S => -1 : S - iff s < t - > COMPARE / s : t : S => 0 : S - iff s = t - > COMPARE / s : t : S => 1 : S - iff s > t - - -Cryptographic primitives -~~~~~~~~~~~~~~~~~~~~~~~~ - -- ``HASH_KEY``: Compute the b58check of a public key. - -:: - - :: key : 'S -> key_hash : 'S - -- ``BLAKE2B``: Compute a cryptographic hash of the value contents using the - Blake2b-256 cryptographic hash function. - -:: - - :: bytes : 'S -> bytes : 'S - -- ``KECCAK``: Compute a cryptographic hash of the value contents using the - Keccak-256 cryptographic hash function. - -:: - - :: bytes : 'S -> bytes : 'S - -- ``SHA256``: Compute a cryptographic hash of the value contents using the - Sha256 cryptographic hash function. - -:: - - :: bytes : 'S -> bytes : 'S - -- ``SHA512``: Compute a cryptographic hash of the value contents using the - Sha512 cryptographic hash function. - -:: - - :: bytes : 'S -> bytes : 'S - -- ``SHA3``: Compute a cryptographic hash of the value contents using the - SHA3-256 cryptographic hash function. - -:: - - :: bytes : 'S -> bytes : 'S - -- ``CHECK_SIGNATURE``: Check that a sequence of bytes has been signed - with a given key. - -:: - - :: key : signature : bytes : 'S -> bool : 'S - -- ``COMPARE``: Key hash, key and signature comparison - -:: - - :: key_hash : key_hash : 'S -> int : 'S - :: key : key : 'S -> int : 'S - :: signature : signature : 'S -> int : 'S - - > COMPARE / x : y : S => -1 : S - iff x < y - > COMPARE / x : y : S => 0 : S - iff x = y - > COMPARE / x : y : S => 1 : S - iff x > y - -BLS12-381 primitives -~~~~~~~~~~~~~~~~~~~~~~~~ - -- ``NEG``: Negate a curve point or field element. - -:: - - :: bls12_381_g1 : 'S -> bls12_381_g1 : 'S - :: bls12_381_g2 : 'S -> bls12_381_g2 : 'S - :: bls12_381_fr : 'S -> bls12_381_fr : 'S - -- ``ADD``: Add two curve points or field elements. - -:: - - :: bls12_381_g1 : bls12_381_g1 : 'S -> bls12_381_g1 : 'S - :: bls12_381_g2 : bls12_381_g2 : 'S -> bls12_381_g2 : 'S - :: bls12_381_fr : bls12_381_fr : 'S -> bls12_381_fr : 'S - -- ``MUL``: Multiply a curve point or field element by a scalar field element. Fr - elements can be built from naturals by multiplying by the unit of Fr using ``PUSH bls12_381_fr 1; MUL``. Note - that the multiplication will be computed using the natural modulo the order - of Fr. - -:: - - :: bls12_381_g1 : bls12_381_fr : 'S -> bls12_381_g1 : 'S - :: bls12_381_g2 : bls12_381_fr : 'S -> bls12_381_g2 : 'S - :: bls12_381_fr : bls12_381_fr : 'S -> bls12_381_fr : 'S - :: nat : bls12_381_fr : 'S -> bls12_381_fr : 'S - :: int : bls12_381_fr : 'S -> bls12_381_fr : 'S - :: bls12_381_fr : nat : 'S -> bls12_381_fr : 'S - :: bls12_381_fr : int : 'S -> bls12_381_fr : 'S - -- ``INT``: Convert a field element to type ``int``. The returned value is always between ``0`` (inclusive) and the order of Fr (exclusive). - -:: - - :: bls12_381_fr : 'S -> int : 'S - -- ``PAIRING_CHECK``: - Verify that the product of pairings of the given list of points is equal to 1 in Fq12. Returns ``true`` if the list is empty. - Can be used to verify if two pairings P1 and P2 are equal by verifying P1 * P2^(-1) = 1. - -:: - - :: list (pair bls12_381_g1 bls12_381_g2) : 'S -> bool : 'S - - -Sapling operations -~~~~~~~~~~~~~~~~~~ - -**For security reasons the use of the type `sapling_transaction` and -instruction `SAPLING_VERIFY_UPDATE` are discouraged and are deprecated in -Protocol 13 which replaces them with a new encoding for the type and a new -signature for the instruction.** - -Please see the :doc:`Sapling integration` page for a more -comprehensive description of the Sapling protocol. - -- ``SAPLING_VERIFY_UPDATE``: verify and apply a transaction on a Sapling state. - -:: - - :: sapling_transaction ms : sapling_state ms : 'S -> option (pair int (sapling_state ms)): 'S - - > SAPLING_VERIFY_UPDATE / t : s : S => Some (Pair b s') : S - iff the transaction t successfully applied on state s resulting - in balance b and an updated state s' - > SAPLING_VERIFY_UPDATE / t : s : S => None : S - iff the transaction t is invalid with respect to the state - -- ``SAPLING_EMPTY_STATE ms``: Pushes an empty state on the stack. - - :: - - :: 'S -> sapling_state ms: 'S - - > SAPLING_EMPTY_STATE ms / S => sapling_state ms : S - with `sapling_state ms` being the empty state (ie. no one can spend tokens from it) - with memo_size `ms` - - -.. _MichelsonTickets: -.. _MichelsonTickets_ithaca: - -Operations on tickets -~~~~~~~~~~~~~~~~~~~~~ - -The following operations deal with tickets. Tickets are a way for smart-contracts -to authenticate data with respect to a Tezos address. This authentication can -then be used to build composable permission systems. - -A contract can create a ticket from a value and an amount. The ticket, when -inspected reveals the value, the amount, and the address of the ticketer (the contract that created the ticket). It is -impossible for a contract to “forge” a ticket that appears to have been created -by another ticketer. - -The amount is a meta-data that can be used to implement UTXOs. - -Tickets cannot be duplicated using the ``DUP`` instruction. - -For example, a ticket could represent a Non Fungible Token (NFT) or a Unspent -Transaction Output (UTXO) which can then be passed around and behave like a value. -This process can happen without the need to interact with a centralized NFT contract, -simplifying the code. - -- ``TICKET``: Create a ticket with the given content and amount. The ticketer is the address - of `SELF`. - -:: - - :: 'a : nat : 'S -> ticket 'a : 'S - -Type ``'a`` must be comparable (the ``COMPARE`` primitive must be defined over it). - -- ``READ_TICKET``: Retrieve the information stored in a ticket. Also return the ticket. - -:: - - :: ticket 'a : 'S -> pair address 'a nat : ticket 'a : 'S - -- ``SPLIT_TICKET``: Delete the given ticket and create two tickets with the - same content and ticketer as the original, but with the new provided amounts. - (This can be used to easily implement UTXOs.) - Return None iff the ticket's original amount is not equal to the sum of the - provided amounts. - -:: - - :: ticket 'a : (pair nat nat) : 'S -> - option (pair (ticket 'a) (ticket 'a)) : 'S - -- ``JOIN_TICKETS``: The inverse of ``SPLIT_TICKET``. Delete the given tickets and create a ticket with an amount equal to the - sum of the amounts of the input tickets. - (This can be used to consolidate UTXOs.) - Return None iff the input tickets have a different ticketer or content. - -:: - - :: (pair (ticket 'a) (ticket 'a)) : 'S -> - option (ticket 'a) : 'S - -Operations on timelock -~~~~~~~~~~~~~~~~~~~~~~ - -- ``OPEN_CHEST``: opens a timelocked chest given its key and the time. The results can be bytes - if the opening is correct, or a boolean indicating whether the chest was incorrect, - or its opening was. See :doc:`Timelock ` for more information. - -:: - - :: chest_key : chest : nat : 'S -> or bytes bool : 'S - - - -Removed instructions -~~~~~~~~~~~~~~~~~~~~ - -:doc:`../protocols/005_babylon` deprecated the following instructions. Because no smart -contract used these on Mainnet before they got deprecated, they have been -removed. The Michelson type-checker will reject any contract using them. - -- ``CREATE_CONTRACT { storage 'g ; parameter 'p ; code ... }``: - Forge a new contract from a literal. - -:: - - :: key_hash : option key_hash : bool : bool : mutez : 'g : 'S - -> operation : address : 'S - -See the documentation of the new ``CREATE_CONTRACT`` instruction. The -first, third, and fourth parameters are ignored. - -- ``CREATE_ACCOUNT``: Forge an account creation operation. - -:: - - :: key_hash : option key_hash : bool : mutez : 'S - -> operation : address : 'S - -Takes as argument the manager, optional delegate, the delegatable flag -and finally the initial amount taken from the currently executed -contract. This instruction originates a contract with two entrypoints; -``%default`` of type ``unit`` that does nothing and ``%do`` of type -``lambda unit (list operation)`` that executes and returns the -parameter if the sender is the contract's manager. - -- ``STEPS_TO_QUOTA``: Push the remaining steps before the contract - execution must terminate. - -:: - - :: 'S -> nat : 'S - -.. _MichelsonViews: -.. _MichelsonViews_ithaca: - -Operations on views -~~~~~~~~~~~~~~~~~~~~ - -Views are a mechanism for contract calls that: - -- are read-only: they may depend on the storage of the contract declaring the view but cannot modify it nor emit operations (but they can call other views), -- take arguments as input in addition to the contract storage, -- return results as output, -- are synchronous: the result is immediately available on the stack of the caller contract. - -In other words, the execution of a view is included in the operation of caller's contract, but accesses the storage of the declarer's contract, in read-only mode. -Thus, in terms of execution, views are more like lambda functions rather than contract entrypoints, -Here is an example: - -:: - - code { - ...; - TRANSFER_TOKENS; - ...; - VIEW "view_ex" unit; - ...; - }; - -This contract calls a contract ``TRANSFER_TOKENS``, and, later on, a view called "view_ex". -No matter if the callee "view_ex" is defined in the same contract with this caller contract or not, -this view will be executed immediately in the current operation, -while the operations emitted by ``TRANSFER_TOKENS`` will be executed later on. -As a result, although it may seem that "view_ex" receives the storage modified by ``TRANSFER_TOKENS``, -this is not the case. -In other words, the storage of the view is the same as when the current contract was called. -In particular, in case of re-entrance, i.e., if a contract A calls a contract B that calls a view on A, the storage of the view will be the same as when B started, not when A started. - -Views are **declared** at the toplevel of the script of the contract on which they operate, -alongside the contract parameter type, storage type, and code. -To declare a view, the ``view`` keyword is used; its syntax is -``view name 'arg 'return { instr; ... }`` where: - -- ``name`` is a string of at most 31 characters matching the regular expression ``[a-zA-Z0-9_.%@]*``; it is used to identify the view, hence it must be different from the names of the other views declared in the same script; -- ``'arg`` is the type of the argument of the view; -- ``'return`` is the type of the result returned by the view; -- ``{ instr; ... }`` is a sequence of instructions of type ``lambda (pair 'arg 'storage_ty) 'return`` where ``'storage_ty`` is the type of the storage of the current contract. Certain specific instructions have different semantics in ``view``: ``BALANCE`` represents the current amount of mutez held by the contract where ``view`` is; ``SENDER`` represents the contract which is the caller of ``view``; ``SELF_ADDRESS`` represents the contract where ``view`` is; ``AMOUNT`` is always 0 mutez. - -Note that in both view input (type ``'arg``) and view output (type ``'return``), the following types are forbidden: ``ticket``, ``operation``, ``big_map`` and ``sapling_state``. - -Views are **called** using the following Michelson instruction: - -- ``VIEW name 'return``: Call the view named ``name`` from the contract whose address is the second element of the stack, sending it as input the top element of the stack. - -:: - - :: 'arg : address : 'S -> option 'return : 'S - - > VIEW name 'return / x : addr : S => Some y : S - iff addr is the address of a smart contract c with storage s - where c has a toplevel declaration of the form "view name 'arg 'return { code }" - and code / Pair x s : [] => y : [] - - > VIEW name 'return / _ : _ : S => None : S - otherwise - - - -If the given address is nonexistent or if the contract at that address does not have a view of the expected name and type, -``None`` will be returned. -Otherwise, ``Some a`` will be returned where ``a`` is the result of the view call. -Note that if a contract address containing an entrypoint ``address%entrypoint`` is provided, -only the ``address`` part will be taken. -``operation``, ``big_map`` and ``sapling_state`` and ``ticket`` types are forbidden for the ``'return`` type. - - -Here is an example using views, consisting of two contracts. -The first contract defines two views at toplevel that are named ``add_v`` and ``mul_v``. - -:: - - { parameter nat; - storage nat; - code { CAR; NIL operation ; PAIR }; - view "add_v" nat nat { UNPAIR; ADD }; - view "mul_v" nat nat { UNPAIR; MUL }; - } - - -The second contract calls the ``add_v`` view of the above contract and obtains a result immediately. - -:: - - { parameter (pair nat address) ; - storage nat ; - code { CAR ; UNPAIR; VIEW "add_v" nat ; - IF_SOME { } { FAIL }; NIL operation; PAIR }; } - -Macros ------- - -In addition to the operations above, several extensions have been added -to the language's concrete syntax. If you are interacting with the node -via RPC, bypassing the client, which expands away these macros, you will -need to desugar them yourself. - -These macros are designed to be unambiguous and reversible, meaning that -errors are reported in terms of desugared syntax. Below you'll see -these macros defined in terms of other syntactic forms. That is how -these macros are seen by the node. - -Compare -~~~~~~~ - -Syntactic sugar exists for merging ``COMPARE`` and comparison -combinators, and also for branching. - -- ``CMP{EQ|NEQ|LT|GT|LE|GE}`` - -:: - - > CMP(\op) / S => COMPARE ; (\op) / S - -- ``IF{EQ|NEQ|LT|GT|LE|GE} bt bf`` - -:: - - > IF(\op) bt bf / S => (\op) ; IF bt bf / S - -- ``IFCMP{EQ|NEQ|LT|GT|LE|GE} bt bf`` - -:: - - > IFCMP(\op) / S => COMPARE ; (\op) ; IF bt bf / S - -Fail -~~~~ - -The ``FAIL`` macros is equivalent to ``UNIT; FAILWITH`` and is callable -in any context since it does not use its input stack. - -- ``FAIL`` - -:: - - > FAIL / S => UNIT; FAILWITH / S - -Assertion macros -~~~~~~~~~~~~~~~~ - -All assertion operations are syntactic sugar for conditionals with a -``FAIL`` instruction in the appropriate branch. When possible, use them -to increase clarity about illegal states. - -- ``ASSERT`` - -:: - - > ASSERT => IF {} {FAIL} - -- ``ASSERT_{EQ|NEQ|LT|LE|GT|GE}`` - -:: - - > ASSERT_(\op) => IF(\op) {} {FAIL} - -- ``ASSERT_CMP{EQ|NEQ|LT|LE|GT|GE}`` - -:: - - > ASSERT_CMP(\op) => IFCMP(\op) {} {FAIL} - -- ``ASSERT_NONE`` - -:: - - > ASSERT_NONE => IF_NONE {} {FAIL} - -- ``ASSERT_SOME`` - -:: - - > ASSERT_SOME @x => IF_NONE {FAIL} {RENAME @x} - -- ``ASSERT_LEFT`` - -:: - - > ASSERT_LEFT @x => IF_LEFT {RENAME @x} {FAIL} - -- ``ASSERT_RIGHT`` - -:: - - > ASSERT_RIGHT @x => IF_LEFT {FAIL} {RENAME @x} - -Syntactic Conveniences -~~~~~~~~~~~~~~~~~~~~~~ - -These macros are simply more convenient syntax for various common -operations. - -- ``P(\left=A|P(\left)(\right))(\right=I|P(\left)(\right))R``: A syntactic sugar - for building nested pairs. In the case of right combs, `PAIR n` is more efficient. - -:: - - > PA(\right)R / S => DIP ((\right)R) ; PAIR / S - > P(\left)IR / S => (\left)R ; PAIR / S - > P(\left)(\right)R => (\left)R ; DIP ((\right)R) ; PAIR / S - -A good way to quickly figure which macro to use is to mentally parse the -macro as ``P`` for pair constructor, ``A`` for left leaf and ``I`` for -right leaf. The macro takes as many elements on the stack as there are -leaves and constructs a nested pair with the shape given by its name. - -Take the macro ``PAPPAIIR`` for instance: - -:: - - P A P P A I I R - ( l, ( ( l, r ), r )) - -A typing rule can be inferred: - -:: - - PAPPAIIR - :: 'a : 'b : 'c : 'd : 'S -> (pair 'a (pair (pair 'b 'c) 'd)) - -- ``UNP(\left=A|P(\left)(\right))(\right=I|P(\left)(\right))R``: A syntactic sugar - for destructing nested pairs. These macros follow the same convention - as the previous one. - -:: - - > UNPA(\right)R / S => UNPAIR ; DIP (UN(\right)R) / S - > UNP(\left)IR / S => UNPAIR ; UN(\left)R / S - > UNP(\left)(\right)R => UNPAIR ; DIP (UN(\right)R) ; UN(\left)R / S - -- ``C[AD]+R``: A syntactic sugar for accessing fields in nested pairs. In the case of right combs, ``CAR k`` and ``CDR k`` are more efficient. - -:: - - > CA(\rest=[AD]+)R / S => CAR ; C(\rest)R / S - > CD(\rest=[AD]+)R / S => CDR ; C(\rest)R / S - -- ``CAR k``: Access the ``k`` -th part of a right comb of size ``n > k + 1``. ``CAR 0`` is equivalent to ``CAR`` and in general ``CAR k`` is equivalent to ``k`` times the ``CDR`` instruction followed by once the ``CAR`` instruction. Note that this instruction cannot access the last element of a right comb; ``CDR k`` should be used for that. - -:: - - > CAR n / S => GET (2n+1) / S - -- ``CDR k``: Access the rightmost element of a right comb of size ``k``. ``CDR 0`` is a no-op, ``CDR 1`` is equivalent to ``CDR`` and in general ``CDR k`` is equivalent to ``k`` times the ``CDR`` instruction. Note that on a right comb of size ``n > k >= 2``, ``CDR k`` will return the right comb composed of the same elements but the ``k`` leftmost ones. - -:: - - > CDR n / S => GET (2n) / S - -- ``IF_SOME bt bf``: Inspect an optional value. - -:: - - > IF_SOME bt bf / S => IF_NONE bf bt / S - -- ``IF_RIGHT bt bf``: Inspect a value of a union. - -:: - - > IF_RIGHT bt bf / S => IF_LEFT bf bt / S - -- ``SET_CAR``: Set the left field of a pair. This is equivalent to ``SWAP; UPDATE 1``. - -:: - - > SET_CAR => CDR ; SWAP ; PAIR - -- ``SET_CDR``: Set the right field of a pair. This is equivalent to ``SWAP; UPDATE 2``. - -:: - - > SET_CDR => CAR ; PAIR - -- ``SET_C[AD]+R``: A syntactic sugar for setting fields in nested - pairs. In the case of right combs, `UPDATE n` is more efficient. - -:: - - > SET_CA(\rest=[AD]+)R / S => - { DUP ; DIP { CAR ; SET_C(\rest)R } ; CDR ; SWAP ; PAIR } / S - > SET_CD(\rest=[AD]+)R / S => - { DUP ; DIP { CDR ; SET_C(\rest)R } ; CAR ; PAIR } / S - -- ``MAP_CAR`` code: Transform the left field of a pair. - -:: - - > MAP_CAR code => DUP ; CDR ; DIP { CAR ; code } ; SWAP ; PAIR - -- ``MAP_CDR`` code: Transform the right field of a pair. - -:: - - > MAP_CDR code => DUP ; CDR ; code ; SWAP ; CAR ; PAIR - -- ``MAP_C[AD]+R`` code: A syntactic sugar for transforming fields in - nested pairs. - -:: - - > MAP_CA(\rest=[AD]+)R code / S => - { DUP ; DIP { CAR ; MAP_C(\rest)R code } ; CDR ; SWAP ; PAIR } / S - > MAP_CD(\rest=[AD]+)R code / S => - { DUP ; DIP { CDR ; MAP_C(\rest)R code } ; CAR ; PAIR } / S - -Concrete syntax ---------------- -.. _ConcreteSyntax: -.. _ConcreteSyntax_ithaca: - -The concrete language is very close to the formal notation of the -specification. Its structure is extremely simple: an expression in the -language can only be one of the five following constructs. - -1. An integer in decimal notation. -2. A character string. -3. A byte sequence in hexadecimal notation prefixed by ``0x``. -4. The application of a primitive to a sequence of expressions. -5. A sequence of expressions. - -This simple five cases notation is called :doc:`../shell/micheline`. - -In the Tezos protocol, the primitive ``constant`` with a single -character string applied has special meaning. See -:doc:`global_constants`. - -Constants -~~~~~~~~~ - -There are three kinds of constants: - -1. Integers or naturals in decimal notation. -2. Strings, with some usual escape sequences: ``\n``, ``\\``, - ``\"``. Unescaped line-breaks (both ``\n`` and ``\r``) cannot - appear in a Michelson string. Moreover, the current version of - Michelson restricts strings to be the printable subset of 7-bit - ASCII, namely characters with codes from within `[32, 126]` range, - plus the escaped characters mentioned above. -3. Byte sequences in hexadecimal notation, prefixed with ``0x``. - -Differences with the formal notation -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The concrete syntax follows the same lexical conventions as the -specification: instructions are represented by uppercase identifiers, -type constructors by lowercase identifiers, and constant constructors -are capitalized. - -All domain specific constants are Micheline constants with specific -formats. Some have two variants accepted by the data type checker: a -readable one in a string and an optimized. - -- ``mutez`` amounts are written as naturals. -- ``timestamp``\ s are written either using ``RFC3339`` notation - in a string (readable), or as the number of seconds since Epoch - in a natural (optimized). -- ``contract``\ s, ``address``\ es, ``key``\ s and ``signature``\ s - are written as strings, in their usual Base58 encoded versions - (readable), or as their raw bytes (optimized). -- ``bls12_381_g1``\ s and ``bls12_381_g2``\ s are written as their raw bytes, using a big-endian point encoding, `as specified here `__. -- ``bls12_381_fr``\ s are written as their raw bytes, using a little-endian encoding. - -The optimized versions should not reach the RPCs, the protocol code -will convert to optimized by itself when forging operations, storing -to the database, and before hashing to get a canonical representation -of a datum for a given type. - -To prevent errors, control flow primitives that take instructions as -parameters require sequences in the concrete syntax. - -:: - - IF { instr1_true ; instr2_true ; ... } - { instr1_false ; instr2_false ; ... } - -Main program structure -~~~~~~~~~~~~~~~~~~~~~~ - -The toplevel of a smart contract file must be an un-delimited sequence -of three primitive applications (in no particular order) that provide its -``code``, ``parameter`` and ``storage`` fields. - -See the next section for a concrete example. - -Annotations ------------ - -The annotation mechanism of Michelson provides ways to better track -data on the stack and to give additional type constraints. Except for -a single exception specified just after, annotations are only here to -add constraints, *i.e.* they cannot turn an otherwise rejected program -into an accepted one. The notable exception to this rule is for -entrypoints: the semantics of the `CONTRACT` and `SELF` instructions vary depending on -their constructor annotations, and some contract origination may fail due -to invalid entrypoint constructor annotations. - -Stack visualization tools like the Michelson's Emacs mode print -annotations associated with each type in the program, as propagated by -the typechecker as well as variable annotations on the types of elements -in the stack. This is useful as a debugging aid. - -We distinguish three kinds of annotations: - -- type annotations, written ``:type_annot``, -- variable annotations, written ``@var_annot``, -- and field or constructors annotations, written ``%field_annot``. - -Type annotations -~~~~~~~~~~~~~~~~ - -Each type can be annotated with at most one type annotation. They are -used to give names to types. For types to be equal, their unnamed -version must be equal and their names must be the same or at least one -type must be unnamed. - -For instance, the following Michelson program which put its integer -parameter in the storage is not well typed: - -.. code-block:: michelson - - parameter (int :p) ; - storage (int :s) ; - code { UNPAIR ; SWAP ; DROP ; NIL operation ; PAIR } - -Whereas this one is: - -.. code-block:: michelson - - parameter (int :p) ; - storage int ; - code { UNPAIR ; SWAP ; DROP ; NIL operation ; PAIR } - -Inner components of composed typed can also be named. - -:: - - (pair :point (int :x_pos) (int :y_pos)) - -Push-like instructions, that act as constructors, can also be given a -type annotation. The stack type will then have on top a type with a corresponding name. - -:: - - UNIT :t - :: 'A -> (unit :t) : 'A - - PAIR :t - :: 'a : 'b : 'S -> (pair :t 'a 'b) : 'S - - SOME :t - :: 'a : 'S -> (option :t 'a) : 'S - - NONE :t 'a - :: 'S -> (option :t 'a) : 'S - - LEFT :t 'b - :: 'a : 'S -> (or :t 'a 'b) : 'S - - RIGHT :t 'a - :: 'b : 'S -> (or :t 'a 'b) : 'S - - NIL :t 'a - :: 'S -> (list :t 'a) : 'S - - EMPTY_SET :t 'elt - :: 'S -> (set :t 'elt) : 'S - - EMPTY_MAP :t 'key 'val - :: 'S -> (map :t 'key 'val) : 'S - - EMPTY_BIG_MAP :t 'key 'val - :: 'S -> (big_map :t 'key 'val) : 'S - - -A no-op instruction ``CAST`` ensures the top of the stack has the -specified type, and change its type if it is compatible. In particular, -this allows to change or remove type names explicitly. - -:: - - CAST 'b - :: 'a : 'S -> 'b : 'S - iff 'a = 'b - - > CAST t / a : S => a : S - - -Variable annotations -~~~~~~~~~~~~~~~~~~~~ - -Variable annotations can only be used on instructions that produce -elements on the stack. An instruction that produces ``n`` elements on -the stack can be given at most ``n`` variable annotations. - -The stack type contains both the types of each element in the stack, as -well as an optional variable annotation for each element. In this -sub-section we note: - -- ``[]`` for the empty stack, -- ``@annot (top) : (rest)`` for the stack whose first value has type ``(top)`` and is annotated with variable annotation ``@annot`` and whose queue has stack type ``(rest)``. - -The instructions which do not accept any variable annotations are: - -:: - - DROP - SWAP - DIG - DUG - IF_NONE - IF_LEFT - IF_CONS - ITER - IF - LOOP - LOOP_LEFT - DIP - FAILWITH - -The instructions which accept at most one variable annotation are: - -:: - - DUP - PUSH - UNIT - SOME - NONE - PAIR - CAR - CDR - LEFT - RIGHT - NIL - CONS - SIZE - MAP - MEM - EMPTY_SET - EMPTY_MAP - EMPTY_BIG_MAP - UPDATE - GET - LAMBDA - EXEC - ADD - SUB - CONCAT - MUL - OR - AND - XOR - NOT - ABS - ISNAT - INT - NEG - EDIV - LSL - LSR - COMPARE - EQ - NEQ - LT - GT - LE - GE - ADDRESS - CONTRACT - SET_DELEGATE - IMPLICIT_ACCOUNT - NOW - LEVEL - AMOUNT - BALANCE - HASH_KEY - CHECK_SIGNATURE - BLAKE2B - SOURCE - SENDER - SELF - SELF_ADDRESS - CAST - RENAME - CHAIN_ID - -The instructions which accept at most two variable annotations are: - -:: - - UNPAIR - CREATE_CONTRACT - -Annotations on instructions that produce multiple elements on the stack -will be used in order, where the first variable annotation is given to -the top-most element on the resulting stack. Instructions that produce -``n`` elements on the stack but are given less than ``n`` variable -annotations will see only their top-most stack type elements annotated. - -:: - - UNPAIR @fist @second - :: pair 'a 'b : 'S - -> @first 'a : @second 'b : 'S - - UNPAIR @first - :: pair 'a 'b : 'S - -> @first 'a : 'b : 'S - -A no-op instruction ``RENAME`` allows to rename variables in the stack -or to erase variable annotations in the stack. - -:: - - RENAME @new - :: @old 'a ; 'S -> @new 'a : 'S - - RENAME - :: @old 'a ; 'S -> 'a : 'S - - -Field and constructor annotations -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Components of pair types, option types and or types can be annotated -with a field or constructor annotation. This feature is useful to encode -records fields and constructors of sum types. - -:: - - (pair :point - (int %x) - (int %y)) - -The previous Michelson type can be used as visual aid to represent the -record type (given in OCaml-like syntax): - -:: - - type point = { x : int ; y : int } - -Similarly, - -:: - - (or :t - (int %A) - (or - (bool %B) - (pair %C - (nat %n1) - (nat %n2)))) - -can be used to represent the algebraic data type (in OCaml-like syntax): - -:: - - type t = - | A of int - | B of bool - | C of { n1 : nat ; n2 : nat } - - -Field annotations are part of the type (at the same level as type name -annotations), and so types with differing field names (if present) are -not considered equal. - -Instructions that construct elements of composed types can also be -annotated with one or multiple field annotations (in addition to type -and variable annotations). - -:: - - PAIR %fst %snd - :: 'a : 'b : 'S -> (pair ('a %fst) ('b %snd)) : 'S - - LEFT %left %right 'b - :: 'a : 'S -> (or ('a %left) ('b %right)) : 'S - - RIGHT %left %right 'a - :: 'b : 'S -> (or ('a %left) ('b %right)) : 'S - -To improve readability and robustness, instructions ``CAR`` and ``CDR`` -accept one field annotation. For the contract to type check, the name of -the accessed field in the destructed pair must match the one given here. - -:: - - CAR %fst - :: (pair ('a %fst) 'b) : S -> 'a : 'S - - CDR %snd - :: (pair 'a ('b %snd)) : S -> 'b : 'S - - -Syntax -~~~~~~ - -Primitive applications can receive one or many annotations. - -An annotation is a sequence of characters that matches the regular -expression ``@%|@%%|%@|[@:%][_0-9a-zA-Z][_0-9a-zA-Z\.%@]*``. -Note however that ``@%``, ``@%%`` and ``%@`` are -:ref:`special annotations ` and are not allowed everywhere. - -Annotations come after the primitive name and before its potential arguments. - -:: - - (prim @v :t %x arg1 arg2 ...) - - -Ordering between different kinds of annotations is not significant, but -ordering among annotations of the same kind is. Annotations of the same -kind must be grouped together. - -For instance these two annotated instructions are equivalent: - -:: - - PAIR :t @my_pair %x %y - - PAIR %x %y :t @my_pair - -An annotation can be empty, in this case it will mean *no annotation* -and can be used as a wildcard. For instance, it is useful to annotate -only the right field of a pair instruction ``PAIR % %right`` or to -ignore field access constraints, *e.g.* in the macro ``UNPPAIPAIR %x1 % -%x3 %x4``. - -Annotations and macros -~~~~~~~~~~~~~~~~~~~~~~ - -Macros also support annotations, which are propagated on their expanded -forms. As with instructions, macros that produce ``n`` values on the -stack accept ``n`` variable annotations. - -:: - - DUU+P @annot - > DUU(\rest=U*)P @annot / S => DIP (DU(\rest)P @annot) ; SWAP / S - - C[AD]+R @annot %field_name - > CA(\rest=[AD]+)R @annot %field_name / S => CAR ; C(\rest)R @annot %field_name / S - > CD(\rest=[AD]+)R @annot %field_name / S => CDR ; C(\rest)R @annot %field_name / S - - CMP{EQ|NEQ|LT|GT|LE|GE} @annot - > CMP(\op) @annot / S => COMPARE ; (\op) @annot / S - -The variable annotation on ``SET_C[AD]+R`` and ``MAP_C[AD]+R`` annotates -the resulting toplevel pair while its field annotation is used to check -that the modified field is the expected one. - -:: - - SET_C[AD]+R @var %field - > SET_CAR @var %field => CDR %field ; SWAP ; PAIR @var - > SET_CDR @var %field => CAR %field ; PAIR @var - > SET_CA(\rest=[AD]+)R @var %field / S => - { DUP ; DIP { CAR ; SET_C(\rest)R %field } ; CDR ; SWAP ; PAIR @var } / S - > SET_CD(\rest=[AD]+)R @var %field/ S => - { DUP ; DIP { CDR ; SET_C(\rest)R %field } ; CAR ; PAIR @var } / S - - MAP_C[AD]+R @var %field code - > MAP_CAR code => DUP ; CDR ; DIP { CAR %field ; code } ; SWAP ; PAIR @var - > MAP_CDR code => DUP ; CDR %field ; code ; SWAP ; CAR ; PAIR @var - > MAP_CA(\rest=[AD]+)R @var %field code / S => - { DUP ; DIP { CAR ; MAP_C(\rest)R %field code } ; CDR ; SWAP ; PAIR @var} / S - > MAP_CD(\rest=[AD]+)R @var %field code / S => - { DUP ; DIP { CDR ; MAP_C(\rest)R %field code } ; CAR ; PAIR @var} / S - -Macros for nested ``PAIR`` accept multiple annotations. Field -annotations for ``PAIR`` give names to leaves of the constructed -nested pair, in order. This next snippet gives examples instead of -generic rewrite rules for readability purposes. - -:: - - PAPPAIIR @p %x1 %x2 %x3 %x4 - :: 'a : 'b : 'c : 'd : 'S - -> @p (pair ('a %x1) (pair (pair ('b %x) ('c %x3)) ('d %x4))) : 'S - - PAPAIR @p %x1 %x2 %x3 - :: 'a : 'b : 'c : 'S -> @p (pair ('a %x1) (pair ('b %x) ('c %x3))) : 'S - -Annotations for nested ``UNPAIR`` are deprecated. - -Automatic variable and field annotations inferring -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -When no annotation is provided by the Michelson programmer, the -typechecker infers some annotations in specific cases. This greatly -helps users track information in the stack for bare contracts. - -For unannotated accesses with ``CAR`` and ``CDR`` to fields that are -named will be appended (with an additional ``.`` character) to the pair -variable annotation. - -:: - - CDAR - :: @p (pair ('a %foo) (pair %bar ('b %x) ('c %y))) : 'S -> @p.bar.x 'b : 'S - -If fields are not named but the pair is still named in the stack then -``.car`` or ``.cdr`` will be appended. - -:: - - CDAR - :: @p (pair 'a (pair 'b 'c)) : 'S -> @p.cdr.car 'b : 'S - -If the original pair is not named in the stack, but a field annotation -is present in the pair type the accessed value will be annotated with a -variable annotation corresponding to the field annotation alone. - -:: - - CDAR - :: (pair ('a %foo) (pair %bar ('b %x) ('c %y))) : 'S -> @bar.x 'b : 'S - -A similar mechanism is used for context dependent instructions: - -:: - - ADDRESS :: @c contract _ : 'S -> @c.address address : 'S - - CONTRACT 'p :: @a address : 'S -> @a.contract contract 'p : 'S - - BALANCE :: 'S -> @balance mutez : 'S - - SOURCE :: 'S -> @source address : 'S - - SENDER :: 'S -> @sender address : 'S - - SELF :: 'S -> @self contract 'p : 'S - - SELF_ADDRESS :: 'S -> @self address : 'S - - AMOUNT :: 'S -> @amount mutez : 'S - - NOW :: 'S -> @now timestamp : 'S - - LEVEL :: 'S -> @level nat : 'S - -Inside nested code blocks, bound items on the stack will be given a -default variable name annotation depending on the instruction and stack -type (which can be changed). For instance the annotated typing rule for -``ITER`` on lists is: - -:: - - ITER body - :: @l (list 'e) : 'A -> 'A - iff body :: [ @l.elt e' : 'A -> 'A ] - -Special annotations -~~~~~~~~~~~~~~~~~~~ -.. _SpecialAnnotations: -.. _SpecialAnnotations_ithaca: - -The special variable annotations ``@%`` and ``@%%`` can be used on instructions -``CAR``, ``CDR``, and ``UNPAIR``. It means to use the accessed field name (if any) as -a name for the value on the stack. The following typing rule -demonstrates their use for instruction ``CAR``. - -:: - - CAR @% - :: @p (pair ('a %fst) ('b %snd)) : 'S -> @fst 'a : 'S - - CAR @%% - :: @p (pair ('a %fst) ('b %snd)) : 'S -> @p.fst 'a : 'S - -The special field annotation ``%@`` can be used on instructions -``PAIR``, ``LEFT`` and ``RIGHT``. It means to use the variable -name annotation in the stack as a field name for the constructed -element. Two examples with ``PAIR`` follows, notice the special -treatment of annotations with ``.``. - -:: - - PAIR %@ %@ - :: @x 'a : @y 'b : 'S -> (pair ('a %x) ('b %y)) : 'S - - PAIR %@ %@ - :: @p.x 'a : @p.y 'b : 'S -> @p (pair ('a %x) ('b %y)) : 'S - :: @p.x 'a : @q.y 'b : 'S -> (pair ('a %x) ('b %y)) : 'S - -Entrypoints ------------ - -The specification up to this point has been mostly ignoring existence -of entrypoints: a mechanism of contract level polymorphism. This -mechanism is optional, non intrusive, and transparent to smart -contracts that don't use them. This section is to be read as a patch -over the rest of the specification, introducing rules that apply only -in presence of contracts that make use of entrypoints. - -Defining and calling entrypoints -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Entrypoints piggyback on the constructor annotations. A contract with -entrypoints is basically a contract that takes a disjunctive type (a -nesting of ``or`` types) as the root of its input parameter, decorated -with constructor annotations. An extra check is performed on these -constructor annotations: a contract cannot define two entrypoints with -the same name. - -An external transaction can include an entrypoint name alongside the -parameter value. In that case, if there is a constructor annotation -with this name at any position in the nesting of ``or`` types, the -value is automatically wrapped into the according constructors. If the -transaction specifies an entrypoint, but there is no such constructor -annotation, the transaction fails. - -For instance, suppose the following input type. - -``parameter (or (or (nat %A) (bool %B)) (or %maybe_C (unit %Z) (string %C)))`` - -The input values will be wrapped as in the following examples. - -:: - - +------------+-----------+---------------------------------+ - | entrypoint | input | wrapped input | - +------------+-----------+---------------------------------+ - | %A | 3 | Left (Left 3) | - | %B | False | Left (Right False) | - | %C | "bob" | Right (Right "bob") | - | %Z | Unit | Right (Left Unit) | - | %maybe_C | Right "x" | Right (Right "x") | - | %maybe_C | Left Unit | Right (Left Unit) | - +------------+-----------+---------------------------------+ - | not given | value | value (untouched) | - | %BAD | _ | failure, contract not called | - +------------+-----------+---------------------------------+ - -The ``default`` entrypoint -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -A special semantics is assigned to the ``default`` entrypoint. If the -contract does not explicitly declare a ``default`` entrypoint, then it -is automatically assigned to the root of the parameter -type. Conversely, if the contract is called without specifying an -entrypoint, then it is assumed to be called with the ``default`` -entrypoint. This behaviour makes the entrypoint system completely -transparent to contracts that do not use it. - -This is the case for the previous example, for instance. If a value is -passed to such a contract specifying entrypoint ``default``, then the -value is fed to the contract untouched, exactly as if no entrypoint -was given. - -A non enforced convention is to make the entrypoint ``default`` of -type unit, and to implement the crediting operation (just receive the -transferred tokens). - -A consequence of this semantics is that if the contract uses the -entrypoint system and defines a ``default`` entrypoint somewhere else -than at the root of the parameter type, then it must provide an -entrypoint for all the paths in the toplevel disjunction. Otherwise, -some parts of the contracts would be dead code. - -Another consequence of setting the entrypoint somewhere else than at -the root is that it makes it impossible to send the raw values of the -full parameter type to a contract. A trivial solution for that is to -name the root of the type. The conventional name for that is ``root``. - -Let us recapitulate this by tweaking the names of the previous example. - -``parameter %root (or (or (nat %A) (bool %B)) (or (unit %default) string))`` - -The input values will be wrapped as in the following examples. - -:: - - +------------+---------------------+-----------------------+ - | entrypoint | input | wrapped input | - +------------+---------------------+-----------------------+ - | %A | 3 | Left (Left 3) | - | %B | False | Left (Right False) | - | %default | Unit | Right (Left Unit) | - | %root | Right (Right "bob") | Right (Right "bob") | - +------------+---------------------+-----------------------+ - | not given | Unit | Right (Left Unit) | - | %BAD | _ | failure, contract not | - +------------+---------------------+-----------------------+ - -Calling entrypoints from Michelson -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Michelson code can also produce transactions to a specific entrypoint. - -For this, both types ``address`` and ``contract`` have the ability to -denote not just an address, but a pair of an address and an -entrypoint. The concrete notation is ``"address%entrypoint"``. -Note that ``"address"`` is strictly equivalent to ``"address%default"``, -and for clarity, the second variant is forbidden in the concrete syntax. - -When the ``TRANSFER_TOKENS`` instruction is called, it places the -entrypoint provided in the contract handle in the transaction. - -The ``CONTRACT t`` instruction has a variant ``CONTRACT %entrypoint -t``, that works as follows. Note that ``CONTRACT t`` is strictly -equivalent to ``CONTRACT %default t``, and for clarity, the second -variant is forbidden in the concrete syntax. - -:: - - +---------------+---------------------+------------------------------------------+ - | input address | instruction | output contract | - +---------------+---------------------+------------------------------------------+ - | "addr" | CONTRACT t | (Some "addr") if contract exists, has a | - | | | default entrypoint of type t, or has no | - | | | default entrypoint and parameter type t | - +---------------+---------------------+------------------------------------------+ - | "addr%name" | CONTRACT t | (Some "addr%name") if addr exists and | - +---------------+---------------------+ has an entrypoint %name of type t | - | "addr" | CONTRACT %name t | | - +---------------+---------------------+------------------------------------------+ - | "addr%_" | CONTRACT %_ t | None | - +---------------+---------------------+------------------------------------------+ - -Similarly, the ``SELF`` instruction has a variant ``SELF %entrypoint``, -that is only well-typed if the current contract has an entrypoint named ``%entrypoint``. - -- ``SELF %entrypoint`` - -:: - - :: 'S -> contract 'p : 'S - where contract 'p is the type of the entrypoint %entrypoint of the current contract - -Implicit accounts are considered to have a single ``default`` -entrypoint of type ``Unit``. - -JSON syntax ------------ - -Micheline expressions are encoded in JSON like this: - -- An integer ``N`` is an object with a single field ``"int"`` whose - value is the decimal representation as a string. - - ``{ "int": "N" }`` - -- A string ``"contents"`` is an object with a single field ``"string"`` - whose value is the decimal representation as a string. - - ``{ "string": "contents" }`` - -- A sequence is a JSON array. - - ``[ expr, ... ]`` - -- A primitive application is an object with two fields ``"prim"`` for - the primitive name and ``"args"`` for the arguments (that must - contain an array). A third optional field ``"annots"`` contains a - list of annotations, including their leading ``@``, ``%`` or ``:`` - sign. - - ``{ "prim": "pair", "args": [ { "prim": "nat", "args": [] }, { "prim": "nat", "args": [] } ], "annots": [":t"] }`` - -As in the concrete syntax, all domain specific constants are encoded as -strings. - -Examples ---------- - -Contracts in the system are stored as a piece of code and a global data -storage. The type of the global data of the storage is fixed for each -contract at origination time. This is ensured statically by checking on -origination that the code preserves the type of the global data. For -this, the code of the contract is checked to be of type -``lambda (pair 'arg 'global) -> (pair (list operation) 'global)`` where -``'global`` is the type of the original global store given on origination. -The contract also takes a parameter and returns a list of internal operations, -hence the complete calling convention above. The internal operations are -queued for execution when the contract returns. - -Empty contract -~~~~~~~~~~~~~~ - -The simplest contract is the contract for which the ``parameter`` and -``storage`` are all of type ``unit``. This contract is as follows: - -.. code-block:: michelson - - code { CDR ; # keep the storage - NIL operation ; # return no internal operation - PAIR }; # respect the calling convention - storage unit; - parameter unit; - - -Example contract with entrypoints -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The following contract maintains a number in its storage. It has two -entrypoints ``add`` and ``sub`` to modify it, and the default -entrypoint, of type ``unit`` will reset it to ``0``. - -:: - - { parameter (or (or (nat %add) (nat %sub)) (unit %default)) ; - storage int ; - code { AMOUNT ; PUSH mutez 0 ; ASSERT_CMPEQ ; UNPAIR ; - IF_LEFT - { IF_LEFT { ADD } { SWAP ; SUB } } - { DROP ; DROP ; PUSH int 0 } ; - NIL operation ; PAIR } } - -Multisig contract -~~~~~~~~~~~~~~~~~ - -The multisig is a typical access control contract. The ownership of -the multisig contract is shared between ``N`` participants represented -by their public keys in the contract's storage. Any action on the -multisig contract needs to be signed by ``K`` participants where the -threshold ``K`` is also stored in the storage. - -To avoid replay of the signatures sent to the contract, the signed -data include not only a description of the action to perform but also -the address of the multisig contract and a counter that gets -incremented at each successful call to the contract. - -The multisig commands of :ref:`Tezos command line client ` -use this -smart contract. Moreover, `functional correctness of this contract has -been verified -`__ -using the Coq proof assistant. - - -.. code-block:: michelson - - parameter (pair - (pair :payload - (nat %counter) # counter, used to prevent replay attacks - (or :action # payload to sign, represents the requested action - (pair :transfer # transfer tokens - (mutez %amount) # amount to transfer - (contract %dest unit)) # destination to transfer to - (or - (option %delegate key_hash) # change the delegate to this address - (pair %change_keys # change the keys controlling the multisig - (nat %threshold) # new threshold - (list %keys key))))) # new list of keys - (list %sigs (option signature))); # signatures - - storage (pair (nat %stored_counter) (pair (nat %threshold) (list %keys key))) ; - - code - { - UNPAIR ; SWAP ; DUP ; DIP { SWAP } ; - DIP - { - UNPAIR ; - # pair the payload with the current contract address, to ensure signatures - # can't be replayed across different contracts if a key is reused. - DUP ; SELF ; ADDRESS ; CHAIN_ID ; PAIR ; PAIR ; - PACK ; # form the binary payload that we expect to be signed - DIP { UNPAIR @counter ; DIP { SWAP } } ; SWAP - } ; - - # Check that the counters match - UNPAIR @stored_counter; DIP { SWAP }; - ASSERT_CMPEQ ; - - # Compute the number of valid signatures - DIP { SWAP } ; UNPAIR @threshold @keys; - DIP - { - # Running count of valid signatures - PUSH @valid nat 0; SWAP ; - ITER - { - DIP { SWAP } ; SWAP ; - IF_CONS - { - IF_SOME - { SWAP ; - DIP - { - SWAP ; DIIP { DIP { DUP } ; SWAP } ; - # Checks signatures, fails if invalid - CHECK_SIGNATURE ; ASSERT ; - PUSH nat 1 ; ADD @valid } } - { SWAP ; DROP } - } - { - # There were fewer signatures in the list - # than keys. Not all signatures must be present, but - # they should be marked as absent using the option type. - FAIL - } ; - SWAP - } - } ; - # Assert that the threshold is less than or equal to the - # number of valid signatures. - ASSERT_CMPLE ; - DROP ; DROP ; - - # Increment counter and place in storage - DIP { UNPAIR ; PUSH nat 1 ; ADD @new_counter ; PAIR} ; - - # We have now handled the signature verification part, - # produce the operation requested by the signers. - NIL operation ; SWAP ; - IF_LEFT - { # Transfer tokens - UNPAIR ; UNIT ; TRANSFER_TOKENS ; CONS } - { IF_LEFT { - # Change delegate - SET_DELEGATE ; CONS } - { - # Change set of signatures - DIP { SWAP ; CAR } ; SWAP ; PAIR ; SWAP }} ; - PAIR } - - - -Full grammar ------------- - -:: - - ::= - | - | - | - | Unit - | True - | False - | Pair ... - | Left - | Right - | Some - | None - | { ; ... } - | { Elt ; ... } - | instruction - ::= - | [0-9]+ - ::= - | - | - - ::= - | "*" - ::= - | \" - | \r - | \n - | \t - | \b - | \\ - | [^"\] - ::= - | 0x[0-9a-fA-F]+ - ::= - | { ... } - | DROP - | DROP - | DUP - | DUP - | SWAP - | DIG - | DUG - | PUSH - | SOME - | NONE - | UNIT - | NEVER - | IF_NONE { ... } { ... } - | PAIR - | PAIR - | CAR - | CDR - | UNPAIR - | UNPAIR - | LEFT - | RIGHT - | IF_LEFT { ... } { ... } - | NIL - | CONS - | IF_CONS { ... } { ... } - | SIZE - | EMPTY_SET - | EMPTY_MAP - | EMPTY_BIG_MAP - | MAP { ... } - | ITER { ... } - | MEM - | GET - | GET - | UPDATE - | UPDATE - | IF { ... } { ... } - | LOOP { ... } - | LOOP_LEFT { ... } - | LAMBDA { ... } - | EXEC - | APPLY - | DIP { ... } - | DIP { ... } - | FAILWITH - | CAST - | RENAME - | CONCAT - | SLICE - | PACK - | UNPACK - | ADD - | SUB - | MUL - | EDIV - | ABS - | ISNAT - | INT - | NEG - | LSL - | LSR - | OR - | AND - | XOR - | NOT - | COMPARE - | EQ - | NEQ - | LT - | GT - | LE - | GE - | SELF - | SELF_ADDRESS - | CONTRACT - | TRANSFER_TOKENS - | SET_DELEGATE - | CREATE_CONTRACT { ... } - | IMPLICIT_ACCOUNT - | VOTING_POWER - | NOW - | LEVEL - | AMOUNT - | BALANCE - | CHECK_SIGNATURE - | BLAKE2B - | KECCAK - | SHA3 - | SHA256 - | SHA512 - | HASH_KEY - | SOURCE - | SENDER - | ADDRESS - | CHAIN_ID - | TOTAL_VOTING_POWER - | PAIRING_CHECK - | SAPLING_EMPTY_STATE - | SAPLING_VERIFY_UPDATE - | TICKET - | READ_TICKET - | SPLIT_TICKET - | JOIN_TICKETS - | OPEN_CHEST - ::= - | - | option - | list - | set - | operation - | contract - | ticket - | pair ... - | or - | lambda - | map - | big_map - | bls12_381_g1 - | bls12_381_g2 - | bls12_381_fr - | sapling_transaction - | sapling_state - | chest - | chest_key - ::= - | unit - | never - | bool - | int - | nat - | string - | chain_id - | bytes - | mutez - | key_hash - | key - | signature - | timestamp - | address - | option - | or - | pair ... - - -Reference implementation ------------------------- - -The language is implemented in OCaml as follows: - -- The lower internal representation is written as a GADT whose type - parameters encode exactly the typing rules given in this - specification. In other words, if a program written in this - representation is accepted by OCaml's typechecker, it is guaranteed - type-safe. This is of course also valid for programs not - handwritten but generated by OCaml code, so we are sure that any - manipulated code is type-safe. - - In the end, what remains to be checked is the encoding of the typing - rules as OCaml types, which boils down to half a line of code for - each instruction. Everything else is left to the venerable and well - trusted OCaml. - -- The interpreter is basically the direct transcription of the - rewriting rules presented above. It takes an instruction, a stack and - transforms it. OCaml's typechecker ensures that the transformation - respects the pre and post stack types declared by the GADT case for - each instruction. - - The only things that remain to be reviewed are value dependent - choices, such as we did not swap true and false when - interpreting the IF instruction. - -- The input, untyped internal representation is an OCaml ADT with - only 5 grammar constructions: ``String``, ``Int``, ``Bytes``, ``Seq`` and - ``Prim``. It is the target language for the parser, since not all - parsable programs are well typed, and thus could simply not be - constructed using the GADT. - -- The typechecker is a simple function that recognizes the abstract - grammar described in section X by pattern matching, producing the - well-typed, corresponding GADT expressions. It is mostly a checker, - not a full inferrer, and thus takes some annotations (basically the - input and output of the program, of lambdas and of uninitialized maps - and sets). It works by performing a symbolic evaluation of the - program, transforming a symbolic stack. It only needs one pass over - the whole program. - - Here again, OCaml does most of the checking, the structure of the - function is very simple, what we have to check is that we transform a - ``Prim ("If", ...)`` into an ``If``, a ``Prim ("Dup", ...)`` into a - ``Dup``, etc. diff --git a/docs/ithaca/plugins.rst b/docs/ithaca/plugins.rst deleted file mode 100644 index f69aec6d9e583ec7d8ac486a6d71f19c42e93ed3..0000000000000000000000000000000000000000 --- a/docs/ithaca/plugins.rst +++ /dev/null @@ -1,244 +0,0 @@ -Protocol Plugins -================ - -This document describes the protocol plugins implemented in Octez. - -Protocol-specific shell plugins, simply called protocol plugins, -implement extra APIs needed by the shell in order to interact with the -economic protocol, beyond the one provided by the :doc:`protocol -environment <../shell/protocol_environment>`. -This code is not strictly speaking part of the protocol -code base, so this is not subject to on-chain governance (see -:doc:`voting procedure `), but it is still protocol-dependent, -which means that it may vary with different protocols. For instance, -the plugin code for protocol Alpha is located in file -:src:`src/proto_alpha/lib_plugin/plugin.ml`. Thus, a specific version -is included in the Octez node for each protocol version (recall that a -new release of Octez is usually delivered for each new protocol -proposal, see :doc:`../releases/releases`) - -In contrast to the Octez code, plugins are protocol-specific and as -such, know how to read the content of an operation. - -So what kind of features may a protocol plugin provide? For instance, -protocol plugins do not define the context, or restrict the validity -of operations. -In turn protocol plugins may, for example: - -- perform protocol-dependent computations that require data not available - in the amendable part of the protocol like accessing the current time - to reason on timestamps (see :ref:`consensus_filter_ithaca`); -- preserve the opacity/abstraction barrier of the protocol's internal data - by performing computations on internal data without revealing it: - e.g., there are some RPCs that can introspect the protocol-dependent - content for certain operations; -- implement some common operations that are customized for each - protocol (e.g., :ref:`prevalidator_filters_ithaca`). - -.. _prevalidator_filters: -.. _prevalidator_filters_ithaca: - -Prevalidator filters --------------------- - -**Prevalidator filters**, which are detailed in the rest of this page, enable the node to discard some -operations (that cannot be included in the next block) faster and -restrict the operations it propagates to the network. -Filters are implemented as a node plugin and a specific filter is -delivered with each protocol version. When the chain switches to a new -protocol, the node installs its corresponding filters, *in lieu of* -the filters of the previous protocol. Notice that prevalidator filters are not -mandatory, their absence does not break the Tezos blockchain protocol. - -The interface of the prevalidator plugin is described at the `mempool plugin API -`__ - -The different kinds of prevalidator filters are described below. - -.. _fees_filter: -.. _fees_filter_ithaca: - -Fees filter -........... - -A very affordable technique for attackers is based on flooding the -network with, valid but useless, zero-fees operations. This is why the -prevalidator filter currently restricts operations based on their -associated fees, to reject "too cheap" or "zero-fees" operations. This -can be configured via the ``minimal_fees``, -``minimal_nanotez_per_gas_unit`` and ``minimal_nanotez_per_byte`` (see -:ref:`filter RPCs`) parameters of the filter -configuration of your node. - -This filtering strategy is implemented in the ``prefilter`` (see -:doc:`../shell/prevalidation`). - -.. _consensus_filter: -.. _consensus_filter_ithaca: - -Consensus filter -................ - -For technical reasons, the economic protocol cannot reject consensus -operations based on their timestamp. Consequently, many -consensus operations are declared as valid by the economic protocol -while being timestamped too early or too late. -The plugin filter aims to narrow down the number of consensus -operations declared as valid based on several heuristics. In -particular, the filter can use the current timestamp while the -protocol cannot. - -This filter classifies a consensus operation according to the current -block proposal as follows: - -- ``Outdated`` if it concerns a previous head at a previous level, -- ``Branch_refused`` if it concerns a previous head at the same level - but in the previous round, -- ``Branch_delayed`` if it concerns a round in the future. - - -This filtering strategy is implemented in the ``prefilter`` (see -:doc:`../shell/prevalidation`). - - - -Prechecking of manager operations -................................. - -The aim of the ``precheck`` filter is to avoid fully executing manager operations -before deciding whether to gossip them to the network. - -The detailed description of this feature is given in -:doc:`./precheck`. For operations other than manager operations, the -``precheck`` filter is a no-op, which entails that these operations need to be -fully executed to decide their propagation (see :doc:`../shell/prevalidation`). - - -One manager operation per manager per block -........................................... - -The mempool filters, ``prefilter``, ``precheck`` and ``postfilter`` -also ensure that, since the last head update (the last valid block which -increased the chain's fitness), only one operation per manager is propagated. -All other received operations originating from the same manager will be classified -as ``Branch_delayed`` and will not be propagated. - -This criterion is used only by the prevalidator to decide the propagation of -operations. A baker can still include several operations originating from the same -manager in a single block, provided that it gets them in time (note that they can be -propagated by nodes using different versions or implementations). - -Alternatively, a user can inject an operation with the same -manager and the same counter, but with a higher fee to replace an already existing -operation in the prevalidator. Only one of the two operations will be eventually -included in a block. To be able to replace the first operation, the fee and the -"fee/gas limit" ratio of the second one is supposed to be higher than the first's -by a factor (currently fixed to 5%). In case of successful replacement, the old -operation is re-classified as ``Outdated``. - -Concretely, a user can replace a successfully prechecked manager operation in the -mempool, with the help of ``tezos-client``, using two methods : - -- manually provide a higher fee to bump the "fee/gas limit" ratio by at least 5% for the new - operation, -- via option ``--replace``: In this case, ``tezos-client`` will automatically - compute the minimal amount of fee for the second operation to be able to - replace the one in the mempool. - - -Operations prioritization and ordering -...................................... - -In addition to quick detection of operations that have no chance to be -prechecked or applied in the current context, the mempool's ``prefilter`` provides -a priority for each successfully filtered operation. Concretely, the priority is -either ``High``, ``Medium`` or ``Low`` in the current implementation, depending -on the :ref:`validation pass`.Some extra information (like the fees, or the gas/fees -ratio of manager operations) are also provided along the priorities to enable -fine-grained operations ordering. -This extra information is similar to the one used by the baker's -operations selection mechanism, that decides which operations will be included -in the next block. - - -Bounding the number of propagated manager operations -..................................................... - -Up to Hangzhou protocol (see :doc:`../protocols/011_hangzhou`), the protocol -plugin did not implement ``precheck``, so the prevalidator exclusively relies on ``apply_operation`` -to classify manager operations. As a consequence, it could also check their -total gas consumption, and thus, naturally limit the number of successfully -applied/propagated operations. - -Starting with Ithaca protocol (see :doc:`../protocols/012_ithaca`), the plugin -implements a lightweight classification function, called ``precheck``, that -doesn't check the total gas consumption. So with this modication and those of -Octez 12.0, the prevalidator, would propagate any succesfully prevalidated -operation. In order to protect nodes from potential DDoS, a new mechanism has -been added in the plugin to bound the number of successfully prechecked -operations. This mechanism works as follows: - -- Advertise the *best* ``N`` successfully prechecked manager operations - (where "best" is w.r.t. the priority described above, and N is a tunable parameter) - found in the set of pending operations to the network after a new head is - chosen and operations' classification reset. All other pending operations that - should have been prechecked are instead classified as ``Branch_delayed``; -- Once the limit ``N`` is reached, the node may still receive additional manager - operations (via the network or RPC injection) with higher priorities than - those previously prechecked/advertised. Any such operation that is - successfully prechecked is advertised, and, in turn, the previously prechecked/advertised - manager operation with the lowest priority (not necessarily from the same - source) is reclassified as ``Branch_delayed``. - -The default value of the parameter ``N`` is chosen such that a node will always propagate enough -manager operations to allow the next baker to produce a filled block (if there are -enough operations in the network). Its value is currently fixed to 5000. -Indeed, the total size occupied by manager operations in a -block is currently bounded by 512 `KiB `_, and ``unset deposits limit`` seems -to be the smallest manager operation, with 126 Bytes, so there are at most -512 * 1024 / 126 = 4161 manager operations per block. - - -.. _active_filter_rpc: -.. _active_filter_rpc_ithaca: - -Filters RPCs -~~~~~~~~~~~~ - -Filters are tunable by several parameters, whose values can be -retrieved and changed by users via the following RPC calls, -respectively: - -- ``rpc get /chains//mempool/filter`` -- ``rpc post /chains//mempool/filter`` - -The following parameters can be thus inspected and modified: - -- ``minimal_fees``: type ``int``, default ``100`` -- ``minimal_nanotez_per_gas_unit``: type ``int``, default ``100`` -- ``minimal_nanotez_per_byte``: type ``int``, default ``1000`` -- ``allow_script_failure``: type ``bool``, default ``true`` -- ``clock_drift`` : type ``Period.t option``, default ``None`` -- ``max_prechecked_manager_operations`` : type ``int``, default ``5000`` -- ``replace_by_fee_factor`` : type ``rational``, default ``21/20`` (ie. ``1.05%``) - -For example, each command below modifies the provided parameter and resets all -the others to their default values:: - - tezos-client rpc post /chains/main/mempool/filter with '{ "minimal_fees": "42" }' - tezos-client rpc post /chains/main/mempool/filter with '{ "replace_by_fee_factor": [ "23", "20" ] }' - tezos-client rpc post /chains/main/mempool/filter with '{ "max_prechecked_manager_operations": 7500 }' - -Changing filters default configuration -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Changing filters configuration may not have the expected outcome. -Because the configuration is only changed on your node, and not on all -the gossip network nodes, this will only impact how operations of your -node are propagated. For example, assuming there are three nodes -``A``, ``B`` and ``C`` such that ``A`` is connected to ``B`` and ``B`` -is connected to ``C``. Assume that ``A`` modifies its filter -configuration so that ``minimal_fees`` is now ``0``. Then ``A`` may -propagate an operation with ``0`` fee to ``B``. However, because ``B`` -has the default filter configuration, this operation will not be -propagated to ``C`` (so ``C`` may never see it). diff --git a/docs/ithaca/precheck.rst b/docs/ithaca/precheck.rst deleted file mode 100644 index dce94ac1bf710e70360bfea024af108b203e1142..0000000000000000000000000000000000000000 --- a/docs/ithaca/precheck.rst +++ /dev/null @@ -1,105 +0,0 @@ -Prechecking of manager operations -================================= - -The prevalidator of Octez prevents the propagation of non-valid -operations by trying to apply (or execute) them. -However, executing -manager operations (like complex smart contract calls) can be -time-consuming. -To ensure a high throughput of the Tezos protocol, the -propagation of operations should be as fast as possible. This calls -for a lighter approach. - -Prechecking manager operations implements such a lighter approach, by -discarding most invalid operations, without executing any of them. -This is possible because the validity of an operation (in the sense, -being able to include it in a block) -depends on its solvability (see below :ref:`solvability_ithaca`). - -Fortunately, it turns out that deciding whether an operation is solvable can be achieved without -applying it. - -However, restricting the propagation to solvable operations is not enough to -ensure resilience against DDoS attacks. -It does not ensure their validity in a direct successor of the current -head. -For instance, given two manager operations from the same source and -with the same counter, these operations can be solvable in the same -Tezos context ``C``, but none of them is solvable in the context -resulting from the application of the other operation on ``C``. -To mitigate this situation, we further restrict the propagation of -manager operations to at most one manager operation per manager per -block. -Note however that one can still inject successive operations with the -same counter using the ``replace-by-fee`` feature. - - -.. _solvability: -.. _solvability_ithaca: - -Solvable operations -------------------- - -The solvability of an operation depends on the content of the Tezos -context in which it is applied. - - -In the following, we consider the context kept by the prevalidator -(see :doc:`../shell/prevalidation`). -Checking operation solvability with this context is lighter than with -the contexts for block validation or block construction: it can be -decided without checking whether the gas announced by the operation -is below the remaining gas for the whole block. -Checking solvability consists in verifying that the -operation is well-formed and that fees can be paid: no execution -of operations (especially of smart-contract code) is done to determine -whether they would be applied in the next block with a success or a -fail status (as done by operation application). - -Roughly, a manager operation is solvable when the following conditions hold: - -- The manager can afford to pay the operation fees in the current prevalidator context; -- the operation's counter is the successor of the operation counter associated to - the manager in the current context; -- the gas limit announced is below the gas limit per operation as - defined by the economic protocol; -- for manager operations with Michelson parameters, the - gas cost of deserialisation is under the gas limit announced by the - operation; and -- the signature of the operation is valid. - - -Co-precheckable operations --------------------------- - -Two manager operations are *compatible* if they correspond to distinct managers. - -Two manager operations are *co-precheckable* in a context if they are -compatible and solvable in this context. - -Considering two co-precheckable operations in a context, the -application of one of them preserves the solvability of the other. - -This property extends to a set of manager operations if every pair of -distinct operations is co-precheckable. -In this case, the operations could be included in the next block in -any order, modulo block limits (eg. maximum gas, block size limit, -etc). - -The precheck of a manager operation, with respect to a context and a -set of co-precheckable operations, consists in checking whether adding -the operation to the set preserves the operations of the set being -co-precheckable. - -The prevalidator (see :doc:`../shell/prevalidation`) aims at -propagating operations that could be included in a direct successor -block of the current head. -It will propagate co-precheckable operations after checking their -solvability. - -In conclusion, manager operation precheck is a simplification over the real -application of operations: the prevalidator checks whether each -manager operation would be valid in a direct successor of the -current head, as long as gas is available in that block. -In other terms, during prechecking of manager operations, they have no -effect on the prevalidator context. diff --git a/docs/ithaca/proof_of_stake.rst b/docs/ithaca/proof_of_stake.rst deleted file mode 100644 index 2d7a7820070435f8611ac873e1320d66067322ff..0000000000000000000000000000000000000000 --- a/docs/ithaca/proof_of_stake.rst +++ /dev/null @@ -1,237 +0,0 @@ -Proof-of-stake -============== - -Overview --------- - -:doc:`The consensus algorithm ` in Tezos is based on the -*proof-of-stake* mechanism. Proof-of-stake means that participants -in the consensus algorithm are chosen in function of their stake (the -amount of tokens a participant has). The same mechanism is used in the -Tezos :doc:`governance `. - -If one does not have enough stake to participate on its own or does not want to -set up the needed infrastructure, (s)he can use :ref:`delegation -`. Therefore, in Tezos, it is the :ref:`delegates` -that may participate in consensus. -However, at each level, not all delegates necessarily participate, and their participation weight may differ. -The selection of the delegates' participation rights at a level is done by running a -PRNG (pseudo-random number generator). -The PRNG's :ref:`seeds ` are obtained from random -data that are regularly produced and stored on the blockchain. Thus, -the procedure is deterministic in that delegates' rights are uniquely -determined from the seed; and it is random, in that its seed (and hence its results) cannot -be predicted too much in advance. - - -Delegation ----------- - -A *delegate* is any :ref:`implicit account ` registered as -such by emitting a delegate registration operation. - -Any :ref:`account ` (implicit or originated) can specify a delegate -through a delegation operation. -Any account can change or revoke its delegate at any time. However, the change -only becomes effective after ``PRESERVED_CYCLES + 2`` :ref:`cycles `. -The value ``PRESERVED_CYCLES`` is a -:ref:`protocol constant `. - -A delegate participates in consensus and in governance with a weight -proportional with their delegated stake, which includes the balances -of all the accounts that delegate to it, and also the balance of the -delegate itself. To participate in consensus or in governance, a -delegate needs to have at least a minimal stake, which is given by the -``TOKENS_PER_ROLL`` :ref:`protocol constant -`. - -Delegates place security deposits that may be forfeited in case they do not -follow (some particular rules of) the protocol. Security deposits are deduced -from the delegates' own balance. - - -Active and passive delegates -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. _active_delegate: -.. _active_delegate_ithaca: - -A delegate can be marked as either active or passive. A passive -delegate cannot participate in the consensus algorithm. - -A delegate is marked as active at its registration. - -A delegate becomes passive at the end of cycle ``n`` when it has -failed to participate in the consensus algorithm in -the past ``PRESERVED_CYCLES + 1`` cycles, that is, in cycles ``n``, ``n-1``, -``n-2``, ..., ``n - PRESERVED_CYCLES``. - -Delegates' rights selection ---------------------------- - -Tezos being proof-of-stake, the delegates' rights are selected at random based on their -stake. In what follows we detail the selection mechanism used in Tezos. - -.. _random_seed: -.. _random_seed_ithaca: - -Random seed -^^^^^^^^^^^ - -To each cycle is associated a random number called the -seed. This seed is used within its cycle to generate pseudo-random -values in the protocol, in particular for selecting delegates to participate in consensus. - -The seed is the output of a simple multi-party randomness protocol -(similar in spirit with the `RANDAO protocol `_): -at each cycle end, a new seed is computed as the hash of the previous -seed and of *nonces* (for "number used only once") provided by -delegates during that cycle and stored on the chain. -Nonces are supposed to be random. -To ensure that participants do not adaptively chose their -nonces and therefore that the seed is not easily biased, -participants in the protocol use a ''commit and reveal'' scheme: in the -previous cycle, they first commit to nonces and they only reveal their -committed nonces later, in the current cycle. - -We make the assumption that at least one participant is honest, that -is, it has indeed chosen a random value and this value was revealed. This is a necessary -condition for the seed to be random. The randomness could however -be biased as this protocol suffers from the following low-impact weakness: -if a malicious participant can make sure she is the last revealer, -then she can choose to reveal or not its committed value and can -thus choose between two different predetermined seeds. - -Concretely, the random seed for cycle -``n`` is a 256-bit long number computed at the very end of cycle ``n-1-PRESERVED_CYCLES`` from -nonces to which delegates commit during cycle ``n-2-PRESERVED_CYCLES``. Every -``BLOCKS_PER_COMMITMENT`` levels, the corresponding block contains a nonce commitment. -More precisely, a block contains a commitment if and only if its cycle -position modulo ``BLOCKS_PER_COMMITMENT`` is ``BLOCKS_PER_COMMITMENT - 1``. -The nonce is a 256-bit number generated by the block proposer and its commitment is included in -the block header. The commitment is simply the hash of the nonce. - -The committed nonce must be revealed by the original block proposer -during cycle ``n-1-PRESERVED_CYCLES`` under penalty of forfeiting all of its expected -endorsing rewards for that cycle. The associated security -deposit is not affected. - -A *nonce revelation* is an operation and multiple nonce revelations can thus be -included in a block. A reward ``SEED_NONCE_REVELATION_TIP`` is given for -including a revelation. Revelations are free operations which do not compete -with transactions for block space. Up to ``MAX_ANON_OPS_PER_BLOCK`` revelations, -wallet activations and denunciations can be contained in any given block. - -The seed for cycle ``n`` is the bitstring obtained by iterating -through the nonces revealed in cycle ``n-1`` as follows: initially it -is the seed of cycle ``n-1``; at each iteration, the new bitstring is -the hash of the concatenation of the previous bitstring with the iterated -revealed nonce. - -.. _snapshots_ithaca: - -Stake snapshots -^^^^^^^^^^^^^^^ - -Before turning to the rights selection mechanism, we first introduce a new -terminology, *stake snapshot*, to denote the stake distribution for a given block, -as stored in the :ref:`context`. -Stake snapshots are taken (and stored) every ``BLOCKS_PER_STAKE_SNAPSHOT`` levels. -More precisely, a snapshot is taken at a level if and only if its cycle -position modulo ``BLOCKS_PER_STAKE_SNAPSHOT`` is ``BLOCKS_PER_STAKE_SNAPSHOT - 1``. -Therefore, at the end of a cycle there are ``BLOCKS_PER_CYCLE / -BLOCKS_PER_STAKE_SNAPSHOT`` stored snapshots. - -At the end of cycle ``n-1-PRESERVED_CYCLES``, the snapshot for cycle -``n`` is randomly selected from the snapshots stored in cycle -``n-1-PRESERVED_CYCLES``. The selection is done through a very simple -PRNG having as seed the :ref:`random seed` for -cycle ``n``. - -Only the stake of active delegates with the minimal stake of ``TOKENS_PER_ROLL`` is snapshot. - -.. _rights: -.. _rights_ithaca: - -Slot selection -^^^^^^^^^^^^^^ - -Delegates' rights to participate are determined using the `alias -method `_, more precisely -using `Vose's algorithm -`_ -(see also `this more pedagogic description -`_; the algorithm is the last one listed there). -This algorithm samples from a discrete probability distribution, which is given by -the stakes in a particular stake snapshot: the probability to sample a -particular delegate is its stake in the snapshot over the total stake -in that snapshot. - -Concretely, the delegates' rights at a given level are expressed in terms of -the (quantity of) *slots* that the delegate owns at that level. -This quantity represents the delegate's weight in consensus. -We note that, in the long run (that is, on average over many levels), the number of slots is proportional to its stake. -The owner of a slot is obtained by sampling using the algorithm -mentioned above. -More precisely, given a level and a slot (which is just a non-negative integer), -the mentioned algorithm is invoked to assign a delegate to the given slot. -Its input is the probability distribution given by the :ref:`stake -snapshot` for the cycle to which the level belongs. -And whenever the algorithm needs to draw a random value, this is obtained using a -simple procedure which has as its initial state: the level, the -:ref:`random seed` for the cycle to which the -level belongs, and the slot. - - -.. _protocol_constants: -.. _protocol_constants_ithaca: - -Protocol constants ------------------- - -Protocols are parameterized by several parameters called *protocol constants*, which may vary from one protocol to another or from one network to another (for instance, test networks move faster). - -The list of protocol constants can be found in the API of the `Constants module `__. - -The values of protocol constants can be found using a :ref:`specific RPC call `, as shown in :ref:`this example `. - -In particular, the protocol constants related to the proof-of-stake mechanism are detailed below. - -.. _ps_constants: -.. _ps_constants_ithaca: - -Proof-of-stake parameters -^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. list-table:: - :widths: 55 25 - :header-rows: 1 - - * - Parameter name - - Parameter value - * - ``BLOCKS_PER_CYCLE`` - - 8192 blocks - * - ``PRESERVED_CYCLES`` - - 5 cycles - * - ``BLOCKS_PER_COMMITMENT`` - - 64 blocks - * - ``MAX_ANON_OPS_PER_BLOCK`` - - 132 revelations - * - ``SEED_NONCE_REVELATION_TIP`` - - 1/8 ꜩ - * - ``TOKENS_PER_ROLL`` - - 6,000 ꜩ - * - ``BLOCKS_PER_STAKE_SNAPSHOT`` - - 512 blocks - - -Further External Resources --------------------------- - -The original design of the proof-of-stake mechanism in Tezos can be -found in the `whitepaper -`_. - -Another presentation of the Tezos' proof-of-stake mechanism can be -found in the `Tezos agora wiki entry -`_. diff --git a/docs/ithaca/protocol.rst b/docs/ithaca/protocol.rst deleted file mode 100644 index 668ed0c4dba827811d2b6ac7a3da6a4f0b53773d..0000000000000000000000000000000000000000 --- a/docs/ithaca/protocol.rst +++ /dev/null @@ -1,72 +0,0 @@ -The economic protocol -===================== - -The economic protocol provides the rules for checking the validity of the blocks and operations, and for updating the blockchain state accordingly, by applying new valid blocks and operations on the current blockchain state. These rules can be changed through voting. -Thus, the -economic protocol represents the amendable part of Tezos. - -This page groups the documentation helping developers and users in -understanding the basic concepts of the economic protocol -(proof-of-stake, consensus, voting, etc), its features (Michelson, -Sapling, etc), and some details about its implementation. - - -.. toctree:: - :maxdepth: 2 - - protocol_overview - -.. toctree:: - :maxdepth: 2 - - proof_of_stake - -.. toctree:: - :maxdepth: 2 - - consensus - -.. toctree:: - :maxdepth: 2 - - voting - -.. toctree:: - :maxdepth: 2 - - michelson - -.. toctree:: - :maxdepth: 2 - - timelock - -.. toctree:: - :maxdepth: 2 - - sapling - -.. toctree:: - :maxdepth: 2 - - liquidity_baking - -.. toctree:: - :maxdepth: 2 - - global_constants - -.. toctree:: - :maxdepth: 2 - - token_management - -.. toctree:: - :maxdepth: 2 - - precheck - -.. toctree:: - :maxdepth: 2 - - plugins diff --git a/docs/ithaca/protocol_overview.rst b/docs/ithaca/protocol_overview.rst deleted file mode 100644 index 5ebd8bf94b0deb535754ef8807e1927cfcd14681..0000000000000000000000000000000000000000 --- a/docs/ithaca/protocol_overview.rst +++ /dev/null @@ -1,123 +0,0 @@ -Overview of the economic protocol -================================= - -Tezos overview -~~~~~~~~~~~~~~ - -Tezos is a distributed system in which nodes agree upon a chain of blocks of -operations. Tezos is also an account-based crypto-ledger, where an account is -associated to a public-private key pair, and has a balance, that is, a number of -tokens. Tezos is a :doc:`proof-of-stake` system in which any -account that has a minimal stake amount has the right to produce blocks, in -proportion to their balance. - -A Tezos node has mainly three roles: it validates blocks and operations, it -broadcasts them to (and retrieves them from) other nodes, and it maintains a -main chain and its associated state (i.e. the ledger), which includes accounts -and their balances, among other things. Note that, as blocks only specify a -predecessor block, exchanged blocks do not necessarily form a chain, but rather -a tree. Nodes communicate over :doc:`a gossip network<../shell/p2p>`. - -A Tezos node acts as a server, which responds to queries and requests from -clients. Such queries and requests are implemented via :doc:`RPC -calls<../developer/rpc>`. A client can query the chain’s state and can inject -blocks and operations into a node. One particular client is the :ref:`baker daemon `, -which is associated to an account. In particular the baker has access to the -account’s private key and thus can sign blocks and operations. - -The main reason for using such a client-server architecture is safety: to insulate -the component that has access to the client keys, i.e. the baker, from the -component which is exposed to the internet, i.e. the node. Indeed, the node and -the baker can sit on different computers and the baker does not need to be -exposed to the internet. So nodes manage communication and shield bakers from -network attacks, and bakers hold secrets and bake blocks into the blockchain. - -Another advantage of this architecture is that bakers can more easily have -different implementations, and this is important, for instance because different bakers may want -to implement different transaction selection strategies. - -Tezos is a self-amending blockchain, in that a large part of Tezos can be -changed through a so-called amendement procedure. To this end, as mentioned in -:doc:`the big picture<../shell/the_big_picture>`, a Tezos node consists of two -components: - -- the shell, which comprises the network and storage layer, and embeds -- the economic protocol component, which is the part that can be changed through amendment. - -The role of the protocol -~~~~~~~~~~~~~~~~~~~~~~~~ - -At a very high level, a protocol must: - -- implement protocol-specific types, such as the type of operations or protocol-specific block header data (in addition to the shell generic header), -- define under which conditions a block is a valid extension of the current blockchain, and define an ordering on blocks to arbitrate between concurrent extensions. - -Validity conditions are implemented in the ``apply`` function which is called -whenever the node processes a block. The ``apply`` function takes as arguments a -*context* and a block. The context represents the *protocol state* and is -therefore protocol specific. The context may contain, for instance, a list of -accounts and their balances. More generally, the context must provide enough -information to determine the validity of a block. Given a context and a block, -the ``apply`` function returns the updated context if the block is valid and has -a higher :ref:`fitness`. The fitness determines a total ordering between blocks. - -.. _shell_proto_interact: -.. _shell_proto_interact_ithaca: - -Shell-protocol interaction -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -:doc:`Recall<../shell/the_big_picture>` that the economic protocol and the shell interact in order to ensure that the blocks being appended to the blockchain are valid. There are mainly two rules that the shell uses when receiving a new block: - -- The shell does not accept a branch whose fork point is in a cycle more than ``PRESERVED_CYCLES`` in the past. More precisely, if ``n`` is the current cycle, :ref:`the last allowed fork point` is the first level of cycle ``n-PRESERVED_CYCLES``. The parameter ``PRESERVED_CYCLES`` therefore plays a central role in Tezos: any block before the last allowed fork level is immutable. -- The shell changes the head of the chain to this new block only if the block is :doc:`valid<../shell/validation>` and has a higher fitness than the current head; a block is valid if the operations it includes are valid. - -The support provided by the protocol for validating blocks can be modulated by different `validation modes `__. -They allow using this same support for quite different use cases, as follows: - -- being able to validate a block, typically used in the :doc:`validator <../shell/validation>`; -- being able to pre-apply a block, typically used in the :doc:`validator <../shell/validation>` to precheck a block, avoiding to further consider invalid blocks; -- being able to construct a block, typically used by the baker to bake a block; -- being able to partially construct a block, typically used by the :doc:`prevalidator <../shell/prevalidation>` to determine valid operations in the mempool. - -Blocks -~~~~~~ - -A block consists of a header and operations. A block's header is -composed of two parts: :ref:`the protocol-agnostic part` -and :ref:`the protocol-specific part`. -This separation enables the shell to interact with different -protocols. - -.. _validation_passes_proto: -.. _validation_passes_proto_ithaca: - -Operations & Validation Passes -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The different kinds of operations are grouped in classes, such that operations belonging to different classes may be validated independently, and/or with different priorities. -Each class has an associated index, called a :ref:`validation pass`. -There are four classes of operations: :doc:`consensus ` operations, :doc:`voting ` operations, anonymous operations, manager operations. - -Consensus operations are endorsements, while `voting ` operations are ballot and proposal. - -Anonymous operations are operations which are not signed. There are three anonymous operations: seed nonce revelation, double baking evidence, and double endorsing evidence. The evidence for double baking and double endorsing is included in a block by the so-called accuser (see :ref:`slashing`). - -Manager operations are activation, origination (see :doc:`smart contracts`), transaction, reveal, and delegation (see :doc:`proof of stake `). Manager operations are the only fee-paying operations. - -Recall that users have associated :ref:`accounts ` which they activate before being able to participate. By means of the operation :ref:`origination`, accounts can be further associated with smart contracts in which they are called :ref:`originated accounts`. :ref:`Transactions` are used to either transfer tez between two accounts or run the code of a smart contract. Transactions are signed by an account's private key. Before making a transaction, a user must reveal her public key so that other users (not being aware of this public key) can effectively check the signature of the transaction. - -Manager operations can be grouped into batches forming a so-called group operation. A group operation satisfies: - -- atomicity: either all the operations in the batch succeed or none is applied -- efficiency: the whole batch is signed only once (by the same implicit account), thus it is much more efficient to check, and it requires much less gas -- usability: the batch only increments the counter of the signer account by one; for this reason it is easier for tools to provide sending several operations per block using operation batches than tracking counter changes. - -The list of operations can be obtained with :ref:`this rpc `. - -See also -~~~~~~~~ - -An in-depth description of the inners of a protocol can be found in the blog -post `How to write a Tezos protocol -`_. diff --git a/docs/ithaca/sapling.rst b/docs/ithaca/sapling.rst deleted file mode 100644 index 780a030ed3e6eb2607081fc23756cc1841f49103..0000000000000000000000000000000000000000 --- a/docs/ithaca/sapling.rst +++ /dev/null @@ -1,504 +0,0 @@ -**The features described in this page are experimental and have not undergone any security review.** - -Deprecated instruction -====================== - -**For security reasons the use of the type `sapling_transaction` and -instruction `SAPLING_VERIFY_UPDATE` are discouraged and are deprecated in -Protocol 13 which replaces them with a new encoding for the type and a new -signature for the instruction.** - -Sapling integration -=================== - -Sapling is a protocol enabling privacy-preserving transactions of fungible -tokens in a decentralised -environment. It was designed and implemented by the Electric Coin -Company as the last iteration over a series of previous protocols and -academic works starting with the `Zerocoin seminal -paper `_. - -The reference implementation of Sapling, -`librustzcash `_, was -integrated in the Tezos codebase during 2019. It will be proposed as -part of a protocol amendment during 2020. - -Librustzcash and the Tezos integration implement the protocol -described in this `specification -`_, version 2020.1.0. - - -Sapling -------- - -Keys -~~~~ - -Sapling offers a rich set of keys, each allowing different operations. -A `spending key` allows to spend tokens so if it is lost or -compromised the tokens could remain locked or be stolen. -From a spending key it is possible to derive a corresponding `viewing -key` which allows to view all incoming and outgoing transactions. -The viewing key allows the owner of the tokens to check their balance -and transaction history so if compromised there is a complete loss of -privacy. -On the other hand a viewing key can willingly be shared with a third -party, for example with an auditor for regulatory compliance purposes. - -A viewing key can also derive several diversified `addresses`. -An address can be used to receive funds, much like the address of an -implicit account. - -Additionally `proving keys` can be used to allow the creation of proofs, -thus revealing private information, without being able to spend funds. -They are useful for example in case the spending key is stored in a -hardware wallet but we'd like to use our laptop to craft the -transaction and produce the zero-knowledge proofs, which are -computationally too intensive for an embedded device. - -More details can be found in the `specification document -`_. - -Shielded transactions -~~~~~~~~~~~~~~~~~~~~~ - -Transactions use Bitcoin's UTXO model with the important difference that each -input and output, instead of containing an amount and an address, -are just cryptographic `commitments`. -In order to avoid double spends, it's important to be able to check -that a commitment has not already been spent. In Bitcoin we just need to -check if an output is also later used as an input to verify if it's -already spent. In Sapling however we can't know because inputs are not -linked to outputs. -For this reason for each input of a transaction, the owner must also -publish a `nullifier`, which invalidates it. The nullifier can only be -produced by the owner of a commitment and it's deterministic so that -everybody can check that it hasn't been already published. -Note however that it is not possible to infer which commitment has -been nullified. -Transactions of this form are privacy preserving and are referred to -as `shielded`, because they reveal neither the amount, the sender nor -the receiver. - -The existing set of transactions is referred to as the `shielded pool`. -Unlike Bitcoin, where everybody can compute the set of unspent -outputs of every user, in Sapling only the owner of a viewing key can -find their outputs and verify that they are not already spent. -For this reason, to an external -observer, the shielded pool is always increasing in size and the more -transactions are added the harder it is to pinpoint the commitments -belonging to a user. - -When we spend a commitment there is some additional information that -we need to transmit to the recipient in order for them to spend the -corresponding output. -This data is encrypted under a symmetric key resulting from a -Diffie-Hellman key exchange using the recipient address and an -ephemeral key. -In principle this `ciphertext` can be transmitted off-chain as it's -not needed to verify the integrity of the pool. For convenience, in -Tezos, it is stored together with the commitment and the nullifier on -chain. - -For reasons of efficiency the commitments are stored in an incremental -`Merkle tree `_ which -allows for compact proofs of membership. The root of the tree is all -that is needed to refer to a certain state of the shielded pool. - -In order to ensure the correctness of a transaction, given that there -is information that we wish to remain secret, the spender must also -generate proofs that various good properties are true. -Thanks to the use of `SNARKs `_ -these proofs are very succinct in size, fast to verify and they don't -reveal any private information. - -This model of transaction adapts elegantly to the case when we need to -mint or burn tokens, which is needed to shield or unshield from a -transparent token. -It suffices to add more values in the outputs than in the inputs -to mint and to have more in inputs than outputs to burn. - -Privacy guarantees -~~~~~~~~~~~~~~~~~~ - -We explained that the shielded pool contains one commitment for each -input (spent or not), and one nullifier for each spent input. -These cryptographic commitments hide the amount and the owner of the -tokens they represent. -Additionally commitments are unlinkable meaning that we can not deduce -which input is spent to create an output. - -It should be noted that the number of inputs and outputs of a -transaction is public, which could help link a class of -transactions. This problem can be mitigated by adding any number of -dummy inputs or outputs at the cost of wasting some space. - -The shielded pool communicates with the public ledger by minting and -burning shielded tokens in exchange for public coins. -Therefore going in and out of the shielded pool is public: we know -which address shielded or unshielded and how much. -We can among other things infer the total number of shielded coins. - -Timing and network information can also help to deduce some private -information. -For example by observing the gossip network we might learn the IP -address of somebody that is submitting a shielded transaction. -This can be mitigated by using `TOR -`_. - -Good practices -~~~~~~~~~~~~~~ - -When blending in a group of people, one should always pay attention to -the size and the variety of the group. - -We recommend two good practices. First, do not originate a second -contract if another one has the same functionalities, it will split -the anonymity set. - -Second, remember that shielding and unshielding are public operations. -A typical anti-pattern is to shield from tz1-alice 15.3 tez, and then -unshield 15.3 tez to tz1-bob. It's fairly clear from timing and -amounts that Alice transferred 15.3 tez to Bob. -To decorrelate the two transfers it is important to change the -amounts, let some time pass between the two and perform the -transactions when there is traffic in the pool. -Similar problems exist in Zcash and they are illustrated in this -introductory `blog post -`_. - -There are a number of more sophisticated techniques to deanonymise -users using timing of operations, network monitoring, side-channels on -clients and analysis of number of inputs/outputs just to mention a few -(`A fistful of Bitcoins -`_ is a good -first read). -We advice users to be familiar with the use of the TOR network and to -use clients developed specifically to protect their privacy. - - -Tezos integration ------------------ - -Michelson: verify update -~~~~~~~~~~~~~~~~~~~~~~~~ - -We introduce two new Michelson types `sapling_state` and -`sapling_transaction`, and two instructions called -`SAPLING_VERIFY_UPDATE` and `SAPLING_EMPTY_STATE` -(see the :doc:`Michelson reference` -for more details). -`SAPLING_EMPTY_STATE` pushes an empty `sapling_state` on the stack. -`SAPLING_VERIFY_UPDATE` takes a transaction and a state and returns an -option type which is Some (updated -state and a balance) if the transaction is correct, None otherwise. -A transaction has a list of inputs, outputs, a signature, a balance, -and the root of the Merkle tree containing its inputs. -The verification part checks the zero-knowledge proofs of all inputs -and outputs of the transaction, which guarantee several properties of -correctness. -It also checks a (randomised) signature associated with each input -(which guarantees that the owner forged the transaction), and the -signature that binds the whole transaction together and guarantees the -correctness of the balance. -All the signatures are over the hash of the data that we wish to sign -and the hash function used is Blake2-b, prefixed with the anti-replay string. -The anti-replay string is the the concatenation of the chain id and -the smart contract address. The same string has to be used by the client for -signing. - -Verify_update also checks that the root of the Merkle tree appears in -one of the past states and that the nullifiers are not already -present (i.e. no double spending is happening). -If one of the checks fails the instruction returns None. - -Otherwise the function adds to the new state the nullifiers given with each inputs -and adds the outputs to the Merkle tree, which will produce a new root. -It should be noted that it is possible to generate transactions -referring to an old root, as long as the inputs used were present in -the Merkle tree with that root and were not spent after. -In particular the protocol keeps 120 previous roots and guarantees -that roots are updated only once per block. -Considering 1 block per minute and that each block contains at least -one call to the same contract, a client has 2 hours to have its -transaction accepted before it is considered invalid. - -The nullifiers are stored in a set. The ciphertexts and other relevant -information linked to the commitment of the Merkle tree are -stored in a map indexed by the position of the commitment in the -Merkle tree. - -Lastly the instruction pushes the updated state and the balance as an option -on the stack. - -Example contracts -~~~~~~~~~~~~~~~~~ - -Shielded tez -^^^^^^^^^^^^ - -An example contract to have a shielded tez with a 1 to 1 conversion to -tez is available in the tests of `lib_sapling`. - -Simple Vote Contract -^^^^^^^^^^^^^^^^^^^^ - -One might think to use Sapling to do private voting. -It is possible to adapt shielded transactions to express preferences. -**Note that this is not what Sapling is designed for and it doesn't provide the same properties as an actual private voting protocol.** -A natural naive idea is the following. -Suppose we want a set of users to express a preference for option A or -B, we can generate two Sapling keys with two addresses that are -published and represent the two options. -The contract lets each user create a token which represents one vote -that can then be transferred to address A or B. -Using the published viewing keys everyone can check the outcome of the -vote. -**However note that a transaction can be replayed and we can see the balance of A or B going up. -This system does not offer ballot privacy. -Therefore one should ensure that the vote he is casting cannot be linked to him. -It is possible that the practical situation makes this usable but we recommend in general not to use -it for any important vote.** -Note that using a random elliptic curve element as incoming viewing key allows to generate a -dummy address that cannot be spent. This eases the counting of the votes. -To ensure that the ivk does not correspond to a normal address with spending key, one -can use the Fiat-Shamir heuristic. - - -Fees issue -~~~~~~~~~~ - -We have an additional privacy issue that Z-cash doesn't have. When -interacting with a shielded pool we interact with a smart contract -with a normal transaction and therefore have to pay fees from an -implicit account. -One could guess that private transactions whose fees are paid by the -same implicit account are from the same user. -This can be mitigated by making a service that act as a proxy by -forwarding the user transactions and paying it fees. The user would -then include in the transaction a shielded output for the service that -covers the fees plus a small bonus to pay the service. -This output can be open by the service before sending the transaction -to check that there is enough money to cover its fees. As for Z-cash, -users interacting with the proxy should use TOR or mitigate network -analysis as they wish. - -Gas, storage and costs -~~~~~~~~~~~~~~~~~~~~~~ - -Gas evaluation is not yet done. - -RPCs -~~~~ - -There are two Sapling RPCs under the prefix `context/sapling`. -`get_size` returns a pair with the size of the set of commitments -and the size of the set of nullifiers. -`get_diff` takes two optional starting offsets `cm_from` and `nf_from` -and returns the sapling state that was added from the offsets to the -current size. In particular it returns three lists, commitments, -ciphertexts from position `cm_from` up to the last one added and -nullifiers, from `nf_from` to the last one added. -Additionally it returns the last computed root of the merkle tree so -that a client updating its tree using the diff can verify the -correctness of the result. - -Client -~~~~~~ - -Wallet -^^^^^^ - -tezos-client supports Sapling keys and can send -shielded transactions to smart contracts. - -The client supports two ways to generate a new Sapling spending key. -It can be generated from a mnemonic using `BIP39 -`_, so -that it can be recovered in case of loss using the mnemonic. -Alternatively it is possible to derive new keys from existing ones -using `ZIP32 -`_, a Sapling -variant of `BIP32 -`_ for -hierarchical deterministic wallets. As usual, in this case it is -important to note the derivation path of the key to be able to recover -it in case of loss. -At the moment there is no hardware wallet support, keys are stored in -`~/.tezos-client/sapling_keys` by default encrypted with a password. -**Users should take care to backup this file.** - -The client can also derive addresses from viewing keys. -By default addresses are generated using an increasing counter called -the address index. Not all indexes correspond to valid addresses for -each key so it is normal to see an increasing counter that -occasionally skips a few positions. - -Because for now the only support for Sapling keys is to interact with -smart contracts, the client binds each newly generated key to a -specific smart contract address. - -Operations -^^^^^^^^^^ - -The client also facilitates the creation of shielded transactions and -their transfer as arguments of smart contracts. -For now there is seamless integration to send transactions to the -reference shielded-tez contract and we are planning to support a -larger class of contracts. - -For the shielded-tez smart contract, the client supports shielding, -unshielding and shielded transactions. -In the case of shielded transactions there are two commands, one to -forge a transaction and save it to file and one to submit it to the -smart contract. -The idea is that a user should not use their own transparent tz{1,2,3} -address to submit a shielded address but rather have a third party -inject it. - -Message argument -^^^^^^^^^^^^^^^^ -Sapling also allows to send an arbitrary encrypted message attached -to an output. -The message size has to be fixed by pool for privacy reasons. -For now it is fixed overall at eight bytes. An incorrect message length -will raise a failure in our client and the protocol will reject the -transaction. Our client adds a default zero's filled message of the -right length. If a message is provided with the --message option, -the client will pad it or truncate it if necessary. A warning message -is printed only if the user's message is truncated. - - -Code base -~~~~~~~~~ - -The current code-base is organized in three main components. -There is a core library called `lib_sapling` which binds `librustzcash`, -adds all the data structures necessary to run the sapling -protocol and includes a simple client and baker. -Under the protocol directory there is a `lib_client_sapling` library -which implements a full client capable of handling Sapling keys and -forging transactions. -Lastly in the protocol there is a efficient implementation of the -Sapling storage, in the spirit of `big_map`s, and the integration of -`SAPLING_VERIFY_UPDATE` in the Michelson interpreter. - -Protocol -^^^^^^^^ - -In order to export the Sapling library to the protocol we first need -to expose it through the environment that sandboxes the protocol. -The changes under `src/lib_protocol_environment` are simple but very -relevant as any change of the environment requires a manual update of the -Tezos node. These changes are part of version V1 of the environment -while protocols 000 to 006 depends on version V0. - -There are two main changes to Tezos' economic protocol, the storage -for Sapling and the addition of `SAPLING_VERIFY_UPDATE` to the Michelson -interpreter. - -Given that the storage of a Sapling contract can be substantially -large, it is important to provide an efficient implementation. -Similarly to what it's done for big_maps, the storage of Sapling can't -be entirely deserialized and modified in memory but only a diff of the -changes is kept by the interpreter and applied at the end of each -smart contract call. - -In the Michelson interpreter two new types are added, `sapling_state` and -`sapling_transaction`, and the instruction `SAPLING_VERIFY_UPDATE`. - -Client -^^^^^^ - -Under `lib_client_sapling` there is the client integration -with the support for Sapling keys and forging of transactions. -The main difference from the existing Tezos client is the need for the -Sapling client to keep an additional state, for each contract. -Because Sapling uses a UTXO model it is necessary for a client to -compute the set of unspent outputs in order to forge new transactions. -Computing this set requires scanning all the state of a contract which -can be expensive. -For this reason the client keeps a local state of the unspent outputs -after the last synchronization and updates it before performing any -Sapling command. -The update is done using the RPCs to recover the new updates since the -last known position. - -The state of all sapling contracts is stored in -`~/.tezos-client/sapling_states`. This file can be regenerated from -the chain in case of loss. However disclosure of this file will reveal -the balance and the unspent outputs of all viewing keys. - -Memo -^^^^^^ - -Sapling offers the possibility to add an arbitrary memo to any -created output. The memo is encrypted and available to anyone -owning the outgoing viewing key or the spending key. -For privacy reasons the size of the memo is fixed per contract -and it is chosen at origination time. -A transaction containing an output with a different memo-size -will be rejected. - -Sandbox tutorial -~~~~~~~~~~~~~~~~ - -As usual it's possible to test the system end-to-end using the -:doc:`../user/sandbox`. -After having set up the sandbox and originated the contract, a good -way to get familiar with the system is to generate keys and then -perform the full cycle of shielding, shielded transfer and -unshielding. - -:: - - # set up the sandbox - ./src/bin_node/tezos-sandboxed-node.sh 1 --connections 0 & - eval `./src/bin_client/tezos-init-sandboxed-client.sh 1` - tezos-activate-alpha - - # originate the contract with its initial empty sapling storage, - # bake a block to include it. - # { } represents an empty Sapling state. - tezos-client originate contract shielded-tez transferring 0 from bootstrap1 \ - running src/proto_012_Psithaca/lib_protocol/test/integration/michelson/contracts/sapling_contract.tz \ - --init '{ }' --burn-cap 3 & - tezos-client bake for bootstrap1 - - # as usual you can check the tezos-client manual - tezos-client sapling man - - # generate two shielded keys for Alice and Bob and use them for the shielded-tez contract - # the memo size has to be indicated - tezos-client sapling gen key alice - tezos-client sapling use key alice for contract shielded-tez --memo-size 8 - tezos-client sapling gen key bob - tezos-client sapling use key bob for contract shielded-tez --memo-size 8 - - # generate an address for Alice to receive shielded tokens. - tezos-client sapling gen address alice - zet1AliceXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX # Alice's address - - - # shield 10 tez from bootstrap1 to alice - tezos-client sapling shield 10 from bootstrap1 to zet1AliceXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX using shielded-tez --burn-cap 2 & - tezos-client bake for bootstrap1 - tezos-client sapling get balance for alice in contract shielded-tez - - # generate an address for Bob to receive shielded tokens. - tezos-client sapling gen address bob - zet1BobXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX # Bob's address - - # forge a shielded transaction from alice to bob that is saved to a file - tezos-client sapling forge transaction 10 from alice to zet1BobXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX using shielded-tez - - # submit the shielded transaction from any transparent account - tezos-client sapling submit sapling_transaction from bootstrap2 using shielded-tez --burn-cap 1 & - tezos-client bake for bootstrap1 - tezos-client sapling get balance for bob in contract shielded-tez - - # unshield from bob to any transparent account - tezos-client sapling unshield 10 from bob to bootstrap1 using shielded-tez --burn-cap 1 - ctrl+z # to put the process in background - tezos-client bake for bootstrap1 - fg # to put resume the transfer diff --git a/docs/ithaca/timelock.rst b/docs/ithaca/timelock.rst deleted file mode 100644 index 9fc225ee4c5d0e1f4439dcb1416621cae5817fa9..0000000000000000000000000000000000000000 --- a/docs/ithaca/timelock.rst +++ /dev/null @@ -1,138 +0,0 @@ -Time-lock -========= - - -Background ----------- - -The issue of "generalized front-running", is a common attack on certain blockchain transactions. -Since a transaction can be observed before it is actually included in the chain, it -can give an advantage to one user (generally a trader) against another. More specifically, -it means block producers can extract "rent" from the system -as they have the ability to choose and order transactions within a block. - -This issue is sometimes referred to, in proof-of-work networks like Ethereum, as -`Miner Extractable Value `_ or MEV for short. -It is described in more detail -`here `__. -We refer to it as BPEV, for "Block Producer Extractable Value". -Note that the term "front-running" is misleading as it implies there is a -fiduciary relationship between block producers and transaction emitters where, -in fact, none exists unless explicitly contracted into. - -For example, upon receiving a transaction, a baker could craft a block including -this transaction and one of their own such that the sequential execution of these -two transactions guarantees a gain to the baker. - -Preventing BPEV with time-lock ------------------------------- - -BPEV can be prevented with the use of time-lock encryption -(see `Time-lock puzzles and timed release Crypto `_ -for more details). - -Time-lock encryption allows for encrypting a message so it can be -decrypted in two ways. -Either the author of the ciphertext produces a plaintext -(and a proof of correct decryption) -by providing a secret trapdoor (the factorization of an RSA modulus in our case). -Or, a sequential computation can decrypt the ciphertext after a computation -requiring ``T`` sequential operations (modular squaring in our case), -for some pre-determined constant ``T``. - -In addition, a proof of the correctness of the decryption can also be produced and checked in sub linear time (``log T`` in our case). - -By experimentally measuring the time the sequential operation takes -on available hardware using optimized implementation, one can estimate -a rough conversion (or a bound in our case) between the constant ``T`` and -wall clock time. -Note that the `VDF alliance `_ has been working on producing an ASIC for squaring in an RSA group to -ensure a level playing field in terms of computational speed. - - -General principles and usage ------------------------------ - -The typical usage pattern would be as follows: - -1. In a first period, a contract collects user-submitted and time-lock encrypted Michelson values along with some valuable deposit, such as tez. -2. In a second period, after the values are collected, the contract collects from users a decryption of the value they submitted alongside with a proof that the decryption is correct. -3. In a third period, if any value isn't decrypted, anyone can claim part of the deposit by submitting a decryption of the value, with the other part of the deposit being burnt. Different penalties can be assessed depending on whether the user merely failed to submit a decryption for their value, or if they also intentionally encrypted invalid data. Different rewards can be distributed for submitting a correct decryption. The third period needs to be long enough so that people have enough time to perform the time-lock decryption. -4. Finally, the contract can compute some function of all the decrypted data. - -There is generally no incentive for users not to provide -the decryption of their data and thus the third period generally does not need -to take place. However, the second period needs to be long enough so that bakers -cannot easily censor submission of the decryption in a bid to later claim the reward. -Burning a part of the deposit also limits grieving attacks where a user gets back -their whole deposit by providing the decryption, but in a way that delays everyone else. - -Cryptographic design --------------------- - -The time-lock features are supported by the Tezos_crypto.Timelock `library `__. - -Users first generate a RSA modulus and a symmetric encryption key. -They use authenticated encryption to encrypt a packed Michelson value (an array of bytes computed with ``PACK``) -and encrypt that encryption key using a time-lock puzzle. -They then combine the RSA modulus, the time-locked symmetric key, the constant ``T`` -and the encrypted value as a single value as well (called ``chest`` in our library). - -A proof of decryption can be the symmetric key itself. -However, a malicious user could propose an authenticated ciphertext that does not yield a valid value -even when decrypted with the symmetric key that was indeed time locked. -To avoid this threat, an opening (called ``chest_key`` in our library) includes the symmetric key and -a proof that the symmetric key proposed is indeed the one hidden in the time-lock puzzle. -In this way one can differentiate whether the chest or the chest_key was proposed by a -malicious user. - - -Opcode and types ----------------- - -To expose the features of this library, the Michelson language provides the following types: - -- ``chest``, which represents time-locked arbitrary bytes with the - necessary public parameters to open it. -- ``chest_key``, which represents the decryption key, - alongside with a proof that the key is correct. - -and the following opcode: - -``open_chest :: chest_key → chest → time → or (bytes, bool)`` - -``open_chest`` takes a ``chest`` and ``chest_key``, and produces either the underlying plaintext -or indicates that the ``chest`` or the ``chest_key`` is malicious. - -If we open the chest with a correctly generated chest key, the instruction pushes -``Left bytes`` on top of the stack where the bytes are -cryptographically guaranteed to be the bytes the chest provider time-locked. -If the ciphertext does not decrypt under the symmetric key that was time-locked, it pushes on the stack -``Right False``. -If the provided symmetric key was not the one time-locked -(detectable due to the time-lock proof), -it pushes on the stack ``Right True``. -Note that the implementation uses an authenticated encryption scheme, -so one can detect if someone provides a wrong key while fooling the time-lock proof. -This is doable only by someone knowing the factorization of the RSA modulus. -However, this cannot prevent someone from encrypting a wrong key, or putting -a wrong message authentication code, so this is why a proof of correctness is still needed. - - -Implementation of the time-lock puzzle --------------------------------------- - -The implementation of the time-lock puzzle -and proof scheme is located in :src:`src/lib_crypto/timelock.ml`. It is inspired by -the proof-of-concept shown -`here `__. - -The utility developed by `Completium `_ available `here `__, -allows a user to create chests and chest keys to interact with a smart contract. - - -Example -------- - -The raffle contract on Open Tezos `here `__ -gives a concrete example of using time-lock. diff --git a/docs/ithaca/token_management.rst b/docs/ithaca/token_management.rst deleted file mode 100644 index d105523c4dfeb5ee245029ed7ae6de2c1975f859..0000000000000000000000000000000000000000 --- a/docs/ithaca/token_management.rst +++ /dev/null @@ -1,194 +0,0 @@ -Token transfers and balance updates -=================================== - -This page describes the reporting of tokens transfers in block metadata, as a sequence of balance updates. They serve among others to the Octez client to derive and print the `Balance updates` sections of the receipts reported when operations are included in blocks. - -Overview -~~~~~~~~ - -Minting, transferring or burning tokens is handled by the `Token `_ module. -The module provides functions (``Token.transfer`` and ``Token.transfer_n``) to transfer tokens from one, respectively from more accounts, to another account. -Balance updates found in block metadata are generated by these functions as a trace of the token movements having taken place. - -Balance updates indicate that either: tokens have been minted and deposited into an account, transferred from or to another account, or taken from an account and burned. -In the Json format, a balance update consists of three parts: - - - an account identification indicated by a combination of fields such as: ``kind``, ``category``, ``contract``, ... - - - the amount transferred (in mutez) indicated by the field ``change``. - A positive amount indicates that the account has been credited, and a negative amount indicates that the account has been debited. - - - - the cause of the update given by the field ``origin`` which may have the following values: - - * ``"block"`` means that the balance update originates from the application of a block - * ``"migration"`` means that the balance update originates from migration - * ``"subsidy"`` means that the balance update originates from subsidies for liquidity baking - - -A transfer of tokens is represented by a continuous and ordered sequence of (balance) updates. -That sequence starts with a series of debits, and ends with a credit matching those debits. -In block metadata, the field ``"balance updates"`` contains one or more transfers, represented by their sequences of updates, concatenated in a flat list. -Consider for example the following list: - -:: - - [ {"kind": "...", ..., "change": "-100", "origin": "block"}, - {"kind": "...", ..., "change": "100", "origin": "block"}, - {"kind": "...", ..., "change": "-125", "origin": "block"}, - {"kind": "...", ..., "change": "-75", "origin": "block"}, - {"kind": "...", ..., "change": "200", "origin": "block"} ] - -This list reports that two transfers have occurred: a transfer of ``100`` mutez from one account to another, and a transfer of ``200`` mutez from two accounts to a third. -There is one exception to this though: migration balance updates are a bit compressed to save space, so the list of balance updates in the corresponding metadata does not necessarily allow to correlate debits to a credit by analyzing the sequence. -However, for those balance updates, the ``delegate`` and ``contract`` fields can be used to establish correlations between debits and credits. - -Source, container, and sink accounts -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -There are three kinds of accounts: source accounts, container accounts, and sink accounts. -Tokens can be transferred from source or container accounts, to container or sink accounts. -All balance updates contain the field ``kind`` which allows to determine the kind of account it refers to. -The possible values of this field are described in the following sections (they are not simply ``"source"``, ``"container"``, and ``"sink"``). -Depending on the kind of account, more fields such as the ``category`` field may be used to identify accounts more specifically. - -Source accounts ---------------- - -Source accounts are debited whenever new tokens are minted. -A balance update refers to a source account if and only if the field ``kind`` has the value ``"minted"``. -The value of the additional field ``category`` designates one of the following fictitious accounts, each containing a virtually unlimited number of tokens: - -* ``"nonce revelation rewards"`` is the source of tokens minted to reward delegates for revealing their nonces -* ``"double signing evidence rewards"`` is the source of tokens minted to reward delegates for injecting a double signing evidence -* ``"endorsing rewards"`` is the source of tokens minted to reward delegates for endorsing blocks -* ``"baking rewards"`` is the source of tokens minted to reward delegates for creating blocks -* ``"baking bonuses"`` is the source of tokens minted to reward delegates for validating blocks and including extra endorsements -* ``"subsidy"`` is the source of tokens minted to subsidize the liquidity baking CPMM contract -* ``"invoice"`` is the source of tokens minted to compensate some users who have contributed to the betterment of the chain -* ``"commitment"`` is the source of tokens minted to match commitments made by some users to supply funds for the chain -* ``"bootstrap"`` is analogous to ``"commitment"`` but is for internal use or testing. - It will not be used during normal operation on mainnet, but may be used on test networks or in sandboxed mode -* ``"minted"`` is only for internal use and may be used to mint tokens for testing. - It will not be used during normal operation on mainnet, but may appear on test networks or in sandboxed mode. - -Container accounts ------------------- - -Container accounts are regular (user and smart contract) accounts, or convenience accounts that hold tokens temporarily (e.g. when parts of a delegate's funds are frozen). -The field ``kind`` allows to identify the type of container account, it can have one of the following values: - -* ``"contract"`` represents implicit or originated accounts, and comes with the additional field (also called) ``contract`` whose value is the public key hash of the implicit or originated account. -* ``"freezer"`` represents frozen accounts, and comes with the additional field ``category`` that can have one of the following values: - - - ``"legacy_deposits"``, ``"legacy_fees"``, or ``"legacy_rewards"`` represent the accounts of frozen deposits, frozen fees or frozen rewards up to protocol HANGZHOU. - These types of accounts are further identified by the following additional fields: - - - the field ``delegate`` contains the public key hash of the delegate who owns the frozen funds - - the field ``cycle`` contains the cycle at which the funds have been deposited or granted. - - - ``"deposits"`` represents the account of frozen deposits in subsequent protocols (replacing the legacy container account ``"legacy_deposits"`` above). - This type of account is further identified by the additional field ``delegate`` whose value is the public key hash of the delegate who owns the frozen funds. -* ``"accumulator"`` represents accounts used to store tokens for some short period of time. - This type of account is further identified by the additional field ``category`` whose (only possible) value ``"block fees"`` designates the container account used to collect manager operation fees while block's operations are being applied. - Other categories may be added in the future. -* ``"commitment"`` represents the accounts of commitments awaiting activation. - This type of account is further identified by the additional field ``committer`` whose value is the encrypted public key hash of the user who has committed to provide funds. - -Sink accounts -------------- - -Sink accounts are credited whenever tokens are burned. -A balance update refers to a sink account if and only if the field ``kind`` has the value ``"burned"``. -The value of the additional field ``category`` allows to identify more specifically a fictitious account able to receive a virtually unlimited number of tokens. -The field ``category`` of a sink account may have one of the following values: - -* ``"storage fees"`` is the destination of storage fees burned for consuming storage space on the chain -* ``"punishments"`` is the destination of tokens burned as punishment for a delegate that has double baked or double endorsed -* ``"lost endorsing rewards"`` is the destination of rewards that were not distributed to a delegate. - This category comes with the following additional fields: - - - the field ``delegate`` contains the public key hash of the delegate - - the field ``participation`` has the value ``"true"`` if participation was not sufficient and has the value ``"false"`` otherwise - - the field ``revelation`` has the value ``"true"`` if the delegate has not revealed his nonce and has the value ``"false"`` otherwise. -* ``"burned"`` is only for internal use and testing. - It will not appear on mainnet, but may appear on test networks or in sandboxed mode. - -Token transfers and metadata -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Balance updates in block metadata give a complete account of all token transfers that have occurred when a block is applied. -A few cases of token transfers and the associated metadata are illustrated below. -All other cases of token transfers in the protocol follow the same pattern. -The only differences are the accounts involved. - -Origination and transaction ---------------------------- - -When an origination or transaction operation is applied, tokens are transferred from one contract to another. -Depending on whether or not storage space has been allocated on the chain by the application of the operation, storage fees may also be burned. -For example, a transaction of ``100`` mutez from address ``tz1a...`` to address ``KT1b...`` that allocates storage space for a cost of ``10`` mutez produces the following list of balance updates: - -:: - - [ {"kind": "contract", "contract": "tz1a...", "change": "-100", "origin": "block"}, - {"kind": "contract", "contract": "KT1b...", "change": "100", "origin": "block"} - {"kind": "contract", "contract": "tz1a...", "change": "-10", "origin": "block"} - {"kind": "burned", "category": "storage fees", "change": "10", "origin": "block"} ] - -Baking fees, rewards and bonuses --------------------------------- - -When a contract pays the baking fees associated to an operation it has emitted, those fees are temporarily collected (during the processing of the block) into the container account ``"block fees"``. -For example, when a manager operation is applied, the account of the payer contract is debited with the amount of fees and the ``"block fees"`` account is credited with the same amount. Hence, for ``100`` mutez in fees, the following balance updates are generated : - -:: - - [ {"kind": "contract", "contract": "tz1x...", "change": "-100", ...}, - {"kind": "accumulator", "category": "block fees", "change": "100", ...} ] - -When all operations of a block have been applied baking fees rewards and bonuses are distributed. -The total amount of fees collected and the baking rewards are transferred from the container account ``"block fees"`` and the source account ``"baking rewards"``, respectively, to the contract of the payload producer that selected the transactions to be included in the block. -So, for a total amount of ``1000`` mutez in fees collected and an amount of ``500`` mutez in baking rewards, the following balance updates are generated: - -:: - - [ {"kind": "accumulator", "category": "block fees", "change": "-1000", ...}, - {"kind": "minted", "category": "baking rewards", "change": "-500", ...}, - {"kind": "contract", "contract": "tz1a...", "change": "1500", ...} ] - -The baking bonus go to the block proposer that signed and injected the block. -Hence the amount of the bonus is transferred from the source account ``"baking bonuses"`` to the contract of the block producer. -For example, the balance updates generated for an amount of ``100`` mutez in baking bonus are: - -:: - - [ {"kind": "minted", "category": "baking bonus", "change": "-100", ...}, - {"kind": "contract", "contract": "tz1b...", "change": "100", ...} ] - -Endorsing, double signing evidence, and nonce revelation rewards ----------------------------------------------------------------- - -Endorsing rewards are reflected in balance updates as a transfer of tokens from the ``"endorsing rewards"`` source account to the account of the delegate that receives the reward. -Hence, for a reward of ``100`` mutez, the following two balance updates are generated: - -:: - - [ {"kind": "minted", "category": "endorsing rewards", "change": "-100", ...}, - {"kind": "contract", "contract": "tz1...", "change": "100", ...} ] - -When endorsing rewards are not distributed to the delegate due to insufficient participation or for not revealing nonces, they are transferred instead to the sink account identified by the quadruple ``("lost endorsing rewards", delegate, participation, revelation)``. -For example, for an amount of ``100`` mutez in rewards not distributed due to insufficient participation, the following balance updates are generated: - -:: - - [ {"kind": "minted", "category": "endorsing rewards", "change": "-100", ...}, - {"kind": "burned", - "category": "lost endorsing rewards", - "delegate": "tz1...", - "participation": "true", - "revelation": "false", - "change": "100", ...} ] - -Double signing evidence rewards and nonce revelation rewards are analogous to endorsing rewards, except that the source accounts used are ``"double signing evidence rewards"`` and ``"nonce revelation rewards"``. - diff --git a/docs/ithaca/voting.rst b/docs/ithaca/voting.rst deleted file mode 100644 index 0f4a6d144bd21551b84b431667ea74d4a1f5063f..0000000000000000000000000000000000000000 --- a/docs/ithaca/voting.rst +++ /dev/null @@ -1,338 +0,0 @@ -The Amendment (and Voting) Process -================================== - -In the Tezos blockchain, the *economic protocol* can be amended. Specifically, -there is an on-chain mechanism to propose changes to the economic protocol, to -vote for-or-against these proposed changes, and, depending on the result of the -vote, to activate these changes or not. - -Note that the proposal, voting and activation processes are part of the economic -protocol itself. Consequently the amendment rules themselves are subject to -amendments. - -The rest of this page gives more details about the amendment and voting process. - -Periods -------- - -The amendment process consists of five *periods*. Each period lasts for 40960 -blocks (5 cycles) (or approximately two weeks). The periods (listed below) -typically succeed one to another for a total duration of approximately 2 months and -a half, after which the whole amendment process starts again. - -The five periods are as follows: - -- *Proposal period*: During this period, delegates can - - - submit *protocol amendment proposals* (or, simply, *proposals*) using the - ``Proposals`` operation (see below); - - upvote one or several proposals, using the same ``Proposals`` operation. - - Each delegate can submit a maximum of 20 proposals. Duplicates count towards - this total. - - At the end of a **proposal period**, if participation reaches a - :ref:`proposal quorum `, the proposal with most support is - selected and we move to an **exploration period**. Note that support is - measured in the cumulated number of :ref:`rolls ` that delegates supporting the - proposal have. E.g., a proposal supported by a single delegate with 100 rolls - has more support than a proposal supported by two delegates with 20 rolls - each. - - If there are no proposals, or a tie between two or more proposals, - or if participation did not reach the proposal quorum, the process - moves back to a new **proposal period**. - -- *Exploration period*: During this period delegates can cast one - Yay, Nay, or Pass ballot on the selected proposal. They do so using the - ``Ballot`` operation. - - If the voting participation reaches *quorum* and there is a *super-majority* - of Yay, the process moves to the **cooldown period**. (See below for details - on participation, quorum, and super-majority.) - - Otherwise the process moves back to the **proposal period**. - -- *Cooldown period*: On-chain nothing specific happens during this period. - Off-chain the delegates can read the proposal with more scrutiny, the - community can discuss finer points of the proposal, the developers can - perform additional tests, etc. - - At the end of this period, the process moves to the **promotion period**. - -- *Promotion period*: During this period, delegates can cast a Yay, Nay, or Pass - ballots using the ``Ballot`` operation. - - If the voting participation reaches *quorum* and there is a super-majority of - Yay, the process moves to the **adoption period**. - - Otherwise the process moves back to the **proposal period**. - -- *Adoption period*: On-chain nothing specific happens during this period except - on the very last block (see below). - - Off-chain the developers release tools that include support for the - soon-to-be activated protocol, other actors (bakers, indexers, etc.) update - their infrastructure to support the newly released tools, smart-contract - developers start working with soon-to-be-available features, etc. - - At the very end of the period, the proposal is *activated*. This means that - the last block of the period is still interpreted by the current economic - protocol, but the first block after the period is interpreted by the new - economic protocol (the one that was voted in). - - And a new **proposal period** starts. - - -Activation ----------- - -After the activation step, the blocks added to the chain are interpreted in the -newly activated protocol. As a result gas costs may differ, new operations may -be available, contracts using new opcodes may be injected, etc. - -Because the amendment process is also part of the economic protocol, the -amendment process now unfolds according to the rules of the newly activated -protocol. As a result the periods may be lengthened or shortened, a new period -might be introduced, a different selection mechanism may be used, the quorum -requirement might differ, etc. - - -Voting Power ------------- - -When supporting a proposal or casting a Yay, Nay, or Pass ballot, each delegate -has voting power equal to its *stake*. The stake is always measured in -**number of rolls**. - -Note that the stake of each delegate is computed at the beginning of each -period. - - -Super-majority and Quorum -------------------------- - -As mentioned above, during either of the **exploration** or **promotion** periods, -delegates can cast ballots using the ``Ballot`` operation (see below). -In both cases, delegates can cast a single Yay, Nay, or Pass ballot. A ballot -has a weight equal to the delegate's stake as detailed above. - -For either of these two periods, the process continues to the next period if the -*vote participation* reaches *quorum* and there is a *super-majority* of -Yay. - -The *vote participation* is the ratio of all the cumulated stake of cast ballots -(including Pass ballots) to the total stake. - -For the first vote, the *quorum* started at 80% of stake. The quorum is -adjusted after each vote as detailed below. This adjustment is necessary to -ensure that the amendment process can continue even if some delegates stop -participating. After each vote the new quorum is updated based on the old quorum -and the **vote participation** with the following coefficients:: - - new-quorum = 0.8 × old-quorum + 0.2 × participation - -However, in order to avoid establishing quorums close to 100% that would be -very difficult to attain, or, conversely, low quorums close to 0% making -little participation chronicle, the quorums are lower- and upper-bounded by -:ref:`quorum_caps`. - -The *super-majority* is reached if the cumulated stake of Yay ballots is -greater than 8/10 of the cumulated stake of Yay and Nay ballots. - -Note that Pass ballots do not count towards or against the super-majority; -they still counts towards participation and quorum. - -More details can be found in the file -:src:`src/proto_012_Psithaca/lib_protocol/amendment.ml`. - - -The Hash and the Protocol -------------------------- - -On the one hand, the voting part of the process revolves around the -**hash of a protocol**. Specifically, a delegate submits a hash of a -protocol, and all the delegates cast ballots on the proposed hash. -The *hash of a protocol* is the hash of the files that constitute the source -code of the protocol. - -On the other hand, the **protocol activation** (at the end of the -**adoption period**) revolves around the compiled sources of the protocol. - -Basically, the voting process works on an identifier of the protocol whilst the -activation step works on the protocol itself. Consequently, if a protocol hash -is voted in and the protocol it identifies is invalid, the activation step -fails. - -.. sidebar:: Checking a hash is of a valid protocol - - When a hash is proposed by a delegate, it is usually accompanied by some - blogposts and forum threads on :ref:`community websites `. - These should include directions for testing the proposed protocols. If you - cannot find such directions, do not hesitate to ask. - -.. sidebar:: Localised failures - - It is possible that the activation step fails on a single node or a few nodes - of the network, but succeed on the others. In this case the nodes with the - failure are stuck, but the network as a whole continues. - - The most likely cause for this is nodes that have not been updated and do not - include a new protocol environment version. - - If your node becomes stuck, you should start a fresh up-to-date node. - -A protocol is *invalid* if its code cannot be compiled (e.g., if the code is not -valid source code), if its code uses functions not present in the -:doc:`protocol environment <../shell/protocol_environment>`, or if it -downgrades the protocol environment version. - -If an invalid protocol is voted in, then the activation fails for all the nodes, -and then the chain becomes stuck. This is why it is important to vote for hashes -that designate valid protocols: ones with sources that are available and that -can be compiled. - -Operations ----------- - -There are two operations used by the delegates: **proposals** and **ballot**. - -A *proposals* operation can only be injected during a proposal period. - -:: - - Proposals : { - source: Signature.Public_key_hash.t ; - period: Voting_period_repr.t ; - proposals: Protocol_hash.t list ; } - -The ``source`` is the public key hash of the delegate, ``period`` is the unique -identifier of each voting period and ``proposals`` is a non-empty list of -maximum 20 protocol hashes. -The operation can be submitted more than once but only as long as the -cumulative length of the proposals lists is less than 20. -Duplicate proposals from the same delegate are accounted for in the -maximum number of proposals for that delegate. -However duplicates from the same delegate are not tallied at the end -of the proposal period. - -For example, a delegate submits a *proposals* operation for protocols A -and B early in the proposal period, later a new protocol C is revealed -and the delegate submits another *proposals* operation for protocols B -and C. -The list of submissions that will be tallied is [A,B,C]. - -A *ballot* operation can only be submitted during periods where a vote happens -(e.g. exploration, promotion), and only once per period. - -:: - - Ballot : { - source: Signature.Public_key_hash.t ; - period: Voting_period_repr.t ; - proposal: Protocol_hash.t ; - ballot: Vote_repr.ballot ; } - -The fields ``source`` and ``period`` are the same as above, while ``proposal`` -is the currently selected proposal and ``ballot`` is one of ``Yay``, ``Nay`` or -``Pass``. -The ``Pass`` vote allows a delegate to contribute towards the quorum without -contributing towards the super-majority. This is important because, as detailed -above, the quorum is adaptive and that low participation would lower the -quorum of the next vote. - -More details on the operations can be found in -:src:`src/proto_012_Psithaca/lib_protocol/operation_repr.ml`. -The binary format is described by -``tezos-client describe unsigned operation``. - -Client Commands ---------------- - -The Octez client, ``tezos-client``, provides commands for basic exploration and -interaction with the amendment and voting process. - - -Show -~~~~ - -Tezos' client provides a command to show the status of a voting period. -It displays different information for different kind of periods, as -in the following samples:: - - $ tezos-client show voting period - Current period: "proposal" - Blocks remaining until end of period: 59 - Current proposals: - PsNa6jTtsRfbGaNSoYXNTNM5A7c3Lji22Yf2ZhpFUjQFC17iZVp 400 - - $ tezos-client show voting period - Current period: "exploration" - Blocks remaining until end of period: 63 - Current proposal: PsNa6jTtsRfbGaNSoYXNTNM5A7c3Lji22Yf2ZhpFUjQFC17iZVp - Ballots: { "yay": 400, "nay": 0, "pass": 0 } - Current participation 20.00%, necessary quorum 80.00% - Current in favor 400, needed supermajority 320 - - $ tezos-client show voting period - Current period: "cooldown" - Blocks remaining until end of period: 64 - Current proposal: PsNa6jTtsRfbGaNSoYXNTNM5A7c3Lji22Yf2ZhpFUjQFC17iZVp - -It should be noted that the ballot number 400 above is the stake counted in -number of rolls. -The proposal has a total stake of 400 rolls, which may come from a single ballot -from a delegate having 400 rolls, or it may come from multiple ballots from -delegates with a combined stake of 400 rolls. - - -Submit proposals -~~~~~~~~~~~~~~~~ - -During a proposal period, a list of proposals can be submitted with:: - - tezos-client submit proposals for ... - -Remember that each delegate can submit a maximum of 20 protocol -hashes and that duplicates count towards this total. -Moreover each proposal is accepted only if it meets one of the -following two conditions: - -- the protocol hash was already proposed on the network. In this case - we can submit an additional proposal that "upvotes" an existing one - and our rolls are added to the ones already supporting the proposal. -- the protocol is known by the node. In particular the first proposer - of a protocol should be able to successfully inject the protocol in - its node which performs some checks, compiles and loads the - protocol. - -These are protection measures that the Octez client takes to prevent the -accidental injection of invalid protocols. As mentioned above, it is still -important to check the validity of the protocols that you vote for as they may -have been injected via different means. - - -Submit ballots -~~~~~~~~~~~~~~ - -During either of the **exploration** or **promotion** periods, -ballots can be submitted once with:: - - tezos-client submit ballot for - -Further External Resources --------------------------- - -Further details and explanations on the voting procedure can be found at: - -- `Governance on-chain `_ on Open Tezos -- `Tezos Governance `_ on Tezos Agora. - -For more details on the client commands refer to the manual at -:ref:`client_manual_ithaca`. - -For vote related RPCs check the :doc:`rpc` under the prefix -``votes/``. - -For Ledger support refer to Obsidian Systems' `documentation -`__. diff --git a/docs/jakarta/cli-commands.rst b/docs/jakarta/cli-commands.rst index 93ac8ddf328acc67f3b8f5a87f9b99dd4d909ab1..eb3d7c891a4523dc2e862e33e698a51ae8571a7f 100644 --- a/docs/jakarta/cli-commands.rst +++ b/docs/jakarta/cli-commands.rst @@ -14,6 +14,7 @@ The rest of this page documents the protocol-dependent tools. The protocol-independent tools are documented :doc:`here <../shell/cli-commands>`. +.. _client_manual: .. _client_manual_jakarta: Client manual @@ -23,6 +24,7 @@ Client manual :file: tezos-client.html +.. _baker_manual: .. _baker_manual_jakarta: Baker manual @@ -32,6 +34,7 @@ Baker manual :file: tezos-baker.html +.. _accuser_manual: .. _accuser_manual_jakarta: Accuser manual diff --git a/docs/jakarta/consensus.rst b/docs/jakarta/consensus.rst index 972d65a4169dd598a07efa37cf73292c8d5ed25c..78d8495a57431e4d09b46d6c89508db0bb544e80 100644 --- a/docs/jakarta/consensus.rst +++ b/docs/jakarta/consensus.rst @@ -50,6 +50,7 @@ length in the `technical report `_ and in a post `_. Here we only provide a user/developer perspective. +.. _tb_validator: .. _tb_validator_jakarta: Tenderbake is executed for each new block level by a "committee" whose members @@ -79,12 +80,14 @@ Round durations thus increase linearly with ``DELAY_INCREMENT_PER_ROUND``. Schematically, a round consists in the following steps: +.. _candidate_block: .. _candidate_block_jakarta: * a validator designated for that round injects a *candidate block* (representing a proposal) and consensus operations (representing votes) into the node to which it is attached, which then * diffuses those blocks and consensus operations to other nodes of the network, and thus * communicates them to the validators attached to those nodes, to carry out voting on which block to accept. +.. _quorum: .. _quorum_jakarta: Unlike Emmy*, Tenderbake has `two types of @@ -105,6 +108,7 @@ the same *payload* as the initial block. We talk about a *re-proposal* in this case. +.. _finality: .. _finality_jakarta: Transaction and block finality @@ -138,6 +142,9 @@ should be taken at round 0, meaning that the time between blocks would be :math:`round\_duration(0)` seconds i.e., parameter ``MINIMAL_BLOCK_DELAY``. +.. _active_stake: +.. _active_stake_jakarta: + Validator selection: staking balance, active stake, and frozen deposits ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -368,6 +375,7 @@ included during that cycle has been ``3,123,456`` slots. Given that this number bigger than the minimum required (``2,867,200 * 2 / 3``), it receives an endorsing reward of ``2,867,200 * 0.002857 = 8191.59`` tez for that cycle. +.. _slashing: .. _slashing_jakarta: Slashing @@ -396,6 +404,7 @@ correct validators have more than two thirds of the total stake, these correct validators have sufficient power for agreement to be reached, thus the lack of participation of a selfish baker does not have an impact. +.. _cs_constants: .. _cs_constants_jakarta: Consensus related protocol parameters @@ -433,6 +442,7 @@ Consensus related protocol parameters - ``endorsing_reward / CONSENSUS_COMMITTEE_SIZE`` = 0.002857 tez +.. _shell_proto_revisit: .. _shell_proto_revisit_jakarta: Shell-protocol interaction revisited @@ -449,6 +459,7 @@ As in Emmy*, the protocol-specific header contains the fields: There are two additional fields: ``payload_hash`` and ``payload_round`` which are needed for establishing if a block is :ref:`final`. +.. _fitness: .. _fitness_jakarta: The fitness is given by the tuple ``(version, level, locked_round, - predecessor_round - 1, round)``. diff --git a/docs/jakarta/glossary.rst b/docs/jakarta/glossary.rst index a51124afcde2b5c86350ebb0a4988492c3dd1385..d1d4137f890ec8367522262ff1c403100328f3a3 100644 --- a/docs/jakarta/glossary.rst +++ b/docs/jakarta/glossary.rst @@ -123,6 +123,7 @@ _`Implicit account` letters `tz` followed by `1`, `2` or `3` (depending on the signature scheme) and finally the hash of the public key. +.. _glossary_michelson: .. _glossary_michelson_jakarta: Michelson @@ -147,6 +148,9 @@ _`Round` the round's corresponding time span. Baking_ outside of one's designated round results in an invalid block_. +.. _glossary_roll: +.. _glossary_roll_jakarta: + _`Roll` An amount of tez (e.g., 6000ꜩ) serving as a minimal amount for a delegate to have baking_ and voting rights in a cycle_. However, diff --git a/docs/jakarta/liquidity_baking.rst b/docs/jakarta/liquidity_baking.rst index 56e210a0eae301523119f984a48fdb28d20b8b0d..35fe9d2598fe154b3be6f4ceb34ab23b9f403c24 100644 --- a/docs/jakarta/liquidity_baking.rst +++ b/docs/jakarta/liquidity_baking.rst @@ -34,6 +34,7 @@ As a safety precaution, the subsidy expires automatically at a given level called the liquidity baking sunset level. The sunset level can be renewed periodically by protocol amendment. +.. _toggle: .. _toggle_jakarta: Toggle vote diff --git a/docs/jakarta/michelson.rst b/docs/jakarta/michelson.rst index a8741d3ebc15806ab90980208d4713dd10e70d2d..95bae23e1eb5de18892f96c2ac9d1bfb01c55deb 100644 --- a/docs/jakarta/michelson.rst +++ b/docs/jakarta/michelson.rst @@ -29,6 +29,7 @@ the specification. The document also starts with a less formal explanation of the context: how Michelson code interacts with the blockchain. +.. _address_prefixes: .. _address_prefixes_jakarta: Semantics of smart contracts and transactions @@ -308,6 +309,7 @@ The concrete language also has some syntax sugar to group some common sequences of operations as one. This is described in this specification using a simple regular expression style recursive instruction rewriting. +.. _michelson_type_system: .. _michelson_type_system_jakarta: Introduction to the type system and notations @@ -1493,6 +1495,7 @@ value that was previously stored in the ``map`` at the same key as Operations on ``big_maps`` ~~~~~~~~~~~~~~~~~~~~~~~~~~ +.. _OperationsOnBigMaps: .. _OperationsOnBigMaps_jakarta: Big maps have three possible representations. A map literal is always @@ -1890,6 +1893,7 @@ until it is actually originated. The parameter must be consistent with the one expected by the contract, unit for an account. +.. _MichelsonSetDelegate: .. _MichelsonSetDelegate_jakarta: - ``SET_DELEGATE``: Set or withdraw the contract's delegation. @@ -2268,6 +2272,7 @@ comprehensive description of the Sapling protocol. with `sapling_state ms` being the empty state (ie. no one can spend tokens from it) with memo_size `ms` +.. _MichelsonTickets: .. _MichelsonTickets_jakarta: Operations on tickets @@ -2379,6 +2384,7 @@ parameter if the sender is the contract's manager. :: 'S -> nat : 'S +.. _MichelsonViews: .. _MichelsonViews_jakarta: Operations on views @@ -2693,6 +2699,7 @@ A typing rule can be inferred: Concrete syntax --------------- +.. _ConcreteSyntax: .. _ConcreteSyntax_jakarta: The concrete language is very close to the formal notation of the @@ -3242,6 +3249,7 @@ type (which can be changed). For instance the annotated typing rule for Special annotations ~~~~~~~~~~~~~~~~~~~ +.. _SpecialAnnotations: .. _SpecialAnnotations_jakarta: The special variable annotations ``@%`` and ``@%%`` can be used on instructions diff --git a/docs/jakarta/plugins.rst b/docs/jakarta/plugins.rst index d013ba1c43032dd2a0cc04e6e5fc03339cef79f5..590fbff4d4f72383787f8ba71c5094dd3f38f7f1 100644 --- a/docs/jakarta/plugins.rst +++ b/docs/jakarta/plugins.rst @@ -35,6 +35,7 @@ In turn protocol plugins may, for example: - implement some common operations that are customized for each protocol (e.g., :ref:`prevalidator_filters_jakarta`). +.. _prevalidator_filters: .. _prevalidator_filters_jakarta: Prevalidator filters @@ -54,6 +55,7 @@ The interface of the prevalidator plugin is described at the `mempool plugin API The different kinds of prevalidator filters are described below. +.. _fees_filter: .. _fees_filter_jakarta: Fees filter @@ -71,6 +73,7 @@ configuration of your node. This filtering strategy is implemented in the ``prefilter`` (see :doc:`../shell/prevalidation`). +.. _consensus_filter: .. _consensus_filter_jakarta: Consensus filter @@ -196,6 +199,7 @@ to be the smallest manager operation, with 126 Bytes, so there are at most 512 * 1024 / 126 = 4161 manager operations per block. +.. _active_filter_rpc: .. _active_filter_rpc_jakarta: Filters RPCs diff --git a/docs/jakarta/precheck.rst b/docs/jakarta/precheck.rst index d9aa89ab9516171ca4adb03d6696eb5a36e5feb2..0e9c7fce276130d78d870e5000f204868e40c7d1 100644 --- a/docs/jakarta/precheck.rst +++ b/docs/jakarta/precheck.rst @@ -34,6 +34,7 @@ Note however that one can still inject successive operations with the same counter using the ``replace-by-fee`` feature. +.. _solvability: .. _solvability_jakarta: Solvable operations diff --git a/docs/jakarta/proof_of_stake.rst b/docs/jakarta/proof_of_stake.rst index 01706c881b0ed2bd11a83dceda1bad4f9eacdbe6..69df8355d600220b95b0578d641cfd381c9630e3 100644 --- a/docs/jakarta/proof_of_stake.rst +++ b/docs/jakarta/proof_of_stake.rst @@ -53,6 +53,7 @@ from the delegates' own balance. Active and passive delegates ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.. _active_delegate: .. _active_delegate_jakarta: A delegate can be marked as either active or passive. A passive @@ -71,6 +72,7 @@ Delegates' rights selection Tezos being proof-of-stake, the delegates' rights are selected at random based on their stake. In what follows we detail the selection mechanism used in Tezos. +.. _random_seed: .. _random_seed_jakarta: Random seed @@ -126,6 +128,7 @@ is the seed of cycle ``n-1``; at each iteration, the new bitstring is the hash of the concatenation of the previous bitstring with the iterated revealed nonce. +.. _snapshots: .. _snapshots_jakarta: Stake snapshots @@ -148,6 +151,7 @@ cycle ``n``. Only the stake of active delegates with the minimal stake of ``TOKENS_PER_ROLL`` is snapshot. +.. _rights: .. _rights_jakarta: Slot selection @@ -180,6 +184,7 @@ simple procedure which has as its initial state: the level, the level belongs, and the slot. +.. _protocol_constants: .. _protocol_constants_jakarta: Protocol constants @@ -193,6 +198,7 @@ The values of protocol constants can be found using a :ref:`specific RPC call `. The fitness determines a total ordering between blocks. +.. _shell_proto_interact: .. _shell_proto_interact_jakarta: Shell-protocol interaction @@ -88,6 +89,7 @@ and :ref:`the protocol-specific part`. This separation enables the shell to interact with different protocols. +.. _validation_passes: .. _validation_passes_jakarta: Operations & Validation Passes diff --git a/docs/jakarta/transaction_rollups.rst b/docs/jakarta/transaction_rollups.rst index 17883f34f07ee56c16beb52fe2489621b7777f9b..57c97e2082f43bfd3dea1583d763b34efaabc209 100644 --- a/docs/jakarta/transaction_rollups.rst +++ b/docs/jakarta/transaction_rollups.rst @@ -428,6 +428,7 @@ refunded by another layer-1 operation, once the last commitment on the rollup from its creator has been removed from the context (that is, after the finality and withdrawal period). +.. _rejected: .. _rejected_jakarta: If a commitment is wrong (that is, its Merkle proof does not @@ -460,6 +461,7 @@ succeeds. So such messages are always treated as no-ops. In the case of a valid rejection, half of the commitment bond goes to the rejector; the rest is burned. +.. _withdrawals: .. _withdrawals_jakarta: Ticket withdrawals diff --git a/docs/kathmandu/consensus.rst b/docs/kathmandu/consensus.rst index c5418b49f0b6221a7b2fa5d1a3185f677d539eeb..643caff955f60352b2107736014bf4fdee64a1db 100644 --- a/docs/kathmandu/consensus.rst +++ b/docs/kathmandu/consensus.rst @@ -138,6 +138,8 @@ should be taken at round 0, meaning that the time between blocks would be :math:`round\_duration(0)` seconds i.e., parameter ``MINIMAL_BLOCK_DELAY``. +.. _active_stake_kathmandu: + Validator selection: staking balance, active stake, and frozen deposits ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/kathmandu/glossary.rst b/docs/kathmandu/glossary.rst index 930645d2558ef1e6ab3bc5679b319fcfea6f1d36..fb9f089d1b2a1c28588549575d055b0992cb21f7 100644 --- a/docs/kathmandu/glossary.rst +++ b/docs/kathmandu/glossary.rst @@ -147,6 +147,8 @@ _`Round` the round's corresponding time span. Baking_ outside of one's designated round results in an invalid block_. +.. _glossary_roll_kathmandu: + _`Roll` An amount of tez (e.g., 6000ꜩ) serving as a minimal amount for a delegate to have baking_ and voting rights in a cycle_. However, diff --git a/docs/protocols/013_jakarta.rst b/docs/protocols/013_jakarta.rst index 32314fb64bde3d9107428080bdd9d9fcdf44bbc6..29f5ff66bc4246aafaca098efe4330239e616c38 100644 --- a/docs/protocols/013_jakarta.rst +++ b/docs/protocols/013_jakarta.rst @@ -201,7 +201,7 @@ Breaking Changes Bonds are like deposits. However, they can be associated to implicit or originated accounts, unlike deposits that only apply to implicit accounts that are also - delegates (see :doc:`../jakarta/token_management`). + delegates (see :doc:`../active/token_management`). (MR :gl:`!4437`) Bug Fixes diff --git a/docs/user/fa12.rst b/docs/user/fa12.rst index 263494824864dc36bf02c15f40aa9fd22ba382ed..0f19620f84b242626a62931e1a00d9b1ddb76328 100644 --- a/docs/user/fa12.rst +++ b/docs/user/fa12.rst @@ -101,7 +101,7 @@ transfers is the following: The complete schema can be inspected via ``tezos-codec describe .fa1.2.token_transfer json schema`` (where ```` -can be replaced with e.g. ``alpha`` or ``012-Psithaca``). +can be replaced with e.g. ``alpha`` or ``013-PtJakart``). View information diff --git a/docs/user/multinetwork.rst b/docs/user/multinetwork.rst index 8b14c468877678162eedc4006e6337e70ded2efc..da78e68412f8fe50429a5de31da6f82efee05b1e 100644 --- a/docs/user/multinetwork.rst +++ b/docs/user/multinetwork.rst @@ -32,11 +32,11 @@ Built-In Networks ----------------- The simplest way to select the network to connect to is to use the ``--network`` -option when you initialize your :doc:`node configuration <./node-configuration>`. For instance, to run on Ithacanet:: +option when you initialize your :doc:`node configuration <./node-configuration>`. For instance, to run on Jakartanet:: - tezos-node config init --data-dir ~/tezos-ithacanet --network ithacanet - tezos-node identity generate --data-dir ~/tezos-ithacanet - tezos-node run --data-dir ~/tezos-ithacanet + tezos-node config init --data-dir ~/tezos-jakartanet --network jakartanet + tezos-node identity generate --data-dir ~/tezos-jakartanet + tezos-node run --data-dir ~/tezos-jakartanet .. note:: Once initialized, the node remembers its network settings on subsequent runs @@ -54,21 +54,17 @@ the following built-in networks: - ``sandbox`` -- ``ithacanet`` (available from version 12.0~rc1 but 12.0~rc2 updated - it to refer to the second version of Ithacanet which runs - ``Psithaca2`` instead of ``PsiThaCa``) - - ``jakartanet`` (available from version 13.0) If you did not initialize your node configuration, or if your configuration file contains no ``network`` field, the node assumes you want to run Mainnet. You can use the ``--network`` option with ``tezos-node run`` to make sure your node runs on the expected network. For instance, to make sure that -it runs on Ithacanet:: +it runs on Jakartanet:: - tezos-node run --data-dir ~/tezos-ithacanet --network ithacanet + tezos-node run --data-dir ~/tezos-jakartanet --network jakartanet -This command will fail with an error if the configured network is not Ithacanet. +This command will fail with an error if the configured network is not Jakartanet. The node also displays the chain name (such as ``TEZOS_MAINNET``) when it starts. Also mind opening the :doc:`RPC interface <../developer/rpc>` as appropriate. @@ -201,11 +197,11 @@ Alias Versus Explicit Configuration If you use one of the `Built-In Networks`_, the configuration file stores the name of the network to connect to. For instance, if you configured it -to connect to Ithacanet, it will contain something like:: +to connect to Jakartanet, it will contain something like:: { "p2p": {}, - "network": "ithacanet" + "network": "jakartanet" } For Mainnet, it would contain ``mainnet``, or nothing as this is actually the default. @@ -217,7 +213,7 @@ overrides may be added. Because the configuration file only contains the name of the network and not its parameters, it will automatically use the updated values. However, if you configure `Custom Networks`_, the configuration file will -no longer contain an alias such as ``mainnet`` or ``ithacanet``. Instead, +no longer contain an alias such as ``mainnet`` or ``jakartanet``. Instead, it will explicitly contain the list of bootstrap peers, user-activated upgrades and user-activated protocol overrides that you specify. This means that when you update your node, updates to built-in network parameters will have no effect.