Turbo
Seamless Blockchain Data Access
Turbo is a powerful smart contract interface that enables smart contract developers to seamlessly integrate Storage Proofs into their applications. By abstracting away the complexities involved in generating Storage Proofs, Turbo provides a user-friendly way to access and utilize blockchain data.
How Turbo Works
Turbo serves as a smart contract interface for the Storage Proof API. When a transaction is sent to a smart contract that integrates Turbo, it triggers Herodotus infrastructure to generate all the necessary Storage Proofs behind the scenes. These proofs are essential for the successful execution of the transaction.
Usage
To use Turbo, you need to integrate it into your smart contract. Here's an example of how to access on-chain data using Turbo in Solidity:
To interact with Turbo-integrated smart contracts, transactions need to be submitted through a special RPC called a Turbo RPC. Please refer to the list of RPCs for each network here.
Turbo Transaction Workflow
Initiation: The process begins when a user initiates a transaction (Tx) targeting a turbo-enabled smart contract.
Turbo Enabled RPC: The transaction is processed through the "Turbo Enabled RPC," which acts as an interface to facilitate the transaction's journey.
Simulated Transaction Execution: Here, the transaction is simulated to check if it requires a storage proof or HDP task execution.
If the transaction does not require storage proof, it's deemed successful and directly forwarded to the Validator/Sequencer.
If the transaction requires a storage proof but lacks it, the transaction fails. In such cases, the system traces the transaction to identify the necessary storage proofs.
Storage Proof API Query Builder: Once the need for storage proof is determined, the "Storage Proof API Query Builder" constructs an API request, aimed at retrieving the required storage proofs from the off-chain Storage Proof API.
Turbo Bundle Builder: Upon receiving the storage proof from the Storage Proof API, the Turbo Bundle Builder creates a bundle of transactions known as the "Herodotus Turbo Bundle."
The first transaction in this bundle verifies the validity of the retrieved storage proof and assigns the proven data to a set of variables.
Subsequent transactions within the bundle then utilize these variables.
The last transaction in the bundle clears the storage proof variables, ensuring that there are no state differences. (Particularly useful for zk-rollups)
Validator/Sequencer Integration: Finally, this crafted bundle is forwarded to either a sequencer or validator which include the bundle into the blockchain.
Synchronous Transactions
One of the key advantages of Turbo is that it offers synchronous transactions from an end-user perspective. When a user sends a transaction involving Turbo, they don't need to take any additional steps. The transaction is processed seamlessly, and the user can sit back and wait for the transaction to be executed.
This synchronous nature of Turbo transactions represents a significant step forward in addressing the increasing fragmentation of the Ethereum ecosystem. With Turbo, users no longer have to navigate complex workflows or interact with multiple systems to complete a transaction.
The Trade-off: Slightly Longer Transaction Times
It's important to note that the convenience of synchronous transactions comes with a trade-off. Transactions involving Turbo may take slightly longer to complete compared to regular transactions. This is because the storage proofs required for the transaction need to be generated and verified before the transaction can be executed.
However, we believe that this increased transaction time is a small price to pay for the enhanced user experience and seamless integration provided by Turbo.
Data Accessible through Turbo
Turbo provides access to a wide range of data that Herodotus can provide, including:
Headers
Accounts
Storage
Receipts (coming soon)
Transactions (coming soon)
Verifiable Compute through HDP (coming soon)
Interfaces
Fees
Note: In Testnet fees are not required.
When interacting with Turbo you are expected to pay the Turbo operator for your transactions through a smart contract by using feeToken.transfer(operator, AMOUNT_TO_TRANSFER)
.
If the fee is too low the transaction won't be picked up by the RPC.
Last updated