Skip to main content

ExternalSparkSignerAdapter

Struct ExternalSparkSignerAdapter 

Source
pub struct ExternalSparkSignerAdapter { /* private fields */ }
Expand description

Wraps a foreign ExternalSparkSigner and implements the native spark_wallet::SparkSigner over it.

Implementations§

Trait Implementations§

Source§

impl SparkSigner for ExternalSparkSignerAdapter

Source§

fn get_identity_public_key<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<PublicKey, SignerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the wallet’s identity public key.
Source§

fn get_public_key_for_leaf<'life0, 'life1, 'async_trait>( &'life0 self, leaf_id: &'life1 TreeNodeId, ) -> Pin<Box<dyn Future<Output = Result<PublicKey, SignerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns the signing public key for a tree leaf. Needed by callers that must construct transactions (refunds, etc.) before signing them.
Source§

fn is_remote(&self) -> bool

Whether this signer is backed by a remote service, so its operations (deriving a leaf’s public key, signing) are network round-trips rather than local computation. When true, callers should avoid redundant signer calls, e.g. re-deriving keys for leaves whose ownership is already verified in storage. Defaults to false: most signers are local.
Source§

fn get_static_deposit_public_key<'life0, 'async_trait>( &'life0 self, index: u32, ) -> Pin<Box<dyn Future<Output = Result<PublicKey, SignerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the static-deposit public key at index. The wallet hands this to the operators to derive a static-deposit address. Analogous to get_public_key_for_leaf.
Source§

fn sign_authentication_challenge<'life0, 'life1, 'async_trait>( &'life0 self, challenge: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<Signature, SignerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Signs a server authentication challenge with the wallet identity key (ECDSA). Used for Spark operator (gRPC) and SSP session authentication.
Source§

fn sign_message<'life0, 'life1, 'async_trait>( &'life0 self, message: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<Signature, SignerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Signs an arbitrary user message with the wallet identity key (ECDSA). Distinct from sign_authentication_challenge so a policy-enforcing signer can gate user-facing message signing separately from session authentication.
Source§

fn sign_leaf_refund_spend<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, leaf_id: &'life1 TreeNodeId, sighash: &'life2 [u8], ) -> Pin<Box<dyn Future<Output = Result<Signature, SignerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Schnorr-sign sighash to spend a tree leaf’s P2TR refund output as a BIP341 key-path spend, with the leaf key as sole signer.
Source§

fn sign_frost<'life0, 'async_trait>( &'life0 self, jobs: Vec<FrostJob>, ) -> Pin<Box<dyn Future<Output = Result<Vec<FrostShareResult>, SignerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Produce FROST shares for a batch of jobs (maps to SPARK_SIGN_FROST). Used directly by deposit tree creation, transfer/coop-exit refund signing, timelock renewal, static-deposit refund, lightning send, and swap (with adaptor). Results are returned in the same order as jobs.
Source§

fn prepare_transfer<'life0, 'async_trait>( &'life0 self, request: PrepareTransferRequest, ) -> Pin<Box<dyn Future<Output = Result<PreparedTransfer, SignerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Prepare an outbound transfer. Returns the per-operator key-tweak packages, the new per-leaf keys, and the transfer-package signature (see [PreparedTransfer]). Refund signing is a separate sign_frost call. Maps to SPARK_PREPARE_TRANSFER.
Source§

fn prepare_claim<'life0, 'async_trait>( &'life0 self, request: PrepareClaimRequest, ) -> Pin<Box<dyn Future<Output = Result<PreparedClaim, SignerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Prepare the key-tweak step for claiming an inbound transfer. Returns one key-tweak package per operator that re-keys each claimed leaf to the receiver (see [PreparedClaim]). Refund signing is a separate sign_frost call. Maps to SPARK_CLAIM_TRANSFER.
Source§

fn prepare_lightning_receive<'life0, 'async_trait>( &'life0 self, request: PrepareLightningReceiveRequest, ) -> Pin<Box<dyn Future<Output = Result<PreparedLightningReceive, SignerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Prepare a Lightning receive. Returns the payment hash for the BOLT11 invoice and one preimage-share package per operator (see [PreparedLightningReceive]). Maps to SPARK_PREPARE_LIGHTNING_RECEIVE.
Source§

fn prepare_static_deposit<'life0, 'async_trait>( &'life0 self, request: PrepareStaticDepositRequest, ) -> Pin<Box<dyn Future<Output = Result<PreparedStaticDeposit, SignerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Prepare a static deposit. Returns the static-deposit secret encrypted for the SSP and the FROST shares for the deposit tree transactions (see [PreparedStaticDeposit]).
Source§

fn start_static_deposit_refund<'life0, 'async_trait>( &'life0 self, request: StartStaticDepositRefundRequest, ) -> Pin<Box<dyn Future<Output = Result<StartedStaticDepositRefund, SignerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Begin a static-deposit refund: return the static-deposit signing public key, a fresh user FROST nonce commitment, and the identity-key ECDSA signature over the refund user-statement. See [StartStaticDepositRefundRequest] for why this is split from sign_static_deposit_refund.
Source§

fn sign_static_deposit_refund<'life0, 'async_trait>( &'life0 self, request: SignStaticDepositRefundRequest, ) -> Pin<Box<dyn Future<Output = Result<Signature, SignerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Finish a static-deposit refund. Returns the final aggregated refund signature; the user’s contribution is bound to the nonce committed by start_static_deposit_refund.
Source§

fn sign_spark_invoice<'life0, 'async_trait>( &'life0 self, request: SignSparkInvoiceRequest, ) -> Pin<Box<dyn Future<Output = Result<SignedSparkInvoice, SignerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Schnorr-sign a Spark invoice (sats or tokens) with the identity key. Spark invoices are unrelated to Lightning.
Source§

fn prepare_token_transaction<'life0, 'async_trait>( &'life0 self, request: PrepareTokenTransactionRequest, ) -> Pin<Box<dyn Future<Output = Result<PreparedTokenTransaction, SignerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Prepare a token transaction (freeze / partial / final). Returns the identity-key signature over the request digest (see [PreparedTokenTransaction]).
Source§

fn prepare_static_deposit_claim<'life0, 'async_trait>( &'life0 self, request: PrepareStaticDepositClaimRequest, ) -> Pin<Box<dyn Future<Output = Result<PreparedStaticDepositClaim, SignerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Prepare a static-deposit claim. Returns the static-deposit secret in the clear (the SSP co-signs the claim and needs it) and the identity-key signature over the claim user-statement (see [PreparedStaticDepositClaim]).

Auto Trait Implementations§

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.

§

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.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
§

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

§

fn vzip(self) -> V

§

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