Hyle-org / examples

Collection of example contracts to be deployed on Hylé
2 stars 9 forks source link

Ethereum signature verification on Hylé #7

Open s0lness opened 3 weeks ago

s0lness commented 3 weeks ago

Write a program to verify Ethereum signature on Hylé. This is the 1st step to supporting Ethereum wallets on Hylé. You can do it in any language (Noir, Rust, Cairo), (https://github.com/starkware-libs/cairo/blob/main/corelib/src/starknet/eth_signature.cairo).

Here's the documentation to code your 1st smart contract on Hylé.

Here's the example of the ECDSA signature verification in Noir used for the vibe check demo.

Iwueseiter commented 3 weeks ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I'm a smart contract developer and I have contributed to project here and with that experience, I'd tackle this issue as expected using cairo lang. I'd follow the example provided in the Starkware ECDSA verification. I would be done on or before first of September when the ODHACK is ending.

How I plan on tackling this issue

Here is how I intend to tackle this issue: with my understanding of the ECDSA Signature which consists of two components, r and s, which are derived from the private key and the message hash, I'd set up cairo Environment and proceed to write the ECDSA Verification Function. after the function is implemented and tested, I'd deploy it to the Hylé network. I'd run relevant test to ensure the logic functions as expected.

PavitraAgarwal21 commented 3 weeks ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I am a seasoned smart contract engineer with deep expertise in Cairo, Rust, Solidity, and zero-knowledge technologies. My experience includes building ERC721 contracts, working extensively with Ethereum and StarkNet, and leveraging zero-knowledge proofs for enhanced security and privacy. I excel in delivering secure, efficient blockchain solutions and handling multi-language projects, making me well-equipped to drive innovative smart contract development on Hylé.

How I plan on tackling this issue

To verify Ethereum signatures on Hylé, I would start by understanding the ECDSA algorithm used in Ethereum. I'd choose Cairo, given its compatibility with StarkNet and Hylé. The approach involves parsing the Ethereum signature into r, s, and v components, hashing the message with Keccak-256, and using Cairo’s ECDSA verification function (verify_eth_signature.cairo) to validate the signature against the public key. Testing would involve validating known signatures. Finally, I'd deploy the contract on Hylé following the platform's documentation, ensuring it supports Ethereum wallets securely.

guha-rahul commented 3 weeks ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I have experience in writing rust code and i have written circuits in halo2 and starky. I have also some experience with cairo. It can be a fun moment to learn and write risc0 zkvm code.

How I plan on tackling this issue

Since the Eth signature is already implemented in cairo it can be levereged to make the verification hyle contract. I also want to explore how we can use risc0 here.

0xTitan commented 3 weeks ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I have experience in solidity, cairo and rust. I already contributed thru OnlyDust previously. I'm training myself with NodeGuardians to increae my skills and already work with ECDSA signature in solidity.

How I plan on tackling this issue

I would like to propose a solution using Noir by reusing the example done for vibe check demo.

wraitii commented 3 weeks ago

Hello all, thanks for applying 😄

Assigning this one to @guha-rahul. Keep in mind that we support Cairo but not starknet extensions. We have Risc0 in Collatz and Cairo in Vibe Check.

For questions, please join t.me/hyle_org. We try to keep the docs at https://docs.hyle.eu up-to-date but things change quickly.