Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.
33

Javascript has access to OpenGL ES, including shaders, so it has access to programmable parts of the GPU at nearly native speeds. I think that a smart kid might be able to build a fragment shader that does SHA256 hashing, which outputs to the stencil buffer, so that Javascript has a 2-way communication channel with the GPU. So yeah, you could probably use ...


12

You can use Adblock Plus to block the miner script. In this case it would be: http://www.bitcoinplus.com/js/miner.js


11

It is true that mining Bitcoins like this is impossible. (I can't speak for altcoins though.) Let us run through a back-of-envelope calculation based on some facts and assumptions. Network hash rate is 800 000 terahashes per second as of 2016-01-18 [source]. Remember that currently 25 BTC are rewarded every 10 minutes. A modern consumer-grade CPU has 4 ...


7

Note that this question has been automatically mapped to reddit and answered there. If you declare your state variables as public, a function to read their values will be automatically created by the compiler ("accessor function"). If you use the rich interface provided by web3.js, you can create a javascript contract object and just call message() on that ...


7

It would not at all be useful for Bitcoin mining. However, it may be useful for other digital cryptocurrencies, such as Litecoin or PPCoin.


7

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(byteArray, function(byte) { return ('0' + (byte & 0xFF).toString(16)).slice(-2); }).join(''); } function toByteArray(hexString) { var result = []; ...


7

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 on reddit leads to, so we will assume the derivation path is m/49'/0'/0'/0/0 This is a simple nodejs script using bitcoinjs-lib to read seeds from a file, ...


6

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 that submit proposals, for later approval. The flow is: create => publish => sign => broadcast. You can check the official client https://github.com/bitpay/...


6

You would need some kind of browser plug-in that monitors the CPU consumption of JavaScript and alerts you if you see excessive usage for an extended period of time.


4

It isn't really theft if you're broadcasting your availability to run javascripts. There are blockers that allow you to selectively block javascript files - check your browser's extensions (Chrome and FF both have many options).


4

First off, without the visitor's consent it would be unethical. Besides that, no it is not impossible. In the past there were sites doing that getting a fee for the service and providing the profits to visitors. Having said that it would provide way less than $0.005 per visitor. But with so many visitors it might still worth it. Also this might be of ...


4

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. Once you get the document, you can store the hash on the blockchain, then to check if it hasn't been changed, you can retrieve the hash and check if the ...


4

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 transactions using bloom filters and then watches pool broadcasted transactions. So you only get transactions that are addressed to your wallet. Full Node With ...


4

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 "164a1e4a7f34b96b0e201dcc6a623c63fe3874696e4875000000000000000000" // prev hash "49de8b4f4bfa9fc890d3d28a93156a111f891dc680090cd497b58a7d5c2b09cf" // merkle ...


4

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 =)


3

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 calculations. You can take a look at the details of a block with the tx hashes here: https://webbtc.com/block/...


3

The problem is not with the timestamp, it's with your method of converting the timestamp to local time. As this SO question describes, convert it this way: var dt = new Date(0); dt.setUTCSeconds(1454846632); console.log(dt.toString()); Which prints Sun Feb 07 2016 07:03:52 GMT-0500 (EST).


3

Good idea on storing it in Satoshis. With anything involving money, you want to avoid floats due to rounding errors. The best way of doing this would be to parse the value in Satoshis as a string, then simply put a decimal place 8 digits from the end to get the value in Satoshis. function convertToBTC(satoshis){ var satoshi_string = satoshis.toString();...


3

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 if that doesn't work rm -rf node_modules && npm i


3

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 mining with CPU which is completly unprofitable as you will probably never be the first one with a hash of 20 zeros but you'll waste energy. Is it possible ...


2

Using a selective JavaScript blocker is basic good practice from a system security point of view, and will prevent websites from using your CPU to mine for bitcoins. The NoScript Firefox extension allows you to disable JavaScript on a per-site or per-page basis. I like to set it to default to denying JavaScript on every page, and then add an exception for ...


2

Not practical at all. Most probably the users would be just pissed of. Right now it is not even practical to mine with GPU-s, not to mention CPU-s and for sure JS. Regarding the question: "if I put the user in as part of a mining pool, ..." No, it is not important that he would find a hash. It is working this way. Your all workers are calculating hashes (...


2

So... I found out what was wrong. The problem was in this part of the code when i was adding the inputs. I was adding an index to each input based on which number of input it was. for(var a = 0; a < input_utxos.length ; a++){ tx.addInput(input_utxos[a].tx,a) sum_outputs+=parseInt(input_utxos[a].amount); } but the index i was supossed to send ...


2

I think there are some great answers here, hopefully this isn't too repetitive... First, the metric you gave (2m daily unique visitors) is a great number, but it's not the right one when you're talking about proof-of-work mining. In that world, the relevant metric is more like the number of CPU-seconds you have available to you (a "cycles per second" number)...


2

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 things easy. PHP with a bitcoind server <?php require("easybitcoin.php"); $bitcoin = new Bitcoin("username", "somepassword"); //add the private key (...


2

The base58 number 16w4zZWjWnhfEasJcSbfDQeHJRk1LytPHF5ir1ZS9mtUD5adsdH is a base58Check encoding of the (compressed) public key: 030d4018f164d58e41e0c5fb99eb5ec26b4f21fc8ad0db726d51a7cce60c75df0a which corresponds toKwY7eRvXXFd7HPX4Zuv8STZMLsVSe2X22HkU24Av84W1Cb7Rd5Yh, and whose address is 16reZXagkyToongduimD25SEerXwP3MQ4n. Note that your private key is ...


2

To a private key corresponds a unique public key. In your case, 16reZXagkyToongduimD25SEerXwP3MQ4n is an address (the hash + encoding of a public key).


2

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.PrivateKey('L23PpjkBQqpAF4vbMHNfTZAb3KFPBSawQ7KinFTzz7dxq6TZX8UA'); var message = new Message('This is an example of a signed message.'); var signature = message.sign(...


2

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 can submit hashes to the API for free. We'll provide you with a proof that you can store alongside your original document. We have a Javascript library you can ...


2

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 you don't mind pruning your DB at the same time, you can run this instead and it will be much faster: node migrate/chaindb2to3.js /path/to/chaindb.ldb --prune ...


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