Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ProofLens — cross-chain tx proof explorer

ProofLens is a minimal, fully working dApp built on the Attestcoin Protocol (Creditcoin). It lets anyone prove, on-chain and trustlessly, that a transaction on a foreign chain (Ethereum Sepolia) is real, part of the finalized source chain, and successful — without trusting any centralized oracle or bridge operator.

Live flow (no funds needed to verify — verification is a synchronous native precompile call):

  1. Attestation check — Creditcoin attestors continuously reach BLS-signature consensus about Sepolia's finalized state (Step 1 of Attestcoin Readability). ProofLens queries the ChainInfo precompile (0x0FD3) to confirm the target block is covered by an attestation/checkpoint.
  2. Proof generation — Merkle proof (tx ∈ block) + continuity proof (block ∈ finalized chain) are fetched from the hosted Proof Builder service.
  3. On-chain verification — proofs are verified synchronously by Creditcoin's Block Prover precompile (0x0FD2), which runs as native Rust code (no EVM overhead).
  4. Status check + notarization — the precompile does not check transaction success, so the ProofLens Attestcoin Smart Contract (ASC) enforces the mandatory receipt status 0x1 check, decodes the verified tx bytes with EvmV1Decoder, and permanently notarizes the result (sender, recipient, value, gas, success flag) with replay protection.

Architecture

flowchart LR
    subgraph Sepolia["Ethereum Sepolia (source chain)"]
        TX[User tx<br/>receipt status 0x1]
    end

    subgraph Attestors["Attestor network (off-chain)"]
        AT[BLS-signed votes →<br/>aggregated attestation]
    end

    subgraph CC3["Creditcoin CC3 Testnet"]
        subgraph ASC["ProofLensASC (Attestcoin Smart Contract)"]
            EX[submitProof] --> PF[replay protection<br/>processedQueries]
            PF --> SR[receipt status == 0x1 ?<br/>EvmV1Decoder decode]
            SR --> ST[(notarizations<br/>+ totalNotarized)]
        end
        PRE[Block Prover precompile<br/>0x0FD2 · native Rust]
        CI[ChainInfo precompile<br/>0x0FD3]
        ASC -- verifyAndEmit --> PRE
        UI -- is_height_attested --> CI
    end

    PB[Hosted Proof Builder<br/>prover.cc3-testnet]
    TX -- proof-by-tx request --> PB
    PB -- merkle + continuity proof --> UI
    PB -- merkle + continuity proof --> W[worker / ASC submitter]
    W -- submitProof --> ASC
    AT -- consensus attestation --> CI
    UI[ProofLens web UI<br/>single HTML page]
Loading
  • Source chain: Ethereum Sepolia (chainKey 1 on CC3 testnet)
  • Verification: verify() (view, free) from the web UI, or verifyAndEmit() inside the ASC via an actual Creditcoin transaction
  • Mandatory dApp check: source receipt status must be 0x1 — enforced in ProofLensASC._processAndEmitEvent
  • Replay protection: processedQueries[keccak(chainKey ‖ blockHeight ‖ txIndex)]
  • Official building blocks: @gluwa/usc-sdk (proofs, verifiers) + @gluwa/asc-contracts (ASCBase)

Repository layout

web/index.html          single-page dApp UI (ethers v6 via CDN, zero build step)
contracts/ProofLensASC.sol   the Attestcoin Smart Contract (uses official ASCBase)
scripts/poc-verify.mjs  end-to-end PoC: real Sepolia tx → proof → precompile verify (node)
scripts/compile.cjs     solc-js build (no network needed)
scripts/deploy.mjs      deploy ProofLensASC to CC3 testnet + submit a proof on-chain
scripts/drive-ui.cjs    Playwright driver (used for the demo video)

Setup

npm install              # ethers v6, @gluwa/usc-sdk, @gluwa/asc-contracts, solc
node scripts/compile.cjs # build ProofLensASC → out/ProofLensASC.json
node scripts/poc-verify.mjs   # prove a live Sepolia tx on CC3 testnet (no gas needed)

Web UI: serve web/ statically (python3 -m http.server) and open in a browser — press Pick a recent tx and watch all four stages complete.

On-chain deployment (needs testnet gas)

CC3 testnet CTC comes from the community faucet (Discord /faucet, see docs). With a funded fresh burner wallet:

PRIVATE_KEY=0x... node scripts/deploy.mjs --submit <sepoliaTxHash>

This deploys ProofLensASC, then submits a real proof: the precompile verifies inclusion + continuity on-chain, the ASC checks status 0x1, and emits TxNotarized.

Demo

Demo video (74s): https://files.catbox.moe/6963xb.mp4 — two full live runs: pick fresh Sepolia tx → attestation check → proof generation → native verification on CC3 testnet.

Verification status

  • ✅ PoC verified end-to-end on CC3 testnet (see scripts/poc-verify.mjs output): a real Sepolia transaction from block 11633500 was proven with 7 merkle siblings + 1 continuity root and accepted by the 0x0FD2 precompile (verify() == true), receipt status 0x1 confirmed.
  • ProofLensASC compiles with solc 0.8.28 (via IR, optimizer on) against the official @gluwa/asc-contracts ASCBase.
  • ⏳ ASC deployment pending testnet gas (Discord faucet requires a human step) — deploy script is ready.

Safety

  • Testnet only. No mainnet, no real funds, no deposits of any kind.
  • All wallets are freshly generated testnet burners funded by public faucets.
  • Source transaction payloads are never trusted — everything is derived from precompile-verified bytes.

Hackathon

Built for BUIDL CTC 2026 Fall (DoraHacks) — tracks: cross-chain interoperability / oracle infrastructure. Solo builder entry.

Get the full pack

More cross-chain and Solana tooling sits in the Matchbook Labs catalog, built by the same solo dev.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages