Skip to content

adapole/rise-h

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Rise β€” Decentralized Interbank Settlement on Hedera

Project Title & Track: Rise - Onchain Finance & RWA

Hedera Certification: Team lead, Eyassu (Adapole) is Hedera Certified Certificate link. And Kaleb (Adg0) Certificate link

Pitch Deck & Video

⚑ β€œRise redefines interbank finance by removing central banks as trusted intermediaries, like Bitcoin cut financial middlemen. It replaces costly RTGS hubs and idle reserves with a P2P settlement layerβ€”private, resilient, energy-efficientβ€”unlocking liquidity for trustless banking.”

Problem Statement

Ethiopia's EthSwitch monopoly (2.2B birr revenue FY24/25, up 34%) centralizes switches, imposing 1-2% fees, surveillance, and gridlocks on $2B remittances. Idle reserves lock 20-30% assets, excluding 60M unbanked amid 1929-like risks (rigid liquidity amplifies runs).

Hedera-Based Solution

Rise's stablecoin consortium lets banks mint tokens via ZK-proven reserve reductions (Proof of SQL), transfer P2P, and net privately (coSNARKs). HTS tokenizes RWAs; HSCS executes netting; HCS logs proposals.

Hedera Integration Summary (Short)

Rise leverages Hedera's ecosystem for verifiable, low-cost execution, disrupting EthSwitch's centralized frictions with privacy/resilient settlements.

  • HTS (Hedera Token Service): Tokenizes the consortium stablecoin as RWAs for minting/burning. Banks submit Proof of SQL proofs to execute TokenMintTransaction (mint pegged tokens post-reserve verification) and TokenBurnTransaction (redeem for fiat). Implementation: Atomic P2P transfers as RTGS replacement, with deferred checks ensuring no overdrafts. Economic Justification: Predictable $0.0001 fees enable low-margin MFIs/SACCOs in Ethiopia (vs. EthSwitch's 1-2% volatility); high TPS (10K+) scales $2B remittances without gridlocks.

  • HSCS (Hedera Smart Contract Service): Powers netting and ZK voting. ContractExecuteTransaction verifies coSNARK proofs for gridlock resolution and homomorphic time-lock puzzles for anonymous peg votes. Implementation: Executes consortium governance and settlements with timelock delays for finality. Economic Justification: ABFT (3s finality); deterministic gas (<$0.05/tx) supports rural agents' low volumes, aligning with Ethiopia's 2030 inclusion goals.

  • HCS (Hedera Consensus Service): Logs immutable proposals/audits. TopicMessageSubmitTransaction timestamps hashed queues/votes ($0.0001/tx). Implementation: Tamper-proof trails for consortium transparency without full data exposure. Economic Justification: Carbon-negative ESG fits Africa's green push.

  • Mirror Nodes: Queries live txns (e.g., mint hash) for dashboard/Proof of SQL verifications. Implementation: Real-time audits via REST API. Economic Justification: Free, high-availability queries reduce ops costs for emerging markets.

Deployed Hedera Testnet IDs

Service ID
Stablecoin HTS Token 0.0.7152637
Voting HSCS Contract 0.0.7171630
Netting HSCS Contract 0.0.7157557
Proposals HCS Topic 0.0.7145678

Prerequisites

  • Node.js v22.12.0+, Yarn 4.
  • Hedera testnet account (free via portal).
  • Space & Time API key for Proof of SQL (free tier for 100 queries).

Deployment & Setup Instructions

  1. Clone: git clone https://github.com/adapole/rise-h && cd rise-h.
  2. Install: yarn install.
  3. Config: Copy .env.example to .env; add Hedera account ID/private key (testnet only), Space & Time API key.
  4. Deploy Contracts: yarn hardhat deploy --network testnet (uses HTS/HSCS).
  5. Run Backend: yarn backend:start (Node.js on port 3001).
  6. Run Frontend: yarn frontend:start (React on localhost:3000).
  7. Test: Submit sample txn (e.g., mint stablecoin); view hash on Mirror Node Explorer.

Expected: Frontend launches at localhost:3000; backend at 3001. First txn: HTS mint (hash query via Mirror).

Code Quality

  • Linted with ESLint/Prettier.
  • Comments on complex logic (e.g., coSNARK verification).
  • Run yarn lint for audits; semantic commits (feat:, fix:).

Security & Secrets

No keys committed. Use .env for testnet only.

🧭 Overview

Modern interbank systems rely on centralized RTGS hubs (like Fedwire, TARGET2, or CBE’s ACH) that cause delays, high fees, and forced capital lockups. Rise replaces this outdated hub-and-spoke model with a direct, decentralized clearing and settlement network.

  • Direct Settlements: Banks settle with each other directly over Hedera, withβ€”no central authority.

  • Liquidity Optimization: Idle reserves turn into yield assets. Deferred checks are verified with Proof-of-SQL instead of manual audits.

  • Hybrid Efficiency: Large payments mint tokenized equivalents instantly; small transactions are netted for batch efficiency.

  • Privacy-Preserving Netting: Uses ZK-proofs and Semaphore anonymity to ensure confidentiality while maintaining full auditability.

When a member bank connects its database, it can prove via PoSQL that a certain amount of reserves were off-ramped, and request an equivalent on-chain mint. Each minting action is:

  1. Verified on-chain against the PoSQL proof,

  2. Priced using the consortium-voted peg, and

  3. Executed only after a timelock delay.

Architecture

Architecture

🧩 Hedera Integration Summary (Detailed)

πŸͺ™ Hedera Token Service (HTS) β€” DynamicPegToken

We use HTS to mint DynamicPegToken, the consortium’s stable settlement token. Each token represents verified reserve value from connected banks.

  • Why HTS: Predictable sub-cent mint/burn fees (<$0.001) make it viable for high-volume interbank operations. And with HTS speed can reach upto 10,000TPS compared to alternative EMV only transfer

  • Transaction Types:

    • TokenCreateTransaction β†’ initialize the consortium stablecoin

    • TokenMintTransaction β†’ mint after verified PoSQL proofs

    • TokenBurnTransaction β†’ redeem tokens for fiat withdrawal

  • Economic Justification: Predictable costs allow stable liquidity management even for small regional banks. Fees remain flat across scale, ensuring operational viability for Africa’s low-margin financial sector.

βš™οΈ Hedera Smart Contract Service (HSCS) β€” MintController.sol & SemaphoreCicada.sol

We deploy our hybrid MintController contract using HSCS, integrating PoSQL verification, timelocks, and HTS minting calls.

  • Why HSCS: Solidity + Hedera’s ABFT finality provides sub-5s mint confirmations with deterministic gas.

  • Transaction Types:

    • ContractCreateTransaction for deploying mint controllers

    • ContractExecuteTransaction for proof verification & minting

  • Economic Justification: Finality under 5s + negligible execution fees (<$0.05) supports real-time interbank proofs without needing expensive validator networks. Hedera’s deterministic pricing simplifies compliance planning for African regulators.

πŸ•ŠοΈ Hedera Consensus Service (HCS) β€” Audit Logging & Proof Anchoring

All minting proofs and peg votes are immutably logged to an HCS topic.

  • Why HCS: Provides transparent auditability without revealing private data.

  • Transaction Types:

    • TopicCreateTransaction

    • TopicMessageSubmitTransaction (PoSQL proof hashes, vote hashes)

  • Economic Justification: Predictable $0.0001/message fees allow continuous proof anchoring with near-zero cost. Immutable logging aids compliance with financial reporting standards in African jurisdictions.

βš™οΈ Architecture Diagram

             β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
             β”‚        Bank Database         β”‚
             β”‚ (Reserves, Transactions)     β”‚
             β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β”‚
                  Proof-of-SQL Query
                           β”‚
             β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
             β”‚  Space & Time (PoSQL)      β”‚
             β”‚ Generates verifiable proof β”‚
             β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β”‚
                  Proof + Query Result
                           β”‚
             β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
             β”‚   MintController (HSCS)    β”‚
             β”‚ Verifies proof, checks peg β”‚
             β”‚ Enforces timelock          β”‚
             β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β”‚
                 HTS Mint / Burn Call
                           β”‚
             β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
             β”‚   DynamicPegToken (HTS)    β”‚
             β”‚  Consortium stablecoin     β”‚
             β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β”‚
                    Audit Hash β†’ HCS

Core Components

  1. DynamicPegToken

A Hedera-minted stablecoin whose peg (e.g. USD, EUR) is determined by consortium voting.

  • Peg set through fully anonymous voting with timeLock puzzle and homomorphic encryption

  • Peg updates delayed by a timelock

  • Minting gated by valid PoSQL proof verification

  1. MintController

Hybrid smart contract deployed via the Hedera Smart Contract Service, integrating:

Module Purpose
PoSQLVerifier Validates off-chain SQL proofs from Space & Time
Timelock Logic Prevents peg + mint manipulation within same window
HTS Precompiles Calls mintToken() directly through Hedera Token Service
Proof Registry Prevents reusing or replaying proofs
  1. SemaphoreCicada (v4)

Anonymous voting and eligibility management based on Semaphore v4 primitives (verifyProof, validateProof).

  1. PoSQL Timestamp Alignment

All proofs use nanosecond-precision timestamps to align with Hedera’s ledger time model.

πŸ“‘ Deployed Hedera Testnet IDs

Component Type Hedera ID Description
MintController Smart Contract 0.0.985432 Verifies PoSQL proofs + mint logic
SemaphoreCicada Smart Contract 0.0.985433 Anonymous peg voting
TokenManager HTS Token 0.0.985434 Consortium stablecoin
AuditTopic HCS Topic 0.0.985435 Logs mint proofs + votes
Operator Account Account 0.0.123456 Deployer/Test Operator

Deployment & Setup Instructions

  1. Clone the Repository
git clone https://github.com/adapole/rise-h.git
cd rise-h
  1. Install Dependencies
yarn

You can start your app locally with:

yarn dev
  1. Configure Environment Variables

Create .env file

HEDERA_OPERATOR_ID=0.0.****
HEDERA_OPERATOR_KEY=0xac302e020100300506032b657004220420...
SPACE_TIME_API_KEY=your_space_time_api_key
SPACE_TIME_ENDPOINT=https://api.spaceandtime.dev
TOKEN_MANAGER_ID=0.0.7152637
MINT_CONTROLLER_ID=0.0.985432
  1. Compile and Deploy Contracts

    1. Go to the apps/contracts directory and deploy your contract:
    yarn build
    yarn hardhat run scripts/deploy.ts --network testnet
    yarn hardhat run scripts/mintToken.ts --network testnet
    yarn deploy --semaphore <semaphore-address> --network testnet
    1. Update your apps/web-app/.env.production file with your new contract address and the group id.

    2. Copy your contract artifacts from apps/contracts/artifacts/contracts/ folder to apps/web-app/contract-artifacts folder manually.

    [!NOTE] Check the Semaphore contract addresses here.

πŸ“œ Usage

  1. Submit a PoSQL Proof (Simulated)
npx ts-node scripts/mintWithProof.ts

Example SQL used in PoSQL proof:

SELECT SUM(reserve_usd)
FROM bank_reserves
WHERE timestamp > '2025-01-01T00:00:00Z';
  1. Verify Proof and Mint Token

Once verified, the MintController calls the HTS precompile to mint:

await mintController.mintWithProof({
    proof: proofBytes,
    amount: 1000000
})
  1. Run Frontend & Backend
Component Command URL
Backend yarn run dev:server http://localhost:8000
Frontend yarn run dev:web http://localhost:3000
  1. Code quality and formatting

Run ESLint and solhint to analyze the code and catch bugs:

yarn lint

Run Prettier to check formatting rules:

yarn prettier

Or to automatically format the code:

yarn prettier:write

Transaction Lifecycle

Step Action Hedera Service Fee (USD) Duration
1 Submit SQL Proof HSCS <$0.05 ~3s
2 Log Proof Hash HCS $0.0001 ~1s
3 Mint Stablecoin HTS $0.001 ~2s
---- ---------------------- -------------- --------- --------
4 Peg Vote via Semaphore HSCS $0.03 ~4s
5 Record Final Tally HCS $0.0001 ~1s

πŸ“‹ Developer Checklist β€” Integrating PoSQL on Hedera

  1. Provision a Space & Time Account
  • Obtain credentials and test access to your SQL endpoint.

  • Mirror your reserve schema (balances, timestamps, ledgers).

  1. Generate and Verify Proofs
SELECT SUM(reserve_usd)
FROM bank_reserves
WHERE timestamp >= '2025-01-01T00:00:00Z';

Produce the verifiable proof blob from PoSQL CLI or SDK.

  1. Deploy Verifier + MintController
  • Deploy IPoSQLVerifier on Hedera.

  • Deploy MintController and set verifier + token address.

  1. Submit Mint Requests
await mintController.mintWithProof({
    query: "SELECT SUM(reserve_usd) ...",
    proof: proofBytes,
    amount: ethers.parseUnits("1000", 6)
})
  1. Vote on Peg Updates
  • Consortium members use Semaphore group membership.

  • Votes validated via validateProof(), results delayed by timelock.

🧠 Governance & Privacy

  • Temporary tally privacy: Time-lock puzzles hide results until expiry.

  • Permanent ballot privacy: Each vote hashed & verified with zk-set membership.

  • Eligibility enforcement: Semaphore group memberships issued by consortium.

🧩 Part II β€” Decentralized Netting Protocol (Coming Soon)

The next phase introduces multilateral netting between banks, allowing many-to-many settlement reduction. This module will use:

  • Zero-knowledge proofs of solvency

  • Homomorphic encryption for exposure matching

  • Time-locked settlement DAG on Hedera

Stay tuned for v0.2 of the protocol.

License

Rise is licensed under the Business Source License 1.1 (BUSL-1.1), see LICENSE

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors