About Testnet T3
The third testnet of Doge Protocol, codenamed as T2 was released on October 31, 2022 (the genesis block was created a few days before this). This blockchain features proof-of-stake consensus and adds on to existing features like Quantum Resistance, Smart Contract and Token support.
- Staking Contract
- Validators
- Block Rewards (network enabler rewards)
- Attestations
- Slashing
Staking Contract
The staking contract is an important part of PoS blockchains; it defines the smart contract for depositing staked coins, withdrawing the stake and maintaining the state machine of the staking system. This contract has been implemented in T2 Part 1. In this version of the blockchain, the smart contract is created after the blockchain is bootstrapped with initial signed list; in subsequent testnets, this will be created automatically as part of the bootstrap process. The blockchain nodes call into this smart contract at runtime, when each block is created, in Testnet T3.
Validators
Validators are essential to keep the blockchain node running. Validators will deposit coins into the staking contract, in order to become eligible to get block rewards. One important requirement of validators is that their primary wallet keys should not be required to be used for running validator nodes. This is because the node will be online and being online increases the risk of theft. To avoid this, in Doge Protocol blockchain, validators are able to create a second keypair known as validator keypair. The public key of this keypair needs to be specified when depositing in to the staking contract. The validator node can use this keypair to attest block transactions while the original wallet keypair can be stored safely in offline storage, such as in an air-gapped location. This has been implemented in Testnet T3.
Block Rewards
Block Rewards are essential so that validators are motivated to run blockchain nodes to keep the network running. At runtime, the blockchain node loads the list of validators from the staking contract; these are the entities who have deposited coins into the staking contract. This list is reloaded each block, since there could have been new validators who had deposited tokens in the previous block. In Testnet T3, when each block is created, as part of the finalization part, a block winner is selected among this list of depositors and a fixed amount of reward is deposited to this winner. Important point to note here is that the rewards get deposited to the validator's original wallet address and not the new keypair address created for running the blockchain node. This is critical for security as described in the above section. For T2 Part 1, the algorithm to select a winner is pretty rudimentary, but it sets the base for upcoming improvements. In subsequent iterations, a system such as RandDao will be used to select a winner deterministically accross blockchain nodes. Note that block rewards in mainnet will halven similar to Bitcoin, as specified in the multi-fork whitepaper.
How about attestations and slashing?
Due to timeline constraints, attestations and slashing will be implemented and improvised in iterations of T2 and T3.
How is genesis block bootstrapped?
An interesting chicken & egg problem in proof-of-stake consensus systems is that in order to create the genesis block, there has to be an initial stake. But in the genesis block there will be no existing stake, since it is the primordial block. Other blockchains like Ethereum changed from proof-of-work to proof-of-stake model, hence the staking contracts were created beforehand in the PoW blockchain. This allowed validators to deposit before the PoS hard-fork. For Testnet T3, Doge Protocol bootstrapped the initial set of blocks with validators (signers) who are hardcoded in the genesis config file. The coins from these initial validators are sent to subsequent new validators to enable testing. The new validators can then deposit the coins into the staking contract to become actual validators. The cut-off point in which the blockchain switches to this Validator set if specified in code and built into blockchain nodes. In subsequent iterations like T2, mainnet and the multi-fork of Bitcoin, Ethereum, Dogecoin, this process will polished to make it decentralized & verifiable.
Known Issues in Testnet T3
In the first iteration of T2, there is a known bug in which validators can continue to get block rewards even after they have withdrawn their entire stake. This critical bug is being actively fixed and will be released at the earliest.
Quantum Resistance
The first testnet of Doge Protocol, codenamed as T0 was released on Feb 22, 2022. This blockchain is quantum resistant and uses clique consensus. Testnet T3 also carries over the quantum resistance feature and consensus model from T0. Falcon 512, a third-round candidate in the NIST post quantum program, is used to secure accounts in this testnet. Falcon is used for digital signatures. Inter-node communication is secured using NTRU HRSS, which is a third-round candidate in the NIST post quantum program for key-exchange/key-encapsulation. Doge Protocol is the first if not one of the first to secure both accounts and inter-node communications using quantum resistant cryptography.
The inter-node communication uses a hybrid model, in which the final client and server encryption keys are derived similar to TLS as detailed in RFC 8446. NTRU HRSS is used for key exchange and the key material thus derived is used as input to HMAC HKDF functions (RFC 5869). However, unlike TLS, instead of trusting the certificate, the key of the other node is instead trusted. The private key corresponds to the Falcon key-pair used to secure the account using digital signatures.
This blockchain is built on Ethereum code-base, hence most of the Ethereum APIs and functionality are available in this blockchain.