create_contract_a
Create a Mode A escrow contract that locks payment and releases it instantly when the worker submits the pre-agreed SHA-256 hash, enabling trustless settlement for deterministic deliverables.
Instructions
Create a Mode A (Hash-verified settlement) Idios escrow contract.
Locks payment from your wallet. The expected output hash is locked in at creation time. When the worker submits the same hash, the contract auto-settles and releases payment. No human approval needed.
Use Mode A for deterministic outputs where the exact deliverable is agreed before the contract starts: a specific model file, dataset, or any output with a known SHA-256 hash.
Both parties must agree on result_hash before the contract is created. The worker should send you the hash of their deliverable in advance for you to verify before locking it in.
Args: job_id: Unique integer ID you choose. Must not already exist on chain. worker_pubkey: Worker's Beam pubkey from their Idios dapp or get_key action. payment: Payment amount in groth (1 BEAM = 100,000,000 groth). asset_id: 0 for BEAM, 47 for NPH (USD-pegged stablecoin). expiry_block: Block height after which the requester can refund. A committed worker who has not delivered by then forfeits their collateral to the treasury. Use current_block + 10000 for ~7 days. result_hash: SHA-256 hash of the expected deliverable file (64-char hex string). required_collateral: Minimum collateral in groth the worker must commit. The contract rejects any commit below this floor. 0 (default) = no floor. spec_hash: Optional SHA-256 hash (64 char hex) of the job specification, stored on chain for later reference. Omit or pass "" for none. subnet_id: Subnet identifier (default 1). epoch: Epoch (default 1).
Returns confirmation once contract is on chain, or error message.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| epoch | No | ||
| job_id | Yes | ||
| payment | Yes | ||
| asset_id | Yes | ||
| spec_hash | No | ||
| subnet_id | No | ||
| result_hash | Yes | ||
| expiry_block | Yes | ||
| worker_pubkey | Yes | ||
| required_collateral | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |