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 |
|
2023-10-16 09:11:31 +00:00
|
|
|
| NetworkId | NetworkId (Rust enum, SCALE-encoded) |
|
|
|
|
| Coin | Coin (Rust enum, SCALE-encoded) |
|
2023-03-25 05:30:53 +00:00
|
|
|
| Session | u32 |
|
2023-10-16 09:11:31 +00:00
|
|
|
| Validator Set | (NetworkId, Session) |
|
2023-03-25 05:30:53 +00:00
|
|
|
| Key | BoundedVec\<u8, 96> |
|
2023-07-30 20:11:30 +00:00
|
|
|
| KeyPair | (SeraiAddress, Key) |
|
2023-10-16 09:11:31 +00:00
|
|
|
| ExternalAddress | BoundedVec\<u8, 196> |
|
2023-03-25 05:30:53 +00:00
|
|
|
| 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 |
|