Skip to content

smpebble/Frontiers-of-Collaboration-Hackathon_ACTUS-FHD_Demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ACTUS-FHD: Confidential Finance with ACTUS Standard and Post-Quantum Security

PL_Genesis: Frontiers of Collaboration Hackathon β€” Zama Γ— Protocol Labs Γ— ACTUS

Go React TypeScript Zama FHEVM NIST PQC


🎯 What is ACTUS-FHD?

ACTUS-FHD is a full-stack demonstration system that integrates three cutting-edge technologies to solve a critical challenge in decentralized finance: How can financial contracts execute on-chain with both privacy AND quantum-resistant security?

Layer Technology Purpose
πŸ“ Financial Engine ACTUS Standard (PAM, ANN, SWAPS) Precise cashflow scheduling & risk modeling
πŸ” Confidential Computation Zama FHEVM (TFHE.sol, euint256) On-chain encrypted balance & coupon operations
πŸ›‘οΈ Post-Quantum Security ML-DSA-65 (FIPS 204) + ML-KEM-768 (FIPS 203) Quantum-resistant signatures & key exchange

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     React Frontend (Vite + TS)                   β”‚
β”‚   Scenario Cards β†’ Run Scenarios β†’ 7-Tab Results Dashboard       β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                      Go HTTP API (:8080)                         β”‚
β”‚   GET /api/scenarios β”‚ POST /api/run β”‚ POST /api/run-all         β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  ACTUS   β”‚    FVM    β”‚  FHEVM    β”‚    PQC    β”‚   ISO 20022      β”‚
β”‚  Client  β”‚  Client   β”‚  Codegen  β”‚  Client   β”‚   Generator      β”‚
β”‚ PAM/ANN  β”‚ Lifecycle β”‚ euint256  β”‚ ML-DSA-65 β”‚  pacs.008        β”‚
β”‚ SWAPS    β”‚ Settlementβ”‚ TFHE.sol  β”‚ ML-KEM-768β”‚  sese.023        β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚              4 Financial Scenarios (Stablecoin / Bond /           β”‚
β”‚              SME Loan / Interest Rate Swap)                      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Quick Start

Prerequisites

  • Go β‰₯ 1.24
  • Node.js β‰₯ 20 with npm
  • actus-go library (local dependency)
  • ml-kem-go and ml-dsa-go libraries (local dependencies)

1. Clone & Install

git clone https://github.com/smpebble/Frontiers-of-Collaboration-Hackathon_ACTUS-FHD_Demo
cd Frontiers-of-Collaboration-Hackathon_ACTUS-FHD_Demo

# Install Go dependencies
go mod tidy

# Install React frontend dependencies
cd web && npm install && cd ..

2. Run CLI Demo

go run main.go

This executes all 4 financial scenarios with live PQC signing and FHEVM contract generation:

══════════════════════════════════════════════════════════════════════
  ACTUS-FHD: Confidential Finance with Post-Quantum Security
  
  Integrated Stack:
    β€’ ACTUS Financial Contract Engine (PAM / ANN / SWAPS)
    β€’ Zama FHEVM (Fully Homomorphic Encryption on EVM)
    β€’ ML-DSA-65 (FIPS 204 Post-Quantum Digital Signatures)
    β€’ ML-KEM-768 (FIPS 203 Post-Quantum Key Encapsulation)
══════════════════════════════════════════════════════════════════════

  βœ… Stablecoin (TWDX) β€” 3 events, 3 PQC sigs, 901ms
  βœ… Corporate Bond (5Y) β€” 13 events, 13 PQC sigs, 320ms
  βœ… SME Loan (60M) β€” 181 events, 181 PQC sigs, 925ms
  βœ… Interest Rate Swap β€” 39 events, 39 PQC sigs, 362ms

3. Run Web UI

# Start Go backend
go run cmd/server/main.go

# In another terminal β€” start React dev server
cd web && npm run dev

Open http://localhost:5173 to access the dashboard.

4. Build for Production

cd web && npm run build && cd ..
go run cmd/server/main.go
# Open http://localhost:8080

πŸ’° Financial Scenarios

1. Stablecoin (TWDX)

  • ACTUS Type: PAM (Principal at Maturity)
  • Description: 1:1 TWD-backed stablecoin with mint/redeem operations
  • FHE: Encrypted balances and totalSupply (euint256)
  • PQC: ML-DSA-65 signatures on mint/burn events
  • Precision: Exact 1:1 mapping (diff = 0)

2. Corporate Bond (5Y, 3.5%)

  • ACTUS Type: PAM with semi-annual coupons
  • Description: 100M TWD bond, Act/360 day count, 10 coupon payments + principal
  • FHE: Encrypted coupon amounts, face value, and accrued interest
  • PQC: ML-DSA-65 signatures on 13 cashflow events
  • Precision: First coupon diff = 0.0000000002

3. SME Loan (60M, 4.5%)

  • ACTUS Type: ANN (Annuity)
  • Description: 50M TWD, 5-year, monthly amortization
  • FHE: Encrypted loan balance, payment amount, and interest accrued
  • PQC: ML-DSA-65 signatures on 181 events
  • Precision: PMT formula diff = 0.0000000031

4. Interest Rate Swap (3Y)

  • ACTUS Type: SWAPS (dual PAM legs)
  • Description: Fixed 3.0% vs TAIBOR+50bps, 100M TWD notional
  • FHE: Encrypted netting amount, fixed leg, and floating leg
  • PQC: ML-DSA-65 signatures on 39 events
  • Precision: Net settlement diff = 0.00000000006

