Further work on transaction signing

This commit is contained in:
Luke Parker
2024-09-06 03:20:38 -04:00
parent b62fc3a1fa
commit a353f9e2da
13 changed files with 299 additions and 74 deletions

View File

@@ -20,7 +20,8 @@ ignored = ["scale", "borsh"]
workspace = true
[dependencies]
group = { version = "0.13", default-features = false }
ciphersuite = { path = "../../../crypto/ciphersuite", default-features = false, features = ["std"] }
frost = { package = "modular-frost", path = "../../../crypto/frost", default-features = false }
scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["std"] }
borsh = { version = "1", default-features = false, features = ["std", "derive", "de_strict_order"] }

View File

@@ -5,16 +5,25 @@
use core::marker::PhantomData;
use std::io;
use group::GroupEncoding;
use ciphersuite::{group::GroupEncoding, Ciphersuite};
use frost::{dkg::ThresholdKeys, sign::PreprocessMachine};
use serai_db::DbTxn;
/// A transaction.
pub trait Transaction: Sized {
/// Read a `Transaction`.
fn read(reader: &mut impl io::Read) -> io::Result<Self>;
/// Write a `Transaction`.
fn write(&self, writer: &mut impl io::Write) -> io::Result<()>;
}
/// A signable transaction.
pub trait SignableTransaction: 'static + Sized + Send + Sync + Clone {
/// The ciphersuite used to sign this transaction.
type Ciphersuite: Cuphersuite;
type Ciphersuite: Ciphersuite;
/// The preprocess machine for the signing protocol for this transaction.
type PreprocessMachine: PreprocessMachine;
type PreprocessMachine: Clone + PreprocessMachine<Signature: Send>;
/// Read a `SignableTransaction`.
fn read(reader: &mut impl io::Read) -> io::Result<Self>;