coinstring
coinstring copied to clipboard
Bitcoin testnet is 6F, not 6E
http://cryptocoinjs.com/modules/currency/coinstring/#list-of-common-crypto-currency-versions
It says that testnet is version 0x6E, but it's actually 0x6F, or 111.
Eeeks! Thanks for reporting! Fortunately I got it correct here: https://github.com/cryptocoinjs/coininfo/blob/master/lib/coins/btc.js#L62 I'll leave this open as a note to correct.
This was fixed, close?
It was just a documentation error. I left this open to remind me to update the docs.
Hi! Have problem with validation testnet address with this script:
var CoinKey = require('coinkey')
var ci = require('coininfo') ///*****
var ck = new CoinKey.createRandom()
console.log("Private Key (Wallet Import Format): " + ck.privateWif)
//KxHycPBUTeWkAuxcG1jzyEogwGFmfVmj3i49i4t4hmfyWkXbujRn
console.log("Private Key (Hex): " + ck.privateKey.toString('hex'))
//20082f69484c00d1c49da31bfe3a700aae0b3218210475d1ede6070063bdc159
console.log("Address: " + ck.publicAddress)
//1Fagh1DKUAZ39EmE6fv6cRHAzUqDK42nAV
//change to Testnet ******
ck.versions = ci('BTC-TEST')
console.log("Testnet Address: " + ck.publicAddress)
//Fagh1DKUAZ39EmE6fv6cRHAzUqDHDw3eD
This site (testnet faucet) say what address not valid --> https://testnet.coinfaucet.eu/en/ Fagh1DKUAZ39EmE6fv6cRHAzUqDHDw3eD Why? Maybe I do something wrong?
@goshva In the future, please open a new issue in the proper module. coinstring and coinkey are different modules.
Also, sorry, I see that you referenced the docs, which are incorrect (http://cryptocoinjs.com/guide/getting-started/)
To answer your question:
var CoinKey = require('coinkey')
var ci = require('coininfo')
var ck = CoinKey.createRandom(ci('BTC-TEST'))
console.log('Private Key (Wallet Import Format): ' + ck.privateWif)
console.log('Private Key (Hex): ' + ck.privateKey.toString('hex'))
console.log('Testnet Address: ' + ck.publicAddress)