プロパティ

Inscriptions may include CBOR properties, stored as data pushes in fields with tag 17. Since data pushes are limited to 520 bytes, CBOR longer than 520 bytes must be split into multiple tag 17 fields which are then concatenated before decoding.

Properties are a structured counterpart to metadata. While metadata may contain arbitrary CBOR which has no protocol-defined meaning, and is presented on /inscription as free-form HTML, properties have protocol-defined meaning and must conform to a strict schema.

Indefinite-length CBOR types are not supported in properties. All maps, arrays, byte strings, and text strings must be definite.

プロパティ値の非規範的なCDDLスキーマは以下の通りです:

Properties = {
  ? 0: [*Item],
  ? 1: Attributes,
  ? 2: bytes, ; concatenated gallery item transaction IDs
  * any => any,
}

Item = {
  ? 0: bytes .size (32..36),
  ? 1: Attributes,
  ? 2: uint, ; inscription ID index
  * any => any,
}

Attributes = {
  ? 0: text,   ; title
  ? 1: Traits, ; traits
  * any => any,
}

Traits = {
  ; trait names must be unique
  text => Trait,
}

Trait = bool / int / null / text;

上記のCDDLスキーマは便宜上提供されています。いつものように、オーディナルズのリファレンス実装であるordがInscriptionの規範的仕様であり、したがってプロパティフィールドの仕様でもあります。

Fields matching the * any => any wildcard must be accepted but ignored, for compatibility with future additions.

Compression

If the inscription property encoding field, tag 19, is set to "br", the value of the properties field will be decompressed with Brotli.

Inscription properties my be compressed when inscribing with ord wallet inscribe and ord wallet batch with the --compress flag.

To avoid decompression bombs, the maximum size of decompressed properties is 4,000,000 bytes.

To avoid denial-of-service attacks, the maximum compression ratio of decompressed properties is 30:1. So, for example, if the compressed properties are 100 bytes, the maximum size of the decompressed properties is 3,000 bytes.

Inscriptions with any of the below issues are treated by ord as if they have no properties:

  • properties encoding field set to a value other than "br"
  • properties which decompress to over 4,000,000 bytes
  • properties with a compression ratio greater than 30:1

ギャラリー

Inscriptions whose properties field contains Items are galleries.

Galleries contain Items, whose key 0 contains a serialized inscription ID. Inscription ID TXIDiINDEX is serialized as a byte string containing the 32 byte TXID, concatenated with by the four-byte little-endian INDEX. Trailing zeros may be removed from four-byte INDEX, so IDs ending in i0 may be serialized in 32 bytes.

ギャラリーアイテムは、エクスプローラーのInscriptionの/inscriptionページに表示されます。

ギャラリーは、Inscriptionのコレクションを作成する方法を提供するという点で子要素に似ています。ただし、ギャラリーはパーミッションレスです。誰でも任意のInscriptionを含むギャラリーを作成できます。したがって、ギャラリーに含まれることは出所を意味しません。さらに、このため、ギャラリーに含まれてもギャラリーアイテムの/inscriptionページからギャラリーへのバックリンクは作成されません。

ギャラリーは、ord wallet batchでバッチInscriptionを行う際に、バッチファイルのInscriptionエントリのgalleryキーの下に文字列Inscription IDの配列を含めることで作成できます。また、ord wallet inscribe--galleryオプションを使用することでも作成できます。

Item Inscription IDs

Inscription IDs consist of a 32-byte bitcoin transaction ID and an 0-4 byte integer index, defaulting to zero if omitted. Transaction IDs are effectively incompressible, since they are as-if-random cryptographic hash digests.

Interleaving this incompressible data with the rest of the properties CBOR can reduce the compressibility of the entire properties CBOR object.

In order to allow for better compressibility, an alternate encoding of gallery item inscription IDs is allowed. Both schemes are interchangeable and must be accepted and displayed identically.

The inline encoding is described above, where each gallery item's 32 to 36 byte inscription ID is stored under Item key 0.

The packed encoding stores the concatenated 32-byte transaction IDs of all inscription IDs under Properties key 2, with the indices stored as integers under Item key 2. Omitted indices default to the value 0.

Attributes

Attributes are structured metadata that may be attached to both inscriptions and gallery items.

Traits

Traits are a structured counterpart to metadata. While metadata may be arbitrary CBOR, traits are ordered maps of string names to values. Names must be unique, and values may be booleans, integers, null, or strings.