/BitcoinAddress

Script for bitcoin Address

Primary LanguageJavaScript

BitcoinAddress

Script for bitcoin Address code snippet demonstrates the process of:

-Generating a random P2PKH wallet (public address and private key). -Constructing a Bitcoin transaction with a specific input and output. -Signing the transaction using the generated private key. -This code snippet uses the BitcoinJS library for Bitcoin-related operations.

Getting Started -Prerequisites Node.js installed on your machine. -Installation Clone the repository: git clone https://github.com/fahadkabali/BitcoinAddress.git -Navigate to the project directory cd BitcoinAddress -Install dependencies npm install

Usage Runing the code snippet to create a P2PKH wallet and print the public address and private key: First modify the txHex variable in wallet.js with your raw transaction hex. Then run the BitcoinAddress code snippet with node wallet.js

This will print the final signed transaction hex.