Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the hardware signer compatibility (secp256r1) #193

Open
remiroyc opened this issue Nov 24, 2023 · 4 comments
Open

Add the hardware signer compatibility (secp256r1) #193

remiroyc opened this issue Nov 24, 2023 · 4 comments
Labels
lang:cairo Work on the Starknet part of the application; you need to know Cairo lang. priority: medium status: help wanted Extra attention is needed

Comments

@remiroyc
Copy link
Contributor

remiroyc commented Nov 24, 2023

Problem

The Bravos wallets use secure enclave and NIST-P256 elliptic curve (secp256r1) to sign messages.
We must implement this signer in Cairo to verify the order proof and be filly compatible with this kind of wallets.

Feature request

The task here is to add a variant to the SignerValidator enum to support this: https://github.com/starkware-libs/cairo/blob/v2.3.1/corelib/src/starknet/secp256r1.cairo

impl SignerValidator of SignatureChecker {
    fn verify(hash: felt252, signer: Signer) -> felt252 {
        match signer {
            Signer::WEIERSTRESS_STARKNET(sign_info) => {
                let is_valid = ecdsa::check_ecdsa_signature(
                    hash, sign_info.user_pubkey, sign_info.user_sig_r, sign_info.user_sig_s
                );
                assert(is_valid, 'INVALID_SIGNATURE');
                sign_info.user_pubkey
            }
        }
    }
}

#[derive(Serde, Copy, Drop)]
enum Signer {
    WEIERSTRESS_STARKNET: SignInfo,
}

Links

https://braavos.app/hardware-signer-2fa-security-crypto-smart-contract-wallets/

@remiroyc remiroyc added lang:cairo Work on the Starknet part of the application; you need to know Cairo lang. app:orderbook labels Nov 24, 2023
@remiroyc remiroyc changed the title Add the hardware signer compatibility: NIST-P256 elliptic curve (secp256r1) Add the hardware signer compatibility (secp256r1) Nov 24, 2023
@remiroyc remiroyc added the status: help wanted Extra attention is needed label Nov 24, 2023
@aji70
Copy link

aji70 commented Sep 19, 2024

hey i'm a solidity and cairo developer basecamp 7 graduate and would like to give this issue a go

@MPSxDev
Copy link

MPSxDev commented Oct 21, 2024

I am a member of the Dojo Coding community.
I would like to work on this issue, I am immediately available to work. We can develop a solution until we achieve what we want.

@od-hunter
Copy link

od-hunter commented Oct 22, 2024

Hi @kwiss , @remiroyc , let me get this done please, I’m ready to work. I’ve worked on this before, Kindly assign.

@ShantelPeters
Copy link
Contributor

Please can I be assigned to this issue @kwiss @remiroyc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang:cairo Work on the Starknet part of the application; you need to know Cairo lang. priority: medium status: help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

6 participants