View Source BitcoinLib.Script.Opcodes.FlowControl.Return (BitcoinLib v0.4.7)

Based on https://en.bitcoin.it/wiki/Script

Word OP_RETURN Opcode 106 Hex 0x6a Input Nothing Output fail Description Marks transaction as invalid. Since bitcoin 0.9, a standard way of attaching extra data to transactions is to add a zero-value output with a scriptPubKey consisting of OP_RETURN followed by data. Such outputs are provably unspendable and specially discarded from storage in the UTXO set, reducing their cost to the network. Since 0.12, standard relay rules allow a single output with OP_RETURN, that contains any sequence of push statements (or OP_RESERVED[1]) after the OP_RETURN provided the total scriptPubKey length is at most 83 bytes.

Link to this section Summary

Functions

Returns <<0x6a>>

Marks transaction as invalid. Since bitcoin 0.9, a standard way of attaching extra data to transactions is to add a zero-value output with a scriptPubKey consisting of OP_RETURN followed by data. Such outputs are provably unspendable and specially discarded from storage in the UTXO set, reducing their cost to the network. Since 0.12, standard relay rules allow a single output with OP_RETURN, that contains any sequence of push statements (or OP_RESERVED[1]) after the OP_RETURN provided the total scriptPubKey length is at most 83 bytes.

v()

Returns 0x6A

Link to this section Types

@type t() :: BitcoinLib.Script.Opcodes.FlowControl.Return

Link to this section Functions

@spec encode() :: <<_::8>>

Returns <<0x6a>>

examples

Examples

iex> BitcoinLib.Script.Opcodes.FlowControl.Return.encode()
<<0x6a>>
@spec execute(t(), list()) :: {:error, binary()}

Marks transaction as invalid. Since bitcoin 0.9, a standard way of attaching extra data to transactions is to add a zero-value output with a scriptPubKey consisting of OP_RETURN followed by data. Such outputs are provably unspendable and specially discarded from storage in the UTXO set, reducing their cost to the network. Since 0.12, standard relay rules allow a single output with OP_RETURN, that contains any sequence of push statements (or OP_RESERVED[1]) after the OP_RETURN provided the total scriptPubKey length is at most 83 bytes.

examples

Examples

iex> stack = [3]
...> %BitcoinLib.Script.Opcodes.FlowControl.Return{}
...> |> BitcoinLib.Script.Opcodes.FlowControl.Return.execute(stack)
{:error, "OP_RETURN has been hit"}
@spec v() :: 106

Returns 0x6A

examples

Examples

iex> BitcoinLib.Script.Opcodes.FlowControl.Return.v()
0x6a