pub fn signature_verify(address: &str, message: &str, signature: &str) {
        // signature treatment
        let bytes = base64::decode(message).expect("Error decoding base64");
        let signature = ed25519::Ed25519Signature::from_bytes(&bytes).expect("Error decoding bytes into signature");

        // address treatment
        let (hrp, data_u5) = bech32::decode(address).expect("Invalid address");
        let mut data = bech32::convert_bits(data_u5.as_ref(), 5, 8, true).expect("Error decoding bech32");
        let address_type = data.remove(0);
        if address_type == 0 {
            panic!("ed25519 version address expected , WOTS version address found");
        };
        if address_type != 1 {
            panic!("ed25519 address expected , unknown version address found");
        };
        let public_key =
            ed25519::Ed25519PublicKey::from_bytes(data.as_ref()).expect("Error decoding data into public key");

        // verification
        public_key
            .verify(&bytes, &signature)
            .expect("Error verifying signature")
    }
/// Verifies a signature
///
/// Given a `signature` you can verify if a `message` belongs to an identity (`address`)
///
/// `address` the address to which the signature is supposed to belong
///
/// `message` the message to which the signature is supposed to belong
///
/// `signature` the signature to verify
///
/// # Example
/// ```no_run
/// use stronghold::Stronghold;
/// let address = "iot10ux2jxa9ashasuendazzrutwvyqv7m9emtgmx64wwdtewzqf4exq09lkta";
/// let message = "With this signed message you can verify my address ownership";
/// let signature = "fMBliDcKbb8HAcjnQET24YhNz/88tKxJeyjSF1ZMky6VUxA3WCXzD7Gw296EHWdBx57ROmFqiYAUgdmVP9vVBg==";
/// let is_legit = Stronghold::signature_verify(&address, &message, &signature);
/// ```


`address` the address to which the signature is supposed to belong

`message` the message to which the signature is supposed to belong

`signature` the signature to verify
` address ` the address to which the signature is supposed to belong ` message ` the message to which the signature is supposed to belong ` signature ` the signature to verify
pub fn signature_verify(address: &str, message: &str, signature: &str) {
        // signature treatment
        let bytes = base64::decode(message).expect("Error decoding base64");
        let signature = ed25519::Ed25519Signature::from_bytes(&bytes).expect("Error decoding bytes into signature");
        // address treatment
        let (hrp, data_u5) = bech32::decode(address).expect("Invalid address");
        let mut data = bech32::convert_bits(data_u5.as_ref(), 5, 8, true).expect("Error decoding bech32");
        let address_type = data.remove(0);
        if address_type == 0 {
            panic!("ed25519 version address expected , WOTS version address found");
        };
        if address_type != 1 {
            panic!("ed25519 address expected , unknown version address found");
        };
        let public_key =
            ed25519::Ed25519PublicKey::from_bytes(data.as_ref()).expect("Error decoding data into public key");
        // verification
        public_key
            .verify(&bytes, &signature)
            .expect("Error verifying signature")
    }
pub fn signature_verify ( address : & str , message : & str , signature : & str ) { // signature treatment let bytes = base64 :: decode ( message ) . expect ( " " ) ; let signature = ed25519 :: Ed25519Signature :: from_bytes ( & bytes ) . expect ( " " ) ; // address treatment let ( hrp , data_u5 ) = bech32 :: decode ( address ) . expect ( " " ) ; let mut data = bech32 :: convert_bits ( data_u5 . as_ref ( ) , 5 , 8 , true ) . expect ( " " ) ; let address_type = data . remove ( 0 ) ; if address_type == 0 { panic ! ( " " ) ; } ; if address_type != 1 { panic ! ( " " ) ; } ; let public_key = ed25519 :: Ed25519PublicKey :: from_bytes ( data . as_ref ( ) ) . expect ( " " ) ; // verification public_key . verify ( & bytes , & signature ) . expect ( " " ) }
Verifies a signature
Given a `signature` you can verify if a `message` belongs to an identity (`address`)
Verifies a signature Given a ` signature ` you can verify if a ` message ` belongs to an identity ( ` address ` )
address
&str
message
&str
signature
&str
example
None