2022-07-20 05:45:07 +00:00
|
|
|
# Constants
|
|
|
|
|
|
|
|
### Types
|
|
|
|
|
|
|
|
These are the list of types used to represent various properties within the
|
|
|
|
protocol.
|
|
|
|
|
2023-03-25 05:30:53 +00:00
|
|
|
| Alias | Type |
|
|
|
|
|-----------------|----------------------------------------------|
|
|
|
|
| SeraiAddress | sr25519::Public (unchecked [u8; 32] wrapper) |
|
|
|
|
| Amount | u64 |
|
|
|
|
| NetworkId | u16 |
|
|
|
|
| Coin | u32 |
|
|
|
|
| Network | Vec<Coin> |
|
|
|
|
| Session | u32 |
|
|
|
|
| Validator Set | (Session, NetworkId) |
|
|
|
|
| Key | BoundedVec\<u8, 96> |
|
2023-07-30 20:11:30 +00:00
|
|
|
| KeyPair | (SeraiAddress, Key) |
|
2023-03-25 05:30:53 +00:00
|
|
|
| ExternalAddress | BoundedVec\<u8, 128> |
|
|
|
|
| Data | BoundedVec\<u8, 512> |
|
2022-07-20 05:45:07 +00:00
|
|
|
|
|
|
|
### Networks
|
|
|
|
|
2023-01-05 03:52:41 +00:00
|
|
|
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.
|
2022-07-20 05:45:07 +00:00
|
|
|
|
2023-03-25 05:30:53 +00:00
|
|
|
| Network | Curve | ID |
|
|
|
|
|----------|-----------|----|
|
2023-04-18 06:01:53 +00:00
|
|
|
| Serai | Ristretto | 0 |
|
|
|
|
| Bitcoin | Secp256k1 | 1 |
|
|
|
|
| Ethereum | Secp256k1 | 2 |
|
|
|
|
| Monero | Ed25519 | 3 |
|
2022-07-20 05:45:07 +00:00
|
|
|
|
|
|
|
### Coins
|
|
|
|
|
|
|
|
Coins exist over a network and have a distinct integer ID.
|
|
|
|
|
2022-07-20 06:56:58 +00:00
|
|
|
| Coin | Network | ID |
|
|
|
|
|----------|----------|----|
|
2023-01-20 16:00:18 +00:00
|
|
|
| Serai | Serai | 0 |
|
|
|
|
| Bitcoin | Bitcoin | 1 |
|
|
|
|
| Ether | Ethereum | 2 |
|
|
|
|
| DAI | Ethereum | 3 |
|
|
|
|
| Monero | Monero | 4 |
|