pub struct Slate {
    pub version_info: VersionCompatInfo,
    pub num_participants: usize,
    pub id: Uuid,
    pub tx: Transaction,
    pub amount: u64,
    pub fee: u64,
    pub height: u64,
    pub lock_height: u64,
    pub ttl_cutoff_height: Option<u64>,
    pub participant_data: Vec<ParticipantData>,
    pub payment_proof: Option<PaymentInfo>,
}
Expand description

A ‘Slate’ is passed around to all parties to build up all of the public transaction data needed to create a finalized transaction. Callers can pass the slate around by whatever means they choose, (but we can provide some binary or JSON serialization helpers here).

Fields§

§version_info: VersionCompatInfo

Versioning info

§num_participants: usize

The number of participants intended to take part in this transaction

§id: Uuid

Unique transaction ID, selected by sender

§tx: Transaction

The core transaction data: inputs, outputs, kernels, kernel offset

§amount: u64

base amount (excluding fee)

§fee: u64

fee amount

§height: u64

Block height for the transaction

§lock_height: u64

Lock height

§ttl_cutoff_height: Option<u64>

TTL, the block height at which wallets should refuse to process the transaction and unlock all associated outputs

§participant_data: Vec<ParticipantData>

Participant data, each participant in the transaction will insert their public data here. For now, 0 is sender and 1 is receiver, though this will change for multi-party

§payment_proof: Option<PaymentInfo>

Payment Proof

Implementations§

source§

impl Slate

source

pub fn parse_slate_version(slate_json: &str) -> Result<u16, Error>

Attempt to find slate version

source

pub fn deserialize_upgrade(slate_json: &str) -> Result<Slate, Error>

Recieve a slate, upgrade it to the latest version internally

source

pub fn blank(num_participants: usize) -> Slate

Create a new slate

source

pub fn add_transaction_elements<K, B>( &mut self, keychain: &K, builder: &B, elems: Vec<Box<Append<K, B>>> ) -> Result<BlindingFactor, Error>
where K: Keychain, B: ProofBuild,

Adds selected inputs and outputs to the slate’s transaction Returns blinding factor

source

pub fn update_kernel(&mut self)

Update the tx kernel based on kernel features derived from the current slate. The fee may change as we build a transaction and we need to update the tx kernel to reflect this during the tx building process.

source

pub fn fill_round_1<K>( &mut self, keychain: &K, sec_key: &mut SecretKey, sec_nonce: &SecretKey, participant_id: usize, message: Option<String>, use_test_rng: bool ) -> Result<(), Error>
where K: Keychain,

Completes callers part of round 1, adding public key info to the slate

source

pub fn fill_round_2<K>( &mut self, keychain: &K, sec_key: &SecretKey, sec_nonce: &SecretKey, participant_id: usize ) -> Result<(), Error>
where K: Keychain,

Completes caller’s part of round 2, completing signatures

source

pub fn finalize<K>(&mut self, keychain: &K) -> Result<(), Error>
where K: Keychain,

Creates the final signature, callable by either the sender or recipient (after phase 3: sender confirmation)

source

pub fn participant_with_id(&self, id: usize) -> Option<ParticipantData>

Return the participant with the given id

source

pub fn participant_messages(&self) -> ParticipantMessages

helper to return all participant messages

source

pub fn verify_messages(&self) -> Result<(), Error>

Verifies any messages in the slate’s participant data match their signatures

source

pub fn calc_excess<K>(&self, keychain: &K) -> Result<Commitment, Error>
where K: Keychain,

return the final excess

Trait Implementations§

source§

impl Clone for Slate

source§

fn clone(&self) -> Slate

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Slate

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Slate

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<&Slate> for SlateV3

source§

fn from(slate: &Slate) -> SlateV3

Converts to this type from the input type.
source§

impl From<&VersionedSlate> for Slate

source§

fn from(slate: &VersionedSlate) -> Slate

Converts to this type from the input type.
source§

impl From<Slate> for SlateV3

source§

fn from(slate: Slate) -> SlateV3

Converts to this type from the input type.
source§

impl From<SlateV3> for Slate

source§

fn from(slate: SlateV3) -> Slate

Converts to this type from the input type.
source§

impl From<VersionedSlate> for Slate

source§

fn from(slate: VersionedSlate) -> Slate

Converts to this type from the input type.
source§

impl Serialize for Slate

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for Slate

§

impl Send for Slate

§

impl Sync for Slate

§

impl Unpin for Slate

§

impl UnwindSafe for Slate

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CloneAny for T
where T: Any + Clone,

§

fn clone_any(&self) -> Box<dyn CloneAny>

§

fn clone_any_send(&self) -> Box<dyn CloneAny + Send>
where T: Send,

§

fn clone_any_sync(&self) -> Box<dyn CloneAny + Sync>
where T: Sync,

§

fn clone_any_send_sync(&self) -> Box<dyn CloneAny + Send + Sync>
where T: Send + Sync,

§

impl<'a, T> DefaultFeatures<'a> for T
where T: 'a + Send + Sync + Clone,

§

fn clone_boxed(&self) -> Box<dyn DefaultFeatures<'a>>

Clone this value, and then immediately put it into a Box behind a trait object of this trait.
§

fn self_address_mut(&mut self) -> *mut ()

Returns the address of self. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<'a, T> NonSyncFeatures<'a> for T
where T: 'a + Clone,

§

fn clone_boxed(&self) -> Box<dyn NonSyncFeatures<'a>>

Clone this value, and then immediately put it into a Box behind a trait object of this trait.
§

fn self_address_mut(&mut self) -> *mut ()

Returns the address of self. Read more
§

impl<T> SafeBorrow<T> for T
where T: ?Sized,

§

fn borrow_replacement(ptr: &T) -> &T

Given ptr, which was obtained from a prior call to Self::borrow(), return a value with the same nominal lifetime which is guaranteed to survive mutations to Self. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> DebugAny for T
where T: Any + Debug,

source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<T> Erased for T

§

impl<T> UnsafeAny for T
where T: Any,