RequantTESTNET
Requant documentation

Wallet CLI: requant-wallet

requant-wallet is the reference wallet. It ships with every node release for Linux and Windows and talks to a node's JSON-RPC, or to a node's public API when you have no node of your own.

Keys and backup

  • One phrase, many addresses. A 24-word BIP 39 phrase (256-bit entropy) restores every address. Keys are derived with SLIP-0010 for ed25519 along the hardened path m/44'/1'/0'/chain'/index': chain 0 for receiving, chain 1 for change.
  • Encrypted file. The phrase's entropy is stored encrypted with Argon2id (64 MiB, 3 passes) and XChaCha20-Poly1305 under your passphrase. Addresses are stored in the clear, so viewing balances needs no passphrase and spending does.
  • Derived ahead. ed25519 has no public derivation, so 20 addresses per chain are derived ahead; going past them asks for the passphrase.
  • Secrets are wiped from memory after use.

Everyday commands

requant-wallet create my.wallet                 # new wallet; shows the phrase once and the first address
requant-wallet address my.wallet                # current address and key hash (for the miner's --payee)
requant-wallet newaddress my.wallet             # a fresh receive address
requant-wallet addresses my.wallet              # addresses handed out, with their coins
requant-wallet balance my.wallet                # whole wallet; an address or key file works too
requant-wallet history my.wallet 20             # moves between own addresses net out to the fee
requant-wallet coins my.wallet                  # unspent outputs
requant-wallet tx TXID
requant-wallet send my.wallet trq1... 1.5       # shows amount, change and fee, asks before sending
requant-wallet send my.wallet trq1... 1 trq1... 0.25   # several recipients in one transaction
requant-wallet send my.wallet trq1... all       # everything spendable, minus the fee
requant-wallet consolidate my.wallet            # merge many small coins, e.g. pool payouts
requant-wallet phrase my.wallet                 # show the phrase again
requant-wallet encrypt my.wallet                # change the passphrase
requant-wallet restore new.wallet               # from the phrase; finds used addresses
  • Change goes to a new change address each time.
  • A transaction takes at most 600 inputs; all and consolidate take the largest 600, so run them again for the rest.
  • restore scans each chain until 20 unused addresses in a row. --no-scan restores without a node.

Offline signing

Keep the phrase on a machine that never goes online. The online machine needs only a watch-only copy.

requant-wallet watchonly my.wallet watch.wallet                    # offline: a copy without the secret
requant-wallet prepare watch.wallet trq1... 1.5 --out pay.json     # online: nothing secret involved
requant-wallet sign my.wallet pay.json --out pay.signed            # offline: shows and checks the payment
requant-wallet broadcast pay.signed                                # online

pay.json carries the transactions that created the coins it spends. Signatures do not cover input values, so the signer reads them from those parent transactions, checked by txid, instead of trusting the online machine about the fee. It refuses a payment whose coins or change are not its own.

Without a node of your own

Every command that reads the chain or sends works through a node's public API:

requant-wallet balance my.wallet --api http://193.187.93.29:19380
requant-wallet send my.wallet trq1... 1 --api http://193.187.93.29:19380

The API answers with that node's view of the chain, and the node learns which addresses you ask about. Run your own node for both trust and privacy.

Deposit lists for services

A service that gives each customer an address of its own can hand out many addresses at once and keep no keys on its server:

requant-wallet newaddress shop.wallet --count 1000 --out deposits.txt   # one address per line
requant-wallet restore shop.wallet --count 1000                         # restore at least that many

Addresses are marked as handed out before they are printed, so a list is never issued twice. A restore stops scanning after 20 unused addresses in a row; --count makes sure a long, partly unused list comes back. See accepting payments.

Spending conditions

Lock coins under a 2-of-2, an HTLC or a revocable output and spend them along any path; see spending conditions.

requant-wallet secret
requant-wallet condition htlc <sha256> <claim> <refund> <timeout> --out htlc.json
requant-wallet send my.wallet <condition address> 1
requant-wallet spend-condition my.wallet htlc.json claim <to> --preimage <secret>
requant-wallet spend-condition a.wallet m2.json both <to> --out part.json && requant-wallet cosign b.wallet part.json

Options

OptionMeaning
--network test|regtestnetwork; default test, or the wallet file's network
--rpc HOST:PORTnode RPC; default 127.0.0.1:19334 (test), 127.0.0.1:19445 (regtest)
--rpc-cookie FILEthe node's .cookie file when it runs with --rpc-cookie
--api http://HOST:PORTuse a node's public API instead of RPC
--fee-rate N|fast|normal|slowatoms per byte, or the node's estimate for 1, 3 or 10 blocks; default normal
--yessend without asking
--out FILEwrite the result to a file
--no-passphrasestore the secret unencrypted (for tests)

Environment variables for scripts: REQUANT_WALLET_PASSPHRASE, REQUANT_WALLET_PHRASE (restore), REQUANT_RPC_TOKEN, REQUANT_RPC_COOKIE.

Fees

The fee is the transaction size times the fee rate, at least 1000 atoms. A transfer's size is at most 11 bytes plus 132 bytes per input and 40 bytes per output. The node's estimatefee suggests a rate from its mempool; the minimum relay rate is 1 atom per byte.

Older single-key files

Files made with keygen still work wherever a wallet does, except for the HD-only commands: keygen my.key, address my.key, encrypt my.key.