铭文
Inscriptions inscribe gros with arbitrary content, creating groestlcoin-native digital artifacts, more commonly known as NFTs. Inscriptions do not require a sidechain or separate token.
These inscribed gros can then be transferred using groestlcoin transactions, sent to groestlcoin addresses, and held in groestlcoin UTXOs. These transactions, addresses, and UTXOs are normal groestlcoin transactions, addresses, and UTXOS in all respects, with the exception that in order to send individual gros, transactions must control the order and value of inputs and outputs according to ordinal theory.
铭文内容是基于万维网标准的。铭文由内容类型(也称为 MIME 类型)和内容本身(字节串)组成。这允许从 Web 服务器返回铭文内容,并用于创建和使用HTML铭文并重新混合其他铭文内容。
铭文内容完全在链上,存储在taproot script-path spend脚本中。 Taproot 脚本对其内容的限制很少,并且额外获得见证折扣,使得铭文内容存储相对经济。
因为taproot script-path spend脚本只能从现有的 taproot 输出中产生,因此使用两阶段commit/reveal过程进行铭刻。首先,在commit中,创建一个提交到包含铭文内容的脚本的taproot 输出。 其次,在reveal交易中,使用commit交易产生的输出,来显示链上的铭文内容。
铭文内容使用未执行条件中的数据推送进行序列化,称为“信封”。信封由 OP_FALSE OP_IF … OP_ENDIF 组成,包装任意数量的数据推送。因为信封实际上是空操作,所以它们不会改变包含它们的脚本的语义,并且可以与任何其他锁定脚本结合使用。
包含字符串“Hello, world!”的文本铭文 序列化如下:
OP_FALSE
OP_IF
OP_PUSH "ord"
OP_PUSH 1
OP_PUSH "text/plain;charset=utf-8"
OP_PUSH 0
OP_PUSH "Hello, world!"
OP_ENDIF
首先字符串ord
被推送,以消除铭文与信封其他用途的歧义。
OP_PUSH 1
indicates that the next push contains the content type, and OP_PUSH 0
indicates that subsequent data pushes contain the content itself. Multiple data pushes must be used for large inscriptions, as one of taproot's few restrictions is that individual data pushes may not be larger than 520 bytes.
The inscription content is contained within the input of a reveal transaction, and the inscription is made on the first gro of its input. This gro can then be tracked using the familiar rules of ordinal theory, allowing it to be transferred, bought, sold, lost to fees, and recovered.
内容
铭文的数据模型是 HTTP 响应的数据模型,允许铭文由网络服务器提供服务并在网络浏览器中查看的内容。
字段
铭文可以在可选主体之前包含字段。每个字段都包含两个数据推送,一个标签和一个值。
目前,唯一定义的字段是‘content-type’,标签为‘1’,其值是正文的 MIME 类型。
正文的开头和字段的结尾用'空数据'指示推送。
无法识别的标签的解释不同,取决于它们是否是偶数或奇数,遵循闪电网络"可以是奇数"的规则。
甚至标签也用于可能影响创建、初始分配的字段,或铭文的转移。因此,即使无法识别的铭文,字段也必须显示为"未绑定",即没有位置。
奇数标签用于不影响创建、初始的字段,分配或转移,例如附加元数据,因此是选择忽略是安全的。
铭文身份ID
铭文包含在揭示交易的输入中。为了唯一地识别他们,他们被分配了一个以下形式的 ID:
521f8eccffa4c41a3a7728dd012ea5a4a02feed81f41159231251ecf1e5c79dai0
i
的前面部分是交易ID (txid
),在i
之后的数字定义了新的铭文在交易总被铭刻的索引的位置 (从 0 开始)
铭文可以位于同一输入中的不同输入中,可以是同一个输入或两者的组合。在任何情况下,顺序都是明确的,因为解析器将连续检查输入并查找所有铭文信封
Input | Inscription Count | Indices |
---|---|---|
0 | 2 | i0, i1 |
1 | 1 | i2 |
2 | 3 | i3, i4, i5 |
3 | 0 | |
4 | 1 | i6 |
沙盒化
HTML 和 SVG 铭文被沙箱化,以防止引用链下内容,从而保持铭文的不可变性和独立性。
这是通过在“iframes”中加载 HTML 和 SVG 铭文来完成的sandbox
属性,以及提供铭文内容Content-Security-Policy”标头。