KNS Docs
  • KNS Documentation
  • Introduction
  • How to Use KNS
    • Step by Step Tutorial
    • Search
    • .kas Inscribe Tool
    • Text Inscribe Tool
    • Dashboard
  • OTHERS
    • Supporting Wallet
    • FAQ
  • Fee Model
  • Reserved List
  • KNS Indexer API
  • Ownership
    • Verfied Domains
    • First Come First Served
  • Inscriptions
    • Overview
    • Operations
      • Create
      • Send
      • List
      • Transfer
Powered by GitBook
On this page
  • Text inscriptions
  • Typescript example
  • Domain inscriptions
  • Standard
  • Rules
  • Pricing
  • Typescript example
  • Inscriptions of other mimeTypes
  • Typescript example
  1. Inscriptions
  2. Operations

Create

Text inscriptions

Inscribe general texts and content on Kaspa.

Typescript example

const data = "abc";
const buf = Buffer.from(data);
const script = new ScriptBuilder()
  .addData(XOnlyPublicKey.fromAddress(account).toString())
  .addOp(Opcodes.OpCheckSig)
  .addOp(Opcodes.OpFalse)
  .addOp(Opcodes.OpIf)
  .addData(Buffer.from("kns"))
  .addI64(0n)
  .addData(buf)
  .addOp(Opcodes.OpEndIf);

Domain inscriptions

Create domains on Kaspa.

Standard

Any characters outside this standard will not be verified.

Rules

    • For example: '🏳️‍🌈' has a visual character length of 1

  • Domains are registered in a first-come, first-serve basis

  • Fees have to be paid to the KNS receiving address in output 0 of the reveal transaction

    • Testnet 10 payment address: kaspatest:qq9h47etjv6x8jgcla0ecnp8mgrkfxm70ch3k60es5a50ypsf4h6sak3g0lru

    • Mainnet: kaspa:qyp4nvaq3pdq7609z09fvdgwtc9c7rg07fuw5zgeee7xpr085de59eseqfcmynn

  • JSON format

    key
    required
    description

    op

    yes

    operation. "create"

    v

    yes

    inscription value. length has to be greater than 1.

    p

    yes

    protocol. "domain"

    s

    no

    the top level domain, defaults to kas, currently only supports kas

Pricing

  • Mainnet (price in kaspa). char indicates character length of the string

    1 char
    2 char
    3 char
    4 char
    5 char

    Price

    4200

    4200

    2100

    525

    35

Typescript example

This would create a example.kas domain

const data = JSON.stringify(
  { op: "create", p: "domain", v: "example" },
  null,
  0
);
const buf = Buffer.from(data);
const script = new ScriptBuilder()
  .addData(XOnlyPublicKey.fromAddress(account).toString())
  .addOp(Opcodes.OpCheckSig)
  .addOp(Opcodes.OpFalse)
  .addOp(Opcodes.OpIf)
  .addData(Buffer.from("kns"))
  .addI64(0n)
  .addData(buf)
  .addOp(Opcodes.OpEndIf);

Inscriptions of other mimeTypes

  • hex string of the file data

Typescript example

const mimeType = "image/jpeg";
const data = (file as Buffer).toString("hex");
const script = new ScriptBuilder()
  .addData(XOnlyPublicKey.fromAddress(account).toString())
  .addOp(Opcodes.OpCheckSig)
  .addOp(Opcodes.OpFalse)
  .addOp(Opcodes.OpIf)
  .addData(Buffer.from("kns"))
  .addOp(1)
  .addOp(1)
  .addData(Buffer.from(mimeType))
  .addI64(0n)
  .addData(data)
  .addOp(Opcodes.OpEndIf);
PreviousOperationsNextSend

Last updated 3 months ago

Domains follow the same standard as

We use the to normalize the domain name.

Price is calculated based on the visual character length of the domain. See

We use to calculate the character length

ENS
ENS library
here
graphemer