2 min read

Proof Anchoring Receipt Flow#

This template demonstrates the narrowest proof artifact in the current stack: take a Merkle root, anchor it with FileAnchor, emit an AnchorReceipt, and then verify that receipt against the same backend.

What Problem It Solves#

Use this template when you need a concrete answer to:

  • What proof object does VEX emit after anchoring?
  • What fields are present in that receipt?
  • How do I verify that receipt later?
  • What is the simplest local anchoring backend that works today?

Uses#

  • Rust crate

Prerequisites#

  • Rust toolchain
  • Access to the vex-anchor and vex-core crates

Exact Example#

Rust
use vex_anchor::{AnchorBackend, AnchorMetadata, FileAnchor};
use vex_core::Hash;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let anchor = FileAnchor::new("./anchors.json");
    let metadata = AnchorMetadata::new("tenant-1", 100);
    let root = Hash::digest(b"provnai-evaluation-root");

    let receipt = anchor.anchor(&root, metadata).await?;
    println!("{}", receipt.to_json()?);

    let verified = anchor.verify(&receipt).await?;
    println!("verified={verified}");

    Ok(())
}

What It Produces#

The primary artifact is an AnchorReceipt with these fields:

JSON
{
  "backend": "file",
  "root_hash": "3f2c1b6a...",
  "anchor_id": "anchor-2026-04-04T10:40:00Z",
  "anchored_at": "2026-04-04T10:40:00Z",
  "proof": null,
  "metadata": {
    "tenant_id": "tenant-1",
    "sequence_number": 100
  }
}

The exact values will differ, but the receipt contract is stable:

  • backend
  • root_hash
  • anchor_id
  • anchored_at
  • proof
  • metadata

Where the Artifact Lives#

  • ./anchors.json contains the append-only local anchor log
  • the emitted AnchorReceipt JSON is the object you can store, pass around, or verify later

How To Verify It#

Verification is a direct backend call:

Rust
let verified = anchor.verify(&receipt).await?;

Expected output:

TEXT
verified=true

What that means:

  • the receipt still exists in the backend
  • the stored root matches the receipt
  • the local anchor log has not diverged from the receipt payload

Current Limitations#

  • FileAnchor is a local development backend, not a public timestamping network.
  • This template proves the receipt flow cleanly, but it does not publish the root to Ethereum, Celestia, or OpenTimestamps.
  • The proof field may be null for local file-based anchoring.
Found something unclear or incorrect?Report issueor useEdit this page
Edit this page on GitHub