Skip to content

buildwithhamzat/blaut

Repository files navigation

Blaut - Decentralized File Storage

Secure, blockchain-based file storage with emergency access controls and wallet-based encryption.

πŸš€ Live App: http://blaut.vercel.app/

πŸ“‹ Smart Contract: 0x06cc01278b3e60fFAF4096ccd08e9Cc6D1D51722 (View on Explorer)

Demo Videos

Feature Demo Link Description
File Upload & Encryption Watch Demo See how files are encrypted and stored securely
File Sharing Watch Demo Learn to share files with wallet addresses
Emergency Access Watch Demo Emergency responder access for medical scenarios
Folder Organization Watch Demo Create and manage folder structures

How Blaut Works

3-Layer Security Architecture

Your Device     β†’ Encrypt file with unique key
     ↓
Blockchain     β†’ Record ownership & access permissions  
     ↓
Supabase      β†’ Store encrypted file + encrypted keys

Upload Process

  1. Select File β†’ Choose file (max 50MB)
  2. Generate Key β†’ Create unique encryption key
  3. Encrypt File β†’ AES-256 encryption on your device
  4. Sign Message β†’ Wallet signs unique challenge for key derivation
  5. Derive Encryption Key β†’ SHA256 hash of signature creates encryption key
  6. Upload β†’ Store encrypted file in cloud
  7. Blockchain Record β†’ Record ownership on blockchain

Sharing Process

  1. Select File β†’ Choose file to share
  2. Enter Address β†’ Input recipient's wallet address
  3. Owner Signs β†’ Owner wallet signs to decrypt original key
  4. Re-encrypt Key β†’ Encrypt file key for recipient's wallet
  5. Grant Access β†’ Update blockchain permissions

Download Process

  1. Verify Access β†’ Check blockchain permissions
  2. Get Encrypted Key β†’ Retrieve your encrypted file key
  3. Sign Challenge β†’ Wallet signs verification message
  4. Derive Decryption Key β†’ Generate key from signature
  5. Decrypt File Key β†’ Use derived key to decrypt file key
  6. Download & Decrypt β†’ Get and decrypt original file

Wallet Signature-Based Encryption

How Signature-Based Key Derivation Works

Blaut uses a unique approach where each user's wallet signature generates deterministic encryption keys:

// 1. Create unique challenge message
const challenge = `Blaut File Key Encryption
Wallet: ${walletAddress.toLowerCase()}
Timestamp: ${Date.now()}`;

// 2. User signs the challenge with their private key
const signature = await signMessage({ message: challenge });

// 3. Derive encryption key from signature
const encryptionKey = SHA256(signature).toString();

// 4. Use key for AES encryption/decryption
const encrypted = AES.encrypt(fileKey, encryptionKey);

Why Signature-Based Encryption?

  1. Unique Keys: Each signature produces a unique encryption key
  2. Non-Deterministic: Same wallet can generate different keys each time
  3. Wallet-Bound: Only the wallet owner can recreate the signature
  4. Secure: Requires private key access to decrypt
  5. Traceable: Each signature is linked to wallet address on blockchain

Signature Verification Flow

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   File Upload       β”‚    β”‚   Signature Process  β”‚    β”‚   Blockchain Link   β”‚
β”‚                 β”‚    β”‚                  β”‚    β”‚                 β”‚
β”‚ 1. Select File      β”‚    β”‚ 3. Create Challenge  β”‚    β”‚ 6. Record on Chain  β”‚
β”‚ 2. Generate File Keyβ”‚    β”‚ 4. Sign with Wallet  β”‚    β”‚ 7. Link Signature   β”‚
β”‚                 β”‚    β”‚ 5. Derive Enc Key    β”‚    β”‚ 8. Explorer Link    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚                        β”‚                        β”‚
         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                  β”‚
                         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                         β”‚   Key Storage        β”‚
                         β”‚                  β”‚
                         β”‚ β€’ Encrypted Keys     β”‚
                         β”‚ β€’ Challenge Data     β”‚
                         β”‚ β€’ Wallet Mapping     β”‚
                         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Transaction Explorer Integration

Every file operation creates a blockchain transaction that can be verified:

  • Contract Address: 0x9C87587f06B43dEF7e0b7FA0fB0F12fFB4337454
  • Network: Sepolia Testnet
  • Explorer: https://sepolia.etherscan.io/address/0x9C87587f06B43dEF7e0b7FA0fB0F12fFB4337454

Transaction Types:

  • uploadFile() - Records file ownership and initial access
  • grantAccess() - Adds new user to file access list
  • revokeAccess() - Removes user from file access list
  • addEmergencyResponder() - Authorizes emergency personnel
  • markFileAsEmergency() - Enables emergency access for file

