Use with your AI agent
- Install — run
npx skills add Kali-Decoder/Midnight-skills --skill midnight-transactionsfor this skill, ornpx skills add Kali-Decoder/Midnight-skillsfor all - Prompt — copy the example prompt and paste it into Cursor, Claude Code, or Codex
- Build — the agent loads this skill and scaffolds your Midnight work
Transactions
Agent picks this when: Explain Midnight transaction lifecycle — proofs, pool, and execution
Proof-based unsigned ledger transactions, pool validation, runtime verification, and state commit lifecycle.
Good for
- Unsigned proof-embedded transactions from the Midnight Ledger.
- Pool well-formedness → runtime proof verification → state commit.
Preview in agent
Suggested promptsExplain Midnight transaction lifecycle — proofs, pool, and execution. Use the "midnight-transactions" skill from MIDSKILLS. Follow Compact smart-contract best practices, wire wallet flows where needed, and explain each step as you implement. Target Midnight Preprod unless I specify otherwise.
Loaded skill midnight-transactions
What the skill guides the agent to do:
- Unsigned proof-embedded transactions from the Midnight Ledger.
- Pool well-formedness → runtime proof verification → state commit.
Illustrative — based on the skill's description, not recorded agent output.
Try it without installing: npx skills use Kali-Decoder/Midnight-skills@midnight-transactions
What changed in v1.0.16
All registry changesNo changes in v1.0.16 or the releases before it that we track.
On this page · 12 sections
Transactions
The Midnight node supports the standard Polkadot SDK transaction format, but default Substrate-style signed extrinsics are uncommon in practice. Midnight relies on a proof-based verification model tightly coupled with the Midnight Ledger.
Lifecycle overview
flowchart TB
Build["Build transaction + ZK proof<br/>(wallet / SDK)"]
Submit["Submit to node RPC / P2P"]
Pool["Transaction pool<br/>well-formedness check"]
Block["Included in block"]
Verify["Runtime verifies embedded proof"]
Execute["Execute state transition"]
Commit["Commit to trie + ledger commitment"]
Build --> Submit --> Pool
Pool -->|Valid structure| Block
Pool -->|Reject| Reject["Dropped from pool"]
Block --> Verify
Verify -->|Invalid proof| Fail["Transaction fails"]
Verify -->|Valid| Execute --> Commit
Proof-based model
Most Midnight transactions are unsigned and follow the Midnight Ledger format.
| Traditional chain | Midnight |
|---|---|
| Signature authorizes action | Cryptographic proof attests validity |
| Public signer identity | Sensitive data stays off-chain / in proof |
| Standard extrinsic format | Ledger-specific transaction envelope |
The proof lets the network validate state transitions without exposing sensitive data or raw signatures directly.
Transaction types
- Contract deployment
- Contract invocation (circuit calls)
- ZSwap asset transfers
Processing stages
1. Submission
Client (wallet, SDK, dApp) submits a transaction to a node's RPC or propagates via P2P gossip.
2. Transaction pool validation
The pool checks well-formedness:
- Structural requirements per runtime and ledger specification
- Logical preconditions (format, size, basic validity)
- Not full proof verification yet (that happens at block execution)
sequenceDiagram
participant Client
participant Pool as Tx pool
participant Block as Block author
participant RT as Runtime (pallet-midnight)
Client->>Pool: Submit unsigned proof tx
Pool->>Pool: Well-formedness validation
alt Invalid
Pool-->>Client: Reject
else Valid
Pool->>Block: Candidate for inclusion
Block->>RT: Execute in block
RT->>RT: Full proof verification
RT->>RT: State transition + commit
end
3. Block inclusion
A block producer (AURA validator) includes the transaction in a new block.
4. Runtime verification and execution
pallet-midnight:
- Fully verifies the embedded cryptographic proof (native libraries).
- If valid, executes the corresponding state transition.
- Commits the updated state to on-chain storage.
5. Finality
Block may be finalized asynchronously via GRANDPA after inclusion.
Comparison: pool vs runtime checks
| Check | Where | What |
|---|---|---|
| Well-formedness | Transaction pool | Structure, basic validity |
| Proof verification | Runtime (pallet-midnight) | Full cryptographic validation |
| State transition | Runtime | ZSwap / contract state update |
| Persistence | Storage layer | Trie + ledger commitment |
Building and submitting txs (dApp context)
For application developers:
| Layer | Skill |
|---|---|
| Prove + submit txs | midnight-js/, 1am-wallet/ |
| Contract logic | compact/ |
| Read results | midnight-indexer/, midnight-rpc/ |
Node operators care about pool sizing, block limits, and RPC submission endpoints.
Related skills
midnight-onchain-logic/—pallet-midnightexecutionmidnight-storage/— how commits are persistedmidnight-consensus/— who includes txs in blocksmidnight-rpc/— submission and state query endpointscompact/— what proofs attest to at the contract level
Related skills
Midnight Environment Setup
Automatically prepare a Midnight dev environment — Compact, PATH, Docker, proof server, and VS Code extension. Run before building or deploying.
Why Midnight
What Midnight is, why it exists, and how it works — public/private state, selective disclosure, and ZK proofs.
ZK vs FHE vs MPC
Compare ZK, FHE, and MPC for privacy-focused DApps — tradeoffs, platforms, and why Midnight uses zk-SNARKs.
Compact
The Compact smart contract language for Midnight Network. TypeScript-like DSL that compiles to ZK circuits.