clearing.create_contract
Create a worker contract; return its contract ID (escrow_id) and Lightning funding invoice (invoice). Requires fresh buyer NIP-98 authentication. New request IDs create separate contracts even for the same task_hash; byte-identical retries by the same buyer reuse the contract and its unexpired invoice. Funds remain merchant-controlled; an unpaid invoice is not funding. No automated payouts. Note: Contract state polling, listing, cancellations, and automated refunds are intentionally disabled in this namespace by design to enforce strict manual payout verification and prevent automated drain attacks.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"worker_pubkey": "<worker_pubkey>",
"task_hash": "<task_hash>",
"amount_sats": "<amount_sats>"
},
"name": "clearing.create_contract"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_hash | Yes | Task commitment as exactly 64 lowercase hexadecimal characters (32 bytes), without a 0x prefix. When production settlement is enabled, its numeric value must be less than 21888242871839275222246405745257275088548364400416034343698204186575808495617. | |
| amount_sats | Yes | Contract funding amount in whole satoshis: an integer from 1 through 9007199254740 inclusive. Fractional satoshis are not accepted. | |
| worker_pubkey | Yes | Worker's Nostr public key: exactly 64 lowercase hexadecimal characters (32-byte x-only secp256k1 key), without a 0x prefix. Must represent a valid curve point. |