Document Architecture

Blockchain-based document management with cryptographic signatures.

Overview

Features:

  • Upload to IPFS/Arweave

  • Cryptographic signatures

  • EAS attestations for documents

  • Multi-party signing

  • Verification tools

Architecture

Documents are NOT stored in diamonds - they use EAS attestations:

Storage:

  • Document content → IPFS/Arweave (off-chain)

  • Document metadata → EAS attestation (on-chain)

  • Signatures → EAS attestations (on-chain)

Wallet Integration:

  • WalletDocumentsFacet - Per-wallet document tracking

  • Local storage of document IDs

  • Links to EAS attestations

Document Flow

1. Upload Document

2. Sign Document

3. Verify

EAS Schemas

Document Schema

Signature Schema

Wallet Documents Facet

Interface

Storage

Minimal storage in wallet:

Actual document data in EAS.

EAS Integration

Creating Document Attestation

Creating Signature Attestation

Verification

Off-Chain Verification

  1. Get document attestation from EAS

  2. Download document from storage URI

  3. Calculate content hash

  4. Compare with attestation hash

  5. Check signature attestations

Smart Contract Verification

Security

Content Integrity

  • SHA-256 hash prevents tampering

  • Any change invalidates signature

  • Hash stored immutably on-chain

Signature Authenticity

  • ERC-1271 wallet signatures

  • Biometric authentication required

  • Replay protection via nonces

Privacy

  • Only hash on-chain (not content)

  • Document stored off-chain

  • Access control via storage layer

Events

Gas Costs

On Base:

  • Create document attestation: 100k gas ($0.001)

  • Sign document: 80k gas ($0.0008)

  • Verify (off-chain): Free

Testing

Resources

Last updated

Was this helpful?