<p>If JavaScript is your language of choice you might be interested in <a href="https://github.com/bcoin-org/bcoin" rel="nofollow noreferrer">bcoin</a> - 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.</p>

<p>This guide in particular walks you through the process: <a href="https://bcoin.io/guides/webapp.html" rel="nofollow noreferrer">https://bcoin.io/guides/webapp.html</a></p>

<p>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)</p>

CC BY-SA 4.0
2020-04-21T11:42:41.600Z
2020-04-21T11:42:41.600Z
pinhead
<p>You need to learn to use Browserify to pack your javascript libraries, so that you can call it from a browser with <code>require()</code>.
The instructions for the library used by the answer can be found <a href="https://github.com/bitcoinjs/bitcoinjs-lib/issues/965#issuecomment-363945639" rel="nofollow noreferrer">here</a> (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 <code>&lt;script src="bitcoinjs.js"&gt;&lt;/script&gt;</code>. Open the html file in your browser, then you should be able to run your script.</p>

CC BY-SA 4.0
2020-04-21T10:30:33.040Z
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
CC BY-SA 4.0
2020-04-21T07:01:48.927Z
2020-04-21T07:01:48.927Z
MCCCS
<p>I am a newbie Bitcoin evangelist and I have a recommendation to see all the code responsible for computing <code>yourPublicKey</code> from <code>yourPrivateKey</code>, especially for big deal addresses.
The easiest way to allow Bitcoin users to see the code is to write it in Javascript to let them run it on console, because any PC user has a browser and almost nobody has Python or any other interpreter. I saw a step-by-step manual in this answer to <a href="https://bitcoin.stackexchange.com/a/18252/105314">How can I generate a bitcoin address?</a> 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.</p>

<public-key><address-generation><javascript>
Generating Bitcoin address from private key in browser console
rcfanboi
# Generating Bitcoin address from private key in browser console

(Asked by: username_0 on 2020-04-21)

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 allow Bitcoin users to see the code is to write it in Javascript to let them run it on console, because any PC user has a browser and almost nobody has Python or any other interpreter. I saw a step-by-step manual in this answer to [How can I generate a bitcoin address?](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.

**Tags:** public-key, address-generation, javascript


---

## 2 answers

### Answer by username_1 on 2020-04-21. Score: 1

If JavaScript is your language of choice you might be interested in [bcoin](https://github.com/bcoin-org/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)


---

### Answer by username_2 on 2020-04-21. Score: 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](https://github.com/bitcoinjs/bitcoinjs-lib/issues/965#issuecomment-363945639) (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.

> **Comments:**
> **username_0**: 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.  

---

