Skip to main content
12 votes
Accepted

Byte array to hexadecimal and back again in JavaScript

Here's something you can copy-paste in. byteArray = new Uint8Array([181,143,16,173,231,56,63,149,181,185,224,124,84,230,123,36]); function toHexString(byteArray) { return Array.prototype.map.call(...
Nick ODell's user avatar
  • 29.4k
7 votes
Accepted

Bruteforce bitcoin address - I know the words + public address but not the order

Doing this requires three things: Permutations of the seed words The address you're trying to locate The derivation path for that address. In this specific case, the address is the one this puzzle ...
Raghav Sood's user avatar
  • 17.1k
6 votes
Accepted

how do you sign and verify a message that you own a bitcoin address using javascript?

bitcoinjs-lib and bitcore-lib are both javascript libraries that allow for key signing. For example with bitcore-lib: var Message = require('bitcore-message'); var privateKey = new bitcore....
m1xolyd1an's user avatar
  • 5,666
6 votes
Accepted

What's the POST endpoint to broadcast a transaction in copay's server?

Multisig and singlesig wallets use the same flow. A Tx proposal need to be created in singlesig wallets also. Copay syncronize across devices, so you can have a non-signing copayers in a 1-1 wallet ...
ematiu's user avatar
  • 233
6 votes

Uncaught TypeError: bip32.fromSeed is not a function

I believe by now you should've figured it out but if you haven’t this is how I resolved it. const ecc = require('tiny-secp256k1') const { BIP32Factory } = require('bip32') // You must wrap a tiny-...
iamnotstatic's user avatar
5 votes
Accepted

How do descriptors work with miniscript in the library bitcoinerLab?

Update [2023-Nov-15]: This answer has been updated to reflect the changes in v2 of the library. As the author of the @bitcoinerlab/descriptors library, I'd like to provide some clarification on the ...
landabaso's user avatar
  • 248
4 votes

how to use bitcoin blockchain be useful to authenticate documents?

You can make a transaction with the hash (of the document) as a comment. That would proof that the file existed at that time. It doesn't however magically proof that a document hasn't been changed. ...
Penquin's user avatar
  • 671
4 votes
Accepted

How do I get transactions from the Bitcoin Blockchain with bcoin?

SPV Node SPV node watches your addresses on network broadcasts. So on SPV Nodes you won't be able to grab other transactions then your address. It communicates with other peers, fetches your ...
Node's user avatar
  • 316
4 votes
Accepted

How can I check the hash of a bitcoin block?

