0x0
and 0x1
. These addresses are reserved for specific purposes and are characterized by their unique behavior in comparison to traditional contract addresses.
0x0
0x0
functions as the default caller_address
for external calls, including interactions with the L1 handler or deprecated Deploy transactions. Unlike regular contracts, address 0x0
does not possess a storage structure and does not accommodate storage mapping.
0x1
0x1
is another special contract address within Starknet’s architecture. It functions as a storage space for mapping block numbers to their corresponding block hashes. The storage structure at this address is organized as follows:
Keys | Block numbers between and . |
Values | Corresponding block hashes for the specified blocks. |
Default Values | For all other block numbers, the values are set to 0 . |
0x1
supports the efficient retrieval of block hashes based on block numbers within a defined range and is also used by the get_block_hash
system call.
INVOKE
transaction, and the storage of is the result of executing the target contract code with respect to the previous state . The arguments, contract instance’s address, and the specific function entry point are part of the transaction.
DEPLOY_ACCOUNT
transaction, and contains the new contract instance’s state at the contract instance’s address. Additionally, the storage of is updated according to the execution of the contract instance’s constructor.
DECLARE
transaction, and contains the class hash and definition in the contract class’s mapping
hPos
is the Poseidon hash function.
STARKNET_STATE_V0
is a constant prefix string encoded in ASCII (and represented as a field element).
contract_trie_root
is the root of the contract trie, a Merkle-Patricia trie whose leaves are the contracts’ states.
class_trie_root
is the root of the class trie, a Merkle-Patricia trie whose leaves are the compiled class hashes.
hPed
is the Pedersen hash function.
class_hash
is the hash of the contract’s definition.
storage_root
is the root of another Merkle-Patricia trie of height 251 that is constructed from the contract’s storage.
nonce
is the current nonce of the contract.
hPos
is the Poseidon hash function
CONTRACT_CLASS_LEAF_V0
is a constant prefix string encoded in ASCII (and represented as a field element).
compiled_class_hash
is the hash of the Cairo assembly resulting from compiling the given class via the Sierra-to-Casm compiler.
DECLARE
transaction. If the transaction is included in a block, then the compiled class hash becomes part of the state commitment.In the future, when Sierra-to-Casm compilation becomes part of the Starknet OS, this value might be updated via a proof of the Sierra-to-Casm compiler execution, showing that compiling the same class with a newer compiler version results in some new compiled class hash.is the length of the path, measured in nodes. | |
is the path from the current node to its unique non-empty subtrie. is an integer in the set , and the binary expansion of indicates how to proceed along the trie, as follows: 1. Expand to its binary representation. 2. Starting with the most significant bit, representing the root of the trie, traverse the tree node by node, where the bit values and indicate left and right, respectively. | |
is the value of the node, which can be either data, or the hash of two non-empty child nodes. |
Figure 1. A three-level Merkle-Patricia trie