Resolve an Algorand ARC-19 template using the reserve address

A wallet may see a template-ipfs URL where a gateway expects a concrete content identifier. For an ARC-19 asset, the reserve field supplies the digest used in the template.

Read the asset configuration and parse the template

Fetch the ASA parameters by asset ID and retain the observed round. In this example the template specifies CID version 1, raw codec and SHA2-256. Decode the Algorand reserve address with an address decoder and use its 32 payload bytes after checksum validation.

template-ipfs://{ipfscid:1:raw:reserve:sha2-256}

Build the CID from the existing digest

Wrap the payload bytes as the digest of a SHA2-256 multihash, then construct the CID using the specified codec and version. Rehashing the reserve payload would produce another address. Keep any literal path following the substitution. A later asset configuration can change reserve while leaving the URL template unchanged, so cache the resolved URL with its configuration round.

Sources