Remove coin crate

Effective reversion of past few commits by request.
This commit is contained in:
Luke Parker
2022-10-16 13:11:32 -04:00
parent 5ce06cf1b7
commit ec7d8ac67b
9 changed files with 36 additions and 120 deletions

View File

@@ -3,10 +3,10 @@ use std::{marker::Send, io::Cursor, collections::HashMap};
use async_trait::async_trait;
use thiserror::Error;
use frost::FrostError;
use frost::{curve::Curve, FrostError};
pub use serai_coin as coin;
use coin::CoinError;
mod coin;
use coin::{CoinError, Coin};
mod wallet;
@@ -30,3 +30,11 @@ pub enum SignError {
#[error("network had an error {0}")]
NetworkError(NetworkError),
}
// 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(crate) fn additional_key<C: Coin>(k: u64) -> <C::Curve as Curve>::F {
C::Curve::hash_to_F(b"Serai DEX Additional Key", &[C::ID, &k.to_le_bytes()].concat())
}