Workflow Examples
Last updated
Last updated
The Storage Proof Workflow will vary slightly depending on the data being proven and how a blockchain stores its data.
Below are simplified workflows for three scenarios: checking a transaction's nonce, finding out a user's token balance, and looking at receipt data.
Note: These workflows are simplified and based on the Ethereum blockchain. Other blockchains may have variations in their structure and requirements.
Additionally, these workflow examples focus on a single blockchain. When using proofs for cross-chain data access, access to a block hash or relevant root of the data origin chain is needed.
Step 1: Access the block hash.
Identify the block at which you want to confirm the user's token balance.
Step 2: Access the block header.
Retrieve the block header associated with the identified block hash to ensure its genuineness.
Step 3: Determine the Desired Root.
Extract the stateRoot
from the block header. This represents the entire state of the blockchain at the time of that block.
Step 4: Verify the Token Contract Address Exists.
Utilize inclusion proofs to confirm the token contract's existence given the stateRoot
.
Step 5: Determine the Storage Root.
From the verified token contract account, extract the storageRoot
. This represents the storage of the contract's account at the time of that block.
Step 6: Verify the User's Address Exists.
Utilize inclusion proofs to confirm the user's address exists within the storageRoot
.
Step 7: Verify the Token Balance Against the Storage Root.
Confirm the user’s token balance within the account storage trie.