xJonathanLEI / starkli

Starkli (/ˈstɑːrklaɪ/), a ⚡ blazing ⚡ fast ⚡ CLI tool for Starknet powered by 🦀 starknet-rs 🦀
https://book.starkli.rs
Apache License 2.0
155 stars 43 forks source link

Add support to import Metamask snap as signer with private key #64

Open 0xcoburn opened 5 months ago

0xcoburn commented 5 months ago

Wondering if we can add starkli support for a Metamask snap account, I can submit a PR, would it be any different than how you added support for Braavos and argent-X? Or should it be pretty straightforward?

xJonathanLEI commented 5 months ago

I have never used the Metamask snap account. Does it use an L1 private key for signing? So secp256k1?

0xcoburn commented 5 months ago

It's the familiar Metamask user interface just compatible with starknet. you can't switch between EVM compatible chains like you can with original Metamask though so it's strictly a Starknet wallet. I'm not sure which signature algorithm it uses but I'm guessing it'd be similar to what argent-X or Braavos are using

xJonathanLEI commented 5 months ago

Will have to look into their contracts to see what's there then.

0xcoburn commented 5 months ago

It uses the starkcurve so I think it wouldn't be much different than importing braavos or argent as a signer, but i don't know enough

https://github.com/Consensys/starknet-snap/blob/main/packages/starknet-snap/src/utils/starknetUtils.ts