Wallet CLI: requant-wallet
requant-wallet is the reference wallet. Version 0.10.0, with ordinary RQT payments and payment channels, is in the wallet releases for Linux, Windows and Android (Termux). The node 0.18.1 release contains node binaries only. It 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;
allandconsolidatetake the largest 600, so run them again for the rest. restorescans each chain until 20 unused addresses in a row.--no-scanrestores 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
broadcast with several files sends them as one package, parents first: a pre-signed transfer that pays too little on its own goes out with a child that pays for both.
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://pool.requant.network:19380
requant-wallet send my.wallet trq1... 1 --api http://pool.requant.network: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
Payment channels
One deposit, many payments, two transactions on the chain (wallet 0.7.0). The client pays a server in small steps; the server closes with the last state before the expiry, or the client takes the deposit back from the expiry.
requant-wallet channel open my.wallet <server pubkey> <server address> 5 <expiry height> --out ch.json
requant-wallet channel accept server.key ch.json # the server signs the refund
requant-wallet channel fund my.wallet ch.json # only now is the deposit sent
requant-wallet channel pay my.wallet ch.json 0.25 --out s1.hex
requant-wallet channel pay my.wallet ch.json 0.40 --out s2.hex # the total so far, always growing
requant-wallet channel receive ch.json s2.hex # the server checks a state: JSON
requant-wallet channel close server.key ch.json s2.hex # the server, before the expiry
requant-wallet channel refund ch.json # the client, from the expiry
requant-wallet channel show ch.json
The channel file holds no secret and both sides keep a copy. It carries the deposit transfer without its signatures, so the server cannot send the deposit before it has signed the refund, and fund refuses a channel whose refund is not signed. A server counts payments only once receive reports the deposit as confirmed, and closes well before the expiry.
Options
| Option | Meaning |
|---|---|
--network test|regtest | network; default test, or the wallet file's network |
--rpc HOST:PORT | node RPC; default 127.0.0.1:19334 (test), 127.0.0.1:19445 (regtest) |
--rpc-cookie FILE | the node's .cookie file when it runs with --rpc-cookie |
--api http://HOST:PORT | use a node's public API instead of RPC |
--fee-rate N|fast|normal|slow | atoms per byte, or the node's estimate for 1, 3 or 10 blocks; default normal |
--yes | send without asking |
--out FILE | write the result to a file |
--no-passphrase | store 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.