Overview

KNS Inscription Mechanism

KNS uses a two-step "Commit-Reveal Scheme" to embed data into the Kaspa network:

Commit Transaction: A hashed "Redeem Script" is created and stored on-chain, serving as a placeholder for the data.

Reveal Transaction: The data is revealed by spending the output of the commit transaction, making the content visible on-chain.

The mechanism supports structured "envelopes" to encapsulate data, ensuring compatibility and ease of retrieval. For KNS-specific data, the identifier "kns" is included in the envelope.

This process enables secure and organized insertion of arbitrary data into the Kaspa network.

Supported operations timeline

  • op transfer (only pubkey wallet types). Blue score: 105161880

  • op transfer for all wallet types. Blue score: 148303448

  • op send. Blue score: 106102538

  • op list. Blue score: 106102471

Prerequisites

  • The Kaspa wasm package, which can be gotten here. Example usage below:

import {
  Opcodes,
  ScriptBuilder,
  XOnlyPublicKey,
  type HexString,
} from "wasm/nodejs/kaspa/kaspa";

The KNS Resolver utilizes Supertypo's Simply-Kaspa-Indexer

Link: https://github.com/supertypo/simply-kaspa-indexer

Last updated