Questions tagged [javascript]

JavaScript is a high-level programming language widely used for web development.

Filter by
Sorted by
Tagged with
1 vote
1 answer
39 views

Using bitcore-p2p and bitcore-lib to get block data

I've prepared a Nodejs javascript script to (attempt to) fetch block information for an example testnet block (3) from the P2P network, using bitcore-p2p library (which uses the getdata P2P protocol, ...
0 votes
1 answer
76 views

bitcoinjs - mandatory-script-verify-flag-failed (Signature must be zero for failed CHECK(MULTI)SIG operation)

I'm trying to follow the below transaction example by magic eden and extend it to support multiple buyers and seller (in red). However I am having difficulties when I add more than one signature from ...
2 votes
1 answer
192 views

Invalid checksum when generating BIP-39 Mnemonic

I am trying to generate a mnemonic seed in Javascript, and while everything seems to be working, I am not getting a mnemonic with a correct checksum. Here is my implementation: export const ...
1 vote
1 answer
89 views

How to use BlockCypher's test network with BitcoinJS-lib?

Trying to make a PSBT via BitcoinJS-lib. I'm using BlockCypher's internal testnet (bcy/test) because I have no choice: literally every other testnet faucet I tested was broken. Using BlockCypher's API ...
1 vote
1 answer
90 views

non-mandatory-script-verify-flag (Invalid Schnorr signature)

I try to put this into a Psbt: Alice make payment to purchase an amount of BRC-20 from Bob Bob request to inscribe a transfer of BRC-20 by using Burner account Burner inscribe the transfer of BRC-20 ...
2 votes
1 answer
249 views

How to spend from a custom P2SH script using bitcore-lib

My Javascript/typescript project uses bitcore-lib. It uses Script.buildScriptHashOut to build custom P2SH outputs. How do I spend from this custom output?
-1 votes
1 answer
610 views

bitcoinjs-lib is installed but cannot use its functions

I've installed the latest version of bitcoinjs-lib but I cannot use the functions of the library. const bitcoin = require('bitcoinjs-lib'); const keyPair = bitcoin.ECPair.makeRandom(); const { address ...
0 votes
1 answer
81 views

How to implement stake.com model of deposit & withdraw flow for my crypto poker casino?

In stake.com for each user they generate separate bech32 address for deposit & displays the deposited amount as balance in top of the navigation bar. Similarly for withdraw they just ask for the ...
0 votes
1 answer
728 views

how to place a bitforex api buy order

I have read the documentation for BitForex on placing a buy order here: https://github.com/bitforexapi/API_Doc_en/wiki/Order Then after understanding that, I read the API Call Description ...
0 votes
1 answer
455 views

Is it possible to talk to bitcoin RPC API with Javascript and WITHOUT using a node server?

I am planning on building a Wallet and want to know if I can hook something like an Electron native JavaScript app to Bitcoin RPC without running node.js for the server calls, so using something like ...
0 votes
1 answer
917 views

Signature for this request is not valid

