Skip to content

aethelred-foundation/noblepay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

45 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
NoblePay

NoblePay

Enterprise cross-border payments. TEE compliance. On-chain settlement.

CI Coverage Audit License

TypeScript Solidity Go Rust Python

Launch App Β· Documentation Β· API Reference Β· Discord


Overview

NoblePay is a full-stack enterprise cross-border payment platform built on Aethelred β€” a sovereign Layer 1 optimised for verifiable AI computation. Businesses can send and receive global payments, manage FX hedging, finance invoices, stream recurring payments, and maintain full regulatory compliance through a TEE-attested on-chain settlement layer β€” all from a single interface.

Status β€” Pre-mainnet. 12 Solidity contracts deployed to testnet with Go gateway, Rust compliance engine, and Python analytics toolkit operational.


Features

Cross-Border Payments

  • Multi-currency settlement with real-time FX rates
  • Payment channels for high-frequency micro-transactions
  • Streaming payments for recurring obligations
  • Invoice financing with on-chain collateralisation

Compliance & Regulatory

  • AI-powered compliance module with ML risk scoring
  • Travel Rule enforcement with counterparty attestation
  • AML/sanctions screening via Rust compliance engine
  • Automated regulatory reporting across jurisdictions

DeFi Infrastructure

  • Cross-chain routing for multi-network settlement
  • FX hedging vaults with automated rebalancing
  • Liquidity pools with institutional-grade depth
  • Multi-sig treasury management with time-locks

Enterprise Treasury

  • Real-time analytics and risk monitoring dashboard
  • Corridor analysis with behavioural pattern detection
  • Graph analysis for transaction flow visualisation
  • Business registry with KYB verification on-chain

Architecture

graph TB
    subgraph Frontend
        A[Next.js 14 / React 18<br/>Tailwind CSS / Wagmi + Viem]
    end

    subgraph API Gateway
        B[Express / TypeScript<br/>WebSocket / JWT Auth]
    end

    subgraph Go Gateway
        C[Go 1.21 / gRPC + REST<br/>Config / Handlers / Middleware]
    end

    subgraph Rust Compliance
        D[Rust 1.75 / AML + Sanctions<br/>Travel Rule / ML Risk Scoring<br/>Graph Analysis / Behavioural]
    end

    subgraph Smart Contracts
        E[Solidity 0.8.20 / Hardhat<br/>NoblePay / ComplianceOracle<br/>CrossChainRouter / FXHedgingVault<br/>PaymentChannels / StreamingPayments]
    end

    subgraph Storage
        F[(PostgreSQL 16<br/>Prisma ORM)]
        G[(Redis 7<br/>Cache & Pub/Sub)]
    end

    A <-->|REST + WS| B
    B <-->|gRPC| C
    C <--> D
    B --- F
    B --- G
    C --- E
Loading

Quick Start

Prerequisites

Tool Version
Node.js >= 20.0.0
Go >= 1.21.0
Rust >= 1.75.0
Python >= 3.11.0
Docker + Compose latest
PostgreSQL >= 16
Redis >= 7

Installation

# Clone
git clone https://github.com/aethelred-foundation/noblepay.git
cd noblepay

# Install dependencies
npm ci

# Configure
cp .env.example .env
# Edit .env with your configuration

# Start infrastructure
docker-compose up -d

# Run database migrations
cd backend/api && npx prisma migrate dev && cd ../..

# Build Rust compliance engine
cd crates/noblepay-compliance && cargo build --release && cd ../..

# Build Go gateway
cd services/gateway && go build ./... && cd ../..

# Start development servers
npm run dev           # Frontend  β€” http://localhost:3000
npm run dev:api       # API       β€” http://localhost:3001
Environment variables
# Database
DATABASE_URL=postgresql://user:pass@localhost:5432/noblepay

# Redis
REDIS_URL=redis://localhost:6379

# Blockchain
RPC_URL=http://localhost:8545
CHAIN_ID=31337

# Security
JWT_SECRET=your-secret-key
JWT_REFRESH_SECRET=your-refresh-secret

# Compliance
COMPLIANCE_ENGINE_URL=http://localhost:9090
SANCTIONS_API_KEY=your-sanctions-key

# Go Gateway
GATEWAY_PORT=8080
GATEWAY_GRPC_PORT=9090

# External Services
SENTRY_DSN=your-sentry-dsn
ANALYTICS_ID=your-analytics-id

Project Structure

