Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🛡️ StellarNotary — Decentralized Proof-of-Existence & Document Notary

Stellar Network Soroban Rust React Freighter

StellarNotary is a decentralized Proof-of-Existence and Document Notary platform built on the Stellar Soroban smart contract ecosystem. It enables users to notarize documents (contracts, certificates, research papers, source code, images, intellectual property) on the Stellar blockchain with zero-knowledge privacy.

The browser computes a 32-byte cryptographic SHA-256 digest locally—the document never leaves your machine. The digest is immutably anchored on Stellar Testnet alongside your wallet signature and the verified ledger timestamp.


🌟 Live Deployed Contract (Stellar Testnet)

Parameter Value
Contract ID CAAXZ2YYE5WQ32HJZ2ASRJP7NIIC7AZVGFUVJD4CP5EHDBM2EHJCIQPP
Network Stellar Testnet (Test SDF Network ; September 2015)
RPC Endpoint https://soroban-testnet.stellar.org
WASM Hash c07d9c8ac60bc1738255ba5e2ede89d4575e5db82ca9f9eb34b8062aa384ef65
User Wallet GBW73Q3WPKTRX6XHKPBOMJMYL64W3LIR5BHOLP4HH6C2DNNNPWFHCE2Z
Stellar.Expert Explorer View Contract on Stellar.Expert
Stellar Lab Interact on Stellar Lab
Genesis Proof Tx 8236b1b2871720f4593fddf4322eaf1c15c49cea4f2c752412cefdcfb0f2d30f

🏗️ Architecture & Workflow

flowchart TD
    A[User drags & drops File in Frontend] --> B[Web Crypto SHA-256 Hashing]
    B --> C[Compute 32-byte Digest: BytesN<32>]
    C --> D{User Action}
    D -->|Notarize| E[Connect Freighter Wallet]
    E --> F[Soroban Invoke 'notarize']
    F --> G[Stellar Testnet Consensus]
    G --> H[Store in Persistent Storage + Emit Event]
    H --> I[Generate Verifiable Proof Certificate with QR Code]
    D -->|Verify| J[Query Soroban 'verify' Simulation]
    J --> K{Hash Exists on Chain?}
    K -->|Yes| L[🟢 Officially Verified Badge + Creator & Block Details]
    K -->|No| M[🔴 Unregistered / Tampered Notice]
Loading

⚡ Core Features

  • Zero-Knowledge Document Privacy: All hashing is performed purely client-side using the browser's native Web Crypto API. Raw files are never uploaded or transmitted.
  • Immutable Timestamp & Priority Protection: The smart contract enforces duplicate prevention (AlreadyNotarized), ensuring that the first person to notarize a document maintains priority proof of creation.
  • Freighter Wallet Integration: Native integration with @stellar/freighter-api on Stellar Testnet, including built-in 1-click Friendbot faucet funding (+10,000 XLM).
  • Instant Verification Scanner: Drag and drop any file or paste a 32-byte hex hash to verify authenticity, creator, timestamp, and ledger sequence in < 1 second.
  • Cryptographic Proof Certificate: Generates an official, printable Certificate of Existence with Soroban watermark, QR code, SHA-256 seal, and transaction links.
  • On-Chain Notary Vault: Searchable directory of notarized documents with filter tags and direct Stellar.Expert explorer links.

📂 Project Structure

├── contracts/
│   └── notary/
│       ├── Cargo.toml
│       └── contracts/
│           └── doc-notary/
│               ├── Cargo.toml
│               └── src/
│                   ├── lib.rs     # Soroban Smart Contract implementation
│                   └── test.rs    # Rust unit tests
├── frontend/
│   ├── index.html
│   ├── package.json
│   ├── vite.config.ts
│   └── src/
│       ├── App.tsx
│       ├── index.css              # Glassmorphism dark aesthetic design system
│       ├── components/
│       │   ├── Navbar.tsx         # Wallet connection & faucet bar
│       │   ├── StatsBanner.tsx    # Live on-chain metrics telemetry
│       │   ├── Dropzone.tsx       # SHA-256 file dropzone
│       │   ├── NotarizeTab.tsx    # Notarization form & workflow
│       │   ├── VerifyTab.tsx      # Instant verification scanner
│       │   ├── CertificateModal.tsx # Proof certificate with QR code
│       │   ├── VaultTab.tsx       # Searchable ledger vault
│       │   ├── TxProgressModal.tsx # Live transaction status tracker
│       │   └── ContractSettingsModal.tsx # Contract inspector
│       ├── hooks/
│       │   └── useFreighter.ts    # Freighter wallet React hook
│       └── lib/
│           ├── crypto.ts          # SHA-256 Web Crypto utilities
│           ├── stellar.ts         # Horizon & Soroban RPC config
│           └── notaryContract.ts  # Smart contract client & transaction builder
├── .gitignore
└── README.md

🚀 Quick Start Guide

Prerequisites


1. Run the Frontend Web Application

cd frontend
npm install
npm run dev

Open http://localhost:5173 in your browser.


2. Test & Build the Soroban Smart Contract

cd contracts/notary

# Run smart contract unit tests
cargo test

# Build optimized WebAssembly contract
stellar contract build --package doc-notary

3. Deploy to Stellar Testnet (Optional)

# Generate and fund deployer account
stellar keys generate --network testnet my-deployer --fund

# Deploy contract WASM
stellar contract deploy \
  --wasm target/wasm32v1-none/release/doc_notary.wasm \
  --source my-deployer \
  --network testnet

📜 Smart Contract API Reference

notarize(creator, doc_hash, title, doc_type, metadata_uri) -> NotaryRecord

  • Requires Auth: creator.require_auth()
  • Stores { creator, doc_hash, timestamp, ledger_seq, title, doc_type, metadata_uri } in persistent storage.
  • Bumps storage TTLs and increments total count.
  • Emits DocumentNotarized contract event.

verify(doc_hash) -> Option<NotaryRecord>

  • Free read-only query returning record metadata or None.

get_user_documents(user) -> Vec<NotaryRecord>

  • Retrieves all document records notarized by a specific Stellar address.

get_stats() -> ContractStats

  • Returns { total_notarized }.

📄 License

MIT License. Built for the Stellar Buildathon.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages