🔗 HEDERA BLOCKCHAIN INTEGRATION - LAFAEKSTREET
📋 OVERVIEW
LafaekStreet uses Hedera Consensus Service (HCS) to create an immutable, transparent record of all road infrastructure reports submitted by citizens in Timor-Leste. This ensures that reports cannot be deleted or tampered with, providing accountability and trust in the civic engagement process.
📁 Files in This Folder
| File | Description |
|---|---|
hedera-playground.js | Topic creation script used in Hedera Portal Playground |
portal_gedera_playground.png | Screenshot of Hedera Portal Playground running the script |
Topic_0.0.7855971.png | Hashscan screenshot showing Reports Topic messages with real citizen reports |
Topic_0.0.7855972.png | Hashscan screenshot showing Status Updates Topic messages with AI validation results |
Example_Transaction.png | Hashscan screenshot showing a single transaction detail with actual costs |
🎯 WHY HEDERA BLOCKCHAIN?
Transparency
Every report is permanently recorded on the blockchain, creating a public audit trail that citizens, government agencies, and oversight organizations can verify independently.
Immutability
Once a report is submitted to Hedera, it cannot be altered or deleted, preventing corruption or manipulation of civic data.
Cost-Effective
Hedera transactions cost approximately $0.0001 USD per report, making it affordable for large-scale civic applications. Our real transaction data confirms this — a SUBMIT MESSAGE transaction costs only $0.00086 (see Example_Transaction.png).
Fast & Reliable
Hedera provides finality in 3-5 seconds with high throughput, ensuring real-time blockchain verification.
🏗️ HEDERA TOPICS ARCHITECTURE
LafaekStreet uses 2 HCS Topics on Hedera Testnet:
Topic 1: Reports Topic
- Purpose: Stores initial report submissions
- Data Stored: Report metadata, GPS location, issue type, severity, AI analysis results, images references
- Topic ID:
0.0.7855971 - View on Hashscan: 🔗 View Topic
Topic 2: Status Updates Topic
- Purpose: Records all status changes (pending → in progress → fixed)
- Data Stored: Status transitions, timestamps, agency actions, resolution details
- Topic ID:
0.0.7855972 - View on Hashscan: 🔗 View Topic
📊 TOPIC CONFIGURATION
Both topics are configured for maximum transparency:
{
submit_key: null, // Anyone can submit messages (public)
admin_key: null, // Immutable (cannot be deleted)
auto_renew_period: 90 days,
memo: "LafaekStreet - [Topic Purpose]"
}Key Features:
- ✅ Public Submission - No private keys required to read messages
- ✅ Immutable - Topics cannot be deleted or modified
- ✅ Auto-Renewal - Automatically maintained on the network
- ✅ Transparent - All messages are publicly queryable
🔍 HOW IT WORKS
1. Citizen Submits Report
Mobile App → FastAPI Backend → Validation
↓
AWS S3 (Images) + PostgreSQL (Metadata)
↓
Prepare Blockchain Payload2. Blockchain Recording
Report Data → AWS KMS (Sign) → Hedera HCS Topic
↓
Consensus Reached (3-5 seconds)
↓
Transaction Receipt with Sequence Number & Timestamp3. Verification
Anyone Can Query:
- Hedera Mirror Node API
- Hashscan Explorer
- Direct Topic Message Query
Compare with PostgreSQL data
↓
Verify Integrity ✓🛠️ TOPIC CREATION SCRIPT
File: hedera-playground.js
This script was executed in the Hedera Portal Playground (portal.hedera.com/playground) to create both HCS topics on Hedera Testnet.
Screenshot: Hedera Portal Playground
The screenshot shows the Hedera Portal Playground interface with:
- Left sidebar: HCS tab selected with topic operations (Create, Update, Submit Message, Delete, Get by ID, etc.)
- Code editor: Running
hedera-playground.jswith@hiero-ledger/sdkv2.75.0- Output panel: Showing successful creation of both topics with Topic IDs and Hashscan URLs
- Chat Assistant: Built-in AI assistant helping with topic creation commands
What the Script Does:
- Connects to Hedera Testnet using operator account
0.0.6255873 - Creates Topic 1 (
0.0.7855971): LafaekStreet Reports Topic — stores report submissions - Creates Topic 2 (
0.0.7855972): LafaekStreet Status Updates Topic — stores status changes - Verifies both topics via Hedera Mirror Node API (
testnet.mirrornode.hedera.com) - Outputs environment variables ready to copy into backend
.envfile
Full Script:
const {
AccountId,
PrivateKey,
Client,
TopicCreateTransaction,
} = require("@hiero-ledger/sdk"); // v2.75.0
async function main() {
let client;
try {
const MY_ACCOUNT_ID = AccountId.fromString("0.0.6255873");
const MY_PRIVATE_KEY = PrivateKey.fromStringECDSA("...");
client = Client.forTestnet();
client.setOperator(MY_ACCOUNT_ID, MY_PRIVATE_KEY);
// CREATE TOPIC 1: REPORTS
const txCreateTopic1 = new TopicCreateTransaction().setTopicMemo(
"LafaekStreet - Reports Topic",
);
const txResponse1 = await txCreateTopic1.execute(client);
const receipt1 = await txResponse1.getReceipt(client);
const topicId1 = receipt1.topicId.toString();
// CREATE TOPIC 2: STATUS UPDATES
const txCreateTopic2 = new TopicCreateTransaction().setTopicMemo(
"LafaekStreet - Status Updates Topic",
);
const txResponse2 = await txCreateTopic2.execute(client);
const receipt2 = await txResponse2.getReceipt(client);
const topicId2 = receipt2.topicId.toString();
// VERIFY VIA MIRROR NODE
const response1 = await fetch(
`https://testnet.mirrornode.hedera.com/api/v1/topics/${topicId1}`,
);
const response2 = await fetch(
`https://testnet.mirrornode.hedera.com/api/v1/topics/${topicId2}`,
);
// OUTPUT FOR .ENV FILE
console.log(`HEDERA_TOPIC_ID_REPORTS="${topicId1}"`);
console.log(`HEDERA_TOPIC_ID_STATUS_UPDATES="${topicId2}"`);
} catch (error) {
console.error("Error:", error);
} finally {
if (client) client.close();
}
}
main();Output:
✅ Topic 1 Created: 0.0.7855971
✅ Topic 2 Created: 0.0.7855972
HEDERA_TOPIC_ID_REPORTS="0.0.7855971"
HEDERA_TOPIC_ID_STATUS_UPDATES="0.0.7855972"📸 LIVE EVIDENCE — REAL REPORTS ON BLOCKCHAIN
The following screenshots show actual citizen reports from LafaekStreet recorded immutably on the Hedera Testnet blockchain. These are real submissions made through the mobile app, processed by our AI pipeline, and permanently stored on-chain.
Reports Topic (0.0.7855971) — Citizen Report Data
Hashscan URL: https://hashscan.io/testnet/topic/0.0.7855971
This screenshot shows messages #74–#78 on the Reports Topic. Each message contains a full report payload submitted by citizens, including:
report_id: Unique report identifier (e.g.,LS-260220-0002,LS-260220-0007)issue_type: AI-classified damage type (pothole,drainage,road_cracks)severity: AI-determined severity level (medium,high,low)location: GPS coordinates with latitude/longitude (e.g.,-8.553...,125.540...)blockchain_metadata: Network (hedera-testnet) and version (1.0)- Timestamps: Precise consensus timestamps for each submission
Example message from the screenshot (Message #78):
{
"report_id": "LS-260220-0002",
"user_id_hash": "f984e7d63559099...",
"issue_type": "pothole",
"severity": "medium",
"location": { "latitude": -8.553..., "longitude": 125.540... },
"blockchain_metadata": { "network": "hedera-testnet", "version": "1.0" }
}Status Updates Topic (0.0.7855972) — AI Validation & Status Changes
Hashscan URL: https://hashscan.io/testnet/topic/0.0.7855972
This screenshot shows messages S49–S53 on the Status Updates Topic. Each message records a status transition with AI validation comments, including:
old_status→new_status: Status transition tracking (pending→pendingfor initial AI validation)comment: AI validation result with confidence scorechanged_by: Hash of the user/system that triggered the change
Real AI validation results visible in the messages:
| Message | Report ID | AI Comment | Date |
|---|---|---|---|
| S53 | LS-260220-0002 | AI Validation: pothole detected with 85.0% confidence | Feb 20, 2026 |
| S52 | LS-260220-0001 | AI Validation: pothole detected with 85.0% confidence | Feb 20, 2026 |
| S51 | LS-260219-0001 | AI Validation: debris detected with 95.0% confidence | Feb 19, 2026 |
| S50 | LS-260218-0001 | AI Validation: pothole detected with 85.0% confidence | Feb 18, 2026 |
| S49 | LS-260217-0001 | AI Validation: road_cracks detected with 85.0% confidence | Feb 17, 2026 |
This proves that every report goes through AI-powered damage analysis (Amazon Bedrock Nova 2 Lite) and the validation result is permanently recorded on the blockchain alongside the report data.
Example Transaction Detail — Real Cost Breakdown
Hashscan URL: https://hashscan.io/testnet/transaction/0.0.6255873@1771493372.580909013
This screenshot shows the actual cost of submitting a single report to the Hedera blockchain:
| Field | Value |
|---|---|
| Transaction ID | 0.0.6255873@1771493372.580909013 |
| Type | SUBMIT MESSAGE |
| Topic ID | 0.0.7855971 (Reports Topic) |
| Payer Account | 0.0.6255873 |
| Consensus At | 6:29 PM, Feb 19, 2026 (GMT+9) |
| Charged Fee | 0.00871297 ℏ ($0.00086) |
| Max Fee | 0.02000000 ℏ ($0.00198) |
| HBAR Price | $0.0989 |
| Block | 31723042 |
| Node | 0.0.4 Node 1 (Hedera) |
| Status | SUCCESS |
| Valid Duration | 2 min |
Key takeaway: A single blockchain report submission costs only $0.00086 USD (less than one-tenth of a cent). At this rate:
- 1,000 reports = $0.86
- 10,000 reports = $8.60
- 100,000 reports = $86.00
This makes blockchain transparency practically free for civic applications.
📈 BLOCKCHAIN DATA FLOW
💡 DATA STORED ON BLOCKCHAIN
Report Submission Payload:
{
"report_id": "RPT-2026-001234",
"user_id_hash": "sha256_hash",
"issue_type": "pothole",
"severity": "high",
"location": {
"latitude": -8.5569,
"longitude": 125.5603,
"municipality": "Dili"
},
"ai_analysis": {
"confidence": 94.5,
"damage_detected": true,
"estimated_size": "0.8m diameter"
},
"images_hash": "sha256_of_s3_keys",
"timestamp": "2026-01-15T10:30:45Z",
"blockchain_metadata": {
"network": "hedera-testnet",
"signature": "kms_signature"
}
}Status Update Payload:
{
"report_id": "RPT-2026-001234",
"old_status": "pending",
"new_status": "in_progress",
"changed_by": "agency_id_hash",
"comment": "Work scheduled for next week",
"timestamp": "2026-01-16T14:22:10Z"
}🔐 SECURITY & PRIVACY
Data Privacy:
- Personal information (names, emails, phone numbers) is NOT stored on blockchain
- Only hashed user IDs and report metadata are recorded
- Images are stored on AWS S3, only S3 key hashes go to blockchain
Authentication:
- All blockchain submissions are signed using AWS KMS with SECP256K1 keys
- Private keys never leave AWS infrastructure
- Signatures verify data integrity and origin
Transparency vs Privacy Balance:
ON BLOCKCHAIN ✓ NOT ON BLOCKCHAIN ✗
- Report ID - User name
- Issue type - Email address
- Location (GPS) - Phone number
- Severity - Password
- Timestamp - Actual images
- Status changes - Personal comments
- AI analysis results - Private agency notes🌐 PUBLIC VERIFICATION
Anyone can verify LafaekStreet reports:
Method 1: Hashscan Explorer
Visit: https://hashscan.io/testnet/topic/0.0.7855971
Method 2: Hedera Mirror Node API
# Get all messages from Reports Topic
curl https://testnet.mirrornode.hedera.com/api/v1/topics/0.0.7855971/messages
# Get specific message by sequence number
curl https://testnet.mirrornode.hedera.com/api/v1/topics/0.0.7855971/messages/1Method 3: In-App Verification
The mobile app includes a "Verify on Blockchain" button that:
- Retrieves the report from PostgreSQL
- Queries the corresponding Hedera transaction
- Compares data hashes
- Shows ✓ or ✗ verification status
💰 COST ANALYSIS
Actual Transaction Costs (from real data):
Based on our live transaction evidence (Example_Transaction.png):
Report Submission (SUBMIT MESSAGE): $0.00086 USD (0.00871297 ℏ)
Status Update (SUBMIT MESSAGE): $0.00086 USD (0.00871297 ℏ)
Topic Query (Read via Mirror Node): FREE
HBAR Price at time of transaction: $0.0989Annual Cost Estimates (using real data):
Small Municipality (500 reports/month):
Reports: 500 × $0.00086 × 12 = $5.16/year
Status Updates: 500 × $0.00086 × 12 = $5.16/year
Total: $10.32/yearNational Scale (2,000 reports/month):
Reports: 2,000 × $0.00086 × 12 = $20.64/year
Status Updates: 2,000 × $0.00086 × 12 = $20.64/year
Total: $41.28/yearConclusion: Full blockchain transparency for an entire nation costs less than a dinner for two! The cost per report is less than one-tenth of a cent.
📊 NETWORK STATISTICS
Hedera Testnet Account:
- Operator Account:
0.0.6255873 - Topics Created: 2
- Cost per Topic Creation: ~0.02 HBAR (~$0.002)
- Cost per Message Submission: 0.00871297 ℏ (~$0.00086)
- Transaction Finality: 3-5 seconds
- Throughput: 10,000+ TPS
- HBAR Price (at test time): $0.0989
Topic Statistics (Live Data from Hashscan):
TOPIC 1: REPORTS (0.0.7855971)
Created: February 7, 2026
Total Messages: 78+ (active, receiving citizen reports)
Auto-Renew Period: 90 days
Status: Active ✅
Hashscan: https://hashscan.io/testnet/topic/0.0.7855971
TOPIC 2: STATUS UPDATES (0.0.7855972)
Created: February 7, 2026
Total Messages: 53+ (active, recording AI validations & status changes)
Auto-Renew Period: 90 days
Status: Active ✅
Hashscan: https://hashscan.io/testnet/topic/0.0.7855972🚀 PRODUCTION DEPLOYMENT
For production deployment (Hedera Mainnet):
- Create Mainnet Account at https://portal.hedera.com
- Fund Account with HBAR for transaction fees
- Re-run Topic Creation script (
hedera-playground.js) on mainnet — changeClient.forTestnet()toClient.forMainnet() - Update Backend .env with mainnet credentials and new Topic IDs
- Enable Monitoring via Hedera Mirror Node (mainnet)
Estimated Production Costs (based on real testnet data):
- Account creation: $1-2 USD one-time
- Initial funding: $50 USD (sufficient for ~58,000 report submissions at $0.00086 each)
- Annual maintenance (national scale, 2,000 reports/month): ~$41/year
🔗 USEFUL LINKS
- Hedera Documentation: https://docs.hedera.com
- Hedera Portal: https://portal.hedera.com
- Hashscan Explorer (Testnet): https://hashscan.io/testnet
- Mirror Node API: https://testnet.mirrornode.hedera.com
- HCS Documentation: https://docs.hedera.com/hedera/sdks-and-apis/sdks/consensus-service
📝 TECHNICAL NOTES
Why Not Use Smart Contracts?
We use HCS (Hedera Consensus Service) instead of smart contracts because:
- ✅ Lower cost ($0.0001 vs $0.001+ per transaction)
- ✅ Simpler integration (no Solidity code needed)
- ✅ Perfect for timestamped data logging
- ✅ Better for our use case (immutable records, not token transfers)
Why Hedera Over Other Blockchains?
- ✅ Fast: 3-5 second finality (vs 15+ seconds on Ethereum)
- ✅ Cheap: $0.0001 per transaction (vs $5-50 on Ethereum)
- ✅ Carbon Neutral: Hedera is carbon-negative
- ✅ Enterprise Grade: Used by Google, IBM, Boeing
🎯 IMPACT & TRANSPARENCY
By using Hedera blockchain, LafaekStreet ensures:
✅ Citizens can prove their reports were submitted and not ignored
✅ Government can demonstrate accountability and response times
✅ Media/NGOs can independently verify civic engagement data
✅ International Donors can audit infrastructure spending effectiveness
✅ Researchers can study civic participation patterns over time
Result: Trust through transparency, accountability through immutability. 🌟
📞 SUPPORT
For questions about the blockchain integration:
- Check Hedera documentation: https://docs.hedera.com
- Contact the development team
Built with Hedera for transparency, accountability, and trust in civic engagement. 🚀




