CashAccounts v2 gives applications an on-chain identity for a display name, payment resolution and sign-in. Each identity is anchored to a CashTokens Identity NFT. The current live NFT output determines which keys control it. An optional Nostr key can be associated with the identity.
Resolve the account
- Ask a resolver on the selected BCH network to resolve a v2 name or category ID. A confirmed name can take the form
Amber#3F2Awith extra collision digits when needed. - Use the network and Identity NFT category as the application’s stable identity key. The name and collision hash help people choose an identity. A pending registration acquires its final collision hash after it confirms.
- For payments, ask the wallet to use the resolved CashCode. For sign-in, issue a fresh CashID challenge bound to the browser session.
Integrate sign-in through OpenID Connect
An OpenID Connect (OIDC) bridge turns a wallet’s signed CashID proof into a web sign-in. The bridge verifies control of the current Identity NFT and acts as the application’s issuer. Register the app and its exact redirect URI with the issuer. Discover its endpoints through the issuer’s /.well-known/openid-configuration document.
- Start an authorization-code flow with the
openidscope and S256 PKCE. Keep the state, nonce and verifier bound to the pending sign-in session. - The bridge presents a CashID request. The wallet shows the requesting service, lets the user pick an identity and signs the request. The bridge verifies that proof and asks the browser to confirm the verified account.
- At the callback, match state, exchange the code with the PKCE verifier and validate the ID token using the configured issuer’s keys. Check issuer, audience, expiry and nonce before starting the application session.
Key the local user by (iss, sub). The bridge’s subject follows the Identity NFT and can survive a transfer. If the application relies on owner-specific access, implement the issuer’s back-channel logout and end affected sessions after verified key changes or burns.
Verify CashID directly
A direct integration issues a short-lived, single-use cashid: challenge and receives a signed response from the wallet. Verify the exact signed URI, the Schnorr signature and its binding to the live Identity NFT. Recheck the NFT’s outpoint before accepting login and consume the challenge when the session is authorized.
CashID proves control of the identity for a login. For payments or contract calls that require approval, use the wallet’s transaction connection flow.
Wallet key derivation
The reference wallet derives the first CashAccount’s scan and spend keys at m/44'/145'/0'/2/0' and m/44'/145'/0'/2/1'. A CashID v2 response uses a fresh key derived by tweaking the CashAccount spending key with the exact response URI. BCH derivation types
CashAccounts v2 protocol reference · CashAccounts v2 demo · OIDC authorization-code flow
Bitcoin Cash’s native fungible token and NFT format, carried in transaction outputs and enforced by consensus.A token with its own commitment and capability that CashTokens stores in a transaction output.The currency unit of Bitcoin Cash, equal to 100,000,000 satoshis.A 32-byte CashTokens identifier that groups related tokens and defines which fungible units are interchangeable.A fixed-length digest used to identify data or commit to its contents, such as a transaction ID or public-key hash.Software or a device that manages addresses and tracks UTXOs, with signing wallets also holding private keys to authorize payments.A reusable payment code that lets a compatible sender derive a fresh destination the recipient can recognize and spend.A sign-in protocol in which a wallet signs a challenge to prove control of a key or identity.A signature scheme CashVM can verify, using 64 bytes for a BCH Schnorr signature before the transaction’s sighash byte.A transaction ID and zero-based output index that together identify the UTXO an input spends.A Bitcoin Cash record that defines new outputs and, for a payment, identifies the UTXOs being spent.