Docs
Build on Tenrai
APIs, SDKs and integrations.
Start here
- Developer quickstart
Read the chain over HTTP, then install the Tenrai SDK to read a balance, send TRAI and follow the payment until it is final.
- Integration overview
The interfaces Tenrai offers to developers, what each one is for, and the handful of rules every integration has to follow.
APIs
- REST API
How the Tenrai HTTP API works. Base URLs, JSON conventions, pagination, batch reads, submitting transactions, limits and signed answers.
- WebSocket events
Follow finalized cuts, addresses, the mempool and single transactions live over the three Tenrai WebSocket endpoints, and recover after a reconnect.
Libraries
- SDK
The Tenrai SDK for TypeScript and JavaScript. Every REST route, the WebSocket streams, signed answers and a wallet that signs locally.
- WASM module
tenrai-wasm brings the Tenrai rules for transactions, addresses, amounts and wallet keys to browsers and other WebAssembly hosts.
Integrations
- Accept and send payments
Integrate TRAI deposits and withdrawals on a server with the wallet daemon. Addresses per customer, crediting, withdrawals that never pay twice.
- Build an explorer or indexer
Which routes and streams an explorer needs for each page, how to index every finalized cut, and how to show payloads and miner tags safely.
- Mining integration
Connect your own mining software to Tenrai, or build a bridge or pool on the node's mining listener. Work, shares, blocks and rewards.
Reference
- REST routes
Every HTTP route of the Tenrai node API and the Tenrai API, grouped by subject, with its parameters and what it returns.
- Stratum protocol
The tenrai-mining-v1 and tenrai-mining-v2 protocols between miners and bridges or pools. Transport, messages, work header, targets and error codes.
- Payment requests
The format of Tenrai payment URIs and payment requests for links and QR codes. Schemes, the amount and payload parameters, and what wallets refuse.
- Errors
The error document of the Tenrai API, its codes and HTTP statuses, which failures to retry, and the messages a rejected transaction gets.
- Test vectors
Known inputs and outputs for wallets, addresses, amounts, hashing, transactions, payloads, the messenger and TenQ, to check another implementation byte for byte.
Conventions
- Conventions (TCCs)
Tenrai Calls for Conventions are voluntary standards that wallets, explorers and mining software share. What a TCC is and the conventions in use today.
- TCC-0001 Wallet derivation
The TENRAI-HD-v1 rule that turns a 24-word recovery phrase and an optional passphrase into ML-DSA-65 keys. Constants, root, paths and the fingerprint.
- TCC-0002 Wallet file
The 103-byte TRAISEED1 file that holds a wallet's seed entropy. Layout, Argon2id and XChaCha20-Poly1305 encryption, and a test vector.
- TCC-0003 Address verification words
The six public words that stand for a Tenrai address. The word list, the derivation from the address, the text form and the strength.
- TCC-0004 Address ownership proof
How the owner of a Tenrai address proves control to a verifier. The request and proof documents, the signed message and the checks in order.
- TCC-0005 Recipient payloads
The TRP layout that packs one payload per recipient into a transaction's single payload. The marker, the entries, and the rules for reading and writing.
- TCC-0009 Messenger
The TRM frames two wallets chat with, and in their sealed text long texts, Codec 2 voice messages, answers, forwards and reactions.
Contributing
- Development guidelines
The engineering rules for contributions to Tenrai. Code style, comments, error handling, consensus code, performance, tests, dependencies and AI coding agents.
- Improvement proposals (TIPs)
How to write a Tenrai Improvement Proposal. The header fields, the required sections, the review stages and the principles every proposal has to meet.
