How to generate a testnet address?

6

2

Bitcoin addresses can be generated on this site https://www.bitaddress.org, but the test network needs m or n at the beginning of the address, where can those be generated?

zhou

Posted 2017-07-11T14:45:00.353

Reputation: 63

1

Use the testnet version. https://www.bitaddress.org/?testnet=true

Nick ODell 2017-07-11T15:47:43.327

Pokes @NickODell: Please post answers as answers, not as comments! ;)

Murch 2017-07-12T05:41:16.507

@Murch Character limits, though.Nick ODell 2017-07-12T15:06:37.750

Answers

5

The site that you reference itself allows you to create Testnet addresses: https://www.bitaddress.org/?testnet=true (Hat tip to Nick ODell)

On the other hand, you could simply use a wallet that supports testnet, see e.g. Running Bitcoin Core in testnet mode.

Murch

Posted 2017-07-11T14:45:00.353

Reputation: 41 609

4

Assume your hexadecimal private key (256 bits in length) is 0000111122223333444455556666777788889999aaaabbbbccccddddeeeeffff for demonstrative purposes.

Use this table to specify interger version to use the Bitcoin Explorer (bx) command to compute WIF private keys and addresses for numerous altcoins.

  1. Compute associated Testnet compressed WIF key:

    % echo 0000111122223333444455556666777788889999aaaabbbbccccddddeeeeffff | sed 's/$/01/' | bx base58check-encode -v 239

    cMahgGtgBvsRn7SZFuFCuKGnV8H8yxYLegVcaRsLL2LjD6WFLuAg

  2. Compute associated Testnet compressed public address from secp256k1 elliptic curve using the same private key:

    % echo 0000111122223333444455556666777788889999aaaabbbbccccddddeeeeffff | bx ec-to-public | bx ec-to-address -v 111

    n47QBape2PcisN2mkHR2YnhqoBr56iPhJh

It is worth examining the result of this example:

% echo cMahgGtgBvsRn7SZFuFCuKGnV8H8yxYLegVcaRsLL2LjD6WFLuAg | bx base58check-decode

{
    checksum 3112764957
    payload 0000111122223333444455556666777788889999aaaabbbbccccddddeeeeffff01
    version 239
}

skaht

Posted 2017-07-11T14:45:00.353

Reputation: 2 588