Wallet Setup Guide

This guide walks you through setting up a quantum-insured Bitcoin wallet using the Quantroot soft-fork implementation. All commands use bitcoin-cli on regtest.

1. Create a Wallet

$ bitcoin-cli -regtest createwallet "quantum"

2. Create a SPHINCS+ Key

Derives a SPHINCS+ keypair from the wallet's master key and registers a quantum-insured descriptor. The key is deterministic — recoverable from the wallet seed.

$ bitcoin-cli -regtest createsphincskey
{ "sphincs_pubkey": "ab12...ef34", "qi_descriptor": "qr(Q1.../0/*)" }

3. Generate a Quantum-Insured Address

Addresses use a hybrid tapleaf: both Schnorr and SPHINCS+ signatures are required in the emergency spending path. Normal spending uses efficient key-path (~64 bytes).

$ bitcoin-cli -regtest getnewaddress "" bech32m
bcrt1p...

The address is a standard Taproot (bech32m) address — indistinguishable from any other Taproot output on-chain.

4. Export the Quantum-Insured Extended Key

Export a qpub for watch-only wallets, or qprv for full backup. Both encode the BIP 32 key hierarchy plus the SPHINCS+ key.

$ bitcoin-cli -regtest exportqpub
{ "qpub": "Q1CFYH..." }

5. Import into a Watch-Only Wallet

A watch-only wallet tracks incoming payments to all QI addresses derived from the qpub, without access to private keys.

$ bitcoin-cli -regtest createwallet "watchonly" true true
$ bitcoin-cli -regtest -rpcwallet=watchonly importqpub "Q1CFYH..."

Hybrid Script Anatomy

Each quantum-insured address contains a single hybrid tapleaf:

<sphincs_pk> OP_CHECKSPHINCSVERIFY OP_DROP <schnorr_pk> OP_CHECKSIG
Normal Operation

Key-path spend with Schnorr signature (~64 bytes). The hybrid leaf is never revealed.

Quantum Emergency

Script-path spend requiring both SPHINCS+ and Schnorr signatures. An attacker must break both.

Available RPCs

Command Description
createsphincskeyDerive SPHINCS+ key and register QI descriptor
getquantumaddressDerive a quantum-insured Taproot address
listsphincskeysList all SPHINCS+ keys in the wallet
exportqpubExport quantum-insured extended public key (Q1...)
importqpubImport qpub as watch-only QI descriptor
exportqprvExport quantum-insured extended private key
importqprvImport qprv with full signing capability

6. Quantum-Insured Extended Keys

The qpub and qprv formats extend BIP 32 extended keys with SPHINCS+ key material, enabling watch-only wallets and full backups.

Format Size Prefix Contains
qpub 110 bytes Q1... / T4... BIP 32 xpub + 32B SPHINCS+ pubkey
qprv 142 bytes Q1... / T5... BIP 32 xprv + 64B SPHINCS+ secret

A watch-only wallet holding a qpub can derive all quantum-insured addresses without private key access.

7. Seed-Derived SPHINCS+ Keys

The SPHINCS+ key is derived deterministically from the wallet's master extended key, so your mnemonic phrase is the only backup you need.

HMAC-SHA512("Sphincs seed", master_ext_privkey || account_path)
→ sk_seed[0:16] || sk_prf[16:32] || pk_seed[32:48]

Account path: m/395'/coin_type'/account'. One SPHINCS+ key per account. Stateless — key reuse does not weaken security.

8. Encrypted Wallet Support

Operation Locked Unlocked
createsphincskeyFailsWorks
listsphincskeysWorksWorks
getquantumaddressWorksWorks
exportqpubWorksWorks
exportqprvFailsWorks
SpendingFailsWorks

9. Descriptor Syntax

The qr() descriptor is a drop-in replacement for tr() that auto-constructs the hybrid SPHINCS+ tapleaf from a qpub.

qr(Q1.../0/*)

For advanced use with custom Taproot trees, the qis() fragment is also available:

tr(xpub/0/*, qis(SPHINCS_HEX, xpub/0/*))

Both expand to the same hybrid script:

<SPHINCS_HEX> OP_CHECKSPHINCSVERIFY OP_DROP <EC_KEY> OP_CHECKSIG

When registered as the active BECH32M descriptor, getnewaddress bech32m automatically produces quantum-insured addresses.