Skip to Content
IntegrationsWallet Integration

PQHD Integration

Tidecoin wallet integration uses the Bitcoin Core descriptor-wallet model, but post-quantum keys are derived through PQHD instead of BIP32. PQHD has no xpub equivalent and no public child derivation. Integrations should treat PQHD seed material like signing key material, not like watch-only metadata.

This page is the integration guide for wallet builders and custodial systems. It is not the PQHD cryptographic specification; see PQHD Wallet for derivation rules and PSBT and Offline Signing for PSBT byte layout.

Descriptor form

PQHD key expressions use a 32-byte seed ID, encoded as 64 hex characters, and a six-element hardened path:

pqhd(<seedid32>)/10007h/6868h/<scheme>h/<account>h/<change>h/<index>h

Ranged receive and change descriptors use a hardened wildcard in the final position:

wpkh(pqhd(<seedid32>)/10007h/6868h/7h/0h/0h/*h) wpkh(pqhd(<seedid32>)/10007h/6868h/7h/0h/1h/*h)

Descriptor parsing rules:

RuleRequirement
Seed ID32 bytes, displayed as 64 hex characters.
Path lengthExactly six elements after pqhd(...).
Hardened-onlyEvery element must be hardened.
Purpose10007h.
Coin type6868h.
Change0h for receive, 1h for change.
WildcardIf present, must be the final *h element.
BIP32xpub and xprv descriptors are not PQHD substitutes.

Scheme policy

The path’s scheme element is the same numeric scheme prefix used by serialized PQ public keys:

Path elementSchemeMainnet policy
7hFalcon-512Live.
8hFalcon-1024Gated by AuxPoW activation.
9hML-DSA-44Gated by AuxPoW activation.
10hML-DSA-65Gated by AuxPoW activation.
11hML-DSA-87Gated by AuxPoW activation.

Mainnet integrations should default to Falcon-512 until the active chain rules allow other schemes. Testnet and regtest are useful for exercising the post-AuxPoW schemes before mainnet activation.

Seed management RPC

Tidecoin Core exposes wallet RPCs for PQHD seed inventory and policy:

CommandPurpose
listpqhdseedsList seed IDs tracked by the loaded wallet.
importpqhdseedImport a 32-byte PQHD master seed.
setpqhdseedSelect default receive and change seed IDs.
removepqhdseedRemove a non-default seed not referenced by wallet descriptors.
setpqhdpolicySelect default receive and change signature schemes.

Use wallet-scoped RPC:

tidecoin-cli -rpcwallet="hot" listpqhdseeds tidecoin-cli -rpcwallet="hot" setpqhdpolicy "falcon-512" "falcon-512"

Do not log master seed material. Seed IDs are identifiers, not secrets, but they still reveal wallet structure and should be treated as operational metadata.

Watch-only and offline signing boundary

An online watch-only wallet can know descriptors, scripts, addresses, UTXOs, and PQHD origin metadata. It should not know PQHD master seeds. An offline signer needs the seed material plus enough PSBT metadata to reconstruct the derivation path for each signing key.

Typical split:

ComponentHolds seedsHolds descriptorsRole
Online watch walletNoYesTracks UTXOs and creates PSBTs.
Offline signerYesYes or imported metadataSigns PSBTs.
BroadcasterNoOptionalRuns testmempoolaccept and broadcasts final hex.

When a PSBT must cross this boundary, request PQHD origin metadata with the wallet RPC option include_pqhd_origins where the command supports it.

Integration workflow

For an application-controlled wallet:

  1. Create or load a descriptor wallet.
  2. Import or generate PQHD seed material.
  3. Set receive and change seed defaults.
  4. Set receive and change scheme policy.
  5. Generate receive descriptors and addresses.
  6. Create transactions through wallet RPC or PSBT.
  7. Verify fee sizing with Tidecoin PQ signature sizes.
  8. Test final transactions with testmempoolaccept.

For a watch-only or cold-signing setup:

  1. Keep seed material offline.
  2. Import descriptors or watch-only address data online.
  3. Create an unsigned funded PSBT online.
  4. Include PQHD origin records when offline signing requires them.
  5. Transfer the PSBT to the offline signer.
  6. Sign and finalize offline.
  7. Return final hex or finalized PSBT to the online broadcaster.
  8. Broadcast and monitor confirmation status.

Failure cases to handle

FailureIntegration response
Descriptor rejects pqhd(...)Check seed ID length, six hardened path elements, purpose, coin type, scheme, and change branch.
Scheme rejected before AuxPoWFall back to an allowed scheme for that network and height.
Missing PQHD seedImport or select the seed before signing.
removepqhdseed failsThe seed is default or still referenced by descriptors. Do not force removal.
Offline signer cannot locate derivationInclude PQHD origin metadata in the PSBT or import matching descriptors.
Fee too low or transaction too largeRecompute vbytes using PQ signature sizes.

Source of truth

TopicSource
PQHD derivation and path rulesPQHD Wallet
Descriptor parser../tidecoin/src/script/descriptor.cpp
Wallet seed and policy RPCs../tidecoin/src/wallet/rpc/wallet.cpp
PQHD wallet descriptors../tidecoin/src/wallet/walletutil.cpp
PSBT origin recordsPSBT and Offline Signing

See also: Wallets / PQHD Wallets, Transaction Size & Fees, RPC Reference.

Last updated on