0

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 adresses. The easiest way to ought Bitcoin users to see the code is to write it on Javascript to let them run it on console, because any PC user has browser and almost nobody has Python or any other interpreter. I saw step-by-step manual from this answer https://bitcoin.stackexchange.com/a/18252/105314 but I still have some obstructions to produce one single sheet of code ready for running in console. Please help me to write that code to make my recommendation easy to follow.

0

You need to learn to use Browserify to pack your javascript libraries, so that you can call it from a browser with require(). The instructions for the library used by the answer can be found here (you don't need step 5). Once you do that you should create a folder with an html page and the script you created. Add to the html page <script src="bitcoinjs.js"></script>. Open the html file in your browser, then you should be able to run your script.

| improve this answer | |
  • As far as I understood, you have provided me instructions how to write my own clone of bitaddress.org website. I do not want an HTML page because it may contain a lot more than I need. All I want is a function publicAdressFromPrivateKey(yourPrivateKey){...console.log(publicAddress)} to be able to see that nothing is happening with my precious private key except some mathematical transformations. – rcfanboi Apr 21 at 10:30
0

If JavaScript is your language of choice you might be interested in bcoin - the bitcoin full node implementation and modular library written in JS. It's designed for use in nodejs environments but can be compiled for the browser as well.

This guide in particular walks you through the process: https://bcoin.io/guides/webapp.html

Please note that web browsers are insecure environments for cryptography and especially cryptocurrency, this guide is based around public keys and testnet addresses to avoid any real risk. If you try to manage private keys in a browser's JS environment you need to be extremely careful (use an offline computer if possible, no "chrome extensions" etc)

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.