/midnight-skills:midnight-onchain-logicfrom midnight-skills
Explains Midnight blockchain's WASM runtime, FRAME pallets, and pallet-midnight ledger state machine. Useful for understanding proof-based transaction validation and Patricia-Merkle state commitments.
Ships in midnight-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
The Midnight node follows the standard Polkadot SDK model: core logic (except native pre-compiles) compiles to WebAssembly (WASM) and forms the runtime — the state transition function executed identically on every node.
flowchart TB
subgraph Runtime["WASM Runtime"]
direction TB
PA["pallet-aura"]
PG["pallet-grandpa"]
PS["pallet-partnerchains-session"]
PVM["pallet_session_validator_management"]
PM["pallet-midnight ★"]
Other["Other FRAME pallets"]
end
Block["Incoming block + extrinsics"] --> Runtime
Runtime --> Trie["Patricia-Merkle trie commit"]
Trie --> DB["ParityDB persistence"]
PM --> Ledger["Midnight Ledger state commitment"]
Each FRAME pallet encapsulates a domain of on-chain logic and may define:
This modular design is similar in spirit to a smart contract framework, but logic is compiled ahead of time and governed at the chain level.
| Pallet | Role |
|---|---|
pallet-aura | Block production via AURA |
pallet-grandpa | Finality via GRANDPA |
pallet-partnerchains-session | Session rotation in Partnerchain context |
pallet_session_validator_management | Validator set coordination |
pallet-midnight | Core privacy-preserving transaction logic |
pallet-midnight is internally maintained and encapsulates the Midnight Ledger state machine.
sequenceDiagram
participant Tx as Ledger transaction
participant Pool as Transaction pool
participant PM as pallet-midnight
participant Lib as Native proof libraries
participant State as On-chain storage
Tx->>Pool: Submit (unsigned, proof-embedded)
Pool->>Pool: Well-formedness check
Pool->>PM: Included in block
PM->>Lib: Verify cryptographic proof
Lib-->>PM: Valid / invalid
PM->>State: Execute state transition
State->>State: Commit trie + ledger commitment
After execution:
| State type | Where | Visibility |
|---|---|---|
| Substrate runtime storage | Patricia-Merkle trie | Standard on-chain queries |
| Midnight Ledger commitment | Persisted per block | Verifiable snapshot of ledger |
| Contract ledger fields | Via disclose() in Compact | Selectively public per contract design |
For application-level privacy patterns, see why-midnight/ and compact/.
midnight-consensus/ — AURA + GRANDPA palletsmidnight-transactions/ — transaction pool → runtime → commit lifecyclemidnight-storage/ — ParityDB + trie detailsmidnight-rpc/ — querying contract and ledger state via RPCWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
43 skills in this plugin
/1am-walletIntegrate the 1AM wallet for dust-free contract deployment and transaction flow on Midnight Network. Use this skill whenever a user is building a Midnight Network dApp, connecting to the 1AM browser extension, deploying or calling a Compact contract, handling ZK proving, setting up providers, or asking about dust-free transaction flow. Also use it for indexer patching, private state providers, payload encryption, or any question involving window.midnight['1am']./android-example-votingBuild a voting/poll dApp on Midnight Network using the Kuira Android SDK — Compact smart contract with create/cast/close circuits, passkey-derived identity, embedded wallet, Compose UI, reactive ledger reads via observeLedger(), and on-device ZK proving. Use when building a poll or voting dApp targeting Android./ankr-midnightIntegrate Ankr as a Midnight Network RPC provider for testnet and mainnet. Covers creating an Ankr project, copying HTTPS/WSS endpoints with API key, wiring the node URL into midnight-js / multinetwork configs, and calling Midnight JSON-RPC methods (midnight_*, system_*, chain_*, state_*). Use when the user asks about Ankr + Midnight, Ankr.js for Midnight, Ankr RPC endpoint, or replacing public Midnight RPC with Ankr.
/compactWrite, reason about, and debug Compact smart contracts for the Midnight blockchain. Use this skill whenever a user asks about Compact syntax, ledger state, witnesses, circuits, disclosure, ZK patterns, data types, standard library functions, security patterns, nullifier design, Merkle trees, or anything related to writing .compact files. Also trigger for questions about compiling contracts, debugging circuit errors, choosing between ledger ADTs, and implementing privacy-preserving patterns like commitments, hash-based auth, and anonymous membership proofs./compact-language-engineeringBuild and maintain language tooling for Midnight's Compact language (parsers, grammars, syntax highlighters, formatters, linters, language servers, IntelliJ/Grammar-Kit plugins, tree-sitter grammars) without changing what the language accepts. Use this skill when a user asks to write or fix a Compact grammar, port the grammar to tree-sitter, Grammar-Kit, JFlex, ANTLR, Lezer, or TextMate, check operator precedence or associativity, track down parser ambiguities or nullable and left-recursive rules, generate parser regression tests, compare a third-party parser against the compiler, or build an LSP or editor extension for `.compact` files. Also use it for questions like "what tokens does Compact have", "is `/` or unary minus valid Compact", "why does my highlighter break on block comments", "tree-sitter-compact rejects valid code", or "how does the Nite language server get its diagnostics".
/dust-gas-sponsorshipLet one wallet pay Midnight transaction fees for another wallet's transaction, so users with zero DUST can transact from their first click. Use whenever a dApp onboards new users, offers a free tier, or covers usage for its users: the two-sided sponsorship flow (user proves and binds, sponsor adds DUST and submits), the sponsor service and its acceptance policy, sponsor economics and monitoring, and the hosted alternatives (NIGHTGATE, Capacity Exchange).npx claudepluginhub kali-decoder/midnight-skills --plugin midnight-skillsOther plugins' skills for the same job