Difference between revisions of "Testnet"

From Bitcoin Wiki
Jump to: navigation, search
m (Genesis Block: Change link to mempool.space)
(Fixed some formatting and grammatical issues.)
Line 1: Line 1:
The '''testnet''' is an alternative Bitcoin [[block chain]], to be used for testing. Testnet coins are separate and distinct from actual bitcoins, and are never supposed to have any value. This allows application developers or bitcoin testers to experiment, without having to use real bitcoins or worrying about breaking the main bitcoin chain.
+
The '''testnet''' is an alternative Bitcoin [[block chain]] to be used for testing. Testnet coins are separate and distinct from actual bitcoins, and are never supposed to have any value. This allows application developers or bitcoin testers to experiment, without having to use real bitcoins or worrying about breaking the main bitcoin chain.
  
 
Run bitcoin-qt or bitcoind with the -testnet flag to use the testnet (or put testnet=1 in the bitcoin.conf file).
 
Run bitcoin-qt or bitcoind with the -testnet flag to use the testnet (or put testnet=1 in the bitcoin.conf file).
  
There have been three generations of testnet. Testnet2 was just the first testnet reset with a different genesis block, because people were starting to trade testnet coins for real money. '''Testnet3''' is the current test network. It was introduced with the 0.7 release, introduced a third genesis block, a new rule to avoid the "difficulty was too high, is now too low, and transactions take too long to verify" problem, and contains blocks with edge-case transactions designed to test implementation compatibility. On the December 21 of 2015 SegNet was deployed, to test the Wuille's Segregated Witness proposal.
+
There have been three generations of testnet. Testnet2 was just the first testnet reset with a different genesis block, because people were starting to trade testnet coins for real money. '''Testnet3''' is the current test network. It was introduced with the 0.7 release, introduced a third genesis block, a new rule to avoid the "difficulty was too high, is now too low, and transactions take too long to verify" problem, and contains blocks with edge-case transactions designed to test implementation compatibility. On 21 December 2015, SegNet was deployed to test the Wuille's Segregated Witness proposal.
  
 
==Differences==
 
==Differences==
Line 9: Line 9:
 
* Default RPC connection port is 18332 (instead of 8332)
 
* Default RPC connection port is 18332 (instead of 8332)
 
* Bootstrapping uses different DNS seeds.
 
* Bootstrapping uses different DNS seeds.
* A different value of ADDRESSVERSION field ensures no testnet Bitcoin addresses will work on the production network. (0x6F rather than 0x00)
+
* A different value of <code>ADDRESSVERSION</code> field ensures no testnet Bitcoin addresses will work on the production network. (<code>0x6F</code> rather than <code>0x00</code>)
* The protocol message header bytes are 0x0B110907 (instead of 0xF9BEB4D9)  
+
* The protocol message header bytes are <code>0x0B110907</code> (instead of <code>0xF9BEB4D9</code>)  
 
* Minimum [[difficulty]] of 1.0 on testnet is equal to difficulty of 0.5 on mainnet. This means that the mainnet-equivalent of any testnet difficulty is half the testnet difficulty. In addition, if no block has been found in 20 minutes, the difficulty automatically resets back to the minimum for a single block, after which it returns to its previous value.
 
* Minimum [[difficulty]] of 1.0 on testnet is equal to difficulty of 0.5 on mainnet. This means that the mainnet-equivalent of any testnet difficulty is half the testnet difficulty. In addition, if no block has been found in 20 minutes, the difficulty automatically resets back to the minimum for a single block, after which it returns to its previous value.
 
* A new genesis block
 
* A new genesis block
* The IsStandard() check is disabled so that non-standard transactions can be experimented with.
+
* The <code>IsStandard()</code> check is disabled so that non-standard transactions can be experimented with.
  
 
==Genesis Block==
 
==Genesis Block==
  
 
Testnet uses a different genesis block to the main network. You can find it [https://mempool.space/testnet/block/000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943 here].
 
Testnet uses a different genesis block to the main network. You can find it [https://mempool.space/testnet/block/000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943 here].
The testnet was [https://github.com/gavinandresen/bitcoin-git/commit/feeb761ba07af74a7cd78b8c8f7c2a961fd9ea1c reset with a new genesis block] for the 0.7 bitcoin release.
+
The testnet was [https://github.com/gavinandresen/bitcoin-git/commit/feeb761ba07af74a7cd78b8c8f7c2a961fd9ea1c reset with a new genesis block] for the 0.7 Bitcoin release.
  
 
==Size==
 
==Size==
Testnet receives less transactions than the main block chain and is typically much smaller in size. As of January 2018 the size of the data on disk was 14GB, containing data for about 6 years worth of testnet activity. Downloading this data required about 12GB of network activity peaking at 2MB/s rate of transfer.
+
Testnet receives less transactions than the main block chain and is typically much smaller in size. As of January 2018, the size of the data on disk was 14&nbsp;GB containing data for about 6 years worth of testnet activity. Downloading this data required about 12&nbsp;GB of network activity peaking at 2&nbsp;MB/s rate of transfer.
  
 
==External links==
 
==External links==

Revision as of 23:39, 19 July 2021

The testnet is an alternative Bitcoin block chain to be used for testing. Testnet coins are separate and distinct from actual bitcoins, and are never supposed to have any value. This allows application developers or bitcoin testers to experiment, without having to use real bitcoins or worrying about breaking the main bitcoin chain.

Run bitcoin-qt or bitcoind with the -testnet flag to use the testnet (or put testnet=1 in the bitcoin.conf file).

There have been three generations of testnet. Testnet2 was just the first testnet reset with a different genesis block, because people were starting to trade testnet coins for real money. Testnet3 is the current test network. It was introduced with the 0.7 release, introduced a third genesis block, a new rule to avoid the "difficulty was too high, is now too low, and transactions take too long to verify" problem, and contains blocks with edge-case transactions designed to test implementation compatibility. On 21 December 2015, SegNet was deployed to test the Wuille's Segregated Witness proposal.

Differences

  • Default Bitcoin network protocol listen port is 18333 (instead of 8333)
  • Default RPC connection port is 18332 (instead of 8332)
  • Bootstrapping uses different DNS seeds.
  • A different value of ADDRESSVERSION field ensures no testnet Bitcoin addresses will work on the production network. (0x6F rather than 0x00)
  • The protocol message header bytes are 0x0B110907 (instead of 0xF9BEB4D9)
  • Minimum difficulty of 1.0 on testnet is equal to difficulty of 0.5 on mainnet. This means that the mainnet-equivalent of any testnet difficulty is half the testnet difficulty. In addition, if no block has been found in 20 minutes, the difficulty automatically resets back to the minimum for a single block, after which it returns to its previous value.
  • A new genesis block
  • The IsStandard() check is disabled so that non-standard transactions can be experimented with.

Genesis Block

Testnet uses a different genesis block to the main network. You can find it here. The testnet was reset with a new genesis block for the 0.7 Bitcoin release.

Size

Testnet receives less transactions than the main block chain and is typically much smaller in size. As of January 2018, the size of the data on disk was 14 GB containing data for about 6 years worth of testnet activity. Downloading this data required about 12 GB of network activity peaking at 2 MB/s rate of transfer.

External links

Wallets

Online testnet wallets to help you test your application.

Faucets

Once you're done with your test coins, it is a nice gesture to send them back to the faucets, so they become available to other developers.

Offline (2018-09-06):

Offline (2016-08-07):

Block explorers