Skip to content
itachi-exePublic

About

Programmable cross-chain crypto inheritance on NEAR, powered by NFTs and Chain Signatures.

Topics

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Torch

Programmable crypto inheritance on NEAR.

Choose an heir, set your check-in schedule, and give them a path to claim your estate if you stop checking in. The estate is an NFT. Its current owner controls requests to sign for its Bitcoin and Ethereum addresses through NEAR Chain Signatures.

Open Torch · Architecture · Run locally · Threat model

Torch landing page

Testnet prototype. Not audited, not a legal will, and not proof of death. Never deposit real funds.

How it works

  1. Create an estate. Name a NEAR heir and choose a check-in interval and grace period.
  2. Keep checking in. An owner check-in refreshes the inheritance clock.
  3. Wait safely. Missed check-ins enter a grace period. Signature requests are frozen during grace and once an estate becomes claimable.
  4. Pass control. After the waiting period, an authorized claim transfers the NFT to the named heir. The derived chain addresses do not change.

Inheritance changes who can request future signatures. It cannot revoke a signature already issued, retrieve assets spent earlier, or move funds from an unrelated wallet.

Torch estate dashboard

What is implemented

  • A Rust contract with NFT ownership, metadata, check-ins, inheritance, storage accounting, transfers, and receiver settlement.
  • Stable Bitcoin testnet4 and Ethereum Sepolia address derivation from the contract account and estate-specific paths.
  • Owner-gated requests to the NEAR MPC signer, including pending-transfer and inheritance-state protections.
  • A responsive React application with wallet connection, estate creation, owner and heir actions, finalized-block context, and recorded transaction links.
  • Cross-chain transaction tools and a dry-run-by-default executor with claim eligibility and finalized-ownership verification.
  • Unit tests and a compiled-WASM sandbox suite covering timing, ownership, receiver behavior, and signing restrictions.

Architecture

React application              Read-only executor / transaction tools
        |                                      |
        +--------------- NEAR -----------------+
                           |
                   Torch estate contract
                   NFT ownership + timing
                           |
                 owner-gated signing request
                           |
                   NEAR Chain Signatures
                           |
                  Bitcoin / Ethereum address
Component Source Responsibility
Estate contract src/lib.rs Ownership, inheritance clock, receiver settlement, signing gate
Contract tests src/tests.rs Unit regressions and authorization boundaries
Web application web/src Landing page, estate dashboard, wallet interactions
Cross-chain tools tools Derivation, transaction construction, relay, receipt checks
Executor tools/executor.py Deadline inspection and opt-in claim execution
Sandbox tests tests/workspaces Compiled-WASM integration tests with a local NEAR sandbox
SDK patch vendor/near-contract-standards Pinned NEAR standards crate with documented NFT event-version adjustment

The MPC signer derives keys from the contract account and derivation path, not the NFT owner's account. Torch authorizes signing requests using the NFT's effective owner and the estate's current state. Provisional receiver ownership never grants signing authority.

Run locally

Requirements

  • Node.js 22.12 or newer, with npm.
  • Rust 1.95.0 (the CI toolchain), including rustfmt, clippy, and the wasm32-unknown-unknown target.
  • Python 3.10 or newer for executor and receipt-verifier tests.

Start the application

git clone https://github.com/itachi-exe/torch.git
cd torch
npm ci --prefix web
npm --prefix web run build
npm --prefix web run preview -- --host 127.0.0.1

Open http://127.0.0.1:4173 for the landing page and /app for the estate dashboard. The default application reads the public NEAR testnet deployment. A wallet is not needed to browse. Creating an estate, checking in, or claiming requires a testnet wallet and an explicitly approved wallet transaction.

No API keys or private environment file are required to build the frontend or run offline tests. Public RPC providers may throttle requests; a failed network read is not a failed contract assertion.

Run the offline checks

cargo fmt --all --check
cargo test --locked
cargo test --locked --manifest-path tests/nft_receiver/Cargo.toml
cargo clippy --locked --all-targets -- -D warnings
python3 -m unittest discover -s tools -p 'test_*.py'
node --test tools/test_crypto.mjs
npm --prefix web run format:check
npm --prefix web test
npm --prefix web run audit:security
npm --prefix web run build

The Node crypto tests import dependencies from web/node_modules, so run npm ci --prefix web first. Python tests use the standard library and mock external calls. Formatting and lint checks additionally use Ruff, configured in pyproject.toml.

Build and test the contract WASM

cargo install cargo-near --version 0.22.0 --locked
cargo near build non-reproducible-wasm --locked --no-abi
cargo near build non-reproducible-wasm --locked --no-abi --manifest-path tests/nft_receiver/Cargo.toml --out-dir target/near
npm ci --prefix tests/workspaces
npm --prefix tests/workspaces test

Use cargo-near for the WASM artifacts exercised by the sandbox suite. A plain Cargo WASM compilation is only a compilation check and does not replace the NEAR build pipeline.

The sandbox suite runs locally and requires enough memory and a supported Linux environment for the NEAR sandbox binary. It does not require wallet credentials or submit public-chain transactions. See docs/standards-regressions.md for the event profile and integration-test scope.

Verification and deployment status

The public testnet contract is torch-a32a4fc6.testnet. Deployment metadata is in deployments/testnet.json.

Archived transaction receipts document earlier runs. They are not represented as freshly repeated transactions. Some Ethereum RPC endpoints have returned unavailable receipts or denied requests during later read-only checks.

Source and deployed contract are not identical releases. The source includes a local NFT event-version update to 1.2.0; the public testnet contract still has the earlier deployed event profile. Publishing this repository does not deploy or upgrade a contract. Full independent NEP-171 conformance is not claimed.

Security and limitations

Read the threat model and security policy before using the project.

  • Missed check-ins indicate inactivity, not death. There is no legal identity or probate integration.
  • The owner can spend before the signing freeze. An already-issued signature cannot be recalled.
  • The executor defaults to a dry run. Live claim submission is an explicit opt-in and uses locally configured NEAR CLI credentials. Production credential isolation remains open work.
  • MPC availability, public RPC availability, chain fees, contract upgrades, and the user's wallet remain trust and operational dependencies.
  • The dependency audit has no high, moderate, or critical findings at publication. Low-severity findings remain in upstream wallet cryptography dependencies. See the publication report; this is not a security audit.

Do not run the live demo scripts or enable the executor's --live mode without reviewing the transactions they submit. Never commit wallet credentials, seed phrases, private keys, or deployment tokens.

Development

See CONTRIBUTING.md for formatting, test expectations, and contribution boundaries. CI checks the frontend, Rust contracts, Python tooling, and dependency audit without deploying the application or sending public-chain transactions.

Built with Rust, near-sdk, near-contract-standards, React, TypeScript, Vite, NEAR Wallet Selector, viem, and @noble/curves. The standards crate's vendored patch and upstream license are included. Geist and Instrument Serif fonts include their OFL licenses under web/public/fonts.

AI assistance was used for code, tests, documentation, and visual review, including work with OpenAI Codex, Claude Code, and Gemini. Test reports describe verified execution, not an independent human security audit.

License

MIT.

About

Programmable cross-chain crypto inheritance on NEAR, powered by NFTs and Chain Signatures.

Topics

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages