Explicit permissions for Web3 actions
Make transaction rules easier to inspect, test, and reason about.
Web3User Permission Lab is an experimental, off-chain transaction authorization SDK for Node.js exploring how proposed blockchain actions can be checked against explicit, testable policies before execution. The current codebase is an in-process Node.js library supporting an ERC-20 transfer policy evaluator with cryptographic authorization binding and persistent SQLite replay protection—not a hosted API, cloud service, universal wallet, or production security product.
Development-stage notice: Web3User is an off-chain decision SDK, not a smart contract, blockchain validator, or transaction broadcaster. This static preview site is purely an informational document, not a functioning backend, hosted API, or interactive wallet playground. The prototype has not undergone an independent commercial security audit. Do not use it to protect real funds or authorize production transactions.
Verified Commit (main)
30a4890b16a1e1e8c33c8efe03d7edd28e7806ae
test: increase Vitest timeouts for CI stability
Release Candidate Tag
v0.1.0-rc.1 (ea52832)
Tagged commit: ea528326d514e46f1c93ab9d3f4c762b4e073730
Hosted CI Matrix Result
332/332 passed (17 test files)
GitHub Actions run 40220716038 across Node.js 22, 24, and 26
Persistent Replay Protection
Verified via SQLite WAL store
Step 1: ALLOW on fresh DB · Step 2: DENY on replay
Milestone 6 Security & Durability Invariants Implemented
Multi-Process Race & Replay Prevention
Deterministic IPC rendezvous barriers release competing OS processes simultaneously to attempt consuming the same V3 authorization; tests strictly enforce exactly one ALLOW and three domain-level DENY outcomes with one persistent record.
Transaction Rollback & Contention Retries
Immediate SQLite write transactions (BEGIN IMMEDIATE;) roll back partial writes and intermediate clock updates on failure. Bounded retry loops with non-spinning sleep resolve transient contention or fail closed predictably.
Authorization & Signing-Key Boundaries
Rigorous boundary tests enforce strict rejection at the exact expiration second (nowSeconds >= expiresAtSeconds), clip expiry to authoritative policy/key caps, and enforce key validity windows and post-retirement forgery rejection.
Safe TTL Arithmetic & Overflow Prevention
Subtraction-first validity window calculation prevents integer overflow when evaluating large TTL inputs up to Number.MAX_SAFE_INTEGER, ensuring effective expiration deadlines never exceed JavaScript safe integer limits.
Persistent-State Invariants Across Restarts
Durable SQLite table schemas, policy revisions, key governance states (active, retired, revoked), and monotonic clock high-water marks survive connection closes and restarts without state loss or corruption.
Process-Crash Recovery (WAL Journaling)
Abrupt child worker termination during active uncommitted write transactions confirms automatic SQLite WAL rollback upon reopen. Note: Qualified strictly as process-crash recovery testing, not physical power-loss durability.
Implemented Prototype Scope vs. Future Work
Implemented in Prototype
• ERC-20 transfer(address,uint256) policy evaluator.
• Exact canonical binding digests (calldata, recipient, amount, chain ID, sender).
• Ed25519 V3 signed authorization artifacts with length-prefixed encoding.
• Monotonic policy revisions & key registry governance in SQLite.
• Persistent two-phase replay protection (issued → consumed).
Planned for Future Milestones
• Universal wallet integration & RPC middleware adapters.
• Cumulative multi-transaction spending budgets over time windows.
• Arbitrary smart contract function call decoders.
• Multi-party threshold key signing and on-chain validator bindings.
• Formal external third-party security audits.
Development Roadmap
M0–M3
Core Foundation, Policy Evaluator, & Initial TestsEvaluator logic, calldata decoding, parameter boundary checks, and test harnesses.
COMPLETE
M4–M5
Canonical Transaction Binding & Persistent Replay ProtectionDeterministic length-prefixed payload binding and SQLite two-phase state storage.
COMPLETE
M6.1–M6.3
V3 Ed25519 Signing, Monotonic Revisions, & Safe MigrationsAsymmetric artifact signing, authoritative policy revisions, and crash-safe schema evolution.
COMPLETE
M6.4
Post-Commit Security & Crash-Recovery ValidationMulti-process race barriers, transaction rollback failure injection, safe TTL arithmetic, and process-crash recovery.
COMPLETE
v0.1.0-rc.1
Release Candidate 1 & Hosted CI VerificationRelease candidate packaging, full multi-version CI matrix passing across Node.js 22, 24, and 26 (332/332 tests), and pre-release security review.
CURRENT RC
M7–M9
Budgets, Replay Controls, Adversarial Testing, & Independent ReviewCumulative budgets, external wallet boundaries, and independent third-party audits before production consideration.
PLANNED
Technical Snapshot
Language: TypeScript · Tooling: Node.js (>=22.13.0), npm, Vitest · Storage: SQLite (built-in node:sqlite, WAL mode) · Signatures: Ed25519 (node:crypto) · Version Control: Git & GitHub.
Current supported selector: 0xa9059cbb — ERC-20 transfer(address,uint256). The prototype enforces single-use persistent replay protection for bound authorizations. Cumulative multi-transaction budgets, arbitrary smart contract parsing, and universal wallet enforcement boundaries are not implemented.