https://github.com/coolcode/crypto-geek-js
Bitcoin Geek Scripts
https://github.com/coolcode/crypto-geek-js
Last synced: 7 months ago
JSON representation
Bitcoin Geek Scripts
- Host: GitHub
- URL: https://github.com/coolcode/crypto-geek-js
- Owner: coolcode
- Created: 2024-06-09T14:03:31.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-16T13:43:28.000Z (over 1 year ago)
- Last Synced: 2025-04-11T04:06:08.248Z (9 months ago)
- Language: TypeScript
- Size: 44.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Crypto Geek JS
## Examples
### BTC HD Wallet
This example aims to generate a Bitcoin address using multiple methods and verify if they produce the same one.
```javascript
const mnemonic = '...'
const purpose = "86" //BIP44 (44), segwit (49), Native segwit (84), Bitcoin taproot (86)
const network = bitcoin.networks.bitcoin
const wallet = new BitcoinWallet(mnemonic, purpose, network)
const account = wallet.createAccount()
const keyPair = bip32.fromPrivateKey(account.privateKey, Buffer.alloc(32), network)
const { address } = bitcoin.payments.p2tr({
internalPubkey: toXOnly(keyPair.publicKey),
network
})
```
## Quickstart
To install dependencies:
```bash
bun i
```
To run an example:
```bash
bun run examples/taproot.example.ts
```
To run tests:
```bash
bun test
```
This project was created using `bun init` in bun v1.0.2. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.