Inscriptions

Inscriptions write data permanently to the blockchain using OP_RETURN outputs. They cost 0 satoshis (beyond the transaction fee) and are immutable once confirmed.

Text Inscription

const result = await wallet.inscribeText('Hello blockchain!')

console.log('TXID:', result.txid)
console.log('Type:', result.type)       // 'text'
console.log('Size:', result.dataSize)   // 17
console.log('Basket:', result.basket)   // 'text'

JSON Inscription

const result = await wallet.inscribeJSON({
  title: 'My Document',
  author: 'Alice',
  created: Date.now()
})

console.log('Type:', result.type)       // 'json'
console.log('Basket:', result.basket)   // 'json'

File Hash Inscription

Inscribe a SHA-256 hash of a file for proof-of-existence:

The hash must be a 64-character hexadecimal string (SHA-256). The method validates the format and throws if invalid.

Image Hash Inscription

Same as file hash, but stored in a separate basket for organization:

Custom Baskets

All inscription methods accept an optional basket override:

Default Baskets

Method
Default Basket

inscribeText()

'text'

inscribeJSON()

'json'

inscribeFileHash()

'hash-document'

inscribeImageHash()

'hash-image'

InscriptionResult

Under the Hood

Inscriptions use the send() method internally with a data-only output:

The output script is: OP_FALSE OP_RETURN <data_bytes>

Last updated