encode_op_return
Encode arbitrary data into Bitcoin OP_RETURN scripts for blockchain storage. Converts text or hex data into the required script format to embed information on-chain.
Instructions
Encode arbitrary data into OP_RETURN script format.
Args:
data: Data to encode (string)
encoding: Encoding for the data ('utf-8', 'hex'). Default: 'utf-8'
Returns:
Dictionary with 'script_hex' containing the OP_RETURN script.
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": {
"data": "<data>"
},
"name": "encode_op_return"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | ||
| encoding | No | utf-8 |