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.
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.
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
Install Txforge with the command below or
yarn add txforge.npm install txforgeImport
forgeTx,toUTXOandcasts; convert the UTXO data into the object required by Txforge.Configure
forgeTxwith an unlocking input, the desired output casts and change address.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.
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