noblepay/
β”œβ”€β”€ src/                            # Next.js frontend
β”‚   β”œβ”€β”€ components/                 # React components
β”‚   β”œβ”€β”€ contexts/                   # Global state
β”‚   β”œβ”€β”€ hooks/                      # Custom React hooks
β”‚   β”œβ”€β”€ lib/                        # Utilities and constants
β”‚   β”œβ”€β”€ pages/                      # Routes β€” 17 pages
β”‚   β”‚   β”œβ”€β”€ payments/               # Payment flows
β”‚   β”‚   β”œβ”€β”€ businesses/             # Business registry
β”‚   β”‚   β”œβ”€β”€ compliance/             # Compliance dashboard
β”‚   β”‚   β”œβ”€β”€ cross-chain/            # Cross-chain routing
β”‚   β”‚   β”œβ”€β”€ fx-hedging/             # FX hedging vaults
β”‚   β”‚   β”œβ”€β”€ invoice-financing/      # Invoice financing
β”‚   β”‚   β”œβ”€β”€ liquidity/              # Liquidity pools
β”‚   β”‚   β”œβ”€β”€ payment-channels/       # Payment channels
β”‚   β”‚   β”œβ”€β”€ streaming/              # Streaming payments
β”‚   β”‚   β”œβ”€β”€ treasury/               # Treasury management
β”‚   β”‚   β”œβ”€β”€ analytics/              # Analytics dashboard
β”‚   β”‚   β”œβ”€β”€ audit/                  # Audit trail
β”‚   β”‚   β”œβ”€β”€ ai-compliance/          # AI compliance module
β”‚   β”‚   β”œβ”€β”€ regulatory-reporting/   # Regulatory reports
β”‚   β”‚   β”œβ”€β”€ risk-monitor/           # Risk monitoring
β”‚   β”‚   └── settings/               # Settings
β”‚   └── __tests__/                  # Jest + RTL test suites
β”‚
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ api/                        # Express API gateway (TypeScript)
β”‚   β”‚   β”œβ”€β”€ src/                    # Routes, services, middleware, auth
β”‚   β”‚   β”œβ”€β”€ prisma/                 # Database schema and migrations
β”‚   β”‚   └── tests/                  # API integration tests
β”‚   └── infra/                      # Docker Compose and K8s configs
β”‚
β”œβ”€β”€ contracts/                      # Solidity smart contracts (Hardhat)
β”‚   └── contracts/                  # 12 contracts
β”‚       β”œβ”€β”€ NoblePay.sol            # Core payment settlement
β”‚       β”œβ”€β”€ AIComplianceModule.sol  # AI-powered compliance
β”‚       β”œβ”€β”€ BusinessRegistry.sol    # On-chain KYB
β”‚       β”œβ”€β”€ ComplianceOracle.sol    # Compliance data oracle
β”‚       β”œβ”€β”€ CrossChainRouter.sol    # Multi-chain routing
β”‚       β”œβ”€β”€ FXHedgingVault.sol      # FX hedging strategies
β”‚       β”œβ”€β”€ InvoiceFinancing.sol    # Invoice collateralisation
β”‚       β”œβ”€β”€ LiquidityPool.sol       # Institutional liquidity
β”‚       β”œβ”€β”€ MultiSigTreasury.sol    # Multi-sig treasury
β”‚       β”œβ”€β”€ PaymentChannels.sol     # State channel payments
β”‚       β”œβ”€β”€ StreamingPayments.sol   # Recurring streams
β”‚       └── TravelRule.sol          # Travel Rule enforcement
β”‚
β”œβ”€β”€ services/
β”‚   └── gateway/                    # Go gateway service (gRPC + REST)
β”‚       β”œβ”€β”€ config/                 # Configuration
β”‚       β”œβ”€β”€ handlers/               # Request handlers
β”‚       β”œβ”€β”€ middleware/             # Auth, logging, rate limiting
β”‚       β”œβ”€β”€ server/                 # Server bootstrap
β”‚       β”œβ”€β”€ services/              # Business logic
β”‚       └── store/                 # Data access layer
β”‚
β”œβ”€β”€ crates/
β”‚   └── noblepay-compliance/        # Rust compliance engine
β”‚       β”œβ”€β”€ src/
β”‚       β”‚   β”œβ”€β”€ aml/               # AML screening
β”‚       β”‚   β”œβ”€β”€ sanctions/         # Sanctions list matching
β”‚       β”‚   β”œβ”€β”€ travel_rule/       # Travel Rule protocol
β”‚       β”‚   β”œβ”€β”€ attestation/       # TEE attestation
β”‚       β”‚   β”œβ”€β”€ behavioral/        # Behavioural analysis
β”‚       β”‚   β”œβ”€β”€ corridor/          # Corridor analysis
β”‚       β”‚   β”œβ”€β”€ graph/             # Graph analysis
β”‚       β”‚   └── ml_risk/           # ML risk scoring
β”‚       └── Cargo.toml
β”‚
β”œβ”€β”€ tools/
β”‚   └── compliance-py/              # Python compliance toolkit
β”‚       β”œβ”€β”€ analytics/             # Analytics modules
β”‚       β”œβ”€β”€ models/                # ML models
β”‚       β”œβ”€β”€ reporting/             # Report generators
β”‚       └── utils/                 # Utility functions
β”‚
β”œβ”€β”€ .github/workflows/              # CI/CD pipeline
└── .env.example                    # Environment template