Technical Implementation Details

Unique Key Generation System

Blaut implements a sophisticated signature-based encryption system that generates unique keys for each operation:

1. Challenge Generation

const generateChallenge = (walletAddress: string, operation: string) => {
  return `Blaut ${operation} Operation
Wallet: ${walletAddress.toLowerCase()}
Timestamp: ${Date.now()}
Nonce: ${crypto.getRandomValues(new Uint32Array(1))[0]}`;
};

2. Signature-Based Key Derivation

const deriveEncryptionKey = async (challenge: string, wallet: any) => {
  // User signs challenge with wallet private key
  const signature = await wallet.signMessage(challenge);
  
  // Create deterministic but unique encryption key
  const keyMaterial = `${signature}:${challenge}`;
  const encryptionKey = await crypto.subtle.digest('SHA-256', 
    new TextEncoder().encode(keyMaterial)
  );
  
  return Array.from(new Uint8Array(encryptionKey))
    .map(b => b.toString(16).padStart(2, '0'))
    .join('');
};

3. Unique Queue System

Each wallet generates a unique queue of encryption keys that are:

  • Non-reversible: Cannot derive private key from encryption key
  • Deterministic: Same signature always produces same encryption key
  • Unique per operation: Different challenges create different keys
  • Wallet-bound: Only the wallet owner can recreate signatures
interface EncryptionQueue {
  walletAddress: string;
  keyIndex: number;
  encryptedKeys: {
    fileId: string;
    encryptedKey: string;
    challenge: string;
    timestamp: number;
    signature: string;
  }[];
}

Blockchain Explorer Integration

Every file operation is recorded on the blockchain and can be verified through the explorer:

Network Details:

  • Network: Awakening Testnet
  • Chain ID: 1043
  • RPC URL: https://rpc.awakening.bdagscan.com
  • Currency: BDAG
  • Explorer: https://explorer.awakening.bdagscan.com

Contract Information:

  • Contract Address: 0x06cc01278b3e60fFAF4096ccd08e9Cc6D1D51722
  • Contract Name: FileStorageV3
  • Network: Ethereum Mainnet / Sepolia Testnet
  • Verification: View all transactions and contract interactions
  • Explorer: View Contract on Etherscan

Transaction Hash Lookup:

// Example transaction verification
const verifyTransaction = async (txHash: string) => {
  const explorerUrl = `https://explorer.awakening.bdagscan.com/tx/${txHash}`;
  // View transaction details, gas usage, and contract interactions
};

Key Transaction Events:

  • FileUploaded(address indexed owner, string fileId, string ipfsHash)
  • AccessGranted(string indexed fileId, address indexed user, address indexed grantedBy)
  • AccessRevoked(string indexed fileId, address indexed user, address indexed revokedBy)
  • EmergencyResponderAdded(address indexed user, address indexed responder, string nickname)
  • EmergencyFileAccessed(string indexed fileId, address indexed responder)

Blockchain Explorer View

The contract is live and all transactions can be verified on the blockchain explorer:

Contract Explorer View

Contract Overview:

  • Address: 0x06cc01278b3e60fFAF4096ccd08e9Cc6D1D51722
  • Creator: 0x170F099B...A3E2bcd13
  • Total Transactions: 4 successful deployments
  • Latest Activity: Recent contract interactions visible
  • Gas Usage: Optimized for file operations

Recent Transactions:

  • Contract deployment and initialization
  • File upload operations with encrypted storage
  • Access permission grants and revokes
  • Emergency responder management
  • Ownership verification transactions

How to Verify Your Transactions:

  1. Copy your transaction hash from the app
  2. Visit the contract explorer page
  3. Check the "Transactions" tab for your specific operation
  4. Verify gas fees, block confirmation, and transaction status

Code Architecture

Frontend Architecture