im testing the binance api but cant get over the signature problem can u spot a mistake on my signature?: const crypted = CryptoJs.HmacSHA256("timestamp=" + new Date().getTime().toString() + "&...
0 votes
1 answer
178 views

How to create an application which constructs a transaction using `bcoin` (javascript)?

I am new to development. I am working on a project and I am trying to use bcoin. I want to create an application which has a UI, where the user will be asked to enter Destination address and amount. ...
1 vote
2 answers
144 views

Bitcoinja-lib. bitcoin.payments is null

I installed bitcoinjs-lib with command: meteor npm install bitcoinjs-lib. The installation command "flow-typed install -f 0.27 [email protected]" didn't work. No idea what flow-typed is and the ...
3 votes
1 answer
214 views

How do descriptors work with miniscript in the library bitcoinerLab?

What I want is to be able to spend the funds from an address, either with its private key or with the private key of another address that I designate in the policy. As I understand it, it works like ...
2 votes
1 answer
215 views

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

I'm trying to broadcast a transaction to my RPC provider: curl https://my-quicknode-rpc-provider/ \ -X POST \ -H "Content-Type: application/json" \ --data '{"method": &...
2 votes
1 answer
103 views

Getting Error while trying to decode psbt base64 to json using bitcoinjs/bip174 library

const base64PSBT = 'base_64'; // Decode the base64 PSBT to a Buffer const psbtBuffer = Buffer.from(base64PSBT, 'base64'); // Parse the PSBT const psbt = bip174.Psbt.fromBuffer(psbtBuffer); // ...
0 votes
1 answer
42 views

Recreate Java code in python

I have a java code that I need to pass to python but I don't know which libraries to use and how to start and if you can help me I would really appreciate it MNEMONIC = "twenty four mnemonic ...
1 vote
0 answers
114 views

Transactions only work the first time

I'm implementing the code to sign and send Bitcoin transactions on testnet, using the bitcore library, in javascript. I need some help, as once I try to broadcast my transaction, it gives me this ...
0 votes
0 answers
131 views

Redeem script for input #0 doesn't match the scriptPubKey in the prevout

I'm trying to create a new bitcoin transaction using bitcoinjs-lib. Here is my transaction. { "weight" : 661, "txid" : "...
3 votes
1 answer
623 views

How to build a transaction using bitcoinjs-lib

I'm trying to build a transaction using bitcoinjs-lib. Here is my last transaction. https://blockstream.info/api/tx/91feea5f5c7b67b3e56c0f5d23d6da3065855c23b4cc7dded8efd8ff8065500f { "weight&...
3 votes
3 answers
2k views

How to use `scantxoutset`

Looking to fetch the UTXOs for a given address and can't seem to find the correct command syntax. Here is an implementation in bitcoin-core via javascript, but I also experience the same on bitcoin-...
1 vote
1 answer
458 views

How to get the private key & wallet address using a multi-wallet recovery seed phrase?

How can I „convert“ a 12-words-long multi wallet seed phrase (of the Blockchain.com wallet) to the wallets private key and the wallets address using any programming language? The given multi wallet ...
1 vote
1 answer
90 views

Do Bitcore APIs have daily limits?

I can't find online if the bitcore API (https://github.com/bitpay/bitcore/blob/master/packages/bitcore-node/docs/api-documentation.md) has daily limits for making requests, or if there is a need to ...
0 votes
0 answers
26 views

Customizing the algoritm of the private key of Bitcoin (js)

Is there a way to change the Bitcoin private key creation algorithm so that only private keys are created whose extracted addresses start with "1a"? A guide on the feasibility of this idea ...
user avatar
0 votes
0 answers
218 views

Generate a Bitcoin taproot address with specific prefix for burning assets

I would like to generate a bitcoin taproot address (bc1p) for burning assets. Which means not one would have the private key. But in the mean time I would also want a vanity address (an address start ...
0 votes
0 answers
73 views

How to sign a PSBT with BitcoinerLAB?

First of all, We are using bitcoinerLab. From the seed, we generate the Master Key, and with the path, we create the child key 0 (the parent's) and child key 1 (the child's). Now, from these keys, we ...
1 vote
1 answer
246 views

How to send a Bitcoin transaction only using the seed phrase using NodeJS?

I am working on a NodeJS script that allows you to enter your 12-words-long Bitcoin secret recovery phrase and automatically withdraw all of your coins to a defined wallet address. The script is for ...
0 votes
2 answers
236 views

How to get BTC transfer amount from raw tx using bitcoinjs

Suppose I have following object console.log(bitcoinjs.Transaction.fromHex(rawTx)); The output Transaction { version: 2, locktime: 1655960, ins: [ { hash: <Buffer dc 4d aa 10 db ...
1 vote
1 answer
337 views

How to make bitcoin hd wallet in typescript?

I am trying to create HD wallet for bitcoin. I have developed an Ethereum wallet, but I am having a hard time making a Bitcoin wallet. In my case, I am developing a server using Golang and Typescript. ...
0 votes
1 answer
145 views

What are some different ways to retrieve btc transaction information of an address using bitcoinjs?

What are some different ways to retrieve btc transaction information of an address using bitcoinjs? I've tried using the syntax from this page (https://github.com/bitcoinjs/bitcoinjs-lib/blob/master/...
4 votes
1 answer
3k views

Uncaught TypeError: bip32.fromSeed is not a function

I am trying to run the below code to print the private key, the Public key and the mnemonics, but getting Uncaught TypeError: bip32.fromSeed is not a function : //Import dependencies const bip32 = ...
1 vote
3 answers
1k views

The best JavaScript libraries supporting Bitcoin Core?

I have downloaded and installed Bitcoin full node on my Linux server and I'd like to start working with the bitcoin core to create wallet, addresses, and transactions. What is the best JS libraries ...
2 votes
1 answer
799 views

Is there a Base58 encoder function that runs in pure javascript without node?

I see a lot of JavaScript Base58 encoder functions online, but all of them seem to require node. Is there a simple JavaScript Base58 encoder that will just run in the browser without any node ...
0 votes
1 answer
2k views

How do you sign data with a private key? [javascript]

Using BlockCypher’s signing tool (link), I can sign the following data: 05de69f5d37f41340eed3230f03d2394dde5e497738a76f027b7d962a0cbdf39 with the private key: ...
1 vote
2 answers
697 views

Derive next HD segwit address from xpub/ypub

I've been using the smartbit api to derive the next receiving address for a while now. However it only works for Legacy addresses and not Segwit addresses. I now have a Ledger Nano s and need a ...
1 vote
0 answers
87 views

Cannot unserialize chainstate transaction outputs after de-obfuscation

I was able to read chainstate database. Getting the key and de-obfuscating to get a valid last block. However, when it comes to transactions that follow after that, I cannot de-serialize them no ...
0 votes
1 answer
687 views

generating a zprv from a base58 rootKey with bitcoinjs-lib

var bitcoin = require('bitcoinjs-lib'); let bip32 = require('bip32'); let rootKey = 'xprv9s21ZrQH143K32CfqoCQHtbKiEb5BqFazXX6jCtNCnuty3gUjxS4CsXWi9rcNyHdjDVPiC6P1bnyEZr2ioouRq56h6HAdwejeTty1BsSEtL' ...
0 votes
1 answer
340 views

Using Javascript, I want to generate a segwit private key (zprv) similarly to how I am generating my legacy base58 extended private key. How?

let bip32 = require('bip32'); let bip39 = require('bip39'); let { bech32, bech32m } = require('bech32') const seed = bip39.mnemonicToSeedSync('rural catch say tooth tell soul road pilot fee board ...
1 vote
2 answers
2k views

How do I use Blockchain.info's Receive Payments API with node JS / Express?

Blockchain has great documentation for PHP, but nothing really for node! Does anyone here have any projects,where they used the blockchain.info Receive Payments API, in their node apps, to receive ...
0 votes
0 answers
59 views

Cryptocurrency Wallet 3rd party access

Do Crypto wallets such as Exodus etc have something like an API? For example is it possible to perform a cryptocurrency transaction directly from the web browser client (using the specified amount and ...
0 votes
1 answer
36 views

Distinguishing bitcoin deposits

If i had a central Bitcoin wallet, and then allowed 3 different people to deposit bitcoin into that address, would there be anyway to distinguish who they are, without knowing who's address is who, i ...
1 vote
0 answers
82 views

Bitcoin Script - Beautify

My question is if something exists to do the job in the opposite direction of miniscript. Miniscript's intention is to help:     ...writing (a subset of) Bitcoin Scripts in a structured way, enabling ...
1 vote
0 answers
188 views

How can I use PSBT in a JavaScript project?

I am trying to use PSBT in a Bitcoin project. The idea is to generate keys and sign transactions client-side. I am already familiar with bitcoinjs-lib but I find the API rather complicated. It would ...
0 votes
2 answers
863 views

Generating Bitcoin address from private key in browser console

I am a newbie Bitcoin evangelist and I have a recommendation to see all the code responsible for computing yourPublicKey from yourPrivateKey, especially for big deal addresses. The easiest way to ...
1 vote
2 answers
904 views

Understand how transaction size and fees calculation works in caravan

Looks like there is no activity in caravan github repository so maybe someone here can help me with this issue. Already mentioned everything in the below link however my three basic questions are: ...
2 votes
0 answers
71 views

Sign transaction externally

I create a transaction with inputs from a given address / public key without signatures. Every input needs to be signed. I use a different method to generate the signatures so I can't provide a ...
1 vote
0 answers
611 views

bitcoind: How to get rawblock data with ZeroMQ

I am trying to use the zeromq api for bitcoind to get rawblock but its not working with the code I've provided below. I am able to get hashtx and rawtx if I remove the filter but not hashblock and ...
6 votes
5 answers
8k views

Ripple testnet explorer

This is Ripple main Explorer. But where can i find the transactions ledger from wallets on Ripple testnet.
2 votes
1 answer
2k views

A NodeJS implementation on creating addresses from a Bitcoin (zpub, xpub) address

I'm looking for a lightweight node package which can handle creating btc receiving addresses on the server using an extended public key (segwit). Like this one: ...
6 votes
1 answer
2k views

How do I remove Wallet from Bcoin?

I'm playing with bcoin cli and created lots of wallets. Is there any way to remove wallet via WalletDB Api?