solana_sdk::secp256k1_instruction

Function new_secp256k1_instruction

source
pub fn new_secp256k1_instruction(
    priv_key: &SecretKey,
    message_arr: &[u8],
) -> Instruction
Expand description

Sign a message and create a secp256k1 program instruction to verify the signature.

This function is suitable for simple uses of the secp256k1 program. More complex uses must encode the secp256k1 instruction data manually. See the module documentation for examples.

The instruction generated by this function must be the first instruction included in a transaction or it will not verify. The SecpSignatureOffsets structure encoded in the instruction data specify the instruction indexes as 0.

message_arr is hashed with the keccak hash function prior to signing.