BLS signature | BLS verification

Hi SUI devs,

I’m having hard time passing arguments from sui cli to a function for bls signature verification. If the function is defined like this:

public fun bls_verification(signature: vector<u8>) { let message = create_message(); let bls_is_correct = bls12381::bls12381_min_pk_verify(&signature, &bls_public_key, &message); }

How to pass signature that is in hex when calling this function in sui cli? Should it be with “0x” or without it?

In FastCrypto I generate public key and signature that are plain hex values without 0x prefix, but I’m not sure what sui cli does with these values when it converts them to vector. I’ve tried all the variations but the validation on chain doesn’t work for me. It does in FastCrypto tho.
I’ll be thankful for any help.

1 Like

Yes, you should pass a signature parameter with 0x.
For example:

sui client call --function bls_verification --module <module_name>  --args 0x16333...(your signature in hex)  ... 
2 Likes

Thank you Alanvu that was very helpful :pray:

1 Like