StarknetByExample icon indicating copy to clipboard operation
StarknetByExample copied to clipboard

feat: recover public key (1.2.0)

Open enitrat opened this issue 1 year ago • 3 comments

In this example, we will demonstrate how to recover the public key from a signature and the signed message hash using recover_public_key_u32.

enitrat avatar Jun 05 '23 17:06 enitrat

I'll take this on!

HansBhatia avatar Jun 29 '23 03:06 HansBhatia

@enitrat do I use the secp256r1 or secp256k1 curve? Also I'm not entirely sure how to import the function. I tried -

use starknet::secp256_trait:: recover_public_key_u32;
use starknet::secp256k1::{Secp256k1Point, Secp256k1PointImpl};

Identifier not found: secp256_trait, Secp256k1Point, Secp256k1PointImpl.

HansBhatia avatar Jun 29 '23 16:06 HansBhatia

@HansBhatia I think you will need to upgrade Cairo to v2.x for this one

enitrat avatar Jun 30 '23 12:06 enitrat