Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Hashi introduces a range of features designed to enhance the security and flexibility of cross-chain applications. Here’s a brief overview of what sets Hashi apart:
Hashi aggregates data from multiple independent oracles to validate block headers and messages. This reduces reliance on a single oracle and increases the security of cross-chain interactions.
Hashi relays entire block headers between chains, providing cryptographic proof of blockchain states across multiple networks. This ensures that data being relayed is both secure and verifiable.
Hashi acts as an abstraction layer, allowing you to easily switch between different oracles without being locked into a single provider. This flexibility helps avoid vendor lock-in and future-proofs your application.
With Hashi, security scales as more oracles are added to the validation process. This makes Hashi adaptable to a variety of applications, from low-risk operations to high-value transactions that require additional layers of security.
Hashi supports a wide range of blockchains and oracle systems, making it a versatile solution for developers building cross-chain applications.
The blockchain ecosystem is rapidly evolving into a diverse environment with various types of virtual machines (VMs), rollup stacks, and modular networks. As more unique blockchain platforms emerge connecting these ecosystems to enable seamless asset transfers, liquidity provision, and state verification has become a significant challenge.
Traditional cross-chain solutions like General Message Passing (GMP) struggle to support the vast and expanding landscape of chains. Most chains can only establish direct connections to their primary settlement layer, limiting interactions across unrelated networks. Furthermore, existing cross-chain solutions often rely on capital-intensive models that are inefficient and costly, particularly when attempting to verify the state of one chain on another.
The Hashi State Sharing Network (SSN) introduces a scalable and efficient solution for cross-chain interoperability. SSN facilitates the regular relaying of state information across multiple chains, allowing for secure, low-cost, and trust-minimized cross-chain interactions. By implementing multi-hop routing pathways, SSN enables communication between any chains, even those that are not directly connected. This solution optimizes state verification and reduces gas costs by leveraging intermediary networks (e.g., Gnosis) as hubs for state updates, making it easier for developers to build interoperable applications across chains.
In short, SSN provides a unified layer for state sharing, driving forward a vision of a fully interconnected blockchain ecosystem where diverse networks can collaborate seamlessly and securely.
The Quick Start guide will walk you through two core use cases of Hashi: verifying storage proofs or event proofs against a block header and pushing messages across chains. We’ll start with reading foreign state via storage proofs, followed by pushing a message to another chain. Both examples will help you understand the core functionality of Hashi and how to implement it in your projects.
The code can be found in Hashi template. This repository serves as a template for developers to kickstart a Hashi project using Hardhat/Foundry.
Hashi is a robust and innovative EVM hash oracle aggregator designed to significantly enhance the security of cross-chain applications. It leverages multiple independent oracles to validate and verify block headers and messages across different blockchain networks, ensuring a more secure and reliable way to facilitate interactions between chains.
In a landscape where cross-chain bridges are prone to risks due to reliance on single points of failure, Hashi introduces an additive security model, where multiple oracles work together to ensure the integrity and authenticity of data relayed across chains. This approach minimizes vulnerabilities and strengthens the overall security of decentralized applications (dApps) that rely on cross-chain communication.
Multi-Oracle Validation: Hashi aggregates the results from multiple oracles to validate block headers and messages, reducing the likelihood of failure due to malicious actors or faulty data.
Cross-Chain Compatibility: It supports multiple blockchain networks, including Ethereum, Gnosis Chain, and others, making it adaptable to a wide range of dApps and cross-chain use cases.
Arbitrary Message Relaying: Hashi allows for secure and scalable message relaying between chains, ensuring that cross-chain interactions are not only secure but also efficient.
Additive Security: The more oracles that participate in Hashi, the stronger the security, creating an increasing level of protection as the network grows.
In essence, Hashi provides an advanced layer of security and reliability for any project that relies on cross-chain data, offering developers peace of mind and more control over the security of their decentralized applications.
Before verifying the state, you need to fetch the event proof from Sepolia using the correct block number that has already been propagated to Hashi. This block number ensures that Hashi can verify the proof against the block header stored on Chiado.
Fetching the Proof
Use the following curl
command to fetch the account and storage proof for the USDC total supply on Optimism:
chainId: 11155111 (Sepolia).
txHash: The tx hash that emitted the Transfer event on Sepolia: .
logIndex: The log index for the event.
blockNumber: The block number on Sepolia, 7016999, which must have already been propagated to Chiado via Hashi for the proof to be valid.
This curl
command / script returns the event proof for the Transfer event on Sepolia, which will be used for verification on Chiado.
As decentralized applications (dApps) increasingly interact with multiple blockchains, ensuring the security of cross-chain communication is more important than ever. Traditional solutions often face security challenges due to reliance on a single oracle or validator, introducing vulnerabilities and risks. Hashi addresses these challenges with its unique approach, which focuses on leveraging multiple oracles and secure block relaying to guarantee reliable cross-chain interactions.
One of Hashi's core functions is its block relaying mechanism, which allows it to securely transmit block headers from one chain to another. This process ensures that dApps working across chains can verify the validity of blockchain states with confidence. Instead of relying on individual messages, Hashi enables the transfer of block headers, ensuring data integrity through cryptographic verification.
Hashi further enhances security by requiring multiple independent oracles to validate and agree on the authenticity of block headers. This multi-oracle model significantly reduces the risks of depending on a single entity and increases the robustness of cross-chain transactions.
Hashi serves as an abstraction layer between your dApp and the underlying oracles or relayers, meaning you’re not tied to any one provider. This flexibility allows developers to integrate multiple oracles from various vendors without the fear of vendor lock-in. Hashi abstracts the complexity, enabling seamless switching between oracles while maintaining the security of your cross-chain interactions. This way, you're always in control, and as new oracles emerge, you can easily adopt them without restructuring your dApp.
In contrast to traditional cross-chain solutions that often rely on a single validator, Hashi distributes trust across multiple oracles. This significantly mitigates the risk of a single point of failure, ensuring that the security of your cross-chain transactions doesn’t hinge on one entity.
Hashi’s additive security model allows you to scale the level of security according to your needs. By involving more oracles in the validation process, you can dynamically increase the security for high-value transactions or sensitive data, making Hashi adaptable for both simple and complex cross-chain applications.
Cross-Chain Application Developers: Hashi provides a reliable, secure solution for developers building dApps that interact across multiple blockchains.
Interoperability-Focused Projects: For teams needing cross-chain verification, Hashi’s abstraction layer and multi-oracle setup ensure flexibility and security.
Bridge Operators: Hashi allows for robust security through its multi-oracle architecture, offering a solution that reduces the risks associated with traditional cross-chain bridges.
Hashi is built to provide flexibility, scalability, and security. Its multi-oracle, block-relaying architecture ensures that your cross-chain interactions are safe, reliable, and free from vendor lock-ins, giving you the freedom to innovate and adapt as the blockchain ecosystem evolves.
Welcome to the official documentation for Hashi, your comprehensive guide to understanding and integrating the Hashi oracle aggregator into your cross-chain applications. Whether you're new to cross-chain security or an experienced developer looking to enhance the security of your blockchain projects, this guide will provide you with all the necessary tools and insights.
Hashi is designed to increase the security of cross-chain interactions by utilizing multiple oracles to verify and validate block headers and messages between chains. By ensuring that cross-chain messages are validated by multiple independent oracles, Hashi mitigates risks associated with single points of failure and enhances the overall security of decentralized ecosystems.
Hashi is a decentralized protocol that allows secure cross-chain communication. By enabling contracts on one blockchain to interact with contracts on another, Hashi facilitates cross-chain data transfer and execution through message dispatching, storage proofs, and cryptographic verification.
The process involves sending a message or verifying a state across blockchains, such as Sepolia and Gnosis Chiado, using a series of contracts and oracles. Let’s break down how this works in practice:
Another powerful feature of Hashi is the ability to verify the state of a contract on one chain using cryptographic proofs stored on another chain. Here’s how this works:
Storing Block Headers:
The first step is to relay block headers from Sepolia to Chiado.
These headers are stored in the Header Storage contract on Chiado and contain essential information like the state root, which can be used to validate the state of a smart contract on Sepolia.
Requesting a Proof:
Imagine you want to verify the value stored in a specific storage slot of a contract on Sepolia (Chain A).
You generate a Merkle proof that shows the value of this storage slot at a particular block on Sepolia. This proof includes information from the block header (stored on Chiado) and the Merkle path leading to the value.
Submitting the Proof:
You submit this proof to the Yaru contract on Chiado. The Yaru contract checks the proof against the block header that was previously relayed and stored in the Header Storage contract.
If the proof is valid, Hashi confirms that the state on Sepolia matches what was proven in the Merkle proof.
In this way, you can verify contract state on Sepolia directly from Chiado, without interacting with Sepolia in real-time, using trustless proofs and stored block headers.
You start on Chain A (Sepolia):
Imagine you have a contract on Sepolia that needs to send a message to a contract on Gnosis Chiado (Chain B).
On Sepolia, you use Hashi’s Yaho contract, which is specifically designed for dispatching messages across chains.
Sending the Message:
Your Sepolia contract calls the Yaho contract, instructing it to send a message to the Yaho contract on Chiado.
The message typically contains the target contract address on Chiado and the data you want to send (such as a function call or value).
Relaying the Message:
Once the message is dispatched, it is picked up by Hashi’s oracle network. These oracles listen for events on Sepolia, relay the message, and submit it to Yaho on Chiado for execution.
Multiple oracles are used for redundancy and security, ensuring that the message is properly validated before it’s passed to Chiado.
Receiving and Executing the Message on Chain B (Chiado):
On Chiado, the Yaho contract receives the message after the oracles validate the block header and the message’s integrity.
Once validated, the Yaho contract triggers the appropriate callback function on the target contract (for example, updating the contract state or calling a specific function).
In practice, this allows you to seamlessly send a message from Sepolia to Chiado, have it validated by multiple oracles, and executed on the destination chain.
Once you’ve fetched the proof, you can now verify it using a contract on Chiado. The contract will use the HashiProver helper library to check the proof against the block header stored on Chiado.
Deploying the Verification Contract on Chiado
Here is the contract that you will deploy on Chiado to read and verify the Transfer event on Sepolia:
For quick start, we've deployed HashiProver & ShoyuBashi on a list of networks that you can call from your Prover contract (check #shoyubashi-and-hashi-prover). If you wish to configure your own oracle sets for your Hashi Prover, simply deploy a new ShoyuBashi contract, inherit Hashi Prover contract and configure your oracle sets in the ShoyuBashi contract.
In this example, pass the Hashi Prover contract on Chiado, ERC20Contract address on Sepolia that the Transfer event is emitted from, and chain ID of the ERC20Contract (Sepolia: 11155111)
Explanation:
This contract uses HashiProver to verify the event proof fetched earlier from Sepolia.
It checks that the proof is from Sepolia (chain ID 11155111), and rlpEncodedEvent returns from HashiProver.verifyForeignEvent matches the expectedRlpEncodedEvent that we passed as the function argument. To create the expectedRlpEncodedEvent, check out the helper script from Hashi-template.
The verifyForeignEvent
function validates the event proof against the block header stored on Chiado, which was relayed from Sepolia.
If the proof is valid, the contract emits the TransferEventVerified
event. You may defie your own logic after the proof has been verified.
The first step is to understand what we’re trying to do:
You want to check if a specific Transfer event has been emitted from an ERC20 contract on Sepolia from Chiado.
We’ll do this by using HashiProver, which will verify the event from an ERC20 contract on Sepolia.
The proof will be verified using the latest block header that was relayed to Hashi from Sepolia to Chiado.
Here’s what we need to accomplish:
Fetch the event proof for Transfer event from Sepolia.
Deploy a contract on Chiado that will verify the event proof using HashiProver.
Submit the proof to this contract to validate the event on Sepolia.
In this example, we’ll send a message from a contract on Sepolia to another contract on Chiado, using Hashi to relay and execute the message. The callback will be triggered and validated on Chiado using the provided onMessage
function.
Before verifying the state, you need to fetch the storage proof from Optimism using the correct block number that has already been propagated to Hashi. This block number ensures that Hashi can verify the proof against the block header stored on Gnosis Chain.
Fetching the Proof
Use the following curl
command or javascript script to fetch the account and storage proof for the USDC total supply on Optimism:
chainId: 10 (Optimism).
address: The address of the USDC contract on Optimism: 0x0b2c639c533813f4aa9d7837caf62653d097ff85
.
storageKeys: The storage key for the USDC total supply: 0xb
.
blockNumber: The block number on Optimism, 126086800, which must have already been propagated to Gnosis Chain via Hashi for the proof to be valid.
This curl
command returns the account and storage proof for the USDC total supply, which will be used for verification on Gnosis Chain.
Beyond block headers, Hashi supports secure message dispatching between blockchains. This allows dApps to send messages across chains while ensuring that the messages are verified and valid according to the state of the originating blockchain.
How it Works Messages are dispatched after the validation of block headers, ensuring that any message relayed between two blockchains is consistent with the blockchain state. Hashi uses its multi-oracle validation system to verify these messages, making sure that only messages based on valid block headers are dispatched.
Use Cases Message dispatching can be used in cross-chain token transfers, governance voting, or any application where information needs to be relayed from one blockchain to another securely and reliably.
Hashi’s security model is based on additive security, where the more oracles involved, the greater the level of protection. This allows developers to dynamically scale the security of their cross-chain interactions by increasing the number of oracles participating in validation.
How Additive Security Works Rather than relying on a single source of truth, Hashi collects validation results from multiple oracles. As more oracles participate in validating block headers and messages, the security of the system increases. This model ensures that even if one or several oracles are compromised, the overall integrity of the system is maintained.
Dynamic Security Developers can adjust the security threshold based on their specific needs. For routine transactions, fewer oracles may be sufficient, but for high-stakes interactions, the number of validating oracles can be increased to ensure maximum security.
Block headers are at the heart of Hashi’s security model. Rather than just relying on arbitrary messages between chains, Hashi works by relaying entire block headers from one blockchain to another. This means that dApps can verify not only the content of a message but the actual state of the originating chain.
Why Block Headers? Block headers contain essential information about the state of a blockchain, including the hash of the previous block, timestamp, and the Merkle root of all transactions. By relaying these, Hashi ensures that cross-chain interactions are based on cryptographic proofs tied to actual blockchain states, making them much more secure than simple message relays.
How Hashi Uses Block Headers Multiple independent oracles relay these block headers, which are then aggregated and validated by Hashi. The result is a robust verification process where only confirmed, valid block headers are accepted, ensuring data integrity across chains.
The first step is to understand what we’re trying to do:
You want to check the total supply of USDC on Optimism from Gnosis Chain.
We’ll do this by using HashiProver, which will verify the state of a specific storage slot (holding the USDC total supply) on Optimism.
The proof will be verified using the latest block header that was relayed to Hashi from Optimism to Gnosis Chain.
Here’s what we need to accomplish:
Fetch the storage proof for the USDC total supply from Optimism.
Deploy a contract on Gnosis Chain that will verify the storage proof using HashiProver.
Submit the proof to this contract to validate the total supply on Optimism.
In this example, you will verify the Transfer event of an ERC20 contract on Sepolia from Chiado using an event proof. The proof will be fetched via an API call and fed to a contract deployed on Chiado. The contract will use the HashiProver helper library to validate the proof against the last reported block header stored in Hashi.
Oracles play a pivotal role in Hashi’s ecosystem. They are responsible for relaying block headers and messages between blockchains and validating them in a decentralized manner. Hashi uses multiple oracles to ensure security and avoid relying on a single point of failure.
Why Multiple Oracles? Trusting a single oracle can introduce vulnerabilities, especially in cross-chain environments where security is critical. Hashi solves this by using multiple oracles, each independently verifying the data. Only when consensus is reached among a majority of these oracles is the data accepted, significantly reducing the risk of manipulation or failure.
Supported Oracles Hashi is designed to work with various oracles, you can find a list of supported ones . These oracles are integrated into Hashi’s framework to ensure compatibility across a range of blockchain environments.
Oracle Adapters Hashi uses a universal adapter interface, making it easy to add support for new oracles as they emerge. This flexibility allows Hashi to evolve with the ecosystem, accommodating new oracle solutions as needed.
Once you’ve fetched the proof, you can now verify it using a contract on Gnosis Chain. The contract will use the HashiProver helper library to check the proof against the block header stored on Gnosis Chain.
Deploying the Verification Contract on Gnosis Chain
Here is the contract that you will deploy on Gnosis Chain to read and verify the USDC total supply on Optimism:
Explanation:
This contract uses HashiProver to verify the storage proof fetched earlier from Optimism.
It checks that the proof is from Optimism (chain ID 10), and that the USDC contract address and storage key match the expected values.
The verifyForeignStorage
function validates the proof against the block header stored on Gnosis Chain, which was relayed from Optimism.
If the proof is valid, the contract emits the total supply of USDC on Optimism.
Submitting the Proof
Once the contract is deployed on Gnosis Chain, you can submit the proof fetched from the API using the following command:
This will trigger the contract to verify the proof using the block header stored in Hashi from Optimism. If the proof is valid, the total supply of USDC will be emitted.
Here’s how you write a contract on Sepolia that dispatches a message using Hashi’s Yaho contract. This message will be relayed to Chiado and trigger the callback.
Explanation:
The contract interacts with the Yaho contract on Sepolia to dispatch a message to Chiado using dispatchMessageToAdapters
.
The sendMessageToChiado
function takes the target chain ID(10200 for Chiado), target address (ChiadoReceiver contract on Chiado), and the message to be sent.
The reporters, adapters, and threshold are passed into the Yaho contract for cross-chain message validation and relaying.
Deployment:
Deploy this contract on Sepolia, passing the reporters, adapters, and threshold into the constructor.
Threshold
must equal to expectedThreshold
in Receiver contract.
A list of reporters and adapters contract can be found in:
Yaho contract address can be found in
Hashi offers a range of resources to help developers get started and integrate Hashi into their cross-chain applications.
GitHub Repository: Access the full source code for Hashi, explore developer tools, or contribute to the project by visiting the official Hashi GitHub repository.
the HashiProver API: Use the HashiProver library and API to easily interact with Hashi's cross-chain storage and state verification functionalities programmatically
Hashi template: A template for developers to kickstart a Hashi project using Hardhat/Foundry.
Hackathon resources: A list of resources for hackers to kickstart their Hashi project.
Hashi relies on a set of core smart contracts to enable secure cross-chain communication, storage verification, and message dispatching. These contracts form the backbone of Hashi's decentralized system, ensuring that data and messages relayed across different blockchains are validated, secure, and cryptographically sound.
In this section, we’ll introduce the key contracts that you will interact with when using Hashi, detailing their primary functions and how they work together to facilitate cross-chain operations.
The Yaho contract is responsible for dispatching messages from one blockchain to another. It manages the sending of cross-chain messages by interacting with Hashi’s oracle system, ensuring that messages are transmitted and validated before they are delivered to the destination chain.
Primary Function: Dispatches messages across chains.
Usage: Interacts with oracles to relay messages from the source chain (e.g., Sepolia) to the destination chain (e.g., Gnosis Chain).
Key Methods:
dispatchMessageToAdapters(uint256 targetChainId, uint256 threshold, address targetAddress, bytes memory data, address[] memory reporters, address[] memory adapters)
Dispatches a message with specified reporters and adapters to the target chain.
The Yaru contract handles the receiving and validation of cross-chain messages. It works on the destination chain to ensure that messages sent by the Yaho contract are legitimate and validated by Hashi’s oracles before triggering any actions.
Primary Function: Validates cross-chain messages and triggers callbacks on the destination chain.
Usage: Used on the receiving side to validate messages dispatched by Yaho.
Key Methods:
onMessage(uint256 messageId, uint256 chainId, address sender, uint256 threshold, address[] memory adapters, bytes memory data)
Validates a message and triggers the corresponding action on the destination contract.
The Header Storage contract stores block headers from a source chain, which are then used to verify storage proofs or validate the state on the destination chain. Block headers are essential to cross-chain validation, as they contain the cryptographic data needed to prove the state of a contract on another chain.
Primary Function: Stores block headers for cross-chain state verification.
Usage: Relays block headers from the source chain (e.g., Optimism) to the destination chain (e.g., Gnosis Chain).
Key Methods:
storeBlockHeader(bytes memory headerData)
Stores a new block header from the source chain.
HashiProver is a helper contract used to verify cross-chain storage proofs and account states. It works by comparing the storage proofs provided with the block headers stored in the Header Storage contract.
Primary Function: Verifies storage proofs and account states across chains.
Usage: Used when you need to verify a foreign contract’s state (e.g., checking the USDC total supply on Optimism from Gnosis Chain).
Key Methods:
verifyForeignStorage(AccountAndStorageProof calldata proof)
Verifies a storage proof against the latest block header stored in the Header Storage contract.
ShoyuBashi manages the oracles that relay messages and block headers between chains. This contract is responsible for coordinating the oracle system and ensuring that multiple oracles reach consensus before a message or block header is considered valid.
Primary Function: Manages oracles and relays messages or block headers.
Usage: Ensures secure and validated message passing between chains by coordinating oracle responses.
Key Methods:
relayBlockHeader(uint256 chainId, bytes memory headerData)
Relays block headers between chains using oracles.
dispatchMessage(uint256 chainId, address targetAddress, bytes memory data)
Dispatches messages through oracles for cross-chain validation.
Each of these contracts plays a crucial role in Hashi’s cross-chain framework:
Yaho dispatches messages, while Yaru validates them.
Header Storage stores block headers, which are used by HashiProver to verify state proofs.
ShoyuBashi coordinates oracles to securely relay data between chains.
These contracts work in harmony to ensure that messages and state changes across blockchains are cryptographically secure and validated by multiple independent oracles, ensuring a trustless cross-chain environment.
The HashiProver API enables developers to easily interact with Hashi's cross-chain storage and state verification functionalities programmatically.
Below is the list of available API calls, with detailed descriptions of their parameters, request methods, and expected responses.
Hashi integrates multiple oracles to relay block headers and messages securely across different blockchains. Each oracle operates with its own set of contracts and mechanisms depending on the source and destination chains. Below are the deployment details for each oracle, including testnets when available.
A GMP Oracle (General Message Passing Oracle) facilitates message transmission across different blockchain networks by acting as a trusted entity to validate, relay, and process cross-chain messages, ensuring that data or instructions are accurately transferred between chains.
LayerZero is a cross-chain communication protocol. It allows developers to configure security through Decentralized Verifier Networks (DVNs), offering modular control over message validation. LayerZero currently supports 49+ chains.
Chain | Reporter Address | Supported destination chains |
---|---|---|
Hyperbridge is a crypto-economic coprocessor that enables secure and efficient cross-chain interoperability by offchain proof verification and decentralized relayer communication.
Gnosis Chain's Arbitrary Message Bridge (AMB) is the chain's legacy canonical bridge. It enables cross-chain communication between Gnosis Chain and Ethereum (and other EVM networks). It allows contracts to send data and trigger actions on another chain through a set of decentralized validators.
Wormhole is a cross-chain interoperability protocol that connects over 30 blockchains. It uses a decentralized network of 19 Guardians to validate cross-chain messages through a mechanism called Verifiable Action Approvals (VAAs).
Chainlink’s Cross-Chain Interoperability Protocol (CCIP) facilitates secure token transfers and cross-chain messaging across nine blockchains. It integrates decentralized oracle networks and a Risk Management Network to ensure security for cross-chain applications.
A ZK Light Client is a lightweight blockchain client that uses zero-knowledge proofs (ZKPs) to securely verify and relay blockchain state data between networks.
Light client-based oracles don't need for a reporter contract on the source chain to dispatch messages or block headers. Instead, they only require an adapter on the destination chain. Off-chain systems generate cryptographic proofs, which are submitted to the adapter contract for on-chain verification. Once validated, the resulting hash is securely stored on the destination chain.
DendrETH is a ZK light-client-based oracle focusing on updating and verifying block headers without needing a reporter on the source chain. It ensures enhanced security by allowing proofs to be generated off-chain and verified on-chain.
Spectre is a ZK light-client oracle solution designed to handle secure message dispatching across chains. Spectre listens to dispatched messages from supported chains and verifies them on the destination chain using cryptographic proofs.
*Spectre listens MessageDispatched event from Source Chain's Yaho and verify on Spectre Adapter on Destination Chain.
Track real-time data on Hashi’s oracle activity, block headers, and message dispatches across multiple chains using the . This explorer gives you complete visibility into how oracles validate and relay messages, helping you monitor and analyze cross-chain operations.
Join our growing community of developers and blockchain enthusiasts on . The Hashi community is a space to share ideas, ask questions, and collaborate on projects. Whether you're a developer or just interested in the technology, there’s a place for everyone to contribute.
In this example, you will verify the total supply of USDC on Optimism from Gnosis Chain using a storage proof. The proof will be fetched via an API call and fed to a contract deployed on Gnosis Chain. The contract will use the HashiProver helper library to validate the proof against the last reported block header stored in Hashi.
Chain | Adapter Address | Supported Source Chains |
---|---|---|
Chain | Reporter Address |
---|---|
Chain | Adapter Address |
---|---|
Source Chain | Destination Chain | Reporter | Adapter |
---|---|---|---|
Source Chain | Destination Chain | Reporter | Adapter |
---|---|---|---|
Source Chain | Destination Chain | Reporter | Adapter |
---|---|---|---|
Source Chain | Destination Chain | Adapter | Light Client |
---|---|---|---|
Source Chain | Destination Chain | Adapter* |
---|---|---|
Ethereum
Polygon, BNB, Optimism, Gnosis Chain
Gnosis Chain
Polygon, BNB, Arbitrum, Optimism, Base
Polygon
Gnosis Chain, BNB, Arbitrum, Optimism, Base
BNB
Gnosis Chain, Polygon, Arbitrum, Optimism, Base
Arbitrum
Gnosis Chain, Polygon, BNB, Optimism, Base
Optimism
Gnosis Chain, Polygon, BNB, Arbitrum, Base
Base
Gnosis Chain, Polygon, BNB, Arbitrum, Optimism
Sepolia (Testnet)
UnichainSepolia, Chiado, ArbitrumSepolia, BaseSepolia, PolygonAmoy, WorldchainSepolia
Unichain Sepolia (Testnet)
Sepolia, ArbitrumSepolia, BaseSepolia, PolygonAmoy
Gnosis Chiado (Testnet)
Sepolia, ArbitrumSepolia, BaseSepolia, PolygonAmoy
Arbitrum Sepolia (Testnet)
Sepolia, Chiado, Unichain S epolia, BaseSepolia, PolygonAmoy
Base Sepolia (Testnet)
Sepolia, Chiado, UnichainSepolia, ArbitrumSepolia, PolygonAmoy
Worldchain Sepolia (Testnet)
Sepolia
Polygon Amoy (Testnet)
Sepolia, Chiado, UnichainSepolia, ArbitrumSepolia, BaseSepolia
Ethereum
Gnosis Chain
Gnosis Chain
Ethereum, Polygon, BNB, Arbitrum, Optimism, Base
Polygon
Ethereum, BNB, Arbitrum, Optimism, Base
BNB
Ethereum, Gnosis Chain, Polygon, Arbitrum, Optimism, Base
Arbitrum
Gnosis Chain, Polygon, BNB, Optimism, Base
Optimism
Ethereum, Gnosis Chain, Polygon, BNB, Arbitrum, Base
Base
Gnosis Chain, Polygon, BNB, Arbitrum, Optimism
Sepolia (Testnet)
UnichainSepolia, Chiado, ArbitrumSepolia, BaseSepolia, PolygonAmoy, WorldchainSepolia
Unichain Sepolia (Testnet)
Sepolia, ArbitrumSepolia, BaseSepolia, PolygonAmoy
Gnosis Chiado (Testnet)
Sepolia, ArbitrumSepolia, BaseSepolia, PolygonAmoy
Arbitrum Sepolia (Testnet)
Sepolia, Chiado, Unichain S epolia, BaseSepolia, PolygonAmoy
Base Sepolia (Testnet)
Sepolia, Chiado, UnichainSepolia, ArbitrumSepolia, PolygonAmoy
Worldchain Sepolia (Testnet)
Sepolia
Polygon Amoy (Testnet)
Sepolia, Chiado, UnichainSepolia, ArbitrumSepolia, BaseSepolia
Ethereum
Gnosis Chain
Sepolia (Testnet)
Chiado (Testnet)
Ethereum
Gnosis Chain
Sepolia (Testnet)
Chiado (Testnet)
Ethereum
Gnosis Chain
Sepolia (Testnet)
Chiado (Testnet)
Chiado (Testnet)
Sepolia (Testnet)
Sepolia (Testnet)
Chiado (Testnet)
Sepolia (Testnet)
Chiado (Testnet)
Ethereum
Gnosis Chain
Gnosis Chain
Ethereum
Chiado (Testnet)
Sepolia (Testnet)
Sepolia (Testnet)
Chiado (Testnet)
Sepolia (Testnet)
Lukso Testnet
Ethereum
Gnosis Chain
Sepolia (Testnet)
Chiado (Testnet)
Chiado (Testnet)
Sepolia (Testnet)
Hashi is committed to ensuring the security and reliability of its protocol. To this end, it regularly undergoes comprehensive third-party security audits. Below are the completed audit reports, which assess the key security components of Hashi.
The g0 audits evaluated the security of Hashi’s core components, including oracle integration, block header aggregation, and cross-chain message dispatching.
The Omega audit focused on Hashi’s integration with the Gnosis Bridge, assessing the interaction between Hashi’s oracle system and the cross-chain relaying mechanism.
View Full Audit Report by Omega
The Least Authority audit examined Hashi’s multi-oracle validation system and overall security architecture, ensuring its resilience against potential security threats.
The following are the main Hashi contracts deployed on supported blockchains, including Yaho, and Yaru for secure message dispatch and block header aggregation. Testnets are also included where applicable.
Source Chain | Destination Chain | Yaho | Yaru |
---|---|---|---|
Hashi contract serves as an entry point for other contracts to check the hashes and threshold from the adapter contracts. Header Storage stores the block header with respect to a block number.
ShoyuBashi lets developers configure their own set of oracles to verify a hash. The Hashi Prover contract verifies storage and event proofs from the source chain on the target chain.
Please note that the following deployed contracts are designed to help you quickly get started with Hashi's state verification logic as the adapters are configured in ShoyuBashi contract and developer can simply call Hashi Prover's verify functions to verify the proof.
If you'd like more control over the oracles used for hash verification, you can deploy your own ShoyuBashi and Hashi Prover contracts.
Chain | Hashi | Header Storage |
---|---|---|
Chain | Hashi Prover | ShoyuBashi |
---|---|---|
Ethereum
Gnosis Chain
Ethereum
Lukso
Gnosis Chain
Ethereum
Polygon
BNB
Base
Arbitrum
Optimism
Lukso
Ethereum
Sepolia (Testnet)
Gnosis Chiado (Testnet)
Sepolia (Testnet)
Lukso Testnet
Sepolia (Testnet)
Holesky (Testnet)
Sepolia (Testnet)
UnichainSepolia (Testnet)
Sepolia (Testnet)
Arbitrum Sepolia (Testnet)
Sepolia (Testnet)
Base Sepolia (Testnet)
Sepolia (Testnet)
Worldchain Sepolia (Testnet)
Sepolia (Testnet)
Polygon Amoy (Testnet)
Holesky (Testnet)
Sepolia (Testnet)
UnichainSepolia (Testnet)
Sepolia (Testnet)
UnichainSepolia (Testnet)
Gnosis Chiado (Testnet)
UnichainSepolia (Testnet)
Arbitrum Sepolia (Testnet)
UnichainSepolia (Testnet)
Base Sepolia (Testnet)
UnichainSepolia (Testnet)
Worldchain Sepolia (Testnet)
UnichainSepolia (Testnet)
Polygon Amoy (Testnet)
Gnosis Chiado (Testnet)
Sepolia (Testnet)
Gnosis Chiado (Testnet)
UnichainSepolia (Testnet)
Gnosis Chiado (Testnet)
Arbitrum Sepolia (Testnet)
Gnosis Chiado (Testnet)
Base Sepolia (Testnet)
Gnosis Chiado (Testnet)
Worldchain Sepolia (Testnet)
Gnosis Chiado (Testnet)
Polygon Amoy (Testnet)
Arbitrum Sepolia (Testnet)
Sepolia (Testnet)
Arbitrum Sepolia (Testnet)
Gnosis Chiado (Testnet)
Arbitrum Sepolia (Testnet)
Unichain Sepolia (Testnet)
Arbitrum Sepolia (Testnet)
Base Sepolia (Testnet)
Arbitrum Sepolia (Testnet)
Worldchain Sepolia (Testnet)
Arbitrum Sepolia (Testnet)
Polygon Amoy (Testnet)
Base Sepolia (Testnet)
Sepolia (Testnet)
Base Sepolia (Testnet)
Gnosis Chiado (Testnet)
Base Sepolia (Testnet)
Unichain Sepolia (Testnet)
Base Sepolia (Testnet)
Arbitrum Sepolia (Testnet)
Base Sepolia (Testnet)
Worldchain Sepolia (Testnet)
Base Sepolia (Testnet)
Polygon Amoy (Testnet)
Worldchain Sepolia (Testnet)
Sepolia (Testnet)
Worldchain Sepolia (Testnet)
Gnosis Chiado (Testnet)
Worldchain Sepolia (Testnet)
Unichain Sepolia (Testnet)
Worldchain Sepolia (Testnet)
Arbitrum Sepolia (Testnet)
Worldchain Sepolia (Testnet)
Base Sepolia (Testnet)
Worldchain Sepolia (Testnet)
Polygon Amoy (Testnet)
Polygon Amoy (Testnet)
Sepolia (Testnet)
Polygon Amoy (Testnet)
Gnosis Chiado (Testnet)
Polygon Amoy (Testnet)
Unichain Sepolia (Testnet)
Polygon Amoy (Testnet)
Arbitrum Sepolia (Testnet)
Polygon Amoy (Testnet)
Base Sepolia (Testnet)
Polygon Amoy (Testnet)
Worldchain Sepolia (Testnet)
Lukso Testnet
Sepolia (Testnet)
Ethereum
Gnosis Chain
Polygon
BNB
Base
Arbitrum*
Optimism
LUKSO
LUKSO testnet
Sepolia (Testnet)
Holesky (Testnet)
Unichain Sepolia (Testnet)
Gnosis Chiado (Testnet)
Arbitrum Sepolia (Testnet)
Base Sepolia (Testnet)
Worldchain Sepolia (Testnet)
Polygon Amoy (Testnet)
Sepolia (Testnet)
Chiado (Testnet)
Arbitrum Sepolia (Testnet)
Base Sepolia (Testnet)
Unichain Sepolia (Testnet)
Worldchain Sepolia (Testnet)
Polygon Amoy (Testnet)
Now, we’ll write the callback function on Chiado using the onMessage
implementation you provided. This contract will handle the message sent from Sepolia.
Explanation:
The onMessage
function implements the callback, which is triggered when the Yaru contract on Chiado relays the message.
The function checks that the Yaru contract on Chiado is the sender, that the chainId, sender address, and threshold match what was expected, and that the list of adapters matches the expected hash.
After the validations pass, the message is decoded and stored in the contract.
Deployment:
Deploy this contract on Chiado. Ensure that the values like SOURCE_SENDER_ADDRESS (Sepolia sender contract), EXPECTED_THRESHOLD, and ADAPTERS are correctly configured.
Yaru address with respect to the source chain can be found in
A list of adapters on the target chain can be found in
Here’s what happens after you send the message:
Message Dispatch on Sepolia:
When sendMessageToChiado
is called on the SepoliaSender contract, the message is dispatched through Yaho on Sepolia.
The message is sent with the targetChainId, threshold, reporters, and adapters, and the data (in this case, the message string).
Oracles and Relaying:
Hashi’s oracles pick up the message and relay it to Chiado.
The oracles validate the message and check the block headers for consensus.
Message Receipt and Callback on Chiado:
On Chiado, the Yaru contract receives the message and triggers the onMessage
function on the ChiadoReceiver contract.
The callback validates the message by ensuring that the message is from the expected Yaru contract, the source chain, and the correct sender.
After validation, the message is decoded and stored in the contract.
You deploy SepoliaSender on Sepolia and configure it with the appropriate Yaho contract and oracle parameters.
You deploy ChiadoReceiver on Chiado to handle the incoming message and validate it against Hashi’s oracle system.
When you call sendMessageToChiado
from SepoliaSender, the message is dispatched to Chiado, where the callback function processes it and updates the state.
This endpoint is used to call various JSON-RPC methods supported by the Hashi server. It accepts a JSON object that specifies the method and its parameters.
Specifies the JSON-RPC protocol version. This API supports version 2.0.
"2.0"
Indicates the JSON-RPC method to invoke. The available methods are specific to Hashi functionality and are listed below.
An object containing parameters specific to the JSON-RPC method being called. The structure of this object varies depending on the method.
The unique numeric identifier of the blockchain from which you want to retrieve the storage value.
An array of storage keys for which you wish to retrieve the associated values.
The block number (block height) at which you want to read the storage values.
Optional. If specified, it represents an earlier block number relative to 'blockNumber'. This allows you to read a value starting from 'blockNumber' and proceeding back to 'ancestralBlockNumber', effectively retrieving the storage value from an ancestor block.
A unique identifier for this request, used to match the response with the request in JSON-RPC communication.
A successful JSON-RPC response
The JSON-RPC protocol version.
The result of the method call. This varies depending on the method.
Error object in case of a failed request.
The ID of the request this is responding to.