Cross-chain intent protocol connecting Midnight with EVM and non-EVM blockchains, powered by Pelagos consensus.
This project is built on the Midnight Network.
Pintent enables cross-chain token transfers from Midnight to any blockchain through an intent-based model. Users lock tNIGHT on Midnight and specify a destination — competitive solvers deliver tokens on the target chain — and a deterministic appchain on Pelagos orchestrates verification and settlement.
The protocol is chain-agnostic by design: the Pelagos multichain oracle already supports EVM chains, Solana, and Midnight, with Cardano and Bitcoin planned. Solvers operate on destination chains natively, meaning Pintent can bridge to any chain that Pelagos can observe.
Midnight Pelagos Destination Chain
┌────────────────┐ ┌──────────────────┐ ┌──────────────┐
│ │ │ │ │ Ethereum │
│ User locks │ block │ Appchain │ │ Solana │
│ tNIGHT in │──sync──▶│ detects intent │ │ Cardano │
│ bridge.compact│ │ status: Open │ │ Bitcoin │
│ │ │ │ query │ any L1/L2 │
│ │ │ Solvers watch │◀─────────│ │
│ │ │ open intents │ │ Solver │
│ │ │ │ │ delivers │
│ Contract │◀─settle─│ Validates fill │◀──fill───│ tokens │
│ marks intent │ │ status: Settled │ │ │
│ FULFILLED │ │ │ │ │
└────────────────┘ └──────────────────┘ └──────────────┘
- User creates intent on Midnight — locks tNIGHT in the bridge contract, specifies destination chain and address
- Pelagos oracle syncs the Midnight block, appchain detects the new intent
- Solver queries open intents via JSON-RPC, evaluates profitability
- Solver delivers tokens on the destination chain (EVM, Solana, Cardano, etc.)
- Appchain validates the delivery and authorizes fulfillment on Midnight
- Bridge contract verifies authorization and marks the intent fulfilled
If no solver fills before the deadline, the user can cancel and reclaim their tNIGHT.
The bridge contract is written in Compact — Midnight's zero-knowledge smart contract language.
| Circuit | Who | Description |
|---|---|---|
createIntent |
Any user | Locks tNIGHT, stores intent on public ledger, returns intent ID |
fulfillIntent |
Validator set | Verifies authorization proof, marks intent as fulfilled |
cancelIntent |
Intent creator | Refunds locked tNIGHT back to creator |
updateValidatorKey |
Admin | Rotates the validator-set public key |
All intent data lives on Midnight's public ledger (disclosed state), queryable via the indexer:
| Field | Type | Description |
|---|---|---|
intentAmounts |
Map<Field, Uint<64>> |
Intent ID to locked tNIGHT amount |
intentDestAddresses |
Map<Field, Bytes<32>> |
Intent ID to destination address |
intentDestChains |
Map<Field, Bytes<32>> |
Intent ID to target chain |
intentStatuses |
Map<Field, IntentStatus> |
PENDING / FULFILLED / CANCELLED |
intentCreators |
Map<Field, Bytes<32>> |
Intent ID to creator address |
validatorKey |
Bytes<32> |
Public key for fulfillment authorization |
createIntent() fulfillIntent()
PENDING ───────────────▶ FULFILLED
│
│ cancelIntent()
▼
CANCELLED (tNIGHT refunded)
Pintent relies on the Pelagos network for cross-chain coordination:
- Multichain oracle — syncs Midnight blocks and contract actions into SQLite via GraphQL indexer
- Intent appchain — deterministic state machine that manages the intent lifecycle across chains
- Validator set — distributed key management for authorizing cross-chain fulfillment
The appchain consumes finalized Midnight blocks from the oracle, detects contract actions on the bridge contract, and coordinates with solvers who operate on destination chains.
| Chain | Status |
|---|---|
| Ethereum + L2s (Arbitrum, Optimism, Base, etc.) | Supported |
| Solana | Supported |
| Cardano | Planned |
| Bitcoin | Planned |
The intent model is chain-agnostic — adding a new destination chain requires only that the Pelagos multichain oracle can observe it and solvers can operate on it. No changes to the Midnight contract are needed.
pintent/
├── contracts/
│ └── midnight/
│ ├── src/
│ │ ├── bridge.compact # ZK bridge intent contract
│ │ ├── witnesses.ts # Witness implementations
│ │ └── index.ts # Re-exports
│ ├── package.json
│ └── tsconfig.json
└── docs/
├── architecture.md # System design
├── protocol.md # Intent protocol specification
└── midnight-bridge.md # Midnight integration details
cd contracts/midnight
npm install
npm run build # compactc compile + tscRequires Compact compiler v0.21.0+.
- Midnight bridge contract: deployed on Preprod
- EVM destination chains: supported (Ethereum, L2s)
- Solana destination chains: supported
- Cardano, Bitcoin: planned
- Appchain: private repository (closed source)
- Fulfillment authorization: signature scheme under development