Skip to main content
Version: 2.0.0

Understanding Key Types

For user convenience and compatibility, we expect the delivery of hashes, keys, and similar data as a prefixed string when using the node. The following is a list of string representations used.

Key Explanations

Key is a wrapper type that may contain one of several possible sets of data.

Account

Key::Account contains an AccountHash.

TypePrefixExample
Key::Accountaccount-hash-account-hash-ef4687f74d465826239bab05c4e1bdd2223dd8c201b96f361f775125e624ef70

Hash

Key::Hash contains a byte array with a length of 32, which can be used to pass any of the hashes. Please take note that the developer of the contract is responsible for the implementation of any checks necessary on the receiving side.

TypePrefixExample
Key::Hashhash-hash-0101010101010101010101010101010101010101010101010101010101010101

URef

Key::URef contains an URef suffixed by access rights.

TypePrefixExample
Key::URefuref-uref-0101010101010101010101010101010101010101010101010101010101010101-001

Transfer

Key::Transfer should contain the address hash for a transfer.

TypePrefixExample
Key::Transfertransfer-transfer-0101010101010101010101010101010101010101010101010101010101010101

DeployInfo

Key::DeployInfo retains the address hash of deploy information.

TypePrefixExample
Key::DeployInfodeploy-deploy-0101010101010101010101010101010101010101010101010101010101010101

EraInfo

Key::EraInfo is the integer number of the associated era.

TypePrefixExample
Key::EraInfoera-era-1

Balance

Key::Balance is the balance of a purse.

TypePrefixExample
Key::Balancebalance-balance-0101010101010101010101010101010101010101010101010101010101010101

BalanceHold

Key::BalanceHold is a Key under which a hold on a purse balance is stored.

TypePrefixExample
Key::BalanceHoldbalance-hold-balance-hold-002a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a6400000000000000

Bid

Key::Bid is used to keep track of bids for the auction contract. It is not generally used by users.

TypePrefixExample
Key::Bidbid-bid-ef4687f74d465826239bab05c4e1bdd2223dd8c201b96f361f775125e624ef70

Withdraw

Key::Withdraw is used to keep track of withdraws for the auction contract. It is not generally used by users and exists in a historical context.

TypePrefixExample
Key::Withdrawwithdraw-withdraw-ef4687f74d465826239bab05c4e1bdd2223dd8c201b96f361f775125e624ef70

Dictionary

Key::Dictionary is the hash derived from a URef and a piece of arbitrary data and leads to a dictionary.

TypePrefixExample
Key::Dictionarydictionary-dictionary-0101010101010101010101010101010101010101010101010101010101010101

SystemContractRegistry

Key::SystemContractRegistry is a unique Key under which a mapping of the names and ContractHashes for system contracts, including Mint, Auction, HandlePayment and StandardPayment, is stored.

TypePrefixExample
Key::SystemContractRegistrysystem-entity-registry-system-entity-registry-0000000000000000000000000000000000000000000000000000000000000000

EraSummary

Key::EraSummary is a Key under which we store current era info.

TypePrefixExample
Key::EraSummaryera-summary-era-summary-00000000000000000000000000000000

Unbond

Key::Unbond is a variant of the key type that tracks unbonding purses.

TypePrefixExample
Key::Unbondunbond-unbond-ef4687f74d465826239bab05c4e1bdd2223dd8c201b96f361f775125e624ef70

ChainspecRegistry

Key::ChainspecRegistry is a unique Key which contains a mapping of file names to the hash of the file itself. These files include Chainspec.toml and may also include Accounts.toml and GlobalState.toml.

TypePrefixExample
Key::ChainspecRegistrychainspec-registry-chainspec-registry-11111111111111111111111111111111

ChecksumRegistry

Key::ChecksumRegistry is a unique key variant under which we write a registry of checksums for a given block. There are two checksums in the registry, one for the execution results and the other for the approvals of all transactions in the block.

|Key::ChecksumRegistry | checksum-registry- | checksum-registry-00000000000000000000000000000000 |

BidAddr

Key::BidAddr manages data associated with bids for the Auction contract. It may be any one of three variants: unified, validator, or delegator.

TypePrefixExample
Unifiedbid-addr-00bid-addr-00ef4687f74d465826239bab05c4e1bdd2223dd8c201b96f361f775125e624ef70
Validatorbid-addr-01bid-addr-01ef4687f74d465826239bab05c4e1bdd2223dd8c201b96f361f775125e624ef70
Delegatorbid-addr-02bid-addr-02ef4687f74d465826239bab05c4e1bdd2223dd8c201b96f361f775125e624ef70ef4687f74d465826239bab05c4e1bdd2223dd8c201b96f361f775125e624ef70

Package

Key::Package is a Key under which package information is stored.

TypePrefixExample
Key::Packagepackage-package-2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a

AddressableEntity

Key::AddressableEntity is a Key under which an AddressableEntity is stored. It may be one of three variants: Account, System or SmartContract.

TypePrefixExample
Accountaddressable-entity-account-addressable-entity-account-2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a
Systemaddressable-entity-system-addressable-entity-system-2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a
SmartContractaddressable-entity-contract-addressable-entity-contract-2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a

ByteCode

Key::ByteCode is a Key under which a byte code record is stored. It may be one of two variants: v1-wasm or empty.

TypePrefixExample
v1-wasmbyte-code-v1-wasm-byte-code-v1-wasm-2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a
emptybyte-code-empty-byte-code-empty-2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a

Message

Key::Message is a Key under which a message is stored.

TypePrefixExample
Message Topicmessage-topic-entity-contract-message-topic-entity-contract-2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a-2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a
Messagemessage-entity-contract-message-entity-contract-2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a-0202020202020202020202020202020202020202020202020202020202020202-f

NamedKey

Key::NamedKey is a Key under which a single named key entry is stored.

TypePrefixExample
Account Named Keynamed-key-entity-account-named-key-entity-account-928d914bdcad3ca269e750f63ed3615c5d3f615cf97dba87006fd9f979dacb3c-dde6f264c89fe385a5b07c26d77284d6fddabe79653c5ca25cec39a6363e6ec7
Contract Named Keynamed-key-entity-contract-named-key-entity-contract-2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a-2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b

BlockGlobal

Key::BlockGlobal is a Key under which per-block details are stored to global state.

TypePrefixExample
Block Timeblock-time-block-time-00000000000000000000000000000000000000000000000000000000000000
Block Message Countblock-message-count-block-message-count-00000000000000000000000000000000000000000000000000000000000000

EntryPoint

Key::EntryPoint is a Key under which an entrypoint record is written.

TypePrefixExample
V1 Entry Pointentry-point-v1-entity-contract-entry-point-v1-entity-contract-53c02487fa9a4bb1cd3e27b849e942cddb97caacb357e5b6bc86f702b2e32dbb-3eba75fc27f0ec2786e09c09d72d61e4c28a86d44d8efc9911460d5438396481
V2 Entry Pointentry-point-v2-entity-contract-entry-point-v2-entity-contract-2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a-1