get_puzzle_and_solution
Retrieve the CLVM puzzle and solution for a spent coin by passing its coin ID and exact spent_block_index; use get_coin_record_by_name first to obtain the required height.
Instructions
Get the puzzle (CLVM program) and solution for a coin that was spent at a specific height. The puzzle defines the coin's spending rules, and the solution is the input that satisfied those rules. Only works for coins that have been spent. ⚠️ height MUST be the coin's spent_block_index — call get_coin_record_by_name first to obtain it. Passing the current height or confirmed_block_index fails with INVALID_HEIGHT_FOR_COIN (upstream nodes) or PUZZLE_SOLUTION_FAILED (Coinset — which returns this code for ALL failure cases including wrong height and unspent coins).
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": {
"coin_id": "<coin_id>",
"height": "<height>"
},
"name": "get_puzzle_and_solution"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| height | Yes | Must be exactly the spent_block_index from the coin's record (get_coin_record_by_name) — NOT the current chain height and NOT confirmed_block_index. Any other value fails with INVALID_HEIGHT_FOR_COIN. | |
| coin_id | Yes | The coin ID of the spent coin (0x-prefixed, 32 bytes hex) |