Testing

# Frontend β€” unit and component tests
npm test
npm run test:coverage
npm run test:watch

# Integration tests
docker-compose -f docker-compose.test.yml up -d
npm run test:integration

# E2E tests (Playwright)
npx playwright install
npm run test:e2e

# Smart contracts
cd contracts
npx hardhat test
npx hardhat coverage

# Rust compliance engine
cd crates/noblepay-compliance
cargo test --all
cargo tarpaulin --all          # coverage

# Go gateway
cd services/gateway
go test ./...

# Python compliance toolkit
cd tools/compliance-py
pytest --cov
Test coverage targets
Module Target Current
Frontend (Jest + RTL) > 80% 82%
Backend API > 85% 87%
Smart Contracts > 95% 96%
Rust Compliance > 90% 91%
Go Gateway > 85% 86%
Python Toolkit > 80% 83%

Security

Audit reports: Security Best Practices Β· Contract Review β€” 12 contracts Β· Compliance Engine Attestation

Application layer: JWT + refresh-token auth, RBAC, Zod input validation, per-endpoint rate limiting, CORS, Helmet security headers, parameterised queries (Prisma), XSS sanitisation, CSRF protection.

Smart contract layer: Reentrancy guard (checks-effects-interactions), checked arithmetic, role-based access control, emergency pause mechanism, multi-sig admin operations, time-locked upgrades, oracle price feed validation.

Compliance layer: TEE-attested sanctions screening, Travel Rule protocol enforcement, AML graph analysis, ML-based risk scoring with explainability, behavioural anomaly detection, jurisdiction-aware regulatory reporting.


Performance

Metric Target Current
First Contentful Paint < 1.5 s 1.0 s
Largest Contentful Paint < 2.5 s 1.9 s
Time to Interactive < 3.5 s 2.4 s
API Response Time (p95) < 200 ms 110 ms
Gateway Throughput (gRPC) > 10k rps 12k rps
Compliance Check Latency < 50 ms 35 ms
Contract Gas β€” payment < 120 k 95 k

Optimisations: code splitting, Next.js image optimisation, Redis response caching, CDN edge delivery, Gzip/Brotli compression, database indexing, connection pooling, gRPC streaming.


Development

npm run lint && npm run lint:fix    # ESLint
npm run format                      # Prettier
npm run type-check                  # TypeScript strict mode
npm run validate                    # All checks

Pre-commit hooks (Husky) run ESLint, Prettier, TypeScript checks, and unit tests on changed files.

CI/CD Pipeline

On every PR: security audit, lint + format, unit tests (frontend, backend, contracts, compliance engine, gateway), integration tests, E2E tests, build verification.

On merge to main: Docker build, push to registry, deploy to staging, smoke tests, compliance regression suite, deploy to production.


API

REST

GET  /v1/payments?limit=10&status=completed
GET  /v1/payments/:id
POST /v1/payments                    # Create payment
GET  /v1/businesses/:id
POST /v1/compliance/check            # Run compliance check
GET  /v1/analytics/corridors
GET  /v1/treasury/:id/balance
POST /v1/invoices/finance            # Submit invoice for financing

WebSocket

const ws = new WebSocket('wss://api.thenoble.one/ws');

ws.send(JSON.stringify({ method: 'subscribe', channel: 'payments', filter: { business: '0x...' } }));
ws.send(JSON.stringify({ method: 'subscribe', channel: 'compliance.alerts' }));
ws.send(JSON.stringify({ method: 'subscribe', channel: 'fx.rates', pairs: ['USD/EUR', 'GBP/JPY'] }));

Full reference: api.thenoble.one/docs


Contributing

We welcome contributions. Please see the Contributing Guide before opening a PR.

  1. Fork the repository
  2. Create a feature branch β€” git checkout -b feature/my-feature
  3. Run npm run validate
  4. Commit with Conventional Commits
  5. Open a Pull Request

License

Apache 2.0 β€” see LICENSE for details.


Acknowledgments

Hardhat Β· OpenZeppelin Β· Next.js Β· Tailwind CSS Β· wagmi Β· viem Β· Prisma


Docs Β· Discord Β· Twitter Β· Support

Copyright Β© 2024–2026 Aethelred Foundation

Releases

No releases published

Packages

 
 
 

Contributors