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.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | ||
| encoding | No | utf-8 | |
| use_envelope | No | ||
| envelope_type | No | raw |