πŸ” FHE Integration (Zama FHEVM)

The system generates FHEVM-compatible Solidity contracts that use Zama's encrypted types:

Standard Type FHEVM Type Operation
uint256 balance euint256 balance TFHE.asEuint256()
transfer(to, amount) transfer(to, einput, bytes) TFHE.sub() / TFHE.add()
balanceOf(addr) balanceOf(addr, bytes32, bytes) TFHE.allow() access control

Generated contracts are stored in generated/fhevm/ with full Solidity source code viewable in the React UI.


πŸ›‘οΈ PQC Integration (NIST FIPS 203/204)

ML-DSA-65 (Digital Signatures)

  • Every ACTUS cashflow event is signed with ML-DSA-65
  • Signatures are verified immediately after signing
  • Total: 236 events signed across all 4 scenarios

ML-KEM-768 (Key Encapsulation)

  • Off-chain key exchange simulation for secure communication
  • Generates shared secret (32 bytes) between counterparties
  • SHA-256 hash of shared secret is included in results

πŸ“ Project Structure

actus-fhd/
β”œβ”€β”€ cmd/
β”‚   β”œβ”€β”€ demo/main.go          # CLI demo runner
β”‚   └── server/main.go        # HTTP API server
β”œβ”€β”€ internal/
β”‚   β”œβ”€β”€ adapter/               # 7 adapters
β”‚   β”‚   β”œβ”€β”€ actus_client.go    # ACTUS engine (PAM/ANN)
β”‚   β”‚   β”œβ”€β”€ fvm_client.go      # FVM lifecycle
β”‚   β”‚   β”œβ”€β”€ codegen_client.go  # Standard Solidity codegen
β”‚   β”‚   β”œβ”€β”€ fhevm_codegen_client.go # FHEVM Solidity codegen
β”‚   β”‚   β”œβ”€β”€ pqc_client.go      # ML-DSA + ML-KEM
β”‚   β”‚   β”œβ”€β”€ iso20022_client.go # ISO 20022 XML messages
β”‚   β”‚   └── vlei_client.go     # vLEI identity verification
β”‚   β”œβ”€β”€ api/server.go          # HTTP API with CORS
β”‚   β”œβ”€β”€ demo/runner.go         # Scenario orchestrator
β”‚   β”œβ”€β”€ model/                 # 5 domain model files
β”‚   └── scenarios/             # 5 scenario files
β”‚       β”œβ”€β”€ common.go          # Shared context + signAndEncrypt
β”‚       β”œβ”€β”€ stablecoin.go      # TWDX scenario
β”‚       β”œβ”€β”€ bond.go            # Corporate bond
β”‚       β”œβ”€β”€ loan.go            # SME loan
β”‚       └── derivative.go      # Interest rate swap
β”œβ”€β”€ web/                       # React frontend (Vite + TypeScript)
β”‚   └── src/
β”‚       β”œβ”€β”€ App.tsx            # Main UI with 7 result tabs
β”‚       β”œβ”€β”€ api.ts             # API client
β”‚       β”œβ”€β”€ types.ts           # TypeScript type definitions
β”‚       β”œβ”€β”€ index.css          # Design system (dark mode)
β”‚       └── App.css            # Component styles
β”œβ”€β”€ generated/                 # Generated Solidity contracts
β”‚   β”œβ”€β”€ fhevm/                 # FHEVM confidential contracts
β”‚   └── standard/              # Standard contracts
β”œβ”€β”€ Docs/                      # Project documentation (Chinese/English)
β”œβ”€β”€ Temps/                     # Development tracking
β”œβ”€β”€ main.go                    # CLI entry point
└── go.mod                     # Go module definition

πŸ§ͺ Verification Results

Metric Value
Go Build βœ… go build ./... β€” clean compile
CLI Demo βœ… All 4 scenarios pass
React Build βœ… TypeScript + Vite production build
Browser Test βœ… All tabs verified (Cashflows/FHE/PQC/Solidity/ISO20022/Precision/vLEI)
Total Events 236 ACTUS cashflow events
PQC Signatures 236 ML-DSA-65 signatures (all verified βœ…)
FHE Fields 11 encrypted fields across 4 scenarios
FHEVM Contracts 4 Solidity contracts generated
Precision Tests All passing (max diff: 1.87e-7)

πŸ› οΈ Technology Stack

Component Technology Version
Backend Go 1.24
Frontend React + TypeScript 19 + 5.7
Build Tool Vite 7.3
ACTUS Engine actus-go Local
PQC Signatures ml-dsa-go (FIPS 204) ML-DSA-65
PQC Key Exchange ml-kem-go (FIPS 203) ML-KEM-768
FHE Contracts Zama FHEVM TFHE.sol
Decimal Math shopspring/decimal v1.4
UUID google/uuid v1.6

πŸ“œ License

Apache 2.0 License β€” see LICENSE for details.


πŸ‘₯ Team

ACTUS-FHD β€” Built for the PL_Genesis: Frontiers of Collaboration Hackathon

Integrating ACTUS financial contract standards with Zama's Fully Homomorphic Encryption and NIST Post-Quantum Cryptography to enable confidential, quantum-resistant decentralized finance.

About

Frontiers of Collaboration Hackathon 2026

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors