Portable cryptographic reputation management system
Cipherblock enables anyone to operate a reputation platform where users build verifiable identity and trust metrics that follow them across services. Service providers (like Uber drivers), forecasters, freelancers, and professionals can carry their ratings and reputation across any platform using the same cryptographic keys.
- π Portable Identity: Same keys work across all operators
- π Portable Reputation: Trust history follows you everywhere
- π Tamper-Proof: Cryptographically signed transactions and blocks
- β‘ Fast: Thousands of transactions per second
- π Decentralized Ecosystem: Multiple competing operators
- π Transparent: All transactions publicly verifiable
- π Serverless: Built on Firebase (zero server management)
Phase 1: Core Cryptography β COMPLETE
The foundational cryptographic layer is fully implemented and tested:
- β Keypair generation (secp256k1)
- β Transaction signing and verification
- β Block signing and verification
- β Hashing functions (SHA-256)
- β Comprehensive test suite (27 tests passing)
- β Browser & Node.js support
Phase 2: Transaction Validation β COMPLETE
Complete validation for all 8 transaction types:
- β Common validation (signature, nonce, format)
- β TOKEN_TRANSFER validation
- β RATE transaction validation
- β NFT transactions (MINT, TRANSFER, orders)
- β ASSET_BURN validation
- β FEE_UPDATE validation
- β State-aware checks (balances, ownership, nonces)
- β Comprehensive test suite (26 validation tests)
Phase 3: State Management β COMPLETE
Complete state execution for all transaction types:
- β Transaction execution (all 8 types)
- β Balance tracking (regular and locked)
- β NFT ownership and locking
- β Order book management
- β Order matching with self-cancellation
- β Order expiration
- β Fee collection and updates
- β Nonce tracking
- β Rating storage
- β Comprehensive test suite (17 state tests)
Phase 4: Block Processing Engine β COMPLETE
Complete block processing with integrated validation and state:
- β Transaction validation and execution
- β Block creation and signing
- β Genesis block creation
- β Block verification
- β Block hashing for chain linking
- β Order matching during finalization
- β Comprehensive test suite (10 block tests)
Phase 5: Firebase Backend
- Cloud Functions (submitTransaction, processBlock)
- Firestore schema and collections
- Distributed locking for block processing
- Mempool management
- Genesis block deployment
Phase 6: Browser Client
- Wallet UI (key generation and management)
- Blockchain explorer
- Transaction submission
- Real-time blockchain updates
- Node.js 18+
- npm
npm installnpm testimport { generateKeypair, signTransaction } from './src/crypto/index.js';
import { validateTransaction } from './src/transactions/index.js';
// Generate a wallet
const wallet = generateKeypair();
console.log('Address:', wallet.address);
// Create a transaction
const tx = {
transaction_type: 'TOKEN_TRANSFER',
sender_address: wallet.address,
recipient_address: '02...',
amount: 100,
nonce: 1,
timestamp: new Date().toISOString()
};
// Sign it
const signature = await signTransaction(tx, wallet.privateKey);
const signedTx = { ...tx, sender_signature: signature };
// Validate against blockchain state
const state = {
balances: { [wallet.address]: 1000 },
nonces: { [wallet.address]: 0 },
fee_schedule: { token_transfer_fee: 0.01 },
// ... other state
};
const result = validateTransaction(signedTx, state);
if (result.valid) {
console.log('Transaction is valid!');
} else {
console.error('Invalid:', result.error);
}- Cryptography: @noble/secp256k1, @noble/hashes
- Backend: Firebase Cloud Functions (2nd gen), Firestore
- Client: Vanilla JavaScript (Web Crypto API)
- Testing: Jest
-
Centralized Processing, Decentralized Ecosystem
- Each operator processes transactions serially for speed
- Multiple competing operators create decentralization
-
Portable Identity
- Same cryptographic keys work everywhere
- Users own their private keys
-
Tamper-Proof History
- Users save signed blocks
- Can prove if operator modifies history
-
Market Competition
- Bad operators lose users
- Good operators attract adoption
-
Simplicity
- Non-Turing-complete (fixed transaction types)
- Easy to audit and verify
- Functional Specification - Complete system requirements
- Technical Specification - Implementation details
- Crypto Module README - Cryptography API reference
- Transaction Validation README - Validation API reference
- State Management README - State management API reference
- Block Processing README - Block processing API reference
Uber drivers, Etsy sellers, and freelancers carry ratings across platforms.
Driver on Lyft β Earns 4.9β
rating β Applies to Uber β
Full rating history visible β Fast-tracked approval
Track forecasting accuracy across markets and platforms.
User predicts 10 events β 8 correct β
Verifiable 80% accuracy β Consulting opportunities
Verifiable work history and peer endorsements.
Developer earns reputation on Platform A β
Switches to Platform B β Reputation follows
cipherblock/
βββ src/
β βββ crypto/ β
Complete
β β βββ index.js # Main exports
β β βββ keys.js # Key management
β β βββ signing.js # Signing/verification
β β βββ keys.test.js # Tests
β β βββ signing.test.js # Tests
β β βββ README.md # Crypto documentation
β βββ transactions/ β
Complete
β β βββ index.js # Main exports
β β βββ types.js # Transaction types & schemas
β β βββ validator.js # Validation logic
β β βββ validator.test.js # Tests
β β βββ README.md # Validation documentation
β βββ state/ β
Complete
β β βββ index.js # Main exports
β β βββ manager.js # State management logic
β β βββ manager.test.js # Tests
β β βββ README.md # State documentation
β βββ blocks/ β
Complete
β βββ index.js # Main exports
β βββ processor.js # Block processing logic
β βββ processor.test.js # Tests
β βββ README.md # Block documentation
βββ cipherblock-functional-spec.md # System requirements
βββ cipherblock-tech-spec.md # Implementation spec
βββ package.json
βββ jest.config.js
βββ README.md # This file
# Run all tests
npm test
# Watch mode
npm run test:watchCurrent Test Results:
Test Suites: 5 passed, 5 total
Tests: 80 passed, 80 total
Time: ~1s
- Generated client-side
- Never transmitted to operator
- User responsible for storage
- Production: encrypt before storing
- All transactions signed by sender
- All blocks signed by operator
- Tamper detection via saved blocks
- Replay prevention via nonces
- Anyone can verify signatures
- Anyone can reconstruct state from genesis
- Operator cannot forge signatures
This is currently a personal project. Contributions, suggestions, and feedback are welcome!
MIT
- Phase 1: Core Cryptography
- Phase 2: Transaction Validation
- Phase 3: State Management
- Phase 4: Block Processing Engine
- Phase 5: Firebase Backend
- Phase 6: Browser Client
- Phase 7: Production Deployment
Built with β€οΈ for portable reputation