POST v0/blob/get_commitment
Create Commitments for Data Blobs
Calculates a Commitment for each provided pair of namespace and blob data. You can include multiple namespace and blob
pairs in a single request, and a Commitment will be returned for each pair in the same order they were provided. The
Commitment is the same for all Celestia networks (mainnet or testnet).
Note: The Commitment is the same for all Celestia networks (mainnet or testnet).
Note: This endpoint does not submit the blob, it simply calculates what the Commitment for the blob would be if it were included in a block on the Celestia network.
Note: The maximum request size is 4,000,000 bytes. If your request exceeds this amount, please contact us at orion@t.tech.
Request
curl \
-X POST 'https://t.tech/v0/blob/get_commitment' \
-H 'Authorization: Bearer <YOUR API KEY>' \
-H 'Content-Type: application/json' \
-d '{"namespace": ["97e1b5a7cc1f7019e423", "a4c2e8b1d7f93a5c6e12"], "data": ["758d869212c4061f", "e3b7c2a1d4f9856c"]}'package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
)
func main() {
url := "https://t.tech/v0/blob/get_commitment"
apiKey := "Your API Key" // Replace with your actual token
payload := map[string]interface{}{"namespace": "f47f010f8dad13d49b8f", "data": "fb9b2a0e09160e07ab49",
}
jsonPayload, err := json.Marshal(payload)
if err != nil {
fmt.Println("Error marshalling JSON:", err)
return
}
req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonPayload))
if err != nil {
fmt.Println("Error creating request:", err)
return
}
req.Header.Set("Content-Type", "application/json")
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", features = ["json"] }
// serde_json = { version = "1.0" }
// tokio = { version = "1.46", features = ["macros", "rt-multi-thread"] }
use reqwest::{Client, header};
use serde_json::json;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
let url = "https://t.tech/v0/blob/get_commitment";
let api_key = "Your API Key"; // Replace with your actual token
let payload = json!({
"namespace": "63b8358763037c45f5c1", "data": "66c49855ceb4f9e0210b",
});
let res = client
.post(url)
.header(header::CONTENT_TYPE, "application/json")
.bearer_auth(api_key)
.json(&payload)
.send()
.await?;
let status = res.status();
let body = res.text().await?;
println!("Status: {}", status);
println!("Response: {}", body);
Ok(())
}Body Parameters
namespaceAn array of namespaces for the data blobs you may post. Each namespace value must be exactly twenty characters of valid hexadecimal text. This corresponds to a V0 Celestia Namespace ID. Read more about namespace IDs at the Celestia Docs here.
dataAn array of data blobs, each encoded in hexadecimal format. Each data entry can be up to just under two mebibytes (MiB). Read more about maximum blob size on the Celestia Docs here.
Response
commitment — array<string>An array of cryptographic hashes for the data blobs. Can be used to prove that the blob was made available when submitted to the Celestia network.
Example Response
{
"commitment": [
"dWPvxZ5mBhtauYM3+Npn3Y0U3+Ctjve9NqlhsTV41PI=",
"YrFmNZary0Xb03qxKRvwso/8BO2KGIAAn2/2dBTz7M4="
]
}