pub trait Electrum {
fn to_electrum(&self) -> [u8; 65];
fn from_electrum(data: &[u8]) -> Option<Self>
where
Self: Sized;
}
Expand description
Trait for encoding a signature into RSV array
and V altered to be in “Electrum” notation, i.e. v += 27
Required Methods
sourcefn to_electrum(&self) -> [u8; 65]
fn to_electrum(&self) -> [u8; 65]
Encode the signature into RSV array (V altered to be in “Electrum” notation).
{r}{s}{v}
sourcefn from_electrum(data: &[u8]) -> Option<Self>where
Self: Sized,
fn from_electrum(data: &[u8]) -> Option<Self>where
Self: Sized,
Parse bytes as a signature encoded as RSV (V in “Electrum” notation).
{r}{s}{v}
Will return None
if given data has invalid length or
if V
(byte 64) component is not in electrum notation (< 27
)