WizardConnect
wiz://?p=<pubkey_bech32>&s=<secret_bech32>
wiz://<host>:<port>?p=<pubkey_bech32>&s=<secret_bech32>&pr=<ws-or-wss>
p encodes a 32-byte x-only Nostr public key. s encodes an 8-byte pairing secret. The default relay is wss://relay.riften.net:443. The documented transport uses Nostr NIP-17 gift wrap.
| Action | Direction | Fields |
|---|---|---|
dapp_ready | Dapp → wallet | supported_protocols, wallet_discovered, optional selected_protocol, app name and icon. |
wallet_ready | Wallet → dapp | supported_protocols, wallet_name, wallet_icon, dapp_discovered, session, public_key and echoed secret. |
sign_transaction_request | Dapp → wallet | transaction is a WC2-BCH signing request. inputPaths contains tuples [inputIndex, pathName, addressIndex]. sequence correlates the response. |
sign_transaction_response | Wallet → dapp | sequence, signedTransaction as hex, and optional error. A failed response has empty signed bytes. |
sign_cancel | Dapp → wallet | The original sequence and optional reason. |
disconnect | Either | Courtesy notification before session teardown. |
Messages carry action and time in Unix seconds. wallet_ready.session.hdwalletv1.paths contains { name, xpub } entries. receive, change and defi are well-known names. Session extensions may supply more.
WizardConnect protocol · URI and key exchange · Relay transport
WalletConnect for BCH
CAIP-2 chain IDs are bch:bitcoincash for mainnet, bch:bchtest for test networks and bch:bchreg for regtest. A session proposal places requested chains, methods and events under the bch namespace. The documented address-change event is addressesChanged.
| Method | Params | Result |
|---|---|---|
bch_getAddresses | {} | Array of CashAddr strings. |
bch_signTransaction | transaction, sourceOutputs, optional broadcast and userPrompt. | { signedTransaction, signedTransactionHash }, both hex strings. |
bch_signMessage | message, optional userPrompt. | Base64 signature using the Bitcoin Signed Message format. |
transaction can be raw hex or a Libauth transaction representation. Each sourceOutputs entry combines the input outpoint and sequence data with the data for the UTXO being spent and optional contract metadata. The Libauth extended JSON form carries byte arrays and big integers as tagged strings. broadcast defaults to true. The raw request is scoped to the approved topic and chainId.
WC2-BCH specification and types
CashConnect Nostr SDK
bch-cc-v1:<x-only-pubkey-hex>?relay=<urlencoded-relay-url>
The SDK uses Nostr event kind 5001 and defaults to wss://nostr.infra.cash. The proposal’s chain field is a nonempty string. The template determines action names, parameters and result types.
| Message | Direction | Payload and result |
|---|---|---|
sessionProposal | Wallet → dapp | {} → proposal with id, dapp, chain, template, allowedTokens, methods and events. |
sessionCreate | Wallet → dapp | { allowedTokens } → {} on successful approval. |
getBalances, getTokens | Dapp → wallet | {} → spendable balance or token output records. |
executeAction | Dapp → wallet | { action, params } → data, transactions, utxos.consumed, utxos.emitted, balanceChanges, optional meta. |
balancesChanged, sessionDelete | Wallet → dapp for balances. Either for deletion. | Spendable balance notification or deletion notification with optional reason. |
CashConnect Nostr protocol schemas · Template types
XO Stack
XOInvitation carries an invitationIdentifier, templateIdentifier, actionIdentifier, signed commits, and optional action result. Commit records identify contributions to the invitation and can refer to a specific template action. @xo-cash/types defines the data structures.
| Engine method | Interface |
|---|---|
importTemplate | Registers a template and returns its templateIdentifier. |
createInvitation, acceptInvitation | Creates or accepts the stored invitation for the action. |
listMissingRequirements, appendInvitation, updateInvitation | Queries unfilled requirements, adds local contributions or applies a shared revision. |
signInvitation | Signs the specified input for the invitation identifier. |
executeAction | Takes an invitation identifier and broadcastTransaction option. Returns builtTransaction and storedInvitation. |
Engine API signatures · XOInvitation fields · Sync-client API
CashAccounts v2
Registration and identity NFT
Registration output 0 is a covenant-bound mutable Identity NFT. Its Pay to Script locking bytecode carries the CashCode spending public key. Output 1 is an OP_RETURN carrying the registration identifier 0x01010102 as a four-byte push, then the account name and optional profile fields. The name is 2–32 ASCII letters, digits or underscores.
| Offset | Bytes | NFT commitment field |
|---|---|---|
| 0 | 1 | Identity NFT version 0x02 |
| 1 | 1 | CashCode version 0x01 for mainnet or 0x05 for testnet |
| 2 | 1 | CashCode prefix |
| 3 | 33 | Compressed CashCode scan public key |
| 36 | 4 | CashCode expiry, unsigned big-endian |
| 40 | 32 | Optional x-only Nostr public key |
The display collision hash is the uppercase hex of the first two bytes of SHA256d(blockHash || categoryId), using the hashes decoded from display-order hex. A collision extension appends more lowercase digits from that digest. The stable identity key is (network, categoryId).
CashID challenge and response
Request: cashid:<host><path>?x=<nonce>[&e=<expiry>]
Response: cashid:<host><path>?x=<nonce>[&e=<expiry>]&d=<category>:<txid>:<vout>
x is a 16-byte random nonce encoded as 32 lowercase hex characters. e is optional Unix time in seconds. An omitted path resolves to /cashid for delivery. Preserve the URI’s exact path and parameter order in the signed string. Both IDs in d are 64-character lowercase display-order hex. The output index is decimal without leading zeros.
The JSON response has request (the complete signed URI), address (the derived P2PKH CashAddr), and signature (the padded Base64 encoding of the raw 64-byte BCH Schnorr signature). The key tweak is SHA256(ASCII("CashID/v2") || spendPublicKey || UTF8(responseUri)), interpreted as an unsigned big-endian integer. The signature covers the URI in the Bitcoin Signed Message format. Verification binds the signature to the currently live Identity NFT outpoint.
The reference indexer exposes GET /resolve?id=<identifier> and POST /verify-cashid. The OpenID Connect bridge issues authorization codes using S256 PKCE and can send signed back-channel logout tokens for affected sessions after confirmed spending-key rotation or burn.
CashAccounts v2 demo · OpenID Connect Core
A cryptographic value derived from a private key and used to verify its signatures.An encoded extended public key that lets a watch-only wallet derive non-hardened public keys and link their addresses.The currency unit of Bitcoin Cash, equal to 100,000,000 satoshis.The public Bitcoin Cash blockchain on which payments use BCH.A private node mode for running a local Bitcoin Cash chain and mining test blocks on demand.A shareable identifier a wallet decodes into a payment’s locking script, usually in CashAddr format on BCH.A Bitcoin Cash record that defines new outputs and, for a payment, identifies the UTXOs being spent.A transaction record that identifies a UTXO to spend and supplies its unlocking bytecode and sequence number.A transaction ID and zero-based output index that together identify the UTXO an input spends.The basic unit of spendable value on Bitcoin Cash, holding satoshis and any attached tokens under the spending rules defined by its locking bytecode.Descriptive information such as a derived key’s depth and index or a token’s name and icon.A locking script that constrains how its UTXO may be spent, for example by requiring the spending transaction to pay a particular output.A token with its own commitment and capability that CashTokens stores in a transaction output.Places the spending program directly in the output’s locking bytecode.The program in an output that specifies the conditions required to spend it.A reusable payment code that lets a compatible sender derive a fresh destination the recipient can recognize and spend.A fixed-length digest used to identify data or commit to its contents, such as a transaction ID or public-key hash.A sign-in protocol in which a wallet signs a challenge to prove control of a key or identity.A spending condition that checks a public key against a saved hash and verifies a signature made with the corresponding private key.The Bitcoin Cash address encoding, which uses a prefix, type, payload, and checksum to describe how to construct a locking script.A value made with a private key that lets someone with the corresponding public key verify authorization of the signed data.A signature scheme CashVM can verify, using 64 bytes for a BCH Schnorr signature before the transaction’s sighash byte.A 256-bit cryptographic hash function used in Bitcoin Cash transaction IDs, block hashes, and HASH160.