serai/docs/protocol/Constants.md
Luke Parker e979883f2d
Initial validator sets pallet (#187)
* Initial work on a Validator Sets pallet

* Update Validator Set docs per current discussions

* Update validator-sets primitives and storage handling

* Add validator set pallets to deny.toml

* Remove Curve from primitives

Since we aren't reusing keys across coins, there's no reason for it to be
on-chain (as previously planned).

* Update documentation on Validator Sets

* Use Twox64Concat instead of Identity

Ensures an even distribution of keys. While xxhash is breakable, these keys
aren't manipulatable by users.

* Add math ops on Amount and define a coin as 1e8

* Add validator-sets to the runtime and remove contracts

Also removes the randomness pallet which was only required by the contracts
runtime.

Does not remove the contracts folder yet so they can still be referred to while
validator-sets is under development. Does remove them from Cargo.toml.

* Add vote function to validator-sets

* Remove contracts folder

* Create an event for the Validator Sets pallet

* Remove old contracts crates from deny.toml

* Remove line from staking branch

* Remove staking from runtime

* Correct VS Config in runtime

* cargo update

* Resolve a few PR comments on terminology

* Create a serai-primitives crate

Move types such as Amount/Coin out of validator-sets. Will be expanded in the
future.

* Fixes for last commit

* Don't reserve set 0

* Further fixes

* Add files meant for last commit

* Remove Staking transfer
2023-01-04 22:52:41 -05:00

1.4 KiB

Constants

Types

These are the list of types used to represent various properties within the protocol.

Alias Type
Amount u64
Coin u32
Session u32
Validator Set Index u16
Validator Set Instance (Session, Validator Set Index)
Key Vec<u8>

Networks

Every network connected to Serai operates over a specific curve. The processor generates a distinct set of keys per network. Beyond the key-generation itself being isolated, the generated keys are further bound to their respective networks via an additive offset created by hashing the network's name (among other properties). The network's key is used for all coins on that network.

Networks are not acknowledged by the Serai network, solely by the processor.

Network Curve
Bitcoin Secp256k1
Ethereum Secp256k1
Monero Ed25519

Coins

Coins exist over a network and have a distinct integer ID.

Coin Network ID
Bitcoin Bitcoin 0
Ether Ethereum 1
DAI Ethereum 2
Monero Monero 3