getAssetProof
https://api.triport.io/v1/solanaReturns the Merkle proof for a compressed NFT asset, for on-chain verification.
getAssetProof returns the Merkle proof for a single compressed NFT (cNFT),
looked up by its Digital Asset Standard (DAS) asset ID. Compressed NFTs are not
stored as individual on-chain accounts — they live as leaves in a concurrent
Merkle tree, and their authenticity is established by a proof against that
tree's root. This method gives you exactly that proof: the leaf, the tree's
current root, and the sibling hashes along the path from the leaf to the root.
Use it whenever you need to verify or act on a compressed NFT on-chain — for
example, when constructing a Bubblegum transfer, burn, or delegate instruction,
which require the proof as input so the program can recompute and check the root.
Pair it with getAsset, which returns the asset's metadata and
ownership, while getAssetProof returns the cryptographic proof for the same
asset.
This method belongs to the sol_das category and requires the basic tier or
higher. It is not available on the free tier — a free-tier key will be rejected
with an authorization error.
Parameters
The parameter schema for this method is a scaffold in the current spec revision and will be expanded in api.2.2+. The intended call takes a single DAS asset ID.
idstringrequiredResponse
The result is a Merkle-proof object for the requested asset. The current spec
revision declares the result as an open object (additionalProperties: true);
the representative shape below will be tightened in api.2.2+.
resultobjectresult.rootstringresult.proofstring[]result.node_indexintegerresult.leafstringresult.tree_idstringErrors
| Code | Meaning | When it happens |
|---|---|---|
-32602 | Invalid params | The id is missing or malformed. |
-32002 | Tier insufficient | Key is below the basic tier (e.g. a free-tier key) for the sol_das category. Returned with HTTP 403. |
-32003 | Rate limited | Per-tier RPS exceeded; retry after backoff. Returned with HTTP 429 and a Retry-After header. |
401 | Unauthorized | Missing, invalid, or revoked API key. |
A -32002 envelope carries the upgrade path in error.data:
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32002,
"message": "Method 'getAssetProof' requires basic tier or higher",
"data": {
"current_tier": "free",
"required_tier": "basic",
"method": "getAssetProof",
"category": "sol_das",
"upgrade_url": "https://triport.io/upgrade/basic"
}
}
}See errors for the full error envelope and shared codes.
Examples
JavaScript (fetch)
const res = await fetch("https://api.triport.io/v1/solana", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.TRIPORT_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
jsonrpc: "2.0",
id: 1,
method: "getAssetProof",
params: { id: "F9Lw3ki3hJ7PF9HQXsBzoY8GyE6sPoEZZdXJBsTTD2rk" },
}),
});
const { result } = await res.json();
console.log(result.root, result.proof);TypeScript SDK (@triport/sdk)
import { Triport } from "@triport/sdk";
const triport = new Triport({ apiKey: process.env.TRIPORT_API_KEY! });
const proof = await triport.solana.getAssetProof({
id: "F9Lw3ki3hJ7PF9HQXsBzoY8GyE6sPoEZZdXJBsTTD2rk",
});
console.log(proof.root, proof.proof.length);Python (triport-sdk)
import os
from triport import Triport
triport = Triport(api_key=os.environ["TRIPORT_API_KEY"])
proof = triport.solana.get_asset_proof(
id="F9Lw3ki3hJ7PF9HQXsBzoY8GyE6sPoEZZdXJBsTTD2rk",
)
print(proof["root"], len(proof["proof"]))Notes
- Spec status: scaffold. Params and result will be expanded in api.2.2+ — pin to a spec version in production and re-check this page when the schema is finalized.
- Tier: requires basic+; there is no free-tier access to
sol_dasmethods. - Compressed NFTs only: a proof exists only for assets stored in a Merkle tree (compressed NFTs). Requesting a proof for a regular (uncompressed) asset will not return tree data.
- Pair with metadata: use
getAssetto read the asset's metadata and ownership; use this method to obtain the proof needed to verify or transact with it on-chain. - Related DAS methods:
getAsset,getAssetsByGroup,getAssetsByOwner.