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