Chains

Cardano

Shelley and stake addresses decoded under CIP-19 with their Bech32 checksum verified. Byron addresses get a CBOR envelope check, CRC unverified.
create
create("cardano")
family
UTXO · utxo
symbol
ADA · 6 decimals
bip44
1815
caip2
cip34:1-764824073
explorer
cardanoscan.io

Address format

Shelley addr1… and stake stake1… addresses are read the same way: the Bech32 checksum under addr or stake, past the 90 characters BIP-173 allows because a base address is 103, then CIP-19's header. The network tag has to be mainnet's, the type has to fit the prefix, and the payload has to be what the type carries: two 28-byte credentials for a base address, one for an enterprise or reward address, one plus a pointer for a pointer address. A pointer has to carry the three coordinates the ledger reads, seven bits a byte, within their widths, with nothing left over.

Byron Ae2… and DdzFF… addresses keep their CBOR envelope check: array of two, tag 24, a byte string opening as the array of three items with its 28-byte root, then a CRC head matching the bytes it claims. The CRC value itself isn't verified, and a Byron testnet address passes, because its network hides in an attribute the check doesn't open.

import { getChain } from "@agntn/chains";

const chain = getChain("ada");
chain.assertAddress("addr1qx2fxv2umyhttkxyxp8x0dlpdt3k6cwng5pxj3jhsydzer3n0d3vllmyqwsx5wktcd8cc3sq835lu7drv2xwl2wywfgse35a3x"); // returned unchanged
chain.type; // "utxo"
chain.caip2; // "cip34:1-764824073"

Spellings

cardano, ada, Cardano. The key is cardano, the rest resolve through getChain.

@agntn/chains·MIT license· A format check, not proof an address exists. Nothing on this site talks to a chain.