Skip to content

Conversation

@timkon99
Copy link

@timkon99 timkon99 commented Nov 6, 2025

Summary

Added a new example script example-sign-transaction.js under /src/
to demonstrate how to sign a basic Bitcoin transaction using bitcoinjs-lib.

Details

  • Utilizes Psbt for transaction construction and signing.
  • Generates a random key pair using ECPairFactory(tinysecp256k1).
  • Uses Testnet for safety and demonstration purposes.
  • Includes console outputs for both signed TX hex and sender address.

Motivation

While the README and docs describe the PSBT API, there was no minimal,
ready-to-run code example showing the full signing process.
This addition should help developers quickly understand
how to build and sign transactions in a test environment.

Notes

  • Compatible with Node.js LTS (ESM format)
  • Verified on bitcoinjs-lib v7.0.0

@timkon99 timkon99 closed this Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant