-
Notifications
You must be signed in to change notification settings - Fork 759
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
Ethereum account #985
Ethereum account #985
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with a caveat.
- Can we add a separate test for the new Cairo type in test/utils/CairoType or an independent type test (Secp256k1Point)
- blind compile of this type will not work?
- Do we need to open an Issue on Abi Wan to support it?
I will extract this test in a separate file (there is no specific class for this cairo type).
Do you mean CallData.compile()?
I alerted Haroun in my first message. I don't know at all Abiwan, but I can tell that a hex string or a Uint8Array has to be provided. |
Secp256k1Point test file created. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Res. conflict to pass the test and can be merged
Done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, lgtm
Left a suggestion for the docs.
Also note that there is an issue with the maxFee
estimation for the ethAccount
deploy in the beforeAll
step of ETH account tx V2
suite. It can be bypassed by manually providing the maxFee
, but it probably makes sense to check the origin of the issue, if it's down to the code or devnet.
Tests where OK 3 weeks ago. |
So @PhilippeR26, If I understand well, we have to add |
A BigNumberish |
Looks like adjusting the fee estimate for the tests to pass should be ok. After that is done this PR should be ok to merge. |
Done. |
OK. It'll be address here keep-starknet-strange/abi-wan-kanabi#68 |
Motivation and Resolution
OpenZeppelin has released an Ethereum account contract v0.9.0 :
https://github.com/OpenZeppelin/cairo-contracts/tree/v0.9.0
This contract has been included in the test suite, for EthSigner validation.
A new cairo 2.5.3
core::starknet::secp256k1::Secp256k1Point
type is necessary for the Ethereum public key, and has been added in Starknet.js. (@haroune-mohammedi )https://github.com/OpenZeppelin/cairo-contracts/blob/7684fb0ca81a718d262145be6722e6f9f9493c54/src/account/utils/secp256k1.cairo#L42-L51 . So, an Eth public key is represented in Starknet.js by an hex string representing a 512 bits number, and is represented in Cairo by a tuple of 2 u256 :
(u256,u256)
, so a raw format of 4 felts.The format of the Eth signature is specific, and has to be conform to https://github.com/starkware-libs/cairo/blob/bd7cca1c3332daddc738682de0fea26da1b1973d/corelib/src/starknet/secp256_trait.cairo#L10-L18 . it's a struct with 2 u256 and a boolean, so coded on 5 felts.
Usage related changes
To connect to an Eth account :
Development related changes
Secp256k1Point
and Eth signature.Checklist: