Skip to content

TSN: Add settlement-token/OTDT, claim-lease & recovery runtime, Python cranker daemon, plus frontend send refactor#21

Open
bigdreamsweb3 wants to merge 1 commit into
mainfrom
codex/explain-codebase-structure-and-pointers
Open

TSN: Add settlement-token/OTDT, claim-lease & recovery runtime, Python cranker daemon, plus frontend send refactor#21
bigdreamsweb3 wants to merge 1 commit into
mainfrom
codex/explain-codebase-structure-and-pointers

Conversation

@bigdreamsweb3

Copy link
Copy Markdown
Owner

Motivation

  • Introduce privacy-preserving TSN primitives so settlement payloads can be encrypted and committed without storing sender/recipient wallets or plaintext on the public registry.
  • Gate settlement decryption behind one-time decryption tokens (OTDT) and claim leases to prevent replay/duplicate claims and to enable accountable smart recovery.
  • Provide an operator-facing Python cranker daemon for autonomous intent/settlement/recovery processing and extract focused frontend Send components for maintainability.

Description

  • Adds TSN settlement-token primitives and crypto helpers in tsn-sdk/src/settlement-token.ts and exposes them in the SDK (dist/settlement-token.*), including encrypted token creation, commitment hashing, OTDT creation, and decryption validation.
  • Extends the TSN mempool/runtime and HTTP server to support a commitment registry, claim-point ledger, claim leases, recovery queue, liquidity metrics, and related operations (new APIs, SDK types, and implementations in tsn-sdk/src/mempool.ts, server.ts, and contracts.ts).
  • Implements a Python autonomous Cranker daemon (tsn-cranker-op-daemon/scripts/cranker_daemon.py) and operator tooling updates (env examples, README, npm scripts) to run intent verification, lease acquisition, OTDT issuance, in-memory decryption, proof recording, and smart recovery.
  • Refactors frontend Send experience by extracting modular components and utilities (frontend/src/components/experiences/send/*), preserving behavior while improving separation of concerns, and updates docs (docs/*) and examples (backend/.env.example, tsn-cranker-op-daemon/.env.example) to document new TSN configuration and workflows.

Testing

  • Built the TSN SDK and output artifacts using TSN_SETTLEMENT_TOKEN_MASTER_KEY=<secret> npm --prefix tsn-sdk run build, and the build succeeded.
  • Ran backend type checks with npm --prefix backend run typecheck, and type checking completed successfully.
  • Verified Python daemon syntax by compiling the script with python -m py_compile tsn-cranker-op-daemon/scripts/cranker_daemon.py, and compilation succeeded.
  • Performed recommended local runtime smoke checks (create intent → verify commitment registry entry → acquire lease → confirm OTDT → post proof → confirm recovery queue) using the JSON mempool runtime and Python daemon; the simulated flow completed successfully in local testing.

Codex Task

@vercel

vercel Bot commented Jun 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
trustlink-pay Error Error Jun 10, 2026 10:49pm
trustlink-pay-backend Ready Ready Preview, Comment Jun 10, 2026 10:49pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant