인스크립션

인스크립션(새김)은 임의의 콘텐츠를 SAT에 새겨 넣어 비트코인 고유의 디지털 아티팩트(일반적인 명칭은 NFT)를 생성한다. 인스크립션은 사이드체인이나 별도의 토큰을 필요로 하지 않는다.

이렇게 새겨진 SAT는 비트코인 트랜잭션을 사용해 전송하고, 비트코인 주소로 보내고, 비트코인 UTXO에 보관할 수 있다. 이러한 트랜잭션, 주소, UTXO는 모든 면에서 일반적인 비트코인 트랜잭션, 주소, UTXOs와 동일다. 다만 개별 사토시를 전송하기 위해서는 트랜잭션이 오디널 이론에 따라 입력과 출력의 순서와 값을 제어해야 한다.

인스크립션 콘텐츠 모델은 웹의 콘텐츠 모델이다. 인스크립션은 MIME 유형이라고도 하는 콘텐츠 유형과 바이트 문자열(string)인 콘텐츠 자체로 구성된다. 이를 통해 웹 서버에서 인스크립션 콘텐츠를 반환하고 다른 인스크립션의 콘텐츠를 사용 및 리믹스하는 HTML 인스크립션을 만들 수 있다.

인스크립션 콘텐츠는 전적으로 온체인에 저장되며, 탭루트 스크립트 경로 지출 스크립트에 저장된다. 탭루트 스크립트는 콘텐츠에 대한 제한이 거의 없으며, 추가로 증인 할인(witness discount)을 받을 수 있어 인스크립션 콘텐츠 저장 비용이 상대적으로 저렴하다.

탭루트 스크립트 지출은 기존 탭루트 출력에서만 만들 수 있으므로, 인스크립션은 2단계 커밋/리빌 절차를 사용하여 만들어진다. 먼저 커밋 트랜잭션에서 인스크립션 내용이 포함된 스크립트에 커밋하는 탭루트 출력이 생성된다. 둘째, 리빌 트랜잭션에서는 커밋 트랜잭션에서 생성된 출력이 소비되어 인스크립션 콘텐츠를 온체인에 공개한다.

인스크립션 콘텐츠는 “엔벨롭”(envelope)이라고 하는 실행되지 않은 조건문 내의 데이터 푸시를 사용하여 직렬화된다. 엔벨롭는 데이터 푸시를 원하는 수만큼 감싸는 OP_FALSE OP_IF ... OP_ENDIF로 구성된다. 엔벨롭는 사실상 노옵(no-op)이므로 엔벨롭이 포함된 스크립트의 의미를 변경하지 않으며 다른 로킹(locking) 스크립트와 결합할 수 있다.

“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은 다음 푸시에 콘텐츠 유형이 포함되어 있음을 나타내고, OP_PUSH 0은 후속 데이터 푸시에 콘텐츠 자체가 포함되어 있음을 나타낸다. 탭루트의 몇 가지 제한 사항 중 하나는 개별 데이터 푸시가 520바이트를 초과할 수 없다는 것이므로, 큰 인스크립션에는 여러 개의 데이터 푸시를 사용해야 한다.

The inscription content is contained within the input of a reveal transaction, and the inscription is made on the first sat of its input if it has no pointer field. This sat can then be tracked using the familiar rules of ordinal theory, allowing it to be transferred, bought, sold, lost to fees, and recovered.

콘텐츠

인스크립션의 데이터 모델은 웹 서버에서 인스크립션 콘텐츠를 제공하고 웹 브라우저에서 볼 수 있도록 하는 HTTP 응답의 데이터 모델이다.

필드

인스크립션은 optional body 앞에 필드를 포함할 수 있다. 각 필드는 두 개의 데이터 푸시, 즉 태그 및 값으로 구성된다.

Currently, there are six defined fields:

  • content_type, with a tag of 1, whose value is the MIME type of the body.
  • pointer, with a tag of 2, see pointer docs.
  • parent, with a tag of 3, see provenance.
  • metadata, with a tag of 5, see metadata.
  • metaprotocol, with a tag of 7, whose value is the metaprotocol identifier.
  • content_encoding, with a tag of 9, whose value is the encoding of the body.
  • delegate, with a tag of 11, see delegate.

Body의 시작과 필드의 끝은 빈 데이터 푸시로 표시된다.

인식되지 않는 태그는 라이트닝 네트워크에서 사용하는 "홀수여도 괜찮아" 규칙에 따라 짝수인지 홀수인지에 따라 다르게 해석된다.

인스크립션 생성, 초기 할당 또는 전송에 영향을 줄 수 있는 필드에는 짝수 태그가 사용된다. 따라서 인식할 수 없는 짝수 필드가 있는 인스크립션은 “unbound”, 즉 위치가 없는 상태로 표시되어야 한다.

홀수 태그는 추가 메타데이터와 같이 생성, 초기 할당 또는 전송에 영향을 주지 않는 필드에 사용되므로 무시해도 안전하다.

인스크립션 ID

인스크립션은 리빌 트랜잭션의 입력값에 포함되어 있다. 인스크립션을 고유하게 식별하기 위해 인스크립션에는 이 형식의 ID가 할당된다:

521f8eccffa4c41a3a7728dd012ea5a4a02feed81f41159231251ecf1e5c79dai0

i 앞 부분은 리빌 트랜잭션의 트랜잭션 ID(txid)이다. i 뒤의 숫자는 리빌 트랜잭션에 새겨지는 새 인스크립션의 인덱스(0부터 시작)를 정의한다.

인스크립션은 다른 입력 아니면 동일한 입력 내에 위치하거나 둘 다 일수 있다. 어떤 경우든 구문 분석기는 입력을 연속적으로 살펴보고 모든 인스크립션 ‘엔벨롭’을 찾기 때문에 순서는 명확하다.

입력인스크립션 개수인덱스
02i0, i1
11i2
23i3, i4, i5
30
41i6

Inscription Numbers

Inscriptions are assigned inscription numbers starting at zero, first by the order reveal transactions appear in blocks, and the order that reveal envelopes appear in those transactions.

Due to a historical bug in ord which cannot be fixed without changing a great many inscription numbers, inscriptions which are revealed and then immediately spent to fees are numbered as if they appear last in the block in which they are revealed.

Inscriptions which are cursed are numbered starting at negative one, counting down. Cursed inscriptions on and after the jubilee at block 824544 are vindicated, and are assigned positive inscription numbers.

샌드박싱 (sandboxing)

오프체인 콘텐츠에 대한 참조를 방지하기 위해 HTML 및 SVG 인스크립션은 샌드박스가 적용되어 인스크립션의 변경을 불가능하게 하고 독립적으로 유지될 수 있게 한다.

이는 HTML 및 SVG 인스크립션을 ‘sandbox’ 속성을 사용하여 'iframe' 내에 로드하고 Content-Security-Policy 헤더를 사용하여 인스크립션 콘텐츠를 제공함으로써 수행된다.

Self-Reference

The content of the inscription with ID INSCRIPTION_ID must served from the URL path /content/<INSCRIPTION_ID>.

This allows inscriptions to retrieve their own inscription ID with:

let inscription_id = window.location.pathname.split("/").pop();

If an inscription with ID X delegates to an inscription with ID Y, that is to say, if inscription X contains a delegate field with value Y, the content of inscription X must be served from the URL path /content/X, not /content/Y.

This allows delegating inscriptions to use their own inscription ID as a seed for generative delegate content.

Reinscriptions

Previously inscribed sats can be reinscribed with the --reinscribe command if the inscription is present in the wallet. This will only append an inscription to a sat, not change the initial inscription.

Reinscribe with satpoint: ord wallet inscribe --fee-rate <FEE_RATE> --reinscribe --file <FILE> --satpoint <SATPOINT>

Reinscribe on a sat (requires sat index): ord --index-sats wallet inscribe --fee-rate <FEE_RATE> --reinscribe --file <FILE> --sat <SAT>