midnight-transactions
Skill18 starsChanged 18 days agoMITView on GitHub
Midnight transaction lifecycle — proof-based unsigned ledger transactions, transaction pool validation, runtime proof verification, ZSwap and contract operations, and on-chain state commits. Use when explaining how txs differ from standard Substrate signed extrinsics.
In this repository36 other files it gives its agents.
- AGENTS.mdAGENTS.md
- 1am-walletSkill
- android-example-votingSkill
- ankr-midnightSkill
- compactSkill
- dynamic-midnight-walletSkill
- example-counterSkill
- example-hello-worldSkill
- example-leaderboard-dappSkill
- example-locker-dappSkill
- example-passport-dappSkill
- example-payment-dappSkill
- example-private-party-dappSkill
- example-private-reserve-auction-dappSkill
- example-zk-loan-applicationSkill
- gsap-coreSkill
- gsap-utilsSkill
- indexerSkill
- midnight-consensusSkill
- midnight-cryptographySkill
- midnight-environment-setupSkill
- midnight-jsSkill
- midnight-onchain-logicSkill
- midnight-p2p-networkingSkill
- midnight-passportSkill
- midnight-rpcSkill
- midnightskillSkill
- midnight-storageSkill
- multinetworkSkill
- nftSkill
- react-wallet-connectorSkill
- midnight-securitySkill
- testingSkill
- token-transfersSkill
- why-midnightSkill
- zk-vs-fhe-vs-mpcSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 95
If valid, executes the corresponding state transition.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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 --> CommitProof-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
end3. 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
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

