Midnight Node overview
The Midnight Node provides the foundational infrastructure for operating on the Midnight Network. It implements core protocol logic, manages peer-to-peer networking, and supports decentralized operations through integration with the Cardano network as a Partner Chain.
Functions
The Midnight Node is responsible for:
- Processing privacy-preserving smart contract transactions with zero-knowledge proofs
- Enforcing protocol rules and maintaining blockchain state integrity
- Enabling peer-to-peer (P2P) capabilities: node discovery, connection establishment, and block gossip
- Supporting decentralization through both permissioned (Federated Node Operators) and registered (Stake Pool Operators) validators
- Bridging to Cardano Mainchain for cNIGHT token management and governance synchronization
Characteristics
- Built on Polkadot SDK (Substrate framework)
- Implements Partner Chain components for Cardano integration
- Acts as a Partner Chain node with cross-chain communication
- Requires persistent connection to Cardano via PostgreSQL database populated by Cardano-db-sync
Architecture
┌────────────────────────────────────────────────────────────────────────────┐
│ Midnight Node Wizard │
└────────────────────────────────────────────────────────────────────────────┘
│
│ Register Partner Chain
▼
┌─────────────┐ ┌─────────────────┐ ┌──────────────┐
│ Cardano │ ───▶ │ Cardano Indexer │ ───▶ │ PostgreSQL │
│ Mainchain │ │ (db-sync) │ │ (cexplorer) │
└─────────────┘ └─────────────────┘ └──────────────┘
│ Observes mainchain state
│ Queries Cardano data
│ (cNIGHT, governance)
▼
┌────────────────────────────────────────────────────────────────────┐
│ Midnight Node │
├────────────────────────────────────────────────────────────────────┤
│ │
│ ┌───────────────────────── ─────────────────────────────────────┐ │
│ │ Runtime │ │
│ │ │ │
│ │ ┌────────────────────────────────────────────────────────┐ │ │
│ │ │ Pallets │ │ │
│ │ │ │ │ │
│ │ │ ┌─────────────┐ ┌──────────────┐ ┌──────────────┐ │ │ │
│ │ │ │ Midnight │ │ Native │ │ Federated │ │ │ │
│ │ │ │ System │ │ Token │ │ Authority │ │ │ │
│ │ │ │ │ │ Observation │ │ │ │ │ │
│ │ │ └─────────────┘ └──────────────┘ └──────────────┘ │ │ │
│ │ │ │ │ │
│ │ │ ┌─────────────┐ ┌──────────────┐ ┌──────────────┐ │ │ │
│ │ │ │ Version │ │ Midnight │ │ Federated │ │ │ │
│ │ │ │ │ │ │ │ Authority │ │ │ │
│ │ │ │ │ │ │ │ Observation │ │ │ │
│ │ │ └─────────────┘ └──────────────┘ └──────────────┘ │ │ │
│ │ └────────────────────────────────────────────────────────┘ │ │
│ └──────────────────────────────────────────────────────────────┘ │
│ │
│ ┌──────────────────────────────────────────────────────────────┐ │
│ │ Node Services │ │
│ │ │ │
│ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ │
│ │ │ RPC │ │Consensus │ │ Keystore │ │ Network │ │ │
│ │ │ Server │ │ AURA │ │ │ │ P2P │◀───│──│────▶ Other Midnight Nodes
│ │ │Port 9944 │ │ GRANDPA │ │ │ │Port 30333│ │ │
│ │ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │ │
│ └──────────────────────────────────────────────────────────────┘ │
└────────────────────────────────────────────────────────────────────┘
│
│ WebSocket RPC
│ Port: 9944
▼
┌─────────────────────────────────────────────────────────┐
│ External Clients: DApps, Indexers, Block Explorers │
└─────────────────────────────────────────────────────────┘
Core parameters
| Parameter | Value |
|---|---|
| Block Time | 6 seconds |
| Session Length | 1200 slots (2 hours) |
| Epoch Length | 300 blocks |
| Hash Function | blake2_256 |
| Account Type | sr25519 public key |
| P2P Port | 30333 (default) |
| RPC Port | 9944 (WebSocket, default) |
Genesis configuration
The genesis configuration for the Midnight Node is as follows:
Ledger
- Initial coin supply: 100,000,000,000,000,000 units
- Distribution: Split into five outputs each across four wallets (4 × 5 × 5,000,000,000,000,000)
- Note: This configuration is for Testnet use only and does not reflect the final Mainnet supply
Consensus
- Initial validator set: Permissioned nodes operated by Federated Node Operators (FNOs) and registered nodes operated by Stake Pool Operators (SPOs)
- The 'D' parameter (system_parameters) controls the split between permissioned and registered validators
- Validator selection uses the Partner Chain Ariadne Selection Algorithm
Governance
- Multi-collective governance system requiring consensus from multiple authority bodies
- Council: Responsible for treasury proposals and network parameter changes
- Technical Committee: Manages runtime upgrades and emergency actions
- Motion-based proposal system with time limits
- Automatic synchronization with Cardano Mainchain for governance authority changes
Runtime pallets
The Midnight Node includes six custom pallets that implement core blockchain functionality:
- pallet-midnight - Core ledger state and privacy-preserving transaction processing
- pallet-midnight-system - System-level administrative operations
- pallet-native-token-observation - Cardano bridge integration for cNIGHT token management and DUST generation
- pallet-federated-authority - Multi-collective governance requiring consensus from multiple bodies
- pallet-federated-authority-observation - Governance synchronization with Cardano Mainchain
- pallet-version - Runtime version tracking and upgrade monitoring
Signature schemes
The Midnight Node uses different cryptographic schemes for various operations:
- ECDSA - Partner Chain consensus message signing and BEEFY aggregated proofs
- Ed25519 - GRANDPA finality message signing
- Sr25519 - AURA block authorship signing (based on Schnorrkel / Ristretto / x25519)
Node types
- Full node - Validates transactions and maintains current blockchain state
- Archive node - Stores complete blockchain history with all historical states
- Boot node - Provides initial connection points for nodes joining the network
- RPC node - Exposes HTTP/WebSocket APIs for external client interactions