Language

Choose a language

/build/rpc / postquantum

generatemldsaaddress

  • workflowpost-quantum-signing·step 1 of 4Workflow: post-quantum-signing · step 1 of 4

generatemldsaaddress ( level ) Generate a Taproot v2 ML-DSA address for post-quantum signatures. EXPERIMENTAL: ML-DSA keys are stored in wallet database. Backup your wallet to preserve ML-DSA keys. Arguments: 1. level (numeric, optional, default=65) ML-DSA parameter set: 44 (weak), 65 (standard), or 87 (high security) Result: { (json object) "address" : "str", (string) The witness v2 address (bech32m) "pubkey" : "hex", (string) ML-DSA public key (raw FIPS 204, hex) "seckey" : "hex", (string) ML-DSA secret key (hex) - KEEP SECRET! "level" : n, (numeric) Parameter set (44/65/87) "tapscript" : "hex", (string) The tapscript spending condition "scriptPubKey" : "hex", (string) The scriptPubKey (witness v2 program) "encoded_pubkey" : "hex", (string) Encoded ML-DSA public key for script (includes alg_id, param_set, and varint length) "internal_pubkey" : "hex", (string) Internal pubkey (wallet-owned key for Taproot construction) "leaf_hash" : "hex", (string) Tapleaf hash of the spending script "merkle_root" : "hex", (string) Merkle root (same as leaf_hash for single-leaf tree) "output_pubkey" : "hex", (string) Output pubkey (tweaked pubkey in scriptPubKey) "parity" : true|false, (boolean) Parity bit of the output pubkey (needed for control block) "warning" : "str" (string) Warning about experimental nature } Examples: > bitcoin-cli generatemldsaaddress > bitcoin-cli generatemldsaaddress 87 > curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "generatemldsaaddress", "params": [65]}' -H 'content-type: application/json' http://127.0.0.1:8332/

Signature

generatemldsaaddress(level?: number) → any

Code samples

curl --user "$RPC_USER:$RPC_PASS" \
  --data-binary '{"jsonrpc":"1.0","id":"docs","method":"generatemldsaaddress","params":[65]}' \
  -H 'content-type: text/plain;' \
  http://127.0.0.1:8332/

Parameters

NameTypeReq.Description
levelnumberML-DSA parameter set: 44 (weak), 65 (standard), or 87 (high security)

Result

Type:  any

{ (json object) "address" : "str", (string) The witness v2 address (bech32m) "pubkey" : "hex", (string) ML-DSA public key (raw FIPS 204, hex) "seckey" : "hex", (string) ML-DSA secret key (hex) - KEEP SECRET! "level" : n, (numeric) Parameter set (44/65/87) "tapscript" : "hex", (string) The tapscript spending condition "scriptPubKey" : "hex", (string) The scriptPubKey (witness v2 program) "encoded_pubkey" : "hex", (string) Encoded ML-DSA public key for script (includes alg_id, param_set, and varint length) "internal_pubkey" : "hex", (string) Internal pubkey (wallet-owned key for Taproot construction) "leaf_hash" : "hex", (string) Tapleaf hash of the spending script "merkle_root" : "hex", (string) Merkle root (same as leaf_hash for single-leaf tree) "output_pubkey" : "hex", (string) Output pubkey (tweaked pubkey in scriptPubKey) "parity" : true|false, (boolean) Parity bit of the output pubkey (needed for control block) "warning" : "str" (string) Warning about experimental nature }

Source: services/core-node/bcore/src/wallet/rpc/pq.cpp:47

C++ symbol: generatemldsaaddress