src/
β”œβ”€β”€ components/           # React UI components
β”‚   β”œβ”€β”€ DashboardUI.tsx   # Main dashboard interface
β”‚   β”œβ”€β”€ VaultUI.tsx       # File management interface
β”‚   β”œβ”€β”€ EmergencyAccess.tsx # Emergency access portal
β”‚   β”œβ”€β”€ Header.tsx        # Navigation header
β”‚   β”œβ”€β”€ Sidebar.tsx       # Navigation sidebar
β”‚   └── modals/           # Modal dialogs
β”‚       β”œβ”€β”€ ShareModal.tsx
β”‚       β”œβ”€β”€ RenameModal.tsx
β”‚       └── FileActionsModal.tsx
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ crypto.ts         # Encryption/decryption utilities
β”‚   β”œβ”€β”€ supabase.ts       # Database client configuration
β”‚   └── hooks/            # Custom React hooks
β”‚       β”œβ”€β”€ useFileManager.ts     # File CRUD operations
β”‚       β”œβ”€β”€ useFileUpload.ts      # File upload logic
β”‚       β”œβ”€β”€ useFileSharing.ts     # File sharing logic
β”‚       β”œβ”€β”€ useFolderManager.ts   # Folder operations
β”‚       └── useEmergencyAccess.ts # Emergency access hooks
β”œβ”€β”€ utils/
β”‚   β”œβ”€β”€ file.ts           # File utility functions
β”‚   β”œβ”€β”€ folder.ts         # Folder utility functions
β”‚   └── emergencyAccess.ts # Emergency access utilities
β”œβ”€β”€ constant/
β”‚   β”œβ”€β”€ abi.ts            # Smart contract ABI
β”‚   β”œβ”€β”€ contract.ts       # Contract address configuration
β”‚   └── index.ts          # Application constants
β”œβ”€β”€ pages/
β”‚   β”œβ”€β”€ DashboardPage.tsx # Main dashboard page
β”‚   β”œβ”€β”€ VaultPage.tsx     # File vault page
β”‚   └── EmergencyAccessLearnPage.tsx # Emergency access info
└── wagmi.ts              # Web3 configuration

Data Flow Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   User Interface   β”‚    β”‚   Business Logic     β”‚    β”‚   Data Layer        β”‚
β”‚                 β”‚    β”‚                  β”‚    β”‚                 β”‚
β”‚ β€’ React Components β”‚    β”‚ β€’ Custom Hooks      β”‚    β”‚ β€’ Supabase DB       β”‚
β”‚ β€’ Modal Dialogs    β”‚    β”‚ β€’ Crypto Functions   β”‚    β”‚ β€’ Supabase Storage  β”‚
β”‚ β€’ Form Validation  β”‚    β”‚ β€’ File Operations    β”‚    β”‚ β€’ Smart Contract    β”‚
β”‚ β€’ State Management β”‚    β”‚ β€’ Access Control     β”‚    β”‚ β€’ IPFS (Future)     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚                        β”‚                        β”‚
         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                  β”‚
                         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                         β”‚   External APIs      β”‚
                         β”‚                  β”‚
                         β”‚ β€’ Wallet Providers   β”‚
                         β”‚ β€’ RPC Endpoints      β”‚
                         β”‚ β€’ Block Explorers    β”‚
                         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Security Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Client-Side Security                     β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ β€’ File Encryption (AES-256)                                β”‚
β”‚ β€’ Key Generation (Crypto-secure random)                    β”‚
β”‚ β€’ Wallet Signature Verification                            β”‚
β”‚ β€’ Zero-Knowledge File Processing                           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                β”‚
                                β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   Blockchain Layer                         β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ β€’ Access Control Lists                                     β”‚
β”‚ β€’ Ownership Verification                                   β”‚
β”‚ β€’ Emergency Responder Registry                             β”‚
β”‚ β€’ Immutable Audit Logs                                     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                β”‚
                                β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Storage Layer                           β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ β€’ Encrypted File Storage                                   β”‚
β”‚ β€’ Encrypted Key Storage                                    β”‚
β”‚ β€’ Metadata Storage                                         β”‚
β”‚ β€’ Row-Level Security                                       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Quick Setup

Option 1: Use Live App (Recommended)

Visit the deployed application: http://blaut.vercel.app/

  1. Connect your wallet (MetaMask recommended)
  2. Ensure you're on the correct network
  3. Start uploading and managing files immediately

Option 2: Local Development

1. Prerequisites

  • Node.js 18+
  • MetaMask wallet
  • Sepolia ETH for gas fees

2. Installation

git clone https://github.com/canhamzacode/blaut.git
cd blaut
npm install

3. Environment Setup

cp .env.example .env

Required Environment Variables:

VITE_PUBLIC_SUPABASE_URL=your_supabase_url
VITE_PUBLIC_SUPABASE_ANON_KEY=your_supabase_key
VITE_WALLET_CONNECT_ID=your_walletconnect_id

4. Database Setup

  • Open Supabase SQL Editor
  • Run supabase-complete-schema.sql
  • Creates all tables, functions, and storage buckets

5. Start Application

npm run dev

Tech Stack

  • Frontend: React 18 + TypeScript + Vite
  • Web3: Wagmi + RainbowKit
  • Blockchain: Ethereum Sepolia Testnet
  • Storage: Supabase Storage + Database
  • Encryption: AES-256 (CryptoJS)
  • Styling: Tailwind CSS

