MetaID Envelope

Envelope

The MetaID content is entirely on-chain, and the MetaID envelope format currently supports two schemes:

1. Taproot-Script:

By utilizing the Taproot-Script "commit/reveal" scheme, the MetaID envelope is placed in the Taproot script of the input, containing various operations that can be legally executed on MetaID. The convention is to use OP_FALSE OP_IF ... OP_ENDIF to place any non-executable content in the Taproot spending script. The byte " metaid " (6D6574616964 in hexadecimal) is used to identify the envelope as a MetaID protocol.

Taproot-Script Envelope format:

OP_FALSE
OP_IF
	<metaid_flag>
	<operation>
	<path>
	<encryption>
	<version>
	<content-type>
	<payload>
OP_ENDIF

2. Locking-Script:

By utilizing the OpReturn opcode, data is placed after it. The MetaID envelope is placed in the Locking-Script of the transaction output, containing various operations that can be legally executed on MetaID. The convention is to use OP_RETURN to place any non-executable content in the locking output script. The byte " metaid " (6D6574616964 in hexadecimal) is used to indicate that the envelope belongs to the MetaID protocol.

Locking-Script Envelope format:

OP_0
OP_RETURN
	<metaid_flag> 
	<operation>
	<path>
	<encryption>
	<version>
	<content-type>
	<payload>

The envelope must appear after OP_RETURN in the output script and at index 1 of the output. The first satoshi of the UTXO at index 0 is used to carry the envelope content.

Note: If both Taproot-Script and Data-script envelopes exist in the same transaction, the Taproot-Script format takes precedence.

Last updated