Questions tagged [javascript]
JavaScript is a high-level programming language widely used for web development.
103
questions
28
votes
3
answers
48k
views
How useful is a JavaScript miner?
I don't have a great understanding of how bitcoin mining works, but how useful would a JavaScript miner be for collecting revenue from visitors? Stupid question, but if I put the user in as part of a ...
13
votes
6
answers
8k
views
How can I stop websites running an integrated Bitcoin miner without disabling javascript altogether?
"Bitcoin Plus" is one example of a javascript bitcoin mining client that can CPU mine bitcoins through a browser when viewing a website. Here is a screenshot from 4bitcoins dot com which automatically ...
11
votes
3
answers
16k
views
Javascript Bitcoin miner is it even worth it?
I know that mining bitcoins via JavaScript is just pointless at this point in time, but is there any other altcoin that is worthwhile mining via a GPU/CPU via a JavaScript embedded into a web page?
...
10
votes
1
answer
32k
views
Byte array to hexadecimal and back again in JavaScript [closed]
I can generate a byte array with
var myByteArray = window.crypto.getRandomValues(new Uint8Array(16))
and I get
181,143,16,173,231,56,63,149,181,185,224,124,84,230,123,36
I can then turn this into ...
7
votes
3
answers
15k
views
Is there a way to access Ethereum Smart Contract's variables by name in JavaScript? [closed]
Say I have a simple smart contract:
contract Simple {
string32 message;
function Simple() {
message = "Hello world!";
}
}
How can I easily access the message variable by name in ...
7
votes
1
answer
2k
views
how do you sign and verify a message that you own a bitcoin address using javascript?
Is there a bitcoin library or even just pure javascript way of signing and verifying you own a btc address?
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.
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?
5
votes
1
answer
933
views
Prevent rounding errors when displaying bitcoin values in javascript
What is the correct way to prevent Floating Point Precision errors when displaying bitcon values in javascript? I've seen many answers on the topic, but they all seem to have their drawbacks.
Here's ...
4
votes
2
answers
910
views
Is the generated Public Key from Private Key Unique in Bitcoin?
I am generating public key from my private key. I did in Java script and C#.
but generated public keys are different.
My Code in c# (KeyCore.NET):
PrivateKey pv = new PrivateKey(Globals....
4
votes
1
answer
254
views
How do the JavaScript SecureRandom() vulnerabilities affect me?
A recent post on the Bitcoin-dev mailing list talks about multiple vulnerabilities in JavaScript SecureRandom() class. Apparently this class has been used in multiple cryptocurrency wallets that use ...
3
votes
1
answer
2k
views
Bruteforce bitcoin address - I know the words + public address but not the order
I have a long list of 1million+ permutations of a 12 word BIP39 seed. How can I try them all on a bitcoin address?
edit: I know the address and the 12 words but i don't know the order of the words
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 ...
3
votes
1
answer
297
views
How do I get transactions from the Bitcoin Blockchain with bcoin?
Is this possible with bcoin? Do I need a full node to get transactions or does it work with an SPV?
3
votes
1
answer
929
views
How can I verify my merkle root function is correct?
I've started playing with Bitcoin on a more technical level recently (I'm an experienced software developer but just a user of Bitcoin up until now). I'm trying to implement a function to calculate a ...
2
votes
2
answers
374
views
What's the POST endpoint to broadcast a transaction in copay's server?
AFAIU, copay's server implementation is bitcore-wallet-service.
From its README, I can deduce that a multi-sig wallet will use the /v1/txproposals/ endpoint to create a new transaction proposal that ...
2
votes
2
answers
457
views
how to use bitcoin blockchain be useful to authenticate documents?
have read a little about blockchains and found there is lot of blockchain npm libraries available.
How can I take benefit of the bitcoin blockchain to authenticate documents : to obtain a proof a ...
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-...
2
votes
2
answers
1k
views
How can I check the hash of a bitcoin block?
Let's pick an example bitcoin block: #499583
This is the block: https://insight.bitpay.com/api/rawblock/000000000000000000677c4077da7c9f01dde5f332ba2fbff962ee699714d5da
It starts with ...
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 = ...
2
votes
1
answer
231
views
Bcoin - Database backend not found
/root/BCoin/node_modules/bcoin/lib/db/backends.js:16
throw new Error('Database backend "' + name + '" not found.');
^
Error: Database backend "leveldown" not found.
at Object.get (/root/...
2
votes
1
answer
803
views
Bitfinex get credits and convert timestamp to JS Date
I'm fetching my active credits in BFX and trying to discover when I'll have my funding back. This is a response example:
/v1/credits
[{
amount: "294.4316181",
currency: "USD",
id: ...
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 ...
2
votes
1
answer
192
views
Resyncing bcoin brings up database version error
I was resyncing my bcoin node and got the following error:
Error: Warning: Your database does not match the current database version.
This is likely because the database layout or serialization ...
2
votes
1
answer
1k
views
How to send portion of funds from a private key programmatically?
I'm building an app and one of my features is being able to scan a bitcoin private key and then send a portion of its funds to another address. How can I do something like this in javascript or php? ...
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 ...
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 ...
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: ...
2
votes
3
answers
352
views
Is there a website widget or javascript library that turns any Bitcoin address into a clickable widget?
Was wondering is there a javascript widget or library that turns any BTC address on a website into a popup QR code on hover?
2
votes
1
answer
415
views
Websocket API: Uknown mtgox message type
Here's a bit of node.js code:
var WebSocket = require('ws');
var ws = new WebSocket('ws://websocket.mtgox.com:80/mtgox?Currency=USD');
ws.on('open', function() {
console.log('Connection opened');
...
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 ...
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?
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 ...
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 ...
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:
...
1
vote
3
answers
7k
views
Is the bitdigger chrome extension fraud?
Today, while I was watching a video on YouTube, I found the video on the bitdigger extension that mine bitcoins with chrome browser. I just want to know if it is fraud or legit? Is it possible to mine ...
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.
...
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 ...
1
vote
1
answer
1k
views
Creating Testnet Bitcoin Transaction with bitcoinjs-lib
I'm trying to setup a simple bitcoin testnet transaction using the bitcoinjs-lib npm module. It seems like I'm building the transaction correctly, and I receive the hex code but I think I'm unable to ...
1
vote
1
answer
212
views
Bcoin crashes with node version error
I installed bcoin and I get this error about the version:
$ node -v
v8.2.1
$ npm -v
5.3.0
$ bcoin
/usr/lib/node_modules/bcoin/lib/db/backends.js:26
throw e;
^
Error: The module '/usr/lib/...
1
vote
1
answer
320
views
OP_EQUALVERIFY Problem
I'm making a full-service wallet, I already made the UTXOs selection algorithm and now I want to push the transaction hex bytes. It works when I push only a transaction with only 1 input, but if I try ...
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 ...
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 ...
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 ...
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 ...
1
vote
1
answer
73
views
How can I generate the qrcode client-side that would be compatible with the Ardor Wallet qrcode
I'd like to generate a qrcode the same way the Ardor Wallet generates it, such that it would be compatible.
I found qrcode related javascript shipped with the Ardor node download in ardor/html/www/js/...
1
vote
1
answer
254
views
Can you explain this JS code?
Can someone explain this JS code to me please?
Maybe line by line? I am trying to understand and learn from it. Is this code creating a raw transaction based on an existing redeemScript? Or is it ...
1
vote
1
answer
213
views
Bitcoin - BitGO - Save all wallet objects into Array of Objects
My Setup:
With the help of Mongoose module we handle all Mongo Database operations.
For each new user a wallet is generated and stored inside a Mongo collection.
METHOD:
If we use User.find({}, ...
1
vote
1
answer
2k
views
avoid rounding errors in javascript with bigdecimal?
a user submits a buy request: 0.0104 BTC at a rate of 345.92 EUR
config:
var mode = RoundingMode.HALF_EVEN();
var satoshi = new BigDecimal("100000000");
user input:
var btc_b = new BigDecimal("0....
1
vote
1
answer
2k
views
Get a JavaScript notification when Bitcoin transaction arrives to a certain address
I'd like to implement a very simple address monitoring feature on a site I'm working on. I'd like to just be able to say "Listen to this address on the testnet for money to come in", and update the ...