pub enum DhFillPoolRequest {
Bitcoin(K1FillPool),
Ethereum(K1FillPool),
NEO(R1FillPool),
}Expand description
DhFillPool requests coordinate between the user’s client and the Nash server to gather a set of shared secret R values. The user sends a list of public ECDSA Points to the Nash server. The server sends back its own list of public Points. Both parties then multply the public point by the secret value to construct the same shared secret value (diffie-hellman). Bitcoin and Ethereum both use the Secp256k1 curve, while NEO users the Secp256r1 curve. While this request type holds both the secret and the public values, only the public values are used in creating the GraphQL request. The secrets are used to process a response. Pool requests will generate N new R values.
Variants§
Implementations§
Source§impl DhFillPoolRequest
impl DhFillPoolRequest
Sourcepub fn make_query(&self) -> QueryBody<Variables>
pub fn make_query(&self) -> QueryBody<Variables>
Build a GraphQL request to get R values for MPC signing. These values can be for
secp256k1 or secp256r1 depending on curve. This sets the state r1 or k1
in the client with the secret values associated with DH, which will be used on
a future request to set_pool
Source§impl DhFillPoolRequest
impl DhFillPoolRequest
Sourcepub fn new(chain: Blockchain, size: u32) -> Result<Self>
pub fn new(chain: Blockchain, size: u32) -> Result<Self>
Create a new DhFillPool request for a given blockchain
Sourcepub fn blockchain(&self) -> Blockchain
pub fn blockchain(&self) -> Blockchain
Get blockchain associated with DH request
Trait Implementations§
Source§impl Clone for DhFillPoolRequest
impl Clone for DhFillPoolRequest
Source§fn clone(&self) -> DhFillPoolRequest
fn clone(&self) -> DhFillPoolRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DhFillPoolRequest
impl Debug for DhFillPoolRequest
Source§impl NashProtocol for DhFillPoolRequest
impl NashProtocol for DhFillPoolRequest
Source§fn graphql<'life0, 'async_trait>(
&'life0 self,
_state: Arc<RwLock<State>>,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn graphql<'life0, 'async_trait>(
&'life0 self,
_state: Arc<RwLock<State>>,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Serialize a SignStates protocol request to a GraphQL string
Source§fn response_from_json<'life0, 'async_trait>(
&'life0 self,
response: Value,
_state: Arc<RwLock<State>>,
) -> Pin<Box<dyn Future<Output = Result<ResponseOrError<Self::Response>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn response_from_json<'life0, 'async_trait>(
&'life0 self,
response: Value,
_state: Arc<RwLock<State>>,
) -> Pin<Box<dyn Future<Output = Result<ResponseOrError<Self::Response>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Deserialize response to DhFillPool protocol response
Source§fn process_response<'life0, 'life1, 'async_trait>(
&'life0 self,
response: &'life1 Self::Response,
state: Arc<RwLock<State>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn process_response<'life0, 'life1, 'async_trait>(
&'life0 self,
response: &'life1 Self::Response,
state: Arc<RwLock<State>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Update pool with response from server
type Response = DhFillPoolResponse
Source§fn acquire_permit<'life0, 'async_trait>(
&'life0 self,
_state: Arc<RwLock<State>>,
) -> Pin<Box<dyn Future<Output = Option<OwnedSemaphorePermit>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn acquire_permit<'life0, 'async_trait>(
&'life0 self,
_state: Arc<RwLock<State>>,
) -> Pin<Box<dyn Future<Output = Option<OwnedSemaphorePermit>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn process_error<'life0, 'life1, 'async_trait>(
&'life0 self,
_response: &'life1 ErrorResponse,
_state: Arc<RwLock<State>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn process_error<'life0, 'life1, 'async_trait>(
&'life0 self,
_response: &'life1 ErrorResponse,
_state: Arc<RwLock<State>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn run_before<'life0, 'async_trait>(
&'life0 self,
_state: Arc<RwLock<State>>,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<ProtocolHook>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn run_after<'life0, 'async_trait>(
&'life0 self,
_state: Arc<RwLock<State>>,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<ProtocolHook>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl Freeze for DhFillPoolRequest
impl RefUnwindSafe for DhFillPoolRequest
impl Send for DhFillPoolRequest
impl Sync for DhFillPoolRequest
impl Unpin for DhFillPoolRequest
impl UnsafeUnpin for DhFillPoolRequest
impl UnwindSafe for DhFillPoolRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> NashProtocolPipeline for T
impl<T> NashProtocolPipeline for T
Source§type PipelineState = Option<ResponseOrError<<T as NashProtocol>::Response>>
type PipelineState = Option<ResponseOrError<<T as NashProtocol>::Response>>
Source§type ActionType = T
type ActionType = T
Source§fn acquire_permit<'life0, 'async_trait>(
&'life0 self,
state: Arc<RwLock<State>>,
) -> Pin<Box<dyn Future<Output = Option<OwnedSemaphorePermit>> + Send + 'async_trait>>where
'life0: 'async_trait,
T: 'async_trait,
fn acquire_permit<'life0, 'async_trait>(
&'life0 self,
state: Arc<RwLock<State>>,
) -> Pin<Box<dyn Future<Output = Option<OwnedSemaphorePermit>> + Send + 'async_trait>>where
'life0: 'async_trait,
T: 'async_trait,
Source§fn init_state<'life0, 'async_trait>(
&'life0 self,
_state: Arc<RwLock<State>>,
) -> Pin<Box<dyn Future<Output = <T as NashProtocolPipeline>::PipelineState> + Send + 'async_trait>>where
'life0: 'async_trait,
T: 'async_trait,
fn init_state<'life0, 'async_trait>(
&'life0 self,
_state: Arc<RwLock<State>>,
) -> Pin<Box<dyn Future<Output = <T as NashProtocolPipeline>::PipelineState> + Send + 'async_trait>>where
'life0: 'async_trait,
T: 'async_trait,
Source§fn next_step<'life0, 'life1, 'async_trait>(
&'life0 self,
pipeline_state: &'life1 <T as NashProtocolPipeline>::PipelineState,
_client_state: Arc<RwLock<State>>,
) -> Pin<Box<dyn Future<Output = Result<Option<<T as NashProtocolPipeline>::ActionType>, ProtocolError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
T: 'async_trait,
fn next_step<'life0, 'life1, 'async_trait>(
&'life0 self,
pipeline_state: &'life1 <T as NashProtocolPipeline>::PipelineState,
_client_state: Arc<RwLock<State>>,
) -> Pin<Box<dyn Future<Output = Result<Option<<T as NashProtocolPipeline>::ActionType>, ProtocolError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
T: 'async_trait,
None if pipeline is finished. &State needs
to be mutable as client may modify itself when producing the next step (e.g., removing
and r value generate a signature)Source§fn process_step<'life0, 'life1, 'async_trait>(
&'life0 self,
result: <<T as NashProtocolPipeline>::ActionType as NashProtocol>::Response,
state: &'life1 mut <T as NashProtocolPipeline>::PipelineState,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
T: 'async_trait,
fn process_step<'life0, 'life1, 'async_trait>(
&'life0 self,
result: <<T as NashProtocolPipeline>::ActionType as NashProtocol>::Response,
state: &'life1 mut <T as NashProtocolPipeline>::PipelineState,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
T: 'async_trait,
Source§fn output(
&self,
state: <T as NashProtocolPipeline>::PipelineState,
) -> Result<ResponseOrError<<T as NashProtocol>::Response>, ProtocolError>
fn output( &self, state: <T as NashProtocolPipeline>::PipelineState, ) -> Result<ResponseOrError<<T as NashProtocol>::Response>, ProtocolError>
None if the pipeline is not finished