Skip to content

Latest commit

 

History

History
91 lines (57 loc) · 4.53 KB

zenip-42201.md

File metadata and controls

91 lines (57 loc) · 4.53 KB

ZenIP-42201

ZenIP: 42201
Title: Sidechain Versions
Owner: Paolo Tagliaferri, <[email protected]>; cronic, <[email protected]>
Discussions-To: Paolo Tagliaferri, <[email protected]>
Comments-URI: https://horizen.global/invite/discord
Status: Final
Type: Consensus
Created: 2022-04-07
License: MIT

Table of Contents

Abstract

This ZenIP describes the consensus rule changes of the proposed enhancements to Zen v3.1.0. The consensus rule changes will activate via a hard fork at mainchain block height #1127000. The consensus rules will include the following changes:

  • a new field version is added to sidechain creation transactions (txtype -4) inside the Sidechain Creation Output (vsc_ccout)
  • the treasury addresses for ZBF Treasury, Secure Nodes and Super Nodes will change (coinbase transaction vout[1,2,3])

In addition the following API changes are made:

  • new fields added to getblocktemplate RPC command
  • new API to retrieve all versions for specified sidechain IDs
  • new value pair added to extend the getscgenesisinfo RPC command

Motivation

The enhancements fix an issue with the management of Custom Fields included in certificates. They also extend functionality for block template requests. These enhancements have already been implemented with v3.1.0.

The change of Treasury addresses is motivated by the changing global security environment. To increase security, the 3-of-5 multisig signature scheme is changed to 4-of-7. In addition the key holders are now distributed over three separate entities: Zen Blockchain Foundation (ZBF), Horizen Community Council (HCC) and Horizen Labs (HL).

Specification

Sidechain Versioning

In previous zend versions, the withdrawalEpoch field was a 4 byte unsigned integer containing the withdrawal epoch length. The maximum valid withdrawal epoch length is limited or capped to 4032. In zend 3.1.0, the withdrawalEpochLength field is split into two separate fields, as follows.

  1. A 1 byte field for version
  2. A 3 byte field for withdrawalEpochLength

4byte

As shown above, the first (most significant byte) of the withdrawalEpochLength is used for the sidechain version. Sidechain versions before this change are assumed to be set to 0.

*Note: Because of the versioning change, version 3.1.0 is incompatible with all previous versions. Previous versions cannot be used with this hard fork.

Treasury Address Changes

The Mainnet coinbase vout addresses will change at block #1127000:

Type From To
Treasury zszpcLB6C5B8QvfDbF2dYWXsrpac5DL9WRk zshX5BAgUvNgM1VoBVKZyFVVozTDjjJvRxJ
Secure Nodes zsxWnyDbU8pk2Vp98Uvkx5Nh33RFzqnCpWN zsx68qSKMNoc1ZPQpGwNFZXVzgf27KN6a9u
Super Nodes zsnL6pKdzvZ1BPVzALUoqw2KsY966XFs5CE zszMgcogAqz49sLHGV22YCDFSvwzwkfog4k

Reward percentages will stay unchanged.

Block Template Request Extensions

The getblocktemplate method includes two additional return values, based on the optional parameter roots:

Key Required Type Description
merkleTree no string Merkle root of the tree containing transactions and certificates of the current block
scTxsCommitment no string Merkle root of the sidechain cumulative commitment tree

Note: If you construct coinbasetxn outside of zend, use getblockmerkleroots RPC to calculate these values.

Sidechain versioning

The GET_SIDECHAINS_VERSIONS websocket API returns sidechain versions for provided sidechain IDs.

The Sidechain Creation Output now includes sidechain version information. The sc_create, createrawtransaction, and getscinfo RPC commands are updated to include the version argument. This field is now mandatory when creating a new sidechain. Also, the version field has been added to CTxScCreationOut and ScFixedParamaters; it is stored in the first byte of withdrawalEpochLength. The sidechainVersion parameter is added to GetFieldElement.

getscgensisinfo extensions

The getscgenesisinfo RPC command includes a new list of pairs (sidechain_id, sidechain_version) for each certificate published in the sidechain genesis block. This is helpful in correctly computing the cumulative commitment tree root hash, especially as the sidechain bootstrapping tool deserializes custom fields included in certificates published by other sidechains.