Key Configuration Files

File Purpose Location
Contract Address Smart contract: 0x06cc01278b3e60fFAF4096ccd08e9Cc6D1D51722 src/constant/contract.ts
Contract ABI Interface for blockchain calls src/constant/abi.ts
Network Config Wallet & chain setup src/wagmi.ts
Database Schema Supabase tables & functions supabase-complete-schema.sql

Current Contract: 0x9C87587f06B43dEF7e0b7FA0fB0F12fFB4337454 (Sepolia)

Core Features

File Operations

  • Upload: Drag-and-drop with client-side encryption
  • Download: Automatic decryption with wallet verification
  • Share: Grant access to any wallet address
  • Delete/Rename: Full file lifecycle management

Organization

  • Folders: Create hierarchical folder structures
  • Navigation: Breadcrumb paths and folder browsing
  • Permissions: Folder-level sharing with role controls

Emergency Access

  • Medical Scenarios: Emergency responder access to critical files
  • Blockchain Verification: Verified emergency personnel only
  • Audit Trail: Complete logging of emergency access events
  • Time-Limited: Automatic access expiration

User Experience

  • Multiple Views: Grid and list display modes
  • Real-time Updates: Live file and folder synchronization
  • Responsive Design: Mobile-friendly interface
  • Progress Tracking: Upload/download progress indicators

Security Features

  • End-to-End Encryption: Files encrypted before upload
  • Zero-Knowledge Storage: Cloud providers can't read files
  • Blockchain Access Control: Immutable permission records
  • Wallet-Based Security: Your keys, your files
  • Emergency Protocols: Secure emergency access with full audit trails

API Reference

Core Hooks

useFileManager

const {
  files,              // Array of accessible files
  isLoading,          // Loading state
  downloadFile,       // Download and decrypt file
  deleteFile,         // Delete file
  renameFile,         // Rename file
  refreshFiles        // Refresh file list
} = useFileManager();

useFileUpload

const {
  uploadFile,         // Upload and encrypt file
  uploadState,        // Upload progress state
  resetUpload         // Reset upload state
} = useFileUpload();

useFileSharing

const {
  shareFile,          // Share file with address
  sharingState,       // Sharing progress state
  resetSharingState   // Reset sharing state
} = useFileSharing();

Utility Functions

Encryption

// Encrypt file with generated key
encryptFileWithKey(file: File, key: string): Promise<EncryptedFileData>

// Decrypt file with key
decryptFileWithKey(encryptedData: string, key: string, metadata: FileMetadata): Blob

// Encrypt key for wallet
encryptKeyForWallet(key: string, walletAddress: string, signMessage: Function): Promise<string>

// Decrypt key with wallet
decryptKeyForWallet(encryptedKey: string, walletAddress: string, signMessage: Function): Promise<string>

File Operations

// Upload encrypted file to storage
uploadEncryptedFileToStorage(encryptedData: EncryptedFileData): Promise<string>

// Download encrypted file from storage
downloadEncryptedFile(filePath: string): Promise<string>

// Get files accessible to user
getAccessibleFiles(walletAddress: string): Promise<FileWithAccess[]>

// Grant file access to user
grantFileAccess(fileId: string, walletAddress: string, encryptedKey: string, grantedBy: string): Promise<void>

Contact & Support

Deployment

Frontend Deployment

npm run build
# Deploy to Vercel, Netlify, or preferred hosting

Smart Contract Deployment

  • Contract source: FileStorageV2.sol
  • Deploy to desired network
  • Update src/constant/contract.ts with new address

Important Notes

  • Wallet Security: Your wallet private key = master key to all files
  • Key Loss Warning: Lost wallet = lost file access (by design)
  • Network Fees: Blockchain transactions require gas fees
  • File Limits: 50MB maximum file size
  • Testnet Only: Currently on Sepolia testnet

License

MIT License - See LICENSE file for details


Built for secure, decentralized file storage

  • About 30% of emergency cases in developing nations fail because crucial records can’t be accessed quickly.
  • In Nigeria alone, thousands lose lives or assets yearly due to missing identity or medical details.

Blault was built to change that β€” ensuring that life-saving data is never locked away when it’s needed most.


πŸ’‘ The Solution β€” BLAULT

Blault blends encryption, blockchain, and smart access control to keep your data safe yet instantly accessible to trusted people.

With Blault, you can:

βœ… Upload and encrypt files directly from your wallet. πŸ” Grant access to trusted contacts like doctors or family. 🚨 Assign emergency responders who can view your files only in crisis. πŸ“œ Track all file activities transparently on-chain.

