mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
Correct when the Processor starts using the first key
It waited for CONFIRMATIONS + 1 confirmations, instead of CONFIRMATIONS confirmations. Also adds a lib interface to access the coin traits and its constants.
This commit is contained in:
14
processor/src/additional_key.rs
Normal file
14
processor/src/additional_key.rs
Normal file
@@ -0,0 +1,14 @@
|
||||
use ciphersuite::Ciphersuite;
|
||||
|
||||
use crate::coins::Coin;
|
||||
|
||||
// Generate a static additional key for a given chain in a globally consistent manner
|
||||
// Doesn't consider the current group key to increase the simplicity of verifying Serai's status
|
||||
// Takes an index, k, to support protocols which use multiple secondary keys
|
||||
// Presumably a view key
|
||||
pub fn additional_key<C: Coin>(k: u64) -> <C::Curve as Ciphersuite>::F {
|
||||
<C::Curve as Ciphersuite>::hash_to_F(
|
||||
b"Serai DEX Additional Key",
|
||||
&[C::ID.as_bytes(), &k.to_le_bytes()].concat(),
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user