Gets the data root inclusion proof from the Celestia blockchain
The proof is a cryptographic proof that shows a specific data root (e.g., for a blob namespace) was included in a given block in the Celestia blockchain.
The block height for which the data root inclusion proof is requested. This is the block height at which the data root was included.
startnumberREQUIRED
The starting index (inclusive) of the leaf or leaves you want a proof for. If you're proving a single leaf, this is the index of that leaf.
endnumberREQUIRED
The end of the proof range in block height for the api call. It is end exclusive and the max difference between start and end is 1000 blocks. If you're proving a single leaf, then end = start + 1.
Response
proofJSON object
Top level object containing the inclusion proof.
proof.totalnumber
The total number of leaves in the Merkle tree (i.e., how many data roots are in the row).
proof.indexnumber
The position of the data root (leaf) in the list of all leaves used to build the Merkle tree. Zero-based index.
proof.leafHashstring
The hash of the leaf in the proof.
proof.auntsarray<string>
An array of the sibling hashes in the Merkle tree needed to verify a leaf node.
// Cargo.toml dependencies:
// [dependencies]
// reqwest = { version = "0.12" }
// tokio = { version = "1.46", features = ["macros", "rt-multi-thread"] }
use reqwest::{Client, header};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
let url = "https://t.tech/v0/data_root_inclusion_proof?height=0&start=0&end=0";
let api_key = "Your API Key"; // Replace with your actual token
let res = client
.get(url)
.bearer_auth(api_key)
.send()
.await?;
let status = res.status();
let body = res.text().await?;
println!("Status: {}", status);
println!("Response: {}", body);
Ok(())
}