No central servers, no leaks β€” only full control and privacy.


βš™οΈ How It Works

  1. File Upload

    • Files are encrypted locally using your wallet’s unique signature.
    • Encrypted content is stored in Supabase.
    • File metadata and permissions are stored on the BlockDAG chain.
  2. Access Management

    • You can add or remove wallet addresses for file access.
    • Authorized users receive their own encrypted decryption keys.
  3. Emergency Mode

    • You can mark files as β€œemergency accessible.”
    • Assigned responders (e.g. hospital, next of kin) can access them in verified emergencies.
  4. Transparency

    • Every access event is logged immutably on-chain β€” no disputes, no hidden edits.

🧱 System Overview

Component Description
Smart Contract (FileStorageV3.sol) Stores file ownership, access control, and emergency logic.
Supabase Handles encrypted file storage & metadata.
Supabase Schema (supabase_schema.sql) Predefined structure for replicating the same backend instantly.
Encryption Layer Uses AES + wallet signature for encryption/decryption.
Frontend (Vite + React) User dashboard for file upload and management.
WalletConnect For authentication and signing transactions.

πŸ“‚ Project Structure

root/
β”‚
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/      # Reusable UI components
β”‚   β”œβ”€β”€ pages/           # App screens
β”‚   β”œβ”€β”€ utils/           # Encryption & wagmi config
β”‚
β”œβ”€β”€ FileStorageV3.sol     # Smart contract file
β”œβ”€β”€ supabase_schema.sql   # Database schema for easy setup
β”œβ”€β”€ .env.example
β”œβ”€β”€ vite.config.ts
β”œβ”€β”€ wagmi.ts              # Blockchain setup
└── README.md

πŸ” Environment Setup

1️⃣ Duplicate .env.example and rename it .env. 2️⃣ Fill in your Supabase and WalletConnect details.

# Supabase
VITE_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
VITE_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key

# WalletConnect
VITE_WALLET_CONNECT_ID=your_wallet_connect_project_id

Example:

VITE_PUBLIC_SUPABASE_URL=https://abcd1234.supabase.co
VITE_PUBLIC_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
VITE_WALLET_CONNECT_ID=abcd1234567890abcd1234567890abcd

⚑ Supabase Setup

To create your own database structure:

  1. Log in to your Supabase Dashboard.
  2. Create a new project.
  3. Navigate to SQL Editor.
  4. Copy all content from supabase_schema.sql (found in the root folder).
  5. Paste and run it.

βœ… This will automatically generate all tables and relationships needed for Blault to work.


⚑ Smart Contract

File: FileStorageV3.sol Network: BlockDAG Sepolia Testnet Compiler: Solidity ^0.8.0 Address: 0x06cc01278b3e60fFAF4096ccd08e9Cc6D1D51722

Features:

  • Upload & encrypt file metadata
  • Grant/revoke access
  • Manage emergency responders
  • Mark and auto-enable emergency access
  • View immutable access logs

πŸ’» Local Setup

# Clone repo
git clone https://github.com/canhamzacode/blault
cd blault

# Install dependencies
npm install

# Run locally
npm run dev

Visit β†’ http://localhost:5173


🧩 Encryption Process

  1. User signs a message β†’ generates AES key.
  2. File is encrypted client-side with that key.
  3. Encrypted file uploaded to Supabase.
  4. File hash & access metadata stored on BlockDAG.
  5. Only authorized wallets can decrypt using their keys.

πŸ›‘οΈ No one, not even Blault’s team, can read your files.


πŸ’¬ FAQ

Q1: What if I lose access to my wallet? 🟒 Your trusted emergency contacts can access your marked files.

Q2: Are my files stored on-chain? 🟒 No, only file hashes and permissions. The encrypted file itself lives securely in Supabase.

Q3: Why BlockDAG? 🟒 BlockDAG offers faster confirmation times and low gas fees β€” ideal for real-time access control.

Q4: Can I revoke someone’s access? 🟒 Yes, instantly on-chain. Their keys are invalidated immediately.


πŸŽ₯ Walkthrough Demo

πŸ”— Watch Demo: Loom β€” Blault Secure File & Emergency System


🧭 Pitch Deck

πŸ“‘ View the full Blault Pitch Deck: πŸ‘‰ https://www.figma.com/deck/kO73drXWEKgr9j6YE1K440/Blault-Presentation?node-id=49-133&t=LpFXpHVHn0ccYScE-0&scaling=min-zoom&content-scaling=fixed&page-id=0%3A1


About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •