Skip to content

Blockchain Anchoring Overview

PrimeStamp anchors document hashes to one or more blockchains to produce immutable, independently verifiable timestamps. Anchoring transforms a cryptographic hash into a public, permanent record that proves the document existed at a specific point in time.

How Anchoring Works

  1. Hash -- PrimeStamp computes a cryptographic hash (SHA3-256, BLAKE3, or SHA-256) of the document.
  2. Submit -- The hash is sent to one or more blockchain networks. Depending on the chain, this may be embedded in transaction calldata, a memo instruction, or aggregated through a calendar service.
  3. Confirm -- Each chain confirms the transaction according to its own consensus rules. Confirmation times range from seconds (Solana, Polygon) to hours (Bitcoin).
  4. Proof -- PrimeStamp stores the transaction hash, block height, and any chain-specific proof data so that anyone can verify the anchor independently.

Supported Chains

Chain Adapter Trust Weight Typical Cost Confirmation Time
Bitcoin BitcoinAnchorAdapter (OpenTimestamps) 5 Free ~1 hour (6 blocks)
Ethereum EthereumAnchorAdapter 4 ~$1-5 (gas dependent) ~12 minutes (12 blocks)
RFC 3161 RFC3161AnchorAdapter 4 Free (public TSAs) Instant
Solana SolanaAnchorAdapter 2 ~$0.001 ~0.4 seconds
Polygon PolygonAnchorPlugin 0.7* ~$0.001 ~10 seconds
Arbitrum ArbitrumAnchorPlugin 0.7* ~$0.001 ~1 second
Optimism OptimismAnchorPlugin 0.7* ~$0.001 ~2 seconds
Base BaseAnchorPlugin 0.7* ~$0.001 ~2 seconds
StarkNet StarkNetAnchorPlugin 0.7* ~$0.005 ~minutes
Linea LineaAnchorPlugin 0.7* ~$0.001 ~seconds

*L2 trust weights are lower because they inherit security from their parent chain rather than providing independent consensus.

Trust Weights and Scoring

Each anchor type carries a trust weight reflecting its security guarantees:

  • Bitcoin (5) -- The most decentralized and battle-tested network. Proof-of-work with the highest hashrate provides the strongest timestamp guarantees.
  • Ethereum (4) -- Proof-of-stake with a large validator set. Direct on-chain embedding.
  • RFC 3161 (4) -- Legally recognized in many jurisdictions under eIDAS and other frameworks. Institutional trust rather than cryptographic decentralization.
  • Solana (2) -- Fast and cheap, but a smaller validator set and shorter track record.
  • L2 Chains (0.7) -- Inherit security from their parent chain. Lower independent trust but excellent for cost-sensitive workflows.

A stamp's trust score is the sum of confirmed anchor weights. The PRESETS dict defines a trust_threshold that must be met before a stamp is considered fully trusted:

Preset Anchors Trust Threshold
casual RFC 3161 only 3
standard Bitcoin + RFC 3161 6
archival Bitcoin + Ethereum + RFC 3161 10
maximum Bitcoin + Ethereum + Solana + RFC 3161 15

Multi-Chain Anchoring

PrimeStamp submits to multiple chains simultaneously using the AnchorManager:

from primestamp.anchors.adapters import create_anchor_manager
from primestamp.core.models import AnchorType

manager = create_anchor_manager(
    ethereum_rpc="https://mainnet.infura.io/v3/YOUR_KEY",
    ethereum_key="0xYOUR_PRIVATE_KEY",
)

# Submit to Bitcoin (OpenTimestamps) and RFC 3161 simultaneously
results = await manager.submit(
    document_hash=hash_bytes,
    anchor_types=[AnchorType.BITCOIN, AnchorType.RFC3161],
)

for anchor_type, result in results.items():
    print(f"{anchor_type}: {result.status}")

Because Bitcoin proofs take time to mature (the hash must be included in a mined block), PrimeStamp tracks pending anchors and can poll for confirmation:

updated_proofs = await manager.update_status(pending_proofs)

Anchor Lifecycle

Every anchor passes through these statuses:

  1. SUBMITTED -- The hash has been sent to the chain but not yet confirmed.
  2. PENDING -- The transaction exists on the network but lacks sufficient confirmations.
  3. CONFIRMED -- The transaction has enough confirmations to be considered final.
  4. FAILED -- The submission or confirmation failed (network error, insufficient funds, etc.).

RFC 3161 timestamps skip directly to CONFIRMED because the TSA response is immediate and self-contained.

Configuration

Anchors are configured through the StampEngine presets or directly via the AnchorManager factory function:

from primestamp.anchors.adapters import create_anchor_manager

manager = create_anchor_manager(
    bitcoin_calendars=["https://a.pool.opentimestamps.org"],
    ethereum_rpc="https://mainnet.infura.io/v3/KEY",
    ethereum_key="0xPRIVATE_KEY",
    solana_rpc="https://api.mainnet-beta.solana.com",
    solana_key="BASE58_PRIVATE_KEY",
    tsa_url="https://freetsa.org/tsr",
)

Plugin System

Anchor adapters are discovered through Python entry points defined in pyproject.toml under the primestamp.anchors group. You can register custom chains by creating a class that extends AnchorAdapter (for core adapters) or AnchorPlugin (for plugin-based adapters) and declaring an entry point.

Next Steps