Understanding Hash Types
For the sake of user convenience and compatibility, we expect the delivery of hashes and similar data in the form of a prefixed string when using the node. The following is a list of string representations used.
Table of Associated Hash Types
Hash and Key Explanations
PublicKey is a 32 byte asymmetric public key, preceded by a one-byte prefix that tells whether the key is
AccountHash is a 32 byte hash of the
PublicKey serving to identify user accounts.
ContractHash is the 32 byte hash of specific smart contract versions. You can use this to call specific contract versions.
ContractPackageHash is a 32 byte hash of the smart contract package. This hash directs you to the contract package. The function
ContractPackageHash and allows you to call the latest version of the contract (by default). It also allows you to call any version stored previously to the package.
Key is a wrapper type that may contain one of several possible sets of data.
Key::Accountcontains an AccountHash.
Key::Hashcontains a byte array with a length of 32, and as such can be used to pass any of the hashes. Please take note that the developer of the contract is responsible for implementation of any checks necessary on the receiving side.
Key::URefcontains an URef suffixed by access rights.
Key::Transfershould contain the address hash for a transfer.
Key::DeployInforetains the address hash of deploy information.
Key::EraInfois the integer number of the associated era.
Key::Balanceis the balance of a purse.
Key::Bidis used to keep track of bids for the auction contract. It is not generally used by users.
Key::Withdrawis used to keep track of withdraws for the auction contract. It is not generally used by users and exists in a historical context.
Key::Dictionaryis the hash derived from a URef and a piece of arbitrary data and leads to a dictionary.
Key::SystemContractRegistryis a unique
Keyunder which a mapping of the names and ContractHashes for system contracts, including
StandardPayment, is stored.
Key::Unbondis a variant of the key type that tracks unbonding purses.
Key::ChainspecRegistryis a unique
Keywhich 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.