GET v0/data_root_inclusion_proof
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.
Request
curl \
-H 'Authorization: Bearer <YOUR API KEY>' \
'https://t.tech/v0/data_root_inclusion_proof?height=0&start=0&end=0'package main
import (
"fmt"
"io"
"net/http"
)
func main() {
url := "https://t.tech/v0/data_root_inclusion_proof?height=0&start=0&end=0"
apiKey := "Your API Key" // Replace with your actual token
req, err := http.NewRequest("GET", url, nil)
if err != nil {
fmt.Println("Error creating request:", err)
return
}
req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", apiKey))
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
fmt.Println("Error sending request:", err)
return
}
defer resp.Body.Close()
body, err := io.ReadAll(resp.Body)
if err != nil {
fmt.Println("Error reading response body:", err)
return
}
fmt.Println("Status:", resp.Status)
fmt.Println("Response:", string(body))
}// 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(())
}Query Parameters
networkThe Celestia network to which the data blob should be posted. Can be either mainnet or mocha-4. Defaults to
mainnet if no value is specified. Read more about networks on the Celestia Docs
here.
heightThe block height for which the data root inclusion proof is requested. This is the block height at which the data root was included.
startThe 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.
endThe 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
proof — JSON objectTop level object containing the inclusion proof.
aunts — array<string>An array of the sibling hashes in the Merkle tree needed to verify a leaf node.
index — integerThe position of the data root (leaf) in the list of all leaves used to build the Merkle tree. Zero-based index.
leafHash — stringThe hash of the leaf in the proof.
total — integerThe total number of leaves in the Merkle tree (i.e., how many data roots are in the row).
Example Response
{
"proof": {
"total": 2,
"index": 1,
"leafHash": "R8qjLw8ntZYlSkIBBf1o291y8lDz9pOIBGEd2OGtj9A=",
"aunts": [
"c8S8ImzdrS9GKfBHs3mI/FG/bTT9sGQuARzkHWy13U0="
]
}
}