pub struct SecretNonce(/* private fields */);Expand description
Musig Secret Nonce.
A signer who is online throughout the whole process and can keep this structure in memory can use the provided API functions for a safe standard workflow.
This structure does not implement Copy or Clone; after construction the only
thing that can or should be done with this nonce is to call Session::partial_sign,
which will take ownership. This is to prevent accidental reuse of the nonce.
See the warnings on Self::dangerous_into_bytes for more information about
the risks of non-standard workflows.
Implementations§
Source§impl SecretNonce
impl SecretNonce
Sourcepub fn as_ptr(&self) -> *const MusigSecNonce
pub fn as_ptr(&self) -> *const MusigSecNonce
Get a const pointer to the inner KeyAggCache
Sourcepub fn as_mut_ptr(&mut self) -> *mut MusigSecNonce
pub fn as_mut_ptr(&mut self) -> *mut MusigSecNonce
Get a mut pointer to the inner KeyAggCache
Sourcepub fn dangerous_into_bytes(self) -> [u8; 132]
pub fn dangerous_into_bytes(self) -> [u8; 132]
Function to return a copy of the internal array. See WARNING before using this function.
§Warning:
Storing and re-creating this structure may lead to nonce reuse, which will leak your secret key in two signing sessions, even if neither session is completed. These functions should be avoided if possible and used with care.
See https://blockstream.com/2019/02/18/musig-a-new-multisignature-standard/ for more details about these risks.
§Warning:
The underlying library, libsecp256k1, does not guarantee the byte format will be consistent
across versions or platforms. Special care should be taken to ensure the returned bytes are
only ever passed to dangerous_from_bytes from the same libsecp256k1 version, and the same
platform.
Sourcepub fn dangerous_from_bytes(array: [u8; 132]) -> SecretNonce
pub fn dangerous_from_bytes(array: [u8; 132]) -> SecretNonce
Function to create a new SecretNonce from a 32 byte array.
Refer to the warnings on SecretNonce::dangerous_into_bytes for more details.