Language

Choose a language

/build/rpc / assets / registry

registerasset

  • workflowissue-an-asset·step 1 of 5Workflow: issue-an-asset · step 1 of 5

registerasset "address" amount "asset_id" policy_bits ( allowed_spk_families unlock_fees_sats "ticker" decimals {"autofund":bool,"broadcast":bool,"fee_rate":n,"replaceable":bool,"kyc_flags":n,"vk_data":"hex","max_root_age":n,"tfr_flags":n,"icu_payload_plain":"hex","icu_plain_commit":"hex","icu_ctxt_commit":"hex","kdf_salt":"hex","icu_payload":"hex","icu_flags":n,"icu_visibility":n,"use_compression":bool,"policy_quorum_bps":n,"issuance_cap_units":n,"issuance_cap":"str"} ) Register a new asset with optional ticker and decimals (wallet version). Arguments: 1. address (string, required) ICU destination address 2. amount (numeric or string, required) ICU BTC amount (minimum 5 BTC) 3. asset_id (string, required) 32-byte asset id hex 4. policy_bits (numeric, required) Policy bits (e.g., 3 for MINT_ALLOWED | BURN_ALLOWED) 5. allowed_spk_families (numeric, optional, default=28) Allowed script families (28 = P2WPKH | P2WSH | P2TR) 6. unlock_fees_sats (numeric, optional) Unlock threshold in satoshis 7. ticker (string, optional) Ticker symbol [A-Z0-9]{3,11} 8. decimals (numeric, optional) Decimal places (0..18) 9. options (json object, optional) Options { "autofund": bool, (boolean, optional, default=true) Automatically fund transaction fees "broadcast": bool, (boolean, optional, default=false) Broadcast after signing "fee_rate": n, (numeric, optional) Fee rate in sat/vB "replaceable": bool, (boolean, optional, default=true) Enable RBF "kyc_flags": n, (numeric, optional, default=0) ZK/KYC flags (e.g., KYC_REQUIRED=1) "vk_data": "hex", (string, optional) ZK verification key data (will be chunked and committed automatically) "max_root_age": n, (numeric, optional, default=0) Maximum merkle root age in seconds "tfr_flags": n, (numeric, optional, default=0) Transfer flags (e.g., TFR_ANCHOR_REQUIRED) "icu_payload_plain": "hex", (string, optional) Canonical ICU plaintext bytes. When provided, the wallet encrypts and computes commits automatically. "icu_plain_commit": "hex", (string, optional) 32-byte plaintext commitment "icu_ctxt_commit": "hex", (string, optional) 32-byte ciphertext commitment "kdf_salt": "hex", (string, optional) 16-byte encryption salt "icu_payload": "hex", (string, optional) Raw ICU payload bytes (for ICU_TEXT_CHUNK) "icu_flags": n, (numeric, optional, default=0) ICU structural flags (e.g., WRAP_REQUIRED=1) "icu_visibility": n, (numeric, optional, default=0) 0=public, 1=holder_only "use_compression": bool, (boolean, optional, default=false) Enable zstd compression for ICU payload "policy_quorum_bps": n, (numeric, optional, default=0) Governance quorum in basis points (0=immutable) "issuance_cap_units": n, (numeric, optional, default=0) Issuance cap in base units (0=unlimited) "issuance_cap": "str", (string, optional) Issuance cap expressed in asset units (e.g., "50.0"). Overrides issuance_cap_units. } Result: "hex" (string) Transaction ID if broadcast, otherwise hex Examples: > bitcoin-cli registerasset "bc1q..." 5.1 "aaa...aaa" 3 28 510000000 "GOLD" 8

Signature

registerasset(address: string, amount: any, asset_id: string, policy_bits: number, allowed_spk_families?: number, unlock_fees_sats?: number, ticker?: string, decimals?: number, options?: object) → any

Code samples

curl --user "$RPC_USER:$RPC_PASS" \
  --data-binary '{"jsonrpc":"1.0","id":"docs","method":"registerasset","params":["\"<address>\"","\"<amount>\"","\"<asset_id>\"",0,28,0,"\"<ticker>\"",0,{}]}' \
  -H 'content-type: text/plain;' \
  http://127.0.0.1:8332/

Parameters

NameTypeReq.Description
addressstringyesICU destination address
amountnumber | stringyesICU BTC amount (minimum 5 BTC)
asset_idstringyes32-byte asset id hex
policy_bitsnumberyesPolicy bits (e.g., 3 for MINT_ALLOWED | BURN_ALLOWED)
allowed_spk_familiesnumberAllowed script families (28 = P2WPKH | P2WSH | P2TR)
unlock_fees_satsnumberUnlock threshold in satoshis
tickerstringTicker symbol [A-Z0-9]{3,11}
decimalsnumberDecimal places (0..18)
optionsobjectOptions { "autofund": bool, (boolean, optional, default=true) Automatically fund transaction fees "broadcast": bool, (boolean, optional, default=false) Broadcast after signing "fee_rate": n, (numeric, optional) Fee rate in sat/vB "replaceable": bool, (boolean, optional, default=true) Enable RBF "kyc_flags": n, (numeric, optional, default=0) ZK/KYC flags (e.g., KYC_REQUIRED=1) "vk_data": "hex", (string, optional) ZK verification key data (will be chunked and committed automatically) "max_root_age": n, (numeric, optional, default=0) Maximum merkle root age in seconds "tfr_flags": n, (numeric, optional, default=0) Transfer flags (e.g., TFR_ANCHOR_REQUIRED) "icu_payload_plain": "hex", (string, optional) Canonical ICU plaintext bytes. When provided, the wallet encrypts and computes commits automatically. "icu_plain_commit": "hex", (string, optional) 32-byte plaintext commitment "icu_ctxt_commit": "hex", (string, optional) 32-byte ciphertext commitment "kdf_salt": "hex", (string, optional) 16-byte encryption salt "icu_payload": "hex", (string, optional) Raw ICU payload bytes (for ICU_TEXT_CHUNK) "icu_flags": n, (numeric, optional, default=0) ICU structural flags (e.g., WRAP_REQUIRED=1) "icu_visibility": n, (numeric, optional, default=0) 0=public, 1=holder_only "use_compression": bool, (boolean, optional, default=false) Enable zstd compression for ICU payload "policy_quorum_bps": n, (numeric, optional, default=0) Governance quorum in basis points (0=immutable) "issuance_cap_units": n, (numeric, optional, default=0) Issuance cap in base units (0=unlimited) "issuance_cap": "str", (string, optional) Issuance cap expressed in asset units (e.g., "50.0"). Overrides issuance_cap_units. }

Result

Type:  any

"hex" (string) Transaction ID if broadcast, otherwise hex

Source: services/core-node/bcore/src/wallet/rpc/assets.cpp:1557

C++ symbol: wallet_registerasset