Loading...
Loading...
Cryptographic primitives used by the Midnight node — Blake2-256 hashing, sr25519/ECDSA/Ed25519 signatures, twoxhash storage keys, and how they map to consensus, P2P, and state. Use when debugging node crypto, signature verification, or hash function choices.
npx skill4agent add kali-decoder/midnight-skills midnight-cryptographyflowchart TB
subgraph Hash["Hashing"]
B2["Blake2-256 — cryptographic"]
T2["twoxhash — non-cryptographic storage keys"]
end
subgraph Sign["Signature schemes"]
SR["sr25519 — AURA block authorship"]
ECDSA["ECDSA — Partnerchain consensus messages"]
ED["Ed25519 — GRANDPA finality + libp2p"]
end
subgraph Use["Used for"]
B2 --> Blocks["Block hashes, state transitions"]
T2 --> Trie["Patricia-Merkle trie key generation"]
SR --> AURA["AURA block production"]
ECDSA --> PC["Partnerchain coordination"]
ED --> GRANDPA["GRANDPA votes"]
ED --> P2P["libp2p protocol messages"]
end| Scheme | Construction / basis | Used for |
|---|---|---|
| sr25519 | Schnorrkel + Ristretto x25519 | Signing AURA block authorship messages |
| ECDSA | Standard elliptic-curve ECDSA | Signing Partnerchain-related consensus messages (external interoperability) |
| Ed25519 | Edwards-curve EdDSA | GRANDPA finality messages and libp2p protocol messages |
flowchart LR
subgraph Consensus
AURA["AURA slot"] -->|sr25519| BA["Block authorship"]
GRANDPA["GRANDPA vote"] -->|Ed25519| FV["Finality message"]
PC["Partnerchain signal"] -->|ECDSA| PM["Cross-chain message"]
end
subgraph Network
L2P["libp2p handshake"] -->|Ed25519| PI["Peer identity separate from consensus keys"]
endmidnight-storage/| Layer | Cryptography |
|---|---|
| Midnight Ledger | ZK proofs, ZSwap circuits, contract proof verification |
| Midnight Node | Blake2-256, sr25519, ECDSA, Ed25519, twoxhash |
pallet-midnightmidnight-consensus/midnight-storage/midnight-p2p-networking/