bitcoin-utility-belt
v2.3.6
Published
Bitcoin Utility Belt is a client-side Bitcoin JavaScript library
Downloads
21
Maintainers
Readme
Bitcoin Utility Belt
I've made this project to make easy to use a lot of Bitcoin functions that you need to build a website or a NodeJS application. You can read the examples to find out how to use it! Feel free to contribute with code or a donation!
Readme Index
- NodeJS Installation
- Browser Installation
- How to compile a new browser version
- Functions
- Examples
- Random Wallet Generator
- Contributing
- Donate
- License
NodeJS Installation
You just need to install the npm package to your project.
npm install bitcoin-utility-belt --save
Here is an example:
// import bitcoin utility belt
let belt = require("bitcoin-utility-belt");
// creating random wallets
// type: P2PK (default)
let wallet = belt.wallet.create();
console.log(wallet);
Browser Installation
You just need to import the /dist/bitcoin-utility-belt.js
to your HTML to have access to the functions.
Here is an example:
<!-- Importing Bitcoin Utility Belt script -->
<script src="../../dist/bitcoin-utility-belt.min.js"></script>
<script>
// creating random wallets
// type: P2PK (default)
var wallet = belt.wallet.create();
console.log(wallet);
</script>
How to compile a new browser version
You have already a compiled version in the directory /dist
(extended and minified files).
But if you want to compile for your self run the script:
npm run build
Functions
The list below should be very easy to understand. Some of them interact (via HTTPS) with a 3rd Party Blockchain Provider (3PBP). I've made HTML and NodeJS examples, so you can understand how it works!
Blockchain (3PBP)
- Get Address Info [HTML example] [NodeJS example]
- Get Blocks Info [HTML example] [NodeJS example]
- Get Blockchain Pools Info [HTML example] [NodeJS example]
- Search for OP_RETURN texts [HTML example] [NodeJS example]
- Get Blockchain Statistics [HTML example] [NodeJS example]
- Get Blockchain Totals Info [HTML example] [NodeJS example]
Messages
- Sign and Verify Messages [HTML example] [NodeJS example]
Wallets
- Creating Wallets (P2PKH, P2SH, P2WPKH and P2WSH) [HTML example] [NodeJS example]
- Creating Brain Wallet [HTML example] [NodeJS example]
- Creating and Validating Mnemonic Words [HTML example] [NodeJS example]
- Create MultiSig Address [HTML example] [NodeJS example]
- Creating Seed (bip32 format) [HTML example] [NodeJS example]
- Creating Seed (bip44 format) [HTML example] [NodeJS example]
- Creating Seed (bip49 format) [HTML example] [NodeJS example]
- Encrypt and Decrypt Private Key (bip38) [HTML example] [NodeJS example]
- Recover Address from Private Key (WIF format) [HTML example] [NodeJS example]
- Recover Wallets from Seed [HTML example] [NodeJS example]
- Validate Wallet Address [HTML example] [NodeJS example]
Examples
- Random Wallet Generator: [Github Code] [Live Coding Video]
Contributing
I'll be glad to receive new pull requests to improve this project! Feel free to contribute!
Donate BTC
If you really liked the project and want to donate, here is the official wallet for this project.
Official Wallet: 18kXMmrDtgfeQgVmwfmygTaYLyQuVS4chK