Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bitcoin testnet is 6F, not 6E #4

Open
nickodell opened this issue Mar 12, 2015 · 5 comments
Open

Bitcoin testnet is 6F, not 6E #4

nickodell opened this issue Mar 12, 2015 · 5 comments
Assignees
Labels

Comments

@nickodell
Copy link

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.

@jprichardson
Copy link
Member

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.

@dcousens
Copy link
Contributor

dcousens commented May 4, 2015

This was fixed, close?

@jprichardson
Copy link
Member

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

@goshva
Copy link

goshva commented Nov 2, 2015

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?

@jprichardson
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants
@jprichardson @dcousens @nickodell @goshva and others