
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
Bitcoin utility belt
npm install undercoin
In node or browser
const undercoin = require('undercoin')
For functions that accept a testnet parameter, said parameter needs be just true (otherwise the function will default to mainnet).
newAddress
undercoin.newAddress(testnet)
Creates a new Bitcoin address.
undercoin.newAddress() // 3FM1J7HkVcZeHTcWadxCN9UyTLYDpUxjJn
Note that no private key is provided (you can never spend funds sent to this address).
newKeypair
undercoin.newKeypair(testnet)
Creates a new Bitcoin keypair; an object containing a private and public key
undercoin.newKeypair()
// {
// private : 12b9a63d4b0d355b2b26d62a56bc165bae2850785d0584d28f1d6db86c66616e,
// public : 03ec7db1055f42f6ea1baf2206ffe90d354a18654774fa4cbc8c36390dfdab73ee
// }
newWIF
undercoin.newWIF(testnet)
Creates a new WIF
undercoin.newWIF()
// KxvdPD4tYwiiDsjMTNNgDiXWx2jK4p3mnLhaATx5NzaMPwMakquy
addressFromWIF
undercoin.addressFromWIF(wif, testnet)
Output a public Bitcoin address from a WIF
undercoin.addressFromWIF(wif)
// 1AoUMgXS3YV5LcJCuCjNzXEctL73cR8FgJ
getAddress
undercoin.getAddress(testnet, callback)
Get a (recent) address on the blockchain
undercoin.getAddress((err, address) => console.log(address))
// 3FM1J7HkVcZeHTcWadxCN9UyTLYDpUxjJn
isSegwit
undercoin.isSegwit(address)
Determines if address is Segwit (Bech32) or not.
undercoin.isSegwit('bc1qx9lplhcemust5q7vjejmfaglg8h6knu7a92r5p')
// true
feeEstimate Get an estimate on the fee required to complete a transaction within x hours
The following conversion functions are directly from fmtbtc, see also that repo for more conversions beyond this selection below:
btc2sat
undercoin.btc2sat(btcAmount)
Converts BTC to satoshis
undercoin.btc2sat(1) // '100000000'
sat2btc
undercoin.sat2btc(satoshis)
Converts satoshis to BTC
undercoin.sat2btc(15000000) // '0.15'
btc2msat
undercoin.btc2msat(btcAmount)
Converts BTC to 1/1000th of a satoshi
undercoin.btc2msat(1) // '100000000000'
msat2btc
undercoin.msat2btc(mSatoshis)
Converts mSatoshis to BTC.
undercoin.msat2btc(1) // '0.00000000001'
msat2sat
undercoin.msat2sat(mSatoshis)
Converts mSatoshis to regular satoshis.
undercoin.msat2sat(1000) // '1'
sat2msat
undercoin.msat2sat(satoshis)
Converts satoshis to mSatoshis.
undercoin.sat2msat(1) // '1000'
MIT
FAQs
Bitcoin utility belt
We found that undercoin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.