build_op_return_transaction
Constructs OP_RETURN output data for embedding information in Bitcoin transactions, preparing the script for inclusion without creating or broadcasting the transaction.
Instructions
Construct OP_RETURN output data for a transaction.
This prepares the data for inclusion in a transaction but does not
create or broadcast the transaction itself.
Args:
data: Data to embed
encoding: Data encoding ('utf-8' or 'hex')
use_envelope: Whether to wrap in BTCD envelope format
envelope_type: Envelope type if use_envelope is True
('raw', 'text', 'json', 'hash', 'token', 'file')
Returns:
Dictionary with 'script_hex' for the OP_RETURN output.
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": "build_op_return_transaction"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | ||
| encoding | No | utf-8 | |
| use_envelope | No | ||
| envelope_type | No | raw |