Overview
Ubu-Block implements a transparent, tamper-evident blockchain designed specifically for election results. The blockchain stores polling station results in an immutable, distributed ledger that anyone can verify.Core Features
Immutable
You can’t make changes, only append—no tampering allowed
Distributed
No single point of data storage across multiple nodes
Accessible
Runs on SQLite, widely supported and SQL-friendly
Auditable
All submissions (accepted or rejected) are recorded
Block Structure
Each block in the Ubu-Block blockchain contains the following components:Block Header
The block header is used to generate the block hash and contains:Ubu-Block uses validator signatures instead of Proof-of-Work (PoW), making it more efficient for election data where authorized nodes validate submissions.
Block Types
There are two types of blocks:Genesis Block
The first block in the chain that initializes the blockchain:- Height:
0 - Previous hash: All zeros (
0x0000...0000) - Contains initial setup data (constituencies, parties, stations)
- Created during blockchain initialization
Result Block
Regular blocks containing election results:How Blocks Are Created
- Collect Results: Submission nodes gather polling station results
- Build Merkle Tree: Create a Merkle tree from all results in the block
- Create Header: Construct the block header with previous hash and Merkle root
- Hash Header: Generate SHA3-256 hash of the header
- Sign Block: Authorized node signs the hash with their private key
- Broadcast: New block is announced to all peers via P2P network
Chain Validation
The blockchain validates integrity through multiple checks:1. Hash Verification
Recalculate the block hash and compare with stored value:2. Signature Verification
Verify the digital signature using ECDSA (P-256):3. Chain Linkage
Ensure each block properly references its predecessor:4. Merkle Root Validation
Verify the Merkle root matches the results (see Merkle Trees).Tamper Detection
Trying to modify data triggers validation failures:The blockchain detects tampering because modifying any data changes the Merkle root, which invalidates the block hash and its signature.
Storage Layer
Ubu-Block uses SQLite for storage, making it:- Portable: Single file database
- SQL-friendly: Query with standard SQL
- Lightweight: No heavy database server required
- Transparent: Anyone can inspect the database directly
Database Structure
Two separate databases:-
blockchain.db (Public):
blockchaintable: Block headers and metadataresultstable: Election resultspubkeystable: Validator public keys- Geographic data (counties, constituencies, wards, stations)
- Candidate and party information
-
private.db (Private):
privkeystable: Node’s private keys for signing
Related Topics
Node Types
Learn about Submission, Observer, and Verification nodes
Consensus
Understand the BFT consensus mechanism
Merkle Trees
How data integrity is maintained
Quick Start
Initialize your first blockchain