Get desktop application:
View/edit binary Protocol Buffers messages
AccountIdentifier The account_identifier uniquely identifies an account within a network. All fields in the account_identifier are utilized to determine this uniqueness (including the metadata field, if populated).
Used in:
The address may be a cryptographic public key (or some encoding of it) or a provided username.
The sub account identifier
Blockchains that utilize a username model (where the address is not a derivative of a cryptographic public key) should specify the public key(s) owned by the address in metadata.
Amount is some Value of a Currency. It is considered invalid to specify a Value without a Currency.
Used in:
Value of the transaction in atomic units represented as an arbitrary-sized signed integer. For example, 1 BTC would be represented by a value of 100000000.
Currency is composed of a canonical Symbol and Decimals. This Decimals value is used to convert an Amount.Value from atomic units (Satoshis) to standard units (Bitcoins).
The metadata is protocol specific metadata
Blocks contain an array of Transactions that occurred at a particular BlockIdentifier. A hard requirement for blocks returned by Rosetta implementations is that they MUST be immutable: once a client has requested and received a block identified by a specific BlockIndentifier, all future calls for that same BlockIdentifier must return the same block contents.
Used in: ,
BlockIdentifier uniquely identifies a block in a particular network.
BlockIdentifier uniquely identifies a block in a particular network.
The timestamp of the block since the Unix Epoch. The rosetta spec only support timestamp in milliseconds granularity. (-- api-linter: core::0142::time-field-names=disabled go/aip/not-precedent: This field was called timestamp in rosetta spec. --)
Transactions within the block.
Metadata for the block.
The block identifier uniquely identifies a block in a particular network.
Used in:
The block height. Note that this this should be >= 0
The block hash.
CoinChange is used to represent a change in state of a coin identified by a coin_identifier. This object is part of the Operation model and must be populated for UTXO-based blockchains. Coincidentally, this abstraction of UTXOs allows for supporting both account-based transfers and UTXO-based transfers on the same blockchain (when a transfer is account-based, don't populate this model).
Used in:
CoinIdentifier uniquely identifies a Coin.
CoinActions are different state changes that a Coin can undergo
CoinActions are different state changes that a Coin can undergo. It is assumed that a single Coin cannot be created or spent more than once.
Used in:
COIN_ACTION_UNSPECIFIED indicating a CoinAction is not set
COIN_CREATED indicating a Coin was created.
COIN_SPENT indicating a Coin was spent.
CoinIdentifier uniquely identifies a Coin.
Used in:
Identifier should be populated with a globally unique identifier of a Coin. In Bitcoin, this identifier would be transaction_hash:index.
Currency is composed of a canonical Symbol and Decimals. This Decimals value is used to convert an Amount.Value from atomic units (Satoshis) to standard units (Bitcoins).
Used in:
Canonical symbol associated with a currency.
Number of decimal places in the standard unit representation of the amount. For example, BTC has 8 decimals. Note that it is not possible to represent the value of some currency in atomic units that is not base 10.
Any additional information related to the currency itself. For example, it would be useful to populate this object with the contract address of an ERC-20 token.
NetworkIdentifier specifies which network a particular object is associated with.
Used in:
Blockchain the network is associated with
If a blockchain has a specific chain-id or network identifier, it should go in this field. It is up to the client to determine which network-specific identifier is mainnet or testnet.
In blockchains with sharded state, the SubNetworkIdentifier is required to query some object on a specific shard. This identifier is optional for all non-sharded blockchains.
Operations contain all balance-changing information within a transaction. They are always one-sided (only affect 1 AccountIdentifier) and can succeed or fail independently from a Transaction. Operations are used both to represent on-chain data (Data API) and to construct new transactions (Construction API), creating a standard interface for reading and writing to blockchains.
Used in:
The operation_identifier uniquely identifies an operation within a transaction.
Restrict referenced related_operations to identifier indices " the current operation_identifier.index. This ensures there exists a clear DAG-structure of relations. Since operations are one-sided, one could imagine relating operations in a single transfer or linking operations in a call tree.
Type is the network-specific type of the operation. Ensure that any type that can be returned here is also specified in the NetworkOptionsResponse. This can be very useful to downstream consumers that parse all block data.
Status is the network-specific status of the operation. Status is not defined on the transaction object because blockchains with smart contracts may have transactions that partially apply (some operations are successful and some are not). Blockchains with atomic transactions (all operations succeed or all operations fail) will have the same status for each operation. On-chain operations (operations retrieved in the /block and /block/transaction endpoints) MUST have a populated status field (anything on-chain must have succeeded or failed). However, operations provided during transaction construction (often times called "intent" in the documentation) MUST NOT have a populated status field (operations yet to be included on-chain have not yet succeeded or failed).
The account_identifier uniquely identifies an account within a network. All fields in the account_identifier are utilized to determine this uniqueness (including the metadata field, if populated).
Amount is some Value of a Currency. It is considered invalid to specify a Value without a Currency.
CoinChange is used to represent a change in state of a some coin identified by a coin_identifier. This object is part of the Operation model and must be populated for UTXO-based blockchains. Coincidentally, this abstraction of UTXOs allows for supporting both account-based transfers and UTXO-based transfers on the same blockchain (when a transfer is account-based, don't populate this model).
Metadata stores any protocol specific information regarding the operation
OperationIdentifier uniquely identifies an operation within a transaction.
Used in:
The operation index is used to ensure each operation has a unique identifier within a transaction. This index is only relative to the transaction and NOT GLOBAL. The operations in each transaction should start from index 0. To clarify, there may not be any notion of an operation index in the blockchain being described.
Some blockchains specify an operation index that is essential for client use. For example, Bitcoin uses a network_index to identify which UTXO was used in a transaction. network_index should not be populated if there is no notion of an operation index in a blockchain (typically most account-based blockchains). Note that this this should be >= 0
RelatedTransaction allows implementations to link together multiple transactions.
Used in:
The network_identifier specifies which network a particular object is associated with. An unpopulated network identifier indicates that the related transaction is on the same network.
The transaction_identifier uniquely identifies a transaction in a particular network and block or in the mempool.
Used by RelatedTransaction to indicate the direction of the relation. Can be used to indicate if a transaction relation is from child to parent or the reverse.
Used by RelatedTransaction to indicate the direction of the relation (i.e. cross-shard/cross-network sends may reference backward to an earlier transaction and async execution may reference forward). Can be used to indicate if a transaction relation is from child to parent or the reverse.
Used in:
DIRECTION_UNSPECIFIED indicating the direction is not specified.
FORWARD indicating a transaction relation is from parent to child.
BACKWARD indicating a transaction relation is from child to parent.
An account may have state specific to a contract address (ERC-20 token) and/or a stake (delegated balance). The sub_account_identifier should specify which state (if applicable) an account instantiation refers to.
Used in:
The SubAccount address may be a cryptographic value or some other identifier (ex: bonded) that uniquely specifies a SubAccount.
If the SubAccount address is not sufficient to uniquely specify a SubAccount, any other identifying information can be stored here. It is important to note that two SubAccounts with identical addresses but differing metadata will not be considered equal by clients.
In blockchains with sharded state, the SubNetworkIdentifier is required to query some object on a specific shard. This identifier is optional for all non-sharded blockchains.
Used in:
The subnetwork identifier.
Metadata info for the subnetwork.
Transactions contain an array of Operations that are attributable to the same TransactionIdentifier.
Used in: ,
The transaction_identifier uniquely identifies a transaction in a particular network and block or in the mempool.
The operations is an array of Operations that are associated with the transaction
The related_transaction allows implementations to link together multiple transactions. An unpopulated network identifier indicates that the related transaction is on the same network.
Transactions that are related to other transactions (like a cross-shard transaction) should include the tranaction_identifier of these transactions in the metadata.
TransactionIdentifier uniquely identifies a transaction in a particular network and block or in the mempool.
Used in: ,
The hash of the transaction. Any transactions that are attributable only to a block (ex: a block event) should use the hash of the block as the identifier.