☕Reading from the Espresso Network
A Caff Node (whicb stands for Caffeinated Node) is the gateway between the Espresso Network and your application. Technically, it is a full node of the chain that you want to read (e.g. Apechain, Rari...), which is instrumented to read confirmations from the Espresso Network. In short, Caff Nodes are how you read Espresso confirmations.
From a developer perspective, the Caff Node is just a normal RPC of the chain, which is instrumeted to read from the Espresso Network.
Caff Nodes in the Rollup Architecture
In a usual rollup setup (not using Espresso at all), you would trust the chain's sequencer to collect, order transactions and post those transactions to the parent chain. By integrating with Espresso, you delegate the confirmation of transaction ordering to the Espresso Network. The Espresso Network will provide a confirmation of the transaction(s) (in around 10s), which can be securely used in your application without being afraid of the transaction(s) being reorged.
For example, if Laura is depositting 10 ETH in an exchange, she can be sure that the operation will not be reorged and show it in the front-end to the end-user without the fear of having to update the status.
Once you have the Espresso confirmation (i.e., the transaction is securely confirmed by the Espresso Network), the Caff Node (a full node of the chain) will derived the correct state of the chain and you can read the from the RPC as you would normally do.
Using the Caff Nodes
Functionally, a Caff Node behaves exactly like a standard full node — it exposes the same RPC interface and methods. The key difference is in how it determines the state of the chain.
Get block by block number (on Rari testnet):
curl -X POST https://rari.caff.testnet.espresso.network \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getBlockByNumber",
"params": ["<BLOCK-NUMBER>", true],
"id": 1
}'
Where <BLOCK-NUMBER>
is the number of the block in hexadecimal.
Get transaction by transaction hash (Rari):
curl -X POST https://rari.caff.testnet.espresso.network \
-H "Content-Type: application/json" \
-d '{
"jsonrpc":"2.0",
"method":"eth_getTransactionByHash",
"params":["<TRANSACTION-HASH>"],
"id":1
}'
Where <TRANSACTION-HASH>
is the hash of the transaction (prefixed with 0x
).
Last updated