coinstring icon indicating copy to clipboard operation
coinstring copied to clipboard

Bitcoin testnet is 6F, not 6E

Open nickodell opened this issue 10 years ago • 5 comments

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.

nickodell avatar Mar 12 '15 23:03 nickodell

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.

jprichardson avatar Apr 21 '15 03:04 jprichardson

This was fixed, close?

dcousens avatar May 04 '15 09:05 dcousens

It was just a documentation error. I left this open to remind me to update the docs.

jprichardson avatar May 04 '15 15:05 jprichardson

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 avatar Nov 02 '15 20:11 goshva

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

jprichardson avatar Nov 02 '15 21:11 jprichardson