Skip to content

flick-ing/inscriptions

Repository files navigation

@bitflick/inscriptions

CI Changesets npm version npm downloads license

TypeScript library for Bitcoin inscriptions and Ordinals/BRC-20 tooling, published as @bitflick/inscriptions on npm.

The library builds Taproot inscription funding, reveal, and refund transactions; supports parent inscription flows and batching helpers; includes network helpers for mainnet, testnet, testnet4, and regtest; and provides mempool.space broadcast/funding utilities.

npm download counts are useful package-usage evidence, not a unique-user count.

Installation

npm install @bitflick/inscriptions

Concise Usage

import {
  broadcastTx,
  bitcoinToSats,
  generateFundableGenesisTransaction,
  generatePrivKey,
  generateRevealTransaction,
  waitForInscriptionFunding,
} from "@bitflick/inscriptions";

const funding = await generateFundableGenesisTransaction({
  address: "bc1p...",
  inscriptions: [
    { content: Buffer.from("Hello, Ordinals"), mimeType: "text/plain" },
  ],
  network: "mainnet",
  privKey: generatePrivKey(),
  feeRate: 10,
  tip: 10_000,
  padding: 546,
});

const [txid, vout] = await waitForInscriptionFunding(
  funding.inscriptionUtxo,
  funding.network
);

const revealTx = await generateRevealTransaction({
  inputs: [
    {
      amount: Number(bitcoinToSats(funding.fundingAmountBtc)),
      cblock: funding.initCBlock,
      leaf: funding.initLeaf,
      script: funding.initScript,
      padding: funding.padding,
      secKey: funding.secKey,
      tapkey: funding.initTapKey,
      txid,
      vout,
      inscriptions: funding.writableInscriptions,
      rootTapKey: funding.initTapKey,
    },
  ],
  feeRateRange: [10, 25],
  feeTarget: 10_000,
});

await broadcastTx(revealTx, funding.network);

See the package README for a longer walkthrough: packages/inscriptions/README.md.

Supported Workflows

  • Create fundable genesis transactions for one or more inscriptions.
  • Generate reveal transactions from funded inscription UTXOs.
  • Generate refund transactions for unspent inscription outputs.
  • Work with parent inscription metadata and grouped funding inputs.
  • Broadcast raw transactions and poll for inscription funding through mempool.space.
  • Test flows against regtest using the checked-in integration test package.

Public API Overview

The package exports transaction builders, network helpers, mempool helpers, grouping utilities, refund support, and shared TypeScript types from packages/inscriptions/src/index.ts.

Key entry points include:

  • generateFundableGenesisTransaction
  • generateRevealTransaction
  • generateRefundTransaction
  • broadcastTx
  • waitForInscriptionFunding
  • generatePrivKey
  • networkNamesToTapScriptName

Release and Compatibility

Packages

Package Description NPM
@bitflick/inscriptions A Node.js TypeScript library for creating Bitcoin inscriptions (BRC20) and interacting with ordinals. npm
@bitflick/tsconfig Shared TypeScript base configuration for all bitflick packages. npm

Monorepo Development

Extend the shared TypeScript configuration in your tsconfig.json:

{
  "extends": "@bitflick/tsconfig/tsconfig.base.json",
  "compilerOptions": {
    /* your overrides */
  }
}

Contributing

Please see CONTRIBUTING.md for guidelines on contributing, reporting issues, and release process.

Code of Conduct

This project and its contributors abide by the Code of Conduct.

Security

See SECURITY.md for reporting security vulnerabilities.

License

This project is licensed under the terms of the MIT License.

About

TypeScript library for Bitcoin inscriptions and Ordinals/BRC-20 tooling, published as @bitflick/inscriptions on npm.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

23 stars

Watchers

2 watching

Forks

Sponsor this project

Packages

 
 
 

Contributors