OpenViSTAI · Agents · Blockchain · Crypto
Menu
Developer Tools

Txforge

Txforge is an open-source JavaScript library for composing and signing Bitcoin transactions from UTXO inputs, configured outputs and script casts. Built on nimble, it can produce transaction hex for a separate transaction processor and documents support for custom script templates.

Independent OpenViST project profile, based on linked sources.

Txforge — OpenViST project profile in Developer Tools.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use Txforge when a JavaScript application needs to assemble Bitcoin transactions from UTXO data and configured scripts, with a separate processor handling submission.

Who it is for

  • JavaScript developers building Bitcoin wallet or payment applications.
  • Developers who need transaction construction with custom locking or unlocking scripts.

Documented uses

  • Convert UTXO details into inputs for a transaction.
  • Configure transaction outputs, including P2PKH and OP_RETURN examples.
  • Build and sign a transaction and retrieve its hexadecimal representation.
  • Define custom casts for script templates beyond the standard examples.
Before you choose

Requirements & limits

The repository identifies Txforge as open source under the Apache-2.0 license. It documents installation through npm or Yarn and browser use through a CDN.

  • Txforge 2.0 is built on nimble; the README notes API changes from earlier versions, particularly around casts.
  • The example requires UTXO data and a private key for signing.
  • The library returns transaction hex; submission is left to a transaction processor.
  • The README provides both package-manager installation and browser CDN options.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Install Txforge and construct a signed transaction

Use the README's JavaScript example to assemble a transaction from UTXO data and produce its hexadecimal representation.

Before you start

  • A JavaScript project with Txforge installed using npm or Yarn.
  • UTXO transaction ID, output index, amount in satoshis and locking script.
  • A private key for the example's P2PKH unlocking cast, plus output and change addresses.

Steps

  1. Install Txforge with the command below or yarn add txforge.

    Documented command
    npm install txforge
  2. Import forgeTx, toUTXO and casts; convert the UTXO data into the object required by Txforge.

  3. Configure forgeTx with an unlocking input, the desired output casts and change address.

  4. Read the built and signed transaction as hexadecimal with tx.toHex().

Expected outcome

A built and signed transaction represented as hex, ready to be sent to a transaction processor.

Guide limitations

  • The example assumes the application supplies the UTXO data, signing key, and transaction destinations.
  • Txforge constructs the transaction; the README identifies submission to a transaction processor as a separate next step.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
16 October 2026
Original website title
libitx/txforge · Official homepage title · retained in its source language