Docs
v1

Concept

Integration overview

The interfaces Tenrai offers to developers, what each one is for, and the handful of rules every integration has to follow.

On this page

Pick an interface

You want toUse
Read blocks, cuts, transactions, balancesREST API
React to new cuts, payments or a transaction's progressWebSocket events
Do both from JavaScript or TypeScript, and sign transactionsSDK
Take deposits and pay withdrawals on a serverWallet daemon
Derive addresses or sign in a browser without the SDKWASM module
Connect mining software or build a poolStratum
Which interface fits which software. Wallets and apps use the SDK, or REST and the WASM module. Explorers and indexers use REST and the event stream. Exchanges and shops use the wallet daemon. All three talk to a node or the Tenrai API, which serve the same routes and sockets. Mining software speaks Stratum to a bridge or pool, which takes work from a node's mining listener. YOUR SOFTWARE Wallets, apps Explorers, indexers Exchanges, shops Mining software INTERFACE SDK or REST and WASM REST, event stream /v1/..., /v1/events Wallet daemon JSON-RPC, events Bridge or pool Stratum Your node or the Tenrai API the same REST routes and sockets Mining listener 127.0.0.1:28702
Each kind of software and the interface it uses.

Node or Tenrai API

Both serve the same routes, the same JSON documents and the same sockets. A client switches between them by changing one URL.

Your nodeTenrai API
Addresshttp://127.0.0.1:28701https://api.tenrai-technologies.org
Run byYouTenrai Technologies
LimitsNone per client unless you set themRate limits per client address
HistoryWhat the node's storage mode keepsAlso what its archive holds
Extra routesMining control on port 28702Network history and price under /v1/gateway/
Signed answersWith the node's identity keyWith the service's own key

Start with the Tenrai API. Move to your own node when you need more throughput, privacy for the addresses you query, or independence from a third party.

What is open source

ComponentSource
Node, command-line wallet, miner, stratum bridgeOpen
Reference poolOpen
SDKOpen
Reference explorer, reference walletOpen; built on the SDK as examples to start from
Tenrai API, Tenrai Explorer, Tenrai WalletHosted services, free to use

Rules every integration follows

  • Finality. Credit a payment when its status is finalized. One finalized cut is final; there are no reorganizations.
  • Amounts. Atoms as decimal strings, 8 decimals. Never parse them as floating point.
  • Identifiers. Transaction, block and cut IDs are 96 lower-case hexadecimal characters, SHA-384.
  • Addresses. Bech32m with a network prefix: trai, ttrai or dtrai. Validate the checksum and the network before use.
  • Spending. A transaction spends at most 8 outputs and only finalized ones. Wallets with many small outputs compound first.
  • Expiry. A transaction names the last cut at which it may execute, at most 1,800 cuts ahead. After that it can never execute, so a retry cannot pay twice.
  • Payloads are public and untrusted. Up to 1,024 bytes travel with a transaction. Escape them before display and pass them to SQL only as parameters.

Type to search guides, concepts and reference pages.