midnight_call_contract
Execute circuit calls on deployed Midnight smart contracts: public reads, private ZK-proof operations, or state-changing transactions. Supports simulated calls without submission.
Instructions
Execute a circuit call on a deployed Midnight smart contract.
Circuit Types:
Public circuits: Read-only operations that don't modify state
Private circuits: Operations with private witnesses and ZK proofs
State-changing circuits: Modify ledger state (requires wallet)
Call Process:
Load contract at specified address
Prepare circuit arguments
Generate ZK proof (if required)
Submit transaction
Return result or state changes
Privacy Features:
Private inputs are never revealed on-chain
ZK proofs validate computation without exposing data
Private state is stored locally with
private_state_id
Example:
midnight_call_contract({
contract_address: "0x123...",
circuit_name: "transfer",
arguments: {
to: "0xabc...",
amount: 100
}
})Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| contract_address | No | Address of the deployed contract | |
| circuit_name | No | Name of the circuit to call | |
| arguments | No | ||
| private_state_id | No | ||
| network | No | Target network | |
| wallet_seed | No | ||
| simulate | No | Simulate the call without submitting transaction |