address_encode
Convert a puzzle hash to a bech32m Chia address (xch1 or txch1) with local computation and no RPC call, flagging warnings when the prefix differs from the configured network.
Instructions
Convert a puzzle hash to a bech32m Chia address (xch1... for mainnet, txch1... for testnet11). Pure local computation, no RPC call. If you supply a prefix that differs from the configured network (e.g., txch on mainnet), the result includes a warning field — cross-network encoding is allowed but may indicate intent to send to the wrong network. Always use address_decode to validate the prefix before querying the chain.
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>"
},
"name": "address_encode"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prefix | No | Address prefix: 'xch' for mainnet, 'txch' for testnet11. Defaults to current network's prefix. | |
| puzzle_hash | Yes | The puzzle hash to encode (0x-prefixed, 32 bytes hex) |