pub struct Address {
pub version: u8,
pub hash: Vec<u8>,
}Fields§
§version: u8§hash: Vec<u8>Implementations§
Source§impl Address
impl Address
pub fn new(version: u8, hash: Vec<u8>) -> Result<Self, TransactionError>
pub const fn is_null_data(&self) -> bool
Sourcepub fn from_compressed_public_key(
public_key: &[u8; 33],
) -> Result<Self, TransactionError>
pub fn from_compressed_public_key( public_key: &[u8; 33], ) -> Result<Self, TransactionError>
Construct HSD’s version-zero single-key witness program from an original compressed secp256k1 public key.
This performs the canonical BLAKE2b-160 address hash. Callers making a cryptographic trust decision must separately validate that the SEC1 bytes encode a curve point.
pub fn validate(&self) -> Result<(), TransactionError>
Trait Implementations§
impl Eq for Address
impl StructuralPartialEq for Address
Auto Trait Implementations§
impl Freeze for Address
impl RefUnwindSafe for Address
impl Send for Address
impl Sync for Address
impl Unpin for Address
impl UnsafeUnpin for Address
impl UnwindSafe for Address
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
Mutably borrows from an owned value. Read more