Overview
Ubu-Block employs a multi-node architecture where different node types serve distinct roles in the network. This design ensures transparency, accessibility, and community-driven validation.Submission Nodes
Allow authorized users to submit polling station results
Observer Nodes
Provide public, read-only access for transparency
Verification Nodes
Cross-reference results with official sources
Submission Nodes
Purpose
Submission nodes are authorized nodes that can:- Accept polling station results from users
- Create new blocks with election data
- Sign blocks with their private keys
- Broadcast new blocks to the network
How They Work
- Authentication: Node has authorized signing keys
- Result Collection: Receives results via HTTP API
- Block Creation: Packages results into a new block
- Validation: Checks data integrity and creates Merkle tree
- Signing: Signs the block with private key
- Broadcasting: Announces new block to all peers
Running a Submission Node
Implementation Details
Fromnodes/submission/src/main.rs:18:
API Endpoints
Submission nodes expose HTTP endpoints:POST /api/v1/results/submit- Submit new resultsGET /api/v1/results/station/{id}- Get station resultsGET /api/v1/blocks/{height}- Get block by heightGET /api/v1/peers- View connected peers
Only nodes with valid signing keys in
private.db can create and sign blocks. The public key hash is recorded in each block for accountability.Observer Nodes
Purpose
Observer nodes provide read-only access to blockchain data:- Sync with submission nodes to maintain a copy of the chain
- Allow public querying of results
- Provide transparency and independent verification
- No ability to create or modify blocks
How They Work
- Connect: Establish P2P connection to submission node
- Handshake: Exchange chain heights
- Sync: Request missing blocks from peers
- Monitor: Receive new block announcements
- Validate: Verify received blocks
- Serve: Respond to read-only queries
Running an Observer Node
Key Features
- No Private Keys: Observer nodes don’t have signing keys
- In-Memory Storage: Can use
sqlite::memory:for lightweight operation - Automatic Sync: Catches up with network when starting
- Public Access: Anyone can run an observer node
Chain Synchronization
When an observer connects, it automatically syncs:- Compare Heights: Check if peer has more blocks
- Request Blocks: Ask for missing blocks in batches
- Validate: Verify each received block
- Apply: Add validated blocks to local chain
Observer nodes participate in the audit trail by maintaining independent copies of the blockchain, making it virtually impossible to rewrite history.
Verification Nodes
Purpose
Verification nodes add an extra layer of trust:- Cross-reference submitted results with official sources (e.g., IEBC)
- Participate in reward distribution for accurate submissions
- Flag discrepancies between submitted and official data
- Enhance consensus reliability
Status: Verification node functionality is currently under development (v0.4 roadmap).
Planned Features
v0.4 - Cross-Reference
- Automated checking against official IEBC results
- Discrepancy detection and reporting
- Integration with official APIs
v0.5 - Rewards
- Reward distribution for correct submissions
- Penalty system for inaccurate data
- Incentive mechanism for community participation
How They Will Work
P2P Communication
All node types communicate via the P2P protocol:Message Types
Connection Flow
P2P Configuration
Node Comparison
| Feature | Submission | Observer | Verification |
|---|---|---|---|
| Create blocks | ✅ Yes | ❌ No | ❌ No |
| Sign blocks | ✅ Yes | ❌ No | ❌ No |
| Read data | ✅ Yes | ✅ Yes | ✅ Yes |
| Validate blocks | ✅ Yes | ✅ Yes | ✅ Yes |
| Private keys | ✅ Required | ❌ Not needed | ❌ Not needed |
| HTTP API | ✅ Yes | ⚠️ Optional | ⚠️ Optional |
| Public access | ⚠️ Restricted | ✅ Yes | ✅ Yes |
| Verify w/ officials | ❌ No | ❌ No | ✅ Yes (v0.4) |
| Distribute rewards | ❌ No | ❌ No | ✅ Yes (v0.5) |
Security Considerations
Submission Node Security
- Store
private.dbwith restricted permissions (600) - Consider hardware security modules (HSM) for production
- Rotate keys periodically
- Monitor for unauthorized access
Network Security
- Encrypted Communication: End-to-end encryption for all node interactions (v0.4)
- Peer Limits: Max 50 peers prevents resource exhaustion
- Message Size Limits: Max 10MB prevents DoS attacks
- Connection Timeouts: 10s timeout prevents hanging connections
Running Multiple Node Types
You can run multiple node types on the same machine:Related Topics
Blockchain
Understand the underlying blockchain architecture
Consensus
Learn about BFT consensus mechanism
API Reference
Explore the HTTP API endpoints
Deployment
Deploy nodes in production