Node HTTP API

Endpoints, parameters and results of a statement-v4 node, plus the restricted public gateway.

On this page
  1. Node endpoints
  2. Submitting
  3. Public gateway
  4. Wallet gateway

Node endpoints#

The node serves a v4 state directory. Every list is paged. Every response carries the header X-Lathen-Height.

RouteParametersResult
GET /stateHeight, tip, roots, counts, frontier and the rule in force. On a one-validator chain it also carries a notice that one key orders everything.
GET /protocolConstants for wallets: domain, root window, oldest accepted root height, envelope size, market settings
GET /blocksfrom, limitSigned blocks with proofs; at most 16 and 64 MiB per page
GET /headersfrom, limitSigned headers; at most 512
GET /effectsfrom, limitPer block, without proofs; at most 64
GET /tapeafter, limitPublic trade tape entries with seq > after; at most 512. /trades is the same.
GET /transactions/<id>Height, index, time, block commitment, first leaf position, leaf count
GET /assetsafter, limitIssued plain assets
GET /launchesafter, limitLaunch records
GET /pools, GET /pools/<id>Pool list and one pool
GET /marketThe whole market state in one response (a wallet caps it at 4 MiB)
POST /transactionsbody belowOn the block producer. Returns { height, commitment, replicated, id, index, time }.
POST /blocksA freshly proposed signed block

Submissions that arrive together go into one block; a rejected one does not affect the others. A follower catches up in pages that overlap its tip by one block and treats any mismatch as a conflict.

Submitting#

{ "proofs": ["<receipt>"], "journals": ["<1336 hex>"], "envelopes": ["<base64>"], "launch": {} }
  • One proof for SPEND, ISSUANCE, POOL_BUY, POOL_SELL or LAUNCH; two proofs, role 0 first, for both halves of one exchange.
  • journals[k] is the journal claimed for proofs[k]; the verified journal must equal it exactly.
  • envelopes: two per proof, plus one more for a pool intent. Each starts with LNR1 and the chain id.
  • launch: required for a launch, refused otherwise; at most 4,096 bytes of canonical JSON.
  • Transaction id: a tagged hash of the one or two journals.

A 400 answer carries one of a fixed set of strings, for example Nullifier already spent or repeated, Exchange half requires its counterpart and Proof verification failed. A follower answers a submission with Submit transactions to the proposer.

Public gateway#

A separate gateway lets a node serve other people's wallets. It is code only; the launcher does not start it, and it speaks plain HTTP.

Private modePublic mode
BindLoopback only, no overrideLoopback by default; another address needs an explicit flag
ReadsEverything the node offersAn allow-list: /state, /protocol, /upgrades, /blocks, /headers, /effects, /tape, /trades, /transactions/<id>, /assets, /launches, /market, /pools, /pools/<id>
WritesPOST /transactions, POST /blocksPOST /transactions only
Admin, block push, peersAs the node allows locallyDo not exist (404)
LimitsThe node's ownPer address: 20 reads per second (burst 40), 6 submissions per minute, 8 concurrent; 2 MiB submission body; 512-byte URL; 256 connections
Forwarded client headersNoneNone: no X-Forwarded-For, no User-Agent, no cookies
Browser originsRefusedRefused; no CORS header is ever sent
LoggingNoneNone, as a property of this code. The operator can still record addresses outside it.

Wallet gateway#

Each wallet runs a gateway for its own page. It is loopback only, with a host allow-list, a local-origin check, a session token in the X-Wallet-Token header, JSON bodies only and bounded sizes. It is a local interface, not a service to build on.

Lathen documentation.