Local Node request/reply transport
Receiver stores encrypted application and native authorization requests; the local Node initiates authenticated outbound sync, claim, renewal and completion. Existing Node handlers execute in-process and return attested encrypted replies. Public application requests target Receiver/node/<path>; Receiver /intents retains the authenticated Node ingress contract. No public Node listener or Receiver-to-Node URL fallback is used.
Pending requests return HTTP 503 NODE_RELAY_PENDING with x-tsn-relay-id. Reuse that exact request ID and identical method/path/body/authorization to await its result. The SDK permits two such retries; ordinary domain errors, arbitrary 503s and transport failures do not automatically reissue operations. Public requests expire after 120 seconds; native jobs remain fenced to the original Cranker generation and deadline. An accepted reply is distinct from chain confirmation.
Node and Receiver expose different HTTP routes. Node is the application facade and verifier; Receiver owns durable work and leases. Construct requests with the typed SDK helpers and consult the generated local interface reference for every discovered route and declared model. The reference parses source without importing a server; it does not publish an invented OpenAPI contract.
Node: POST /intents
post_intent accepts message-only CreateIntentRequest, which rejects extra fields and forbids signed-deposit bytes or blockhash context at this stage. Required fields include payment/seed identifiers, resolved owner recipientHash, recipientTin, mint, UI amount, sender wallet, canonical signed message/nonce, senderFundingMode: "tcap_funded_note_v1" and restricted fundingNote: {version: 1, secret, blinding, commitment}. Note values are canonical 32-byte BN254 scalar hex; secret and commitment are nonzero. Receiver encrypts the original approval, records fundingPhase: "AUTHORIZATION" and its immutable authorizationPayloadCommitment, and creates no settlement yet. Node independently verifies authorization, identity, asset and source balance before signed FUNDING_READY. Optional timestamp, fee/recipient amount, source and destination-route fields remain subject to their verification branch; model fields do not establish an operational cross-chain route.
After readiness, the wallet prepares and signs funding with fresh senderFundingBlockhashContext: {blockhash, lastValidBlockHeight, contextSlot}. Its blockhash is a canonical nonzero 32-byte Base58 string, its height a positive safe JavaScript integer number, and its slot a nonnegative safe integer number. Numeric strings and additional nested fields are invalid. Completion preserves the tuple used to prepare the exact wallet-returned bytes. Node validates the saved authorization preflight before final wire checks and simulation, which keep the original signature/hash and use minContextSlot. This metadata identifies bank/lifetime context; it is not an issuer signature or proof of chain acceptance.
Use buildPaymentAuthorizationIntentRequest for the exact shape and amount conversion; do not build a request from a retired receipt or escrow example. The sender message signature and deposit signature are distinct authorizations. Node forwards to Receiver with its configured service credential using a 30-second HTTPX timeout. This handler has no declared worker-key dependency; ingress authorization comes from the submitted wallet material and later verification, rather than an assumed public API token.
Success returns PublicMempoolIntent with work/payment identifiers, pending status and timestamps. Staged Receiver views additionally expose phase, version and readiness metadata while omitting amount, private recipient data, signed message and funding body. Response acceptance does not establish Node readiness; funding and settlement confirmations remain separate outcomes.
/intents schema failures return a generic HTTP 422 response without echoing the submitted body or private funding opening. Missing Receiver configuration or forwarding failures produce HTTP 503. Receiver rejection statuses propagate with a detail message. TsnHttpClient throws a plain Error for non-2xx responses and has no generic automatic retry or timeout. Applications should retain identifiers and reconcile uncertain outcomes before resubmitting.
Node: GET /network/recent-blockhash
This route asks the Node’s configured Solana RPC forgetLatestBlockhash at confirmed commitment. It returns {recentBlockhash, lastValidBlockHeight, contextSlot}; height and slot are JSON numbers with the limits above. Map recentBlockhash to senderFundingBlockhashContext.blockhash and retain the height and slot from that same response. Node also checks isBlockhashValid and confirmed block height at nondecreasing minimum slots, requiring at least 100 remaining blocks before returning the original tuple. Up to three unsigned candidates use four-second per-endpoint reads; a normal candidate uses three logical RPC calls. Invalid, unavailable, unrecognized or insufficient-margin candidates exhaust to HTTP 503 before signing. This issuance margin does not extend signed lifetime or replace Cranker’s 20-block send margin. The route has no declared worker-key dependency, and a successful response supplies preparation metadata rather than transaction acceptance.
Owner funding readiness and completion
POST /network/funding/readiness accepts FundingReadinessRequest: {workId, senderPubkey, authorizationSignature}. Node binds this owner authorization to the persisted signed payment message and checks its accepted readiness attestation, encrypted preflight and expiry. Its response contains workId, stateVersion, authorizationPayloadCommitment, expiresAt, depositAccounts and amountBaseUnits; these owner-specific preparation fields are absent from public status. A source-balance observation does not reserve tokens.
POST /network/funding/complete accepts those owner fields plus expectedStateVersion, authorizationPayloadCommitment, senderFundingDepositTxB64 and senderFundingBlockhashContext. Node authenticates the same sender and forwards only the signed wire, tuple and coordination binding to Receiver. The original message, funding note, recipient and asset remain unchanged. An exact completion retry can reconcile a lost response after later transitions; it cannot replace a signed deposit. Receiver’s existing /network/[...path] forwards both POST routes to Node without giving the browser a service key.
For a first attachment Node reads confirmed block height using the tuple’s contextSlot as minContextSlot. Fewer than 40 remaining blocks returns HTTP 409 with detail: "FUNDING_BLOCKHASH_TOO_OLD_BEFORE_ATTACHMENT". An unavailable or invalid height returns HTTP 503 with detail: "FUNDING_BLOCK_HEIGHT_UNAVAILABLE_BEFORE_ATTACHMENT". Both stop the current request before attachment. A matching already-attached wire bypasses the height read and uses Receiver’s existing idempotent response.
Receiver ingress and status
POST /api/work requires { id?, kind, payload }. External work kinds are checked by assertExternalWorkKind; an external caller cannot create arbitrary SETTLEMENT work. Success returns HTTP 201 and an allowlisted coordination projection. Missing kind/payload returns 422, an idempotency conflict returns 409, and other caught input/store failures return 400. This generic interface is a Receiver work contract; it is not the Node /intents schema.
Receiver’s POST /intents requires its Node service credential. Both it and AUTHORIZED_FUNDING through /api/work accept only the initial message and forbid signed wire/context. GET /api/work-status/[id] adds fundingPhase, stateVersion, fundingReady, authorizationPayloadCommitment and fundingReadiness: {expiresAt, authorizationPayloadCommitment} | null for staged work. It returns settlement: null before attachment. These public fields exclude private preflight, note, message/signature, resolved accounts and amount; historical record projections retain their existing shape.
The Node-authenticated POST /api/internal/node/work/funding accepts exactly {id, expectedVersion, authorizationPayloadCommitment, senderSignedFundingTransaction, senderFundingBlockhashContext}. Its transaction requires FUNDING_READY, current version, original commitment and unexpired signed readiness. It merges only wire/context into encrypted original authorization, changes the completed payload commitment, marks SIGNED_DEPOSIT/RECEIVED, and creates deterministic settlement from the completed commitment. Success returns {work}; unauthorized service access returns 401, absent work 404, and caught shape/state/expiry/conflict failures 409. Identical attachment repeats succeed after later states; changed wire/context fails. Final verified context enters the attested Cranker projection, and confirmed receipt compaction removes it from execution evidence while preserving encrypted original and funding lineage.
GET /api/work returns recent sanitized state, bounded rejection diagnostics and result signatures, with its declared short cache headers. The status-by-ID route is another projection and must not be assumed to expose the signed or decrypted work. These views support diagnostics; they do not replace chain confirmation or owner record recovery.
Node worker and settlement authorization
/api/internal/node/work requires the Receiver Node service key. POST leases with nodeId and optional supported kinds, GET retrieves with an id query, and PATCH applies a versioned Node transition. POST also accepts fundingPhase: "AUTHORIZATION" or "SIGNED_DEPOSIT" only with exactly supportedKinds: ["AUTHORIZED_FUNDING"]; each pass selects only its own phase, rechecks persisted phase during reclamation and atomic claim, and returns {work: null} when no matching funding is available. Other filter combinations return HTTP 400 with INVALID_NODE_FUNDING_FILTER before accessing storage. Omitting the filter preserves ordinary accounting-priority selection. Node runs signed funding in its own worker; the other worker prepares message-only authorization before coordination and selects nonfunding supported kinds. POST/GET use 401 for unauthorized service requests, 400 for missing required identifiers and 500 for other caught failures; GET also returns 404 for missing work. PATCH maps caught transition/authentication errors to 409 in its actual implementation. Clients must inspect the returned error and reconcile lease state rather than assume all routes use identical status mapping.
The initial funding decision is FUNDING_READY with verificationType: "TSN_FUNDING_AUTHORIZATION_READY" and an empty execution projection. Receiver encrypts authorizationPreflight, retaining signed readiness metadata, attestation and Receiver lease context; authenticated GET exposes the private preflight without leasing work. This status never enables a Cranker lease/wake. After attachment, Node performs final checks before VERIFIED. Node state claim_once returns {claimed} for first or exact same serialized work/initial-commitment binding; another binding returns false, while existing consume_once semantics remain unchanged.
PUT renews an active Node claim with {id, owner, expectedVersion, leaseId, leaseVersion}. It returns {id, stateVersion, nodeLease} and extends expiry by 60 seconds without changing the work version or lease generation. It requires the matching owner/version/claim and rejects expired, reassigned or completed work. Invalid credentials return 401, malformed identifiers/versions 400, absent work 404 and lease/state conflicts 409. Node renews every 15 seconds during verification/reporting and cancels that work if renewal fails; idle workers send no renewal requests.
The Node’s /internal/settlement-authorizations/settlement and /internal/settlement-authorizations/signature require its worker-key dependency. The first takes workId and crankerPubkey, checks confirmed funding, current TIP/balance/funded roots, locally verified proof and active lease, then returns the public authorization. For native credit, fundingRootAccount is the canonical global TCAP funding-root account and proof input 12 is a current or retained root authenticated by that account; no note opening or membership path appears in this response. Receiver sanitizes the transition and nested proof fields and requires the public projection to match verified work. The signature route additionally takes canonical messageBase64, validates size/encoding and transaction content, and obtains Mother co-signing. Missing inputs produce 422, oversized signing messages produce 413, invalid authorization/proof/lease bindings produce 403, and stale root, lease or blockhash conditions produce 409. The service cannot authorize an arbitrary caller-selected transition.
The native signature route returns {authority, signatureBase64, messageBase64, blockhash, lastValidBlockHeight, blockhashContextSlot} after independently validating work, lease and exact V1 message. It selects the final confirmed hash after expensive checks and changes only bytes [8:40]. Mother signs the replacement before Cranker’s payer signer; Cranker verifies every nonhash byte, the signature, authority/hash correspondence and canonical encodings. Lifetime/context fields are positive u64 decimal strings. The final hash issuing slot pins margin/preflight/height polling; existing checkpoints reject replacement. This route cannot refresh owner-signed funding.
The current native-credit authorization includes kind=TSN_TCAP_GPRU_CREDIT_AUTHORIZATION_V1, transition, workStateVersion, leaseId, leaseVersion, leaseExpiresAt and expiresAtTs. Coordination uses TSN_TCAP_COORDINATION_AUTHORIZATION_V1 with its own verified epoch transition. Both preserve the exact verified transition and bound expiry to the current Receiver lease. The November 5 finalized funded-note receipt belongs to the historical amount-public ABI; it does not verify this private-credit replacement.
POST /api/internal/node/work/retry requires the Receiver Node service key and JSON {id, expectedVersion}. It accepts only an unsubmitted settlement rejection for GPRU_HIDDEN_HEAD_WITNESS_UNAVAILABLE:, the exact asset reason TCAP settlement asset is unavailable or its reserve binding is invalid, or the exact funded-root reason TCAP_FUNDING_ROOT_CHANGED_BEFORE_SETTLEMENT, after repairing the affected verification prerequisite. Original funding must be confirmed, with unchanged settlement payload commitment and deterministic lineage. It archives the rejection, increments the version, returns {id, status: "RECEIVED", stateVersion} and wakes independent Node verification. Invalid credentials return 401, malformed inputs 400, absent work 404 and state/funding/reason conflicts 409. This endpoint never requeues funding and can lead to settlement submission after Node verifies again; the operator utility requires explicit --execute.
Wallet/session-authenticated POST /api/cranker/work/retry accepts {id, expectedVersion, reason} for unsigned native credit and epoch accounting. The reason must belong to the executable native allowlist, including TCAP_FUNDING_ROOT_CHANGED_BEFORE_SETTLEMENT, TCAP_TRANSACTION_BLOCKHASH_TOO_OLD_FOR_SUBMISSION, TSN_NODE_SIGNING_SERVICE_UNAVAILABLE, TCAP_TRANSACTION_BLOCKHASH_HEIGHT_UNAVAILABLE and TCAP_TRANSACTION_BLOCKHASH_LIFETIME_UNAVAILABLE. It requires an unexpired lease owned by the caller, the exact work version, intact payload commitment and no persisted result. Native credit additionally requires a thirteen-input verified transition, confirmed original funding and unchanged settlement lineage. The endpoint clears verification/authorization/leases, archives the reason, returns {id, status: "RECEIVED", stateVersion} and wakes fresh Node verification. Malformed bodies return 400, authentication failures 401, absent work 404 and guard conflicts 409. Exact allowlisted HTTP 409 Node authorization rejections also take this guarded path inside /api/cranker/work POST, returning {work: null, requeued: {id, status: "RECEIVED", stateVersion}}. A saved checkpoint cannot be discarded through this route.
Cranker authentication and leased execution
Crankers obtain wallet challenge/session authorization and call/api/cranker/work with authenticated exact request bytes. POST accepts supported work kinds and enforces the implemented lease rate limit. Settlement leasing obtains Node authorization and attaches it under the expected work version. The returned execution view excludes private ingress routing; PATCH reports an authenticated Cranker transition.
The work route maps its own authentication/session failures to 401, lease rate limiting to 429 and other caught conflicts to 409. Deliberate Node protocol rejections preserve their HTTP status and bounded body, including domain 404, authorization 401/403 and malformed-input 422. Exhausted authorization availability requeues eligible native work with {work: null, requeued} under the current lease and no-checkpoint guards; nonnative availability and missing configuration return 503.
Receiver’s shared authorization/signing forwarding preserves Node’s exact domain 404 Receiver work was not found; a missing endpoint/other 404, transport failure (including interrupted response bodies) or HTTP 5xx can try the configured fallback. Other protocol 4xx responses pass through without selecting another Node. Exhausted signing availability returns {error: "TSN Node signing service is unavailable", nodeStatus?} with HTTP 503, excluding dependency URLs and raw messages. Missing configuration has a separate 503 error and is not an availability retry. Cranker maps only the exact unavailable response from /api/cranker/settlement-signature to TSN_NODE_SIGNING_SERVICE_UNAVAILABLE, requiring an active native lease/version/owner and no persisted execution result before requeue. No uniform rate limit for all HTTP routes is claimed.
Retry and security limits
Read current work state and chain signatures after a lost response. A lease or root conflict needs re-verification; stale owner funding needs a fresh sender-approved transaction. Keep worker/session credentials server-side, verify the same cluster and program IDs across services, and redact raw signed work/private witnesses in diagnostic reports. Public status fields reveal some coordination information, and ingress services can see the data they initially receive. See trust boundaries and failure handling.Signed settlement checkpoints and receipt reconciliation
Wallet/session-authenticatedPUT /api/cranker/work accepts {id, expectedVersion, evidence} for an active native settlement lease. Evidence contains signature, blockhash, lastValidBlockHeight, wireSha256, wireBytes and stage=TCAP_GPRU_MEMO_CREDIT_V1_SIGNED (or the matching TCAP_EPOCH_ACCOUNTING_V1_SIGNED stage for coordination). Receiver saves this before broadcast, checks version/lease/native authorization, rejects replacement identity and preserves the lease generation. It is a signed-attempt checkpoint, not a confirmation. An expired claim with a saved signature becomes FAILED pending reconciliation.
Node-service-authenticated POST /api/internal/node/work/reconcile accepts {id, expectedVersion, signature, execute} for FAILED native credit. execute=false reads and verifies finalized receipts without changing work. execute=true sets only settlement CONFIRMED at the next version after checking exact authorized instruction/Memo, signatures, accounts, root and funded lineage. It archives the error and preserves funding/payload/history, without chain submission; it wakes Node only after the durable receipt repair. Invalid bodies return 400, unauthorized access 401, missing work 404 and state/receipt conflicts 409. This is separate from REJECTED snapshot/preflight retry.
Node-service-authenticated POST /api/internal/node/work/resolve-failed accepts the same {id, expectedVersion, signature, execute} shape for an expired, signed FAILED native credit. The exact authorized predecessor root and sequence must still match the canonical finalized TCAP account at a slot beyond authorization expiry. Receiver also checks absent transaction/history results, blockhash invalidity, finalized height beyond the saved lifetime, checkpoint identity, verified authorization and confirmed funding lineage. A null receipt alone is insufficient. Preview returns {id, status: "FAILED", stateVersion, resolution, executed: false}. Explicit execution records bound nonexecution evidence at the next version, preserves the original failed attempt and wakes dependent work after persistence; it never requeues that attempt or funding. Invalid bodies return 400, unauthorized access 401, missing work 404 and evidence/state/RPC conflicts 409. A progressed root or observed receipt remains outside this resolution path.
The existing authenticated CONFIRMED PATCH also reconciles an expired native lease after a lease/version conflict. The body remains {id, expectedVersion, status: "CONFIRMED", evidence}; Receiver uses evidence.signature and the stored signed checkpoint/authorization to verify the original reporting payer, lease generation, exact finalized wire, both signatures, instruction/Memo, canonical accounts, confirmed funding and resulting TCAP root. Only the expired leased version or its immediately reclaimed FAILED version is eligible. A late report never renews signing authority or repeats settlement. Temporary receipt RPC/finality unavailability returns an error without a status mutation; the corrected Cranker retries only that same report within its bounded window.
Private credit coordination
Authenticated Node coordination uses/api/internal/node/coordination for bounded funding/settlement/epoch inventory, dedicated epoch work and deferral. Native verification is serialized around the current shared private root. TCAP_EPOCH_ACCOUNTING carries the complete aggregate proof; execution payloads omit openings. Confirmed funding directly enables individual credit preparation through the global funding account. Native hidden-head credit and epoch accounting receive a bounded 180-second Cranker lease covering Node authorization, Mother co-signing and submission. Node claims and funding/TIN/other-settlement Cranker claims remain 60 seconds. Signing requires the current active lease; expired unsigned work requires fresh verification, while a saved signature retains its reconciliation boundary. Unsigned stale work requires fresh verification; signed uncertain attempts require exact finalized receipt reconciliation.
Node schedules TCAP_EPOCH_ACCOUNTING for a complete 2–63-credit epoch after 120 slots from its first credit, or immediately at 64. A singleton remains open and 64 blocks further credit preparation until accounting succeeds. This is Node scheduling maturity rather than account expiry or an on-chain deadline. TCAP owns the credit-only transcript and applies aggregate liability accounting after GPRU proof verification; retained TSNP Epoch Treasury work has a separate contract. See the TCAP lifecycle.
Retired pool API boundary
Pool capture work, its recovery endpoint and CLI are retired. They are absent from the supported runtime. Historical signed records and on-chain accounts are preserved for separately authorized inspection/cleanup; source removal does not refund rent or mark payment confirmed.Cranker wake cursor
UseGET /api/cranker/wake to poll the Receiver’s opaque {cursor} hint before requesting a lease. It reads one control document and returns no work payload or session credential. A changed cursor tells the Cranker to use its normal authenticated claim. Keep periodic authenticated recovery claims to discover work after a missed hint or lease expiry. The reference Cranker checks every ten seconds for idle signed funding and every sixty seconds for idle native work, and drains immediately while claims return work.
TIN-Debit
To pay from a TIN balance, resolve the recipient and pass their display name, name source and verified credentials tosendTinDebitV1. The sender signs TSN TIN Balance Payment Preparation, showing that recipient review, both TINs, mint and expiry. Node independently checks the reviewed identity and signature at /network/tin-debit/prepare, then returns asset decimals, route/context commitments and a slot interval. Owner-provided names are labeled; when no verified credentials exist, the prompt says None attached. A missing debit verifier returns HTTP 503 with TIN_DEBIT_VERIFIER_UNAVAILABLE.
The remaining signatures are TSN TIN Balance Payment Approval for the committed payment and TSN Sender Balance Verification for disclosure of the sender opening to Node. The latter signs the complete packet’s digest, keeping raw balance/blinding values out of the wallet prompt. A cold session can also request identity and local seed-access signatures; opted-in access reuse clears when the wallet changes or disconnects. The SDK submits the payment ID, private amount/nonce/blinding, deployment/slots, approval and signed opening to /network/tin-debit. Receiver obtains current Node authorization before returning a debit lease to Cranker. The recipient supplies no signature, opening or private key.
Node forwards validated debit ingress to Receiver using its service credential. Receiver encrypts the private request, and public coordination/status omit its TINs, amount and opening. The response identifies pending work with {workId,status,stateVersion}; it does not establish chain execution. Repeat an uncertain submission with the exact same body and payment ID. Replacement details conflict, and approval expiry or unrelated root movement does not create a new payment. Public /api/work-status/<id> returns the debit status and compact signature/stage, while private processing stays authenticated.
Debit status also returns safeToReplace for the exact debit identity with no retained lease after an initial rejection without an execution attempt, a TIN_DEBIT_AUTHORIZATION_LEASE_INVALID failure that stopped before authorization and signing, or a finalized nonexecution resolution bound to the failed attempt. XP releases its original private retry request after a matching CONFIRMED response or this affirmative flag. Keep the original payment ID for receipt reconciliation while a signed attempt remains unresolved.
One debit proof binds both owner balance changes, replay protection and two encrypted Memos. The sender sees outgoing debit and the recipient recovers incoming credit later. Existing deposit-credit requests and their thirteen-input proof are unchanged. Matching deployed binaries, the separate enabled verifier and configured proving artifacts remain prerequisites for live execution; source and offline verification are separate evidence.