Shard - a set of validators working together to validate transactions and create blocks. Validators in one shard can be clients of another shard, but they cannot exchange unforgeable names.
What is lost - the ability to use OCaps security between the shards.
The following Code block can be exchanged across shards:
new x in {y!(*x)}
not
y!(*@{182acdb344-7fd533-bbd5433cfe})
Shards support unforgeable names within the validator set. A block proposal containing an unforgeable name from a validator within the validator set is fine. Both of the above code blocks are supported within a shard.
The validators in a child shard are clients of the parent shard. This has a few implications:
They must listen for events taking place in the depository contract in the parent. They must listen for events taking place in the mint contract on the blockchain they are validating. They have to create events (deployments) based on events both of these chains.
A group of Rev holding validators come together and decide they want to spawn a new child shard.
If the shard wants to engage in cross shard transfers, and is not a child of the root shard, then it is advisable that validators in the shard validate transactions in the parent. To do this, they will need to stake that shard separately.
Steps
By sharding the blockchain, in essence we create 'altcoins' in each shard. Rev will exist in the rchain shard (the root shard). All other shards will have token that will be 'backed' by Rev, much in the same way that currency can be backed by gold. Tokens in shards will be exchanged for Rev in the rchain shard with a 1:1 exchange rate.
The process of transferring token between 2 shards requires invoking a contract in the nearest common ancestor of both shards. The platform will only support the atomic transfer from a child to a parent and a parent to a child.
Client software will need to provide the following data:
The validators in a shard have to be aware of certain events in the parent shard. These are:
Events in the child shard they have to be aware of for the purposes of updating the depository parameters:
Validators are listening on the depository contract & receive a message that token has been deposited.
Monitor the transaction to the depository reaches a level of safety on the parent shard
Each node can choose the frequency the node polls the parent shard for messages on the depository)
transfer
function of the depository. args: (purse, public key, return channel); returns session id over return channel.rho:uuid:<session id>
.Note: the session id is also used in the k-of-n contract to relate the validator's message to an active request.
//session id creation
contract newId(return) = { new id in { return!(*id.toByteArray) } }
transfer
function of the mint args: (purse, public key, return channel); returns session id over return channel.rho:uuid:<session id>
.Users are familiar with urls and uri formats. Therefore it's reasonable to treat the hierarchy of shards as one would treat a directory structure, and reference them in the same way.
As part of testnet launch, the Core dev team will create the number of shards that are needed to demonstrate network performance of 20,000 tps (40,000 would be even better). The actual number of shards will depend on the performance of a single shard.
The root shard will contain the genesis block for the network. It shall be called 'rchain'
If shards A and B are both children of the root shard, they would be referenced as rchain/A and rchain/B
The blockchain of the parent shard will store information about it's child shards. This information is:
The above information should be sufficient for a Read only node or client to build a tree of the shard structure similar to a blockchain explorer.
Other information that is available for a shard on the blockchain:
bond
function of PoS contract; args: (purse, public key, return channel); returns status over return channel (bond may fail validity conditions).Question: If the validator has funds locked up in the K/N contract, those funds should be held until the unbonding wait period expires.
The blessed Mint contract will exist in each shard. While the master Rev mint contract (our version of 'gold') exists only in the rchain shard at the root of the tree, all other shards have pegged their token supply to the token supply in the root shard. The mint contracts in all the shards have to mint tokens at the same time, such that the exchange rate for Rev between the shards remain 1:1 all the way up to the rchain shard (root shard). The blessed Mint contract will be a K/N contract that is created by the K/N Sharding contract
Transfer the token from fort knox out to the new mount point. The K/N contract is invoked, and the required number of validators need to agree on Exodus.