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 FNOs (Federated Node Operators) and registered SPOs (Stake Pool Operators) validators
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
Dparameter (system_parameters) controls the split between permissioned and registered validators.
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