Seems to me that you are hashing the whole block instead of header only. Take my code (in C++). void test ( ) { const MyByteArray header ( QByteArray::fromHex ( "00000020" // version "...
amaclin's user avatar
  • 6,780
4 votes

Ripple testnet explorer

There is a variant of viewing the transaction history at a certain address: http://ripplerm.github.io/ripple-wallet/ Dont forget to switch the network to the test in the upper left corner. Good luck =...
Дима Марков's user avatar
4 votes

How to use `scantxoutset`

You are trying to use a mainnet encoded address on testnet. That is not valid. You need to use a testnet encoded address. The testnet form of the address you are trying to use is ...
Ava Chow's user avatar
  • 71.1k
4 votes
Accepted

How to build a transaction using bitcoinjs-lib

In P2SH, the output script is created by applying HASH160 (SHA256+RIPEMD160) to the redeem script, which is then revealed at spend time. So if you created the previous output, you should know what the ...
Vojtěch Strnad's user avatar
4 votes
Accepted

Why is my P2WSH OP_IF/NOTIF argument not minimal?

In SegWit (by standardness) and Taproot (by consensus), the arguments to OP_IF and OP_NOTIF must be minimal, i.e. be either the empty vector or the one-byte vector 01. Your transaction uses 00, which ...
Vojtěch Strnad's user avatar
3 votes
Accepted

Is the bitdigger chrome extension fraud?

I just want to know is it fraud or legit? I have never used it. But: It's not profitable. Big mining pools use ASICs to mine bitcoins. In the past, people used GPU. But mining in your browser means ...
hardfork's user avatar
  • 2,117
3 votes
Accepted

How can I verify my merkle root function is correct?

Most likely, you have some endian-ness issues. Remember that the merkle root published is in little-endian and so are the transaction hashes. You'll have to reverse them and then calculate merkle ...
Jimmy Song's user avatar
  • 7,759
3 votes

Is the generated Public Key from Private Key Unique in Bitcoin?

The base58 number 16w4zZWjWnhfEasJcSbfDQeHJRk1LytPHF5ir1ZS9mtUD5adsdH is a base58Check encoding of the (compressed) public key: 030d4018f164d58e41e0c5fb99eb5ec26b4f21fc8ad0db726d51a7cce60c75df0a ...
Sven Williamson's user avatar
3 votes
Accepted

Bcoin - Database backend not found

This happens when your dependencies get twisted up, especially when bcoin has an update where leveldown gets upgraded. You should be good with a npm rebuild leveldown to fix the dependency tree, but ...
Bucko's user avatar
  • 183
3 votes

How to use `scantxoutset`

I resolved this. Here is the functional command: client.command('scantxoutset', 'start' ['addr(mfe87Qheq7SSveCDedyDUBEjMD9tgzRiU7)']) <!-- Address is valid. This address: '...
Michael's user avatar
  • 173
3 votes
Accepted

Understand how transaction size and fees calculation works in caravan

The fee rate is pulled here: export function fetchFeeEstimate(network, client) { if (client.type === BLOCK_EXPLORER) { return blockExplorerGetFeeEstimate(network); } return ...
Destry's user avatar
  • 46
3 votes
Accepted

How to make bitcoin hd wallet in typescript?

Paul Miller has created a number of modern typescript libraries to help with this: https://github.com/paulmillr/scure-bip39 https://github.com/paulmillr/scure-bip32 https://github.com/paulmillr/micro-...
aulneau's user avatar
  • 46
3 votes
Accepted

"Witness program hash mismatch" code -26 when broadcasting a transaction

"Witness program hash mismatch" in a Taproot script path spend means the Taproot commitment wasn't successfully verified, in other words the internal key tweaked with the taptweak hash (...
Vojtěch Strnad's user avatar
2 votes
Accepted

Coinhive for bitcoin/ethereum

I did this, actually! In terms of disclosure, @eric allam is absolutely correct, above; you should let your users know that's going on, at a minimum, and ideally have some sort of "Start mining" ...
Will Jobs's user avatar
  • 136
2 votes

How do I remove Wallet from Bcoin?

As Bucko commented in August 2017: Unfortunately right now there's no way to remove a wallet via the API in bcoin. There is a zap endpoint but I don't think it does anything yet. If you don't care ...
2 votes
Accepted

Bcoin crashes with node version error

This probably happened because you updated your node version after your installation of bcoin. You need to recompile the C++ bindings for the leveldown module to fix this. Checkout npm rebuild: https:/...
Bucko's user avatar
  • 183
2 votes
Accepted

Resyncing bcoin brings up database version error

If you're running master, there was a recent migration that would cause this. you can run this to fix it: node migrate/chaindb2to3.js /path/to/chaindb.ldb That will take a very long time, but if ...
Thann's user avatar
  • 70
2 votes
Accepted

how to use bitcoin blockchain be useful to authenticate documents?

I'd suggest taking a look at chainpoint.org (Full disclosure, I'm the VP Engineering at Tierion, the creators of the Chainpoint open standard). Chainpoint currently uses the Tierion HashAPI, and you ...
Glenn Rempe's user avatar
2 votes

How to send portion of funds from a private key programmatically?

You can either use your own bitcoind server or you can use a 3rd party API service. Let's do a few examples of what you are asking. I'll use short fake addresses and private keys as examples to make ...
m1xolyd1an's user avatar
  • 5,666
2 votes
Accepted

Is the generated Public Key from Private Key Unique in Bitcoin?

To a private key corresponds a unique public key. In your case, 16reZXagkyToongduimD25SEerXwP3MQ4n is an address (the hash + encoding of a public key).
hartmut's user avatar
  • 681
2 votes

How to set up a private chain/local testnet : reverse engineering the blockchain code

The question slightly exceeds capabilities of this q&a forum. Maybe better to search bitcointalk.org, there these type of requests get often discussed. Join one of the discussions there! Anyhow, ...
pebwindkraft's user avatar
  • 5,106
2 votes
Accepted

Creating Testnet Bitcoin Transaction with bitcoinjs-lib

The input you are trying to spend appears to be vout 1 in the tx. Your current code tries to spend vout 0, which has already been spent. Try changing transaction.addInput(input.sender_prev_txid, 0); ...
Raghav Sood's user avatar
  • 17.1k

Only top scored, non community-wiki answers of a minimum length are eligible