ArkoorBuilder

Struct ArkoorBuilder 

Source
pub struct ArkoorBuilder<'a, T: Clone> {
    pub input: &'a Vtxo,
    pub user_nonce: &'a PublicNonce,
    pub outputs: Cow<'a, [T]>,
}
Expand description

This types helps both the client and server with building arkoor txs in a synchronized way. It’s purely a functional type, initialized with the parameters that will make up the arkoor: the input vtxo to be spent and the desired outputs.

The flow works as follows:

Fields§

§input: &'a Vtxo§user_nonce: &'a PublicNonce§outputs: Cow<'a, [T]>

Implementations§

Source§

impl<'a, T: Borrow<VtxoRequest> + Clone> ArkoorBuilder<'a, T>

Source

pub fn new( input: &'a Vtxo, user_nonce: &'a PublicNonce, outputs: impl Into<Cow<'a, [T]>>, ) -> Result<Self, ArkoorError>

Construct a generic arkoor builder for the given input and outputs.

Source

pub fn txouts(&self) -> Vec<TxOut>

Construct the transaction outputs of the resulting arkoor tx.

Source

pub fn unsigned_transaction(&self) -> Transaction

Source

pub fn sighash(&self) -> TapSighash

Source

pub fn total_weight(&self) -> Weight

Source

pub fn server_cosign(&self, keypair: &Keypair) -> ArkoorCosignResponse

Used by the Ark server to cosign the arkoor request.

Source

pub fn verify_cosign_response( &self, server_cosign: &ArkoorCosignResponse, ) -> bool

Validate the server’s partial signature.

Source

pub fn unsigned_output_vtxos(&self) -> Vec<Vtxo>

Construct the vtxos of the outputs of this OOR tx.

These vtxos are not valid vtxos because they lack the signature.

Source

pub fn build_vtxos( &self, user_sec_nonce: SecretNonce, user_key: &Keypair, cosign_resp: &ArkoorCosignResponse, ) -> Result<Vec<Vtxo>, IncorrectSigningKeyError>

Finish the arkoor process.

Returns the resulting vtxos and the signed arkoor tx.

Auto Trait Implementations§

§

impl<'a, T> Freeze for ArkoorBuilder<'a, T>

§

impl<'a, T> RefUnwindSafe for ArkoorBuilder<'a, T>
where T: RefUnwindSafe,

§

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

§

impl<'a, T> Sync for ArkoorBuilder<'a, T>
where T: Sync,

§

impl<'a, T> Unpin for ArkoorBuilder<'a, T>
where T: Unpin,

§

impl<'a, T> UnwindSafe for ArkoorBuilder<'a, T>

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
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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.

Source§

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

Source§

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>,

Source§

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V