Finance 3.0 WIKI | Ethereum Testnet vs. Mainnet
WHAT IS A TESTNET?
A Testnet is an Ethereum blockchain that uses identical technology and software as the “Mainnet” Ethereum blockchain. However, whereas the Mainnet network is used for “actual” transactions with “value”, Testnets are used for testing smart contracts and decentralized applications (“DApps”).
Differences between the Testnet and Mainnet
Blockchains are simply databases created by a network of computers that interact with each other, using purposefully designed software to get the computers on that network to agree (i.e. achieve “consensus”) on what data to add and store on the database. The only difference between Testnets and Mainnet is that they are operated by different networks; i.e. one group of computers has agreed to work with each other and form a Testnet network, while another group of computers has agreed to work together to serve as the Mainnet network.
In order for a network of computers to agree to “work with each other”, they must agree on two parameters which uniquely identify each network:
- A network ID: a number parameter which acts as an identifier for a network. For example, the Mainnet’s network ID is 1, while the other most commonly used Testnets have network IDs of 3, 4, and 42 for Ropsten, Rinkeby, and Kovan, respectively. So if you want to connect your computer to one of the blockchains, you run the Ethereum software and specify a network ID of 1 to connect it to the Mainnet, or you specify a network ID of 3 for Ropsten. That way, it knows which network of computers to connect to.
- Genesis block: all computers on a network must agree to all the data stored on that blockchain, which of course must begin somewhere: the genesis block. The genesis block is block #1 of a network’s blockchain; it is just arbitrary data that has been designated as the beginning of that blockchain.
Why Does Ether on the Mainnet Have Value?
As mentioned, the software used by computers on Testnets and the Mainnet is identical. You can even mine Ether on some Testnets (“Test Ether”), just as you would on Mainnet. So if the software is exactly the same, why is Test Ether “worthless” while Mainnet Ether has value?
The reason that “Mainnet Ether” has value is just because the community assigns value to Ether that exists on the Ethereum network with a network ID of 1. For example, if you buy Ether on Coinbase, that Ether corresponds to Ether on the Mainnet (network ID = 1), rather than Ether on a Testnet (network ID ≠ 1). This is similar in concept to how a dollar bill is just a piece of paper; the only reason it has value is because the U.S. government says it does and the general public believes it does and therefore uses dollar bills to transact value.
WHY DID WE LAUNCH CRYPTOBASKETS ON THE TESTNET?
As mentioned, the technologies and software underlying testnets and the mainnet are identical. Therefore, deploying on the testnet serves as a simulation of how our DApp and protocol would work on the Mainnet itself, with real tokens and real Ether.
Since the testnet functions the same way, it is useful to test smart contracts, transactions and mining, simulating a real-world environment since there are many computers running nodes on the testnet, and other developers running smart contracts and other testnet DApps.
There are also different Testnets available for developers. At CoinAlpha, our engineers test DApps end-to-end on the Ropsten Testnet before deploying to the Mainnet.
Why did we choose Ropsten Testnet?
The Ropsten Testnet is the most similar network to the Mainnet. It uses the same consensus algorithm (“proof of work”), which achieves consensus through mining. Therefore, any computer connecting to the Ropsten network can mine for test Ether.
In contrast, some Ethereum test networks such as Rinkeby and Kovan are more centralized and use different consensus algorithms (“proof of authority”), which have different dynamics and are more centralized. The original creators of the network control the bulk of the Ether on the network. For example, to get some initial test ether, you may have to request it from a single party which has “authority”.
HOW CAN YOU GET TEST ETHER?
Test Ether can also be mined. A web search for “testnet mining” should turn up the information necessary to prepare for mining Testnet tokens.
Another way to acquire Test Ether, which is simpler, is through a web-based service known as a faucet. These are faucets set up for easily acquiring and donating Testnet tokens. A web search for “testnet faucet” should point you to the available faucets.
Since test tokens require mining and only a few people engage in mining them, martinkou, co-founder and CTO at CoinAlpha once controlled over 50% of hash power of the entire Testnet, and was therefore capable of perpetrating a “51% attack”. :P