coin_id
Compute a Chia coin ID locally from the parent coin ID, puzzle hash, and amount using SHA256, with no RPC call. Verify coin identity before querying or spending.
Instructions
Compute a coin ID from its three components: parent_coin_id (also accepted as parent_coin_info), puzzle_hash, and amount. The coin ID is SHA256(parent_coin_id + puzzle_hash + amount_bytes). Amount is encoded as a big-endian integer with minimal bytes. Pure local computation, no RPC call.
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": {
"puzzle_hash": "<puzzle_hash>",
"amount": "<amount>"
},
"name": "coin_id"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | Yes | The coin amount in mojos (use string for values > 9007199254740991) | |
| puzzle_hash | Yes | The puzzle hash of this coin (0x-prefixed, 32 bytes hex) | |
| parent_coin_id | No | The parent coin's ID (0x-prefixed, 32 bytes hex). Also accepted as parent_coin_info. | |
| parent_coin_info | No | Alias for parent_coin_id — matches the field name used in coin records returned by the RPC. |