Requant documentation
For developers
Everything needed to build on Requant: wallets, explorers, payment services, mining software and research tools. All interfaces are open and documented; the reference implementation is Apache-2.0 Rust.
Choose an interface
| Interface | Where | Best for |
|---|---|---|
| JSON-RPC | your own requantd, localhost | full access: chain, mempool, sending, mining, administration |
| Public API | any node with --explorer; public at 193.187.93.29:19380 | web apps and light services without a node; CORS-enabled REST |
| Mining protocol | a node or the pool | miners, proxies, pool software |
| requant-wallet | command line | scripted payments, offline signing, deposit address lists |
| Consensus crate | Rust library | encoding, txids, sighashes, addresses, validation in your own code |
| TNet crate | Rust library | computing and verifying work claims |
Things to know first
- Atoms. All amounts are integers: 1 RQT = 100,000,000 atoms.
- Address or key hash. An address (
trq1…) is a bech32m encoding of a 32-byte key hash. RPC methods take the hex key hash; the public API accepts both;validateaddressconverts. - UTXO model. Balances are sums of unspent outputs. A payment spends whole outputs and returns change to a new address.
- Confirmations. A block is found about every 60 seconds. Coinbase outputs mature after 100 blocks. Choose a confirmation depth that fits the amount; on the test network a reorganisation deeper than 1440 blocks is refused by default.
- Epochs. The work-function weights change every 1440 blocks. This affects miners and verifiers, not wallets.
- Domain separation. Every hash is
SHA256(tag || data)with arequant/tag; signatures commit to the network'schain_id.
A local development chain
requantd without --network runs regtest: a private chain with a tiny work function, instant CPU mining and maturity of 2 blocks.
requant-wallet --network regtest create dev.wallet --no-passphrase
requant-wallet --network regtest address dev.wallet # prints the key hash
requantd --datadir ./regtest-data --mine <key hash> --mine-interval-ms 200
The RPC is then on 127.0.0.1:19445; add --explorer 127.0.0.1:19480 for the explorer and the public API locally. Addresses on regtest start with rqrt1.
Common integrations
- Show balances and history of a set of addresses:
GET /api/utxos?owners=…and/api/history?owners=…with up to 200 owners per request, or the RPCutxos/historywith a list. - Accept payments: one address per customer, watched for confirmed deposits. See accepting payments.
- Send payments: build and sign with the wallet or the consensus crate, then
sendtxorPOST /api/tx. Fee rate fromestimatefeeor/api/fee. - Mine or proxy work:
getworkwith long polling andsubmitwork; see mining protocol. - Monitor a node:
/health,geteventsandauditsupply; see node operations. - Build swaps or channels: HTLC, 2-of-2 and time locks are in consensus; see spending conditions.
Specifications
- SPEC.md: the TNet v1 work function, frozen, with test vectors.
- CHAIN.md: chain rules, encodings and consensus parameters.
- SWAPS.md: swap and channel designs on the spending conditions.
- TESTNET.md: the running test network.
Contributing
Issues and pull requests are welcome on requant-network/requant. Consensus changes update the rules, the code and the tests together. Report vulnerabilities privately (security).