As of May 31, 2023, we have updated our Code of Conduct.

Questions tagged [javascript]

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

Filter by
Sorted by
Tagged with
1 vote
0 answers
35 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 ...
AlexCav's user avatar
  • 41
0 votes
0 answers
62 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 ...
daniaoren's user avatar
0 votes
0 answers
18 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
41 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 ...
Chupitastiiks's user avatar
3 votes
1 answer
99 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 ...
Chupitastiiks's user avatar
1 vote
1 answer
91 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 ...
FledPaul's user avatar
1 vote
1 answer
53 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 ...
FledPaul's user avatar
0 votes
1 answer
32 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 ...
you1977's user avatar
  • 19
2 votes
1 answer
59 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 ...
Egge's user avatar
  • 21
0 votes
1 answer
116 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. I get errors like: const keyPair = bitcoin.ECPair.fromPrivateKey(Buffer.from(privateKey, 'hex'), { ...
Tornike Tskhvediani's user avatar
0 votes
1 answer
39 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 ...
Kimi Raikkonen 9790's user avatar
1 vote
1 answer
171 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. ...
Primrose's user avatar
2 votes
1 answer
1k 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 = ...
spraveenitpro's user avatar
1 vote
1 answer
601 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 ...
schulwitz's user avatar
  • 325
0 votes
1 answer
92 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/...
jiamijiang's user avatar
0 votes
0 answers
62 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 ...
Anonymous's user avatar
  • 101
0 votes
1 answer
501 views

generating a zprv from a base58 rootKey with bitcoinjs-lib

var bitcoin = require('bitcoinjs-lib'); let bip32 = require('bip32'); let rootKey = 'xprv9s21ZrQH143K32CfqoCQHtbKiEb5BqFazXX6jCtNCnuty3gUjxS4CsXWi9rcNyHdjDVPiC6P1bnyEZr2ioouRq56h6HAdwejeTty1BsSEtL' ...
Not My Real Name's user avatar
0 votes
1 answer
211 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 ...
Not My Real Name's user avatar
2 votes
1 answer
181 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?
MCCCS's user avatar
  • 10k
0 votes
0 answers
55 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 ...
shauna vayne's user avatar
0 votes
1 answer
33 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 ...
Nathan Leadill's user avatar
1 vote
0 answers
68 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 ...
Vlad Stan's user avatar
1 vote
3 answers
937 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 ...
Armin's user avatar
  • 11
1 vote
0 answers
129 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 ...
Mario Mazzola's user avatar
2 votes
0 answers
53 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 ...
Bernd Strehl's user avatar
1 vote
0 answers
485 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 ...
Kevin Kelbie's user avatar
1 vote
2 answers
633 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: ...
user avatar
2 votes
0 answers
330 views

How to connect to an ElectrumX server using JavaScript WebSockets?

I'm trying to connect to an ElectrumX server from an HTML webpage. But I can't get a working connection. I've tried with many servers from Electrum's servers.json list but none worked. Here's the ...
M.K. Safi's user avatar
  • 143
1 vote
0 answers
28 views

Is there any 'Metamask-like' app for Bitcoin? [duplicate]

9 months ago someone asked this same question: Metamask-like web3 inject for bitcoin but I was wondering if there had been be any changes since then. I'm currently looking for a Chrome extension that ...
Stack's user avatar
  • 127
1 vote
1 answer
695 views

How do I get old blocks while running a pruned node?

Hello I'm trying to build a NodeJS app that fetches Bitcoin blocks, potentially old ones, and I'm running into issues. I've downloaded Bitcoin Core but I don't have enough space to run a full node and ...
Colman Koivisto's user avatar
0 votes
2 answers
671 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 ...
rcfanboi's user avatar
0 votes
1 answer
70 views

how to sign a multiple output transaction

currently i m using below code,how to add multiple address to address. let transaction = new bitcore.Transaction() transaction .from(txoSet) .to( ...
indrajit's user avatar
0 votes
0 answers
71 views

How can i mine bitcoins to direct wallet using JavaScript?

I heard that we can mine bitcoins using javascript direct to the wallet? How can I create Program, script or application which direct mines to the wallet & I even search online but did not get ...
user avatar
0 votes
2 answers
193 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 ...
Michael Khoroshun's user avatar
0 votes
0 answers
174 views

broadcasting bitcoin transaction issue using bitcore-explorers

I have been trying to do a transaction using bitcore-lib. I have successfully created transaction object. let bitcore_transaction = new bitcore.Transaction() .from(utxos[0]) .to(to, +...
Komal Bansal's user avatar
0 votes
1 answer
46 views

JavaScript Mining System Design

How do I verify a unconfirmed transaction using JavaScript ?
Hide7's user avatar
  • 1
2 votes
2 answers
1k 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-...
Michael's user avatar
  • 153
0 votes
1 answer
1k views

Javascript library or code that can convert an "uncompressed" bitcoin private key to a compressed one

I forked a pretty old brain wallet generator: https://dvdbng.github.io/memwallet/ -- Currently it generates uncompressed bitcoin private keys. Is there a javascript library that can convert an ...
Patoshi パトシ's user avatar
0 votes
1 answer
677 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 ...
adbarads's user avatar
  • 101
0 votes
1 answer
157 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. ...
Deb's user avatar
  • 123
0 votes
1 answer
165 views

Using only Javascript and JS related Bitcoin Libraries. How do you extract the Bitcoin Address from a private key?

I'm building an js related application that only stores my user's bitcoin private keys, but not the public key or bitcoin address to save space. Is there a javascript library that can output the ...
Patoshi パトシ's user avatar
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: ...
timothyylim's user avatar
0 votes
1 answer
815 views

Creating a raw bitcoin transaction and signing it with the private key using php and javascript

I have a full bitcoin core node setup and would like to use it to just "broadcast" my signed transactions. But what is required to make a raw transaction using PHP and Javascript? The variables I have ...
Patoshi パトシ's user avatar
2 votes
1 answer
34 views

Ardor: How to decide if an asset can be send?

My (Javascript) frontend needs to decide whether the user can send an Ardor/Ignis asset in his account. My code checked for: quantityQNT >= amount_to_send But I realise that this doesn't work if ...
Mal Nemark's user avatar
2 votes
1 answer
9k views

generating private key from bip39 seed

according to bip39, I maked 12 mnemonic words and then get a 512 bit seed from them. now I want to know how must I convert this seed to private key ? what functions must I use ? please introduce me ...
saeid ezzati's user avatar
1 vote
2 answers
622 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 ...
David's user avatar
  • 113
2 votes
1 answer
175 views

I have a 100 character text message and I want to encrypt this message with my bitcoin "PUBLIC KEY" and decrypt it with my private key in Javascript

Are there any javascript libraries that can encrypt a 100 character text message using your bitcoin public key, but only be able to decrypt it with your bitcoin private key? I'm looking to create a ...
Patoshi パトシ's user avatar
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: ...
rW3ZpUdwYducwSuD's user avatar
0 votes
1 answer
1k views

UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'fromSeedBuffer' of undefined

I am getting Getting error at this line var root = bitcoin.HDNode.fromSeedBuffer(seed); UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'fromSeedBuffer' of undefined Here is ...
Ishwar Chandra Tiwari's user avatar
0 votes
1 answer
281 views

Explain blockexplorer UTXO

Bitcoin testnet I used the following code to obtain info about unspent outputs: const blockchainInfo = require('blockchain.info') const blockexplorer = blockchainInfo.blockexplorer.usingNetwork(3) ...
srgbnd's user avatar
  • 103