The Trust-Minimized Digital Agreement Protocol.
LinkSignX402 is a decentralized agreement protocol built for the Web3 era. It allows anyone to upload a PDF, pay a small fee via x402, and anchor an immutable proof of existence and multiple signatures on the blockchain.
Demo: https://linksignx402.xyz
Traditional e-signature platforms rely on centralized databases, private accounts, and "trust us" models. LinkSignX402 flips this:
- No Accounts: Connect your wallet, upload, and sign. No emails or passwords required.
- Privacy by Design: Documents are pinned to IPFS; only cryptographic hashes and payment references live on-chain.
- Payment-Backed Intent: We leverage the x402 protocol to make the payment itself a verifiable part of each signature process.
- Platform Independence: Your agreements survive even if we disappear. Everything is verifiable using only public blockchain data and IPFS.
We use the x402 HTTP Payment Protocol. Instead of complex checkout flows, protected API endpoints return a 402 Payment Required response.
- Cryptographic Intent: The user signs an EIP-712 authorization to pay.
- Relayer Friendly: Because we verify via ERC-20 Transfer logs in the
paymentReftransaction, the payment can be broadcast by a facilitator while still proving the intent of the original wallet.
Documents are stored on IPFS. Because IPFS is content-addressed, the CID (Content Identifier) is directly tied to the file bytes. If even a single comma in the PDF changes, the CID changes, immediately breaking the link to the on-chain record.
A slim smart contract acts as the "Source of Truth," emitting events that link:
- Agreement ID: A deterministic hash of
(docHash, creator, paymentRef). - docHash: The keccak256 fingerprint of the file.
- paymentRef: The transaction hash of the x402 payment.
You don't need to trust our backend. Any third party can verify an agreement's validity:
- Query Blockchain: Read
AgreementCreatedand allAgreementSignedevents from the contract. - Fetch File: Download the PDF from IPFS using the
cidfrom the event. - Verify Integrity: Confirm
keccak256(file) == docHash. - Verify Payment: Confirm the
paymentReftransaction receipt contains a valid USDC Transfer to ourPAY_TO_ADDRESS.
If any check fails, the agreement is tampered or fraudulent.
The x402 protocol makes LinkSignX402 a first-class citizen in the agent economy. AI agents can autonomously create and sign agreements without human intervention:
- Agent requests
POST /api/createorPOST /api/sign - Server responds with
402 Payment Required+ payment details - Agent pays (signs EIP-712 authorization, facilitator settles)
- Agent retries the request with payment proof
- Agreement is created/signed on-chain
This is the power of x402: any HTTP client that can hold a wallet can transact. No OAuth, no API keys, no subscription management. Just standard HTTP + crypto signatures.
Use cases unlocked:
- Autonomous contract negotiation: AI agents drafting and signing agreements on behalf of users
- Multi-agent workflows: Multiple AI agents co-signing documents programmatically
- 24/7 operations: Agents creating binding agreements while humans sleep
We went beyond standard implementations to handle real-world Web3 UX and edge runtime constraints:
- Manual x402 Settlement: Standard middlewares settle payments after the request handler. We implemented a custom flow to obtain the real
txHashupfront, allowing us to include the payment reference inside the smart contract event in a single atomic-feeling operation. - Lazy Facilitator Init: To support Cloudflare Workers (which don't support top-level await), we built a lazy-initialization wrapper for the x402 resource server that triggers only on the first protected request.
- Deterministic Collision-Resistant IDs: Agreement IDs are derived using
abi.encodeandkeccak256, ensuring a unique and stable identifier that links the creator, the file, and the specific payment.
- Frontend: React + TanStack Router (SSR-ready)
- Backend: Hono on Cloudflare Workers
- Payments: x402 Protocol (
@x402/fetch&@x402/hono) - Storage: IPFS (Pinata)
- Blockchain: EVM-compatible (Viem / Wagmi)
- Node.js & pnpm
- WalletConnect Project ID (from cloud.reown.com)
- Pinata JWT (for IPFS pinning)
pnpm install- Copy
.env.exampleto.env. - Fill in the required secrets (CDP API Keys, Pinata JWT, Server Wallet Private Key).
- Ensure
PAY_TO_ADDRESSandCONTRACT_ADDRESSare set correctly for your target blockchain.
pnpm devpnpm buildMIT
