-
Notifications
You must be signed in to change notification settings - Fork 18
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
feat: add support for starknet account to offchain actions #383
Conversation
It's ready on sx side, waiting for update on backend (sequencer) side to accept starknet addresses |
If you are signed in using ArgentX (or Braavos, or any other Starknet wallet) you will get Starknet provider, starknet's |
Yes, I just finally made it work with StarknetSig. A small thing I noticed is that there are no network switcher when the wallet is on the wrong network, and the signing will fail with "Invalid chain ID" |
Shouldn't the alias and any hub-related action done with it be agnostic of the chain currently used in the wallet? That's at least how it works for evm wallets right now |
Is this PR supposed to work or it's missing sequencer support? |
refactoring in progress, to include features in the current cycle |
@wa0x6e this PR is waiting to get retested as sequencer PR has been merged, is that correct? |
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.
It worked with Argent X (Starknet mainnet account following starknet mainnet space). |
Yes, just confirmed the issue with braavos and argentx. Braavos is returning a signature array with 3 items, whereas argent x is returning only 2 Working on a fix on snapshot.js side |
Fixed deployed on sequencer. You can now sign with argent x or braavos wallet. Still, braavos can sign the message on any chain, whereas argent x will return an error when signing on a different chainId than the one set in the message |
I still encounter this issue with Braavos wallet. Braavos (failing): curl 'https://seq.snapshot.org/' \
-H 'accept: application/json' \
-H 'accept-language: en-GB,en-US;q=0.9,en;q=0.8,pl;q=0.7' \
-H 'content-type: application/json' \
-H 'origin: http://localhost:8080' \
-H 'priority: u=1, i' \
-H 'referer: http://localhost:8080/' \
-H 'sec-ch-ua: "Chromium";v="124", "Brave";v="124", "Not-A.Brand";v="99"' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'sec-ch-ua-platform: "macOS"' \
-H 'sec-fetch-dest: empty' \
-H 'sec-fetch-mode: cors' \
-H 'sec-fetch-site: cross-site' \
-H 'sec-gpc: 1' \
-H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36' \
--data-raw '{"address":"0x0679a64fb03683f0aea697da37e2b62549f5d527aadd7fa06f7cb4a0dd8f7f58","sig":["0x303ce05e24ab6836e10be55f2322ec476a8277a9fba3ad9121f3c4f44c22b9b","0x1946094ed071a324589562bacc67d4db45824d30c5db367fe6cdf57c43b2e93"],"data":{"domain":{"name":"sx-starknet","version":"0.1.0","chainId":"0x534e5f4d41494e","verifyingContract":""},"types":{"StarkNetDomain":[{"name":"name","type":"felt252"},{"name":"version","type":"felt252"},{"name":"chainId","type":"felt252"},{"name":"verifyingContract","type":"ContractAddress"}],"SetAlias":[{"name":"from","type":"ContractAddress"},{"name":"alias","type":"string"},{"name":"timestamp","type":"felt"}]},"message":{"from":"0x0679a64fb03683f0aea697da37e2b62549f5d527aadd7fa06f7cb4a0dd8f7f58","timestamp":1722013734,"alias":"0x20Fe6C2F907407CacaF5f4Da0aDA30BB4B975eb8"},"primaryType":"SetAlias"}}' ArgentX (working): curl 'https://seq.snapshot.org/' \
-H 'accept: application/json' \
-H 'accept-language: en-GB,en-US;q=0.9,en;q=0.8,pl;q=0.7' \
-H 'content-type: application/json' \
-H 'origin: http://localhost:8080' \
-H 'priority: u=1, i' \
-H 'referer: http://localhost:8080/' \
-H 'sec-ch-ua: "Chromium";v="124", "Brave";v="124", "Not-A.Brand";v="99"' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'sec-ch-ua-platform: "macOS"' \
-H 'sec-fetch-dest: empty' \
-H 'sec-fetch-mode: cors' \
-H 'sec-fetch-site: cross-site' \
-H 'sec-gpc: 1' \
-H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36' \
--data-raw '{"address":"0x06abd599ab530c5b3bc603111bdd20d77890db330402dc870fc9866f50ed6d2a","sig":["0x7612c93866317c50256dc3803a42ea222d05f7e091cf926f05627707959be39","0x5b2cdee002fb8244a8ca13bd2929a9afd5f53eaf3bd0eb51bfe0ee307ce6157"],"data":{"domain":{"name":"sx-starknet","version":"0.1.0","chainId":"0x534e5f4d41494e","verifyingContract":""},"types":{"StarkNetDomain":[{"name":"name","type":"felt252"},{"name":"version","type":"felt252"},{"name":"chainId","type":"felt252"},{"name":"verifyingContract","type":"ContractAddress"}],"SetAlias":[{"name":"from","type":"ContractAddress"},{"name":"alias","type":"string"},{"name":"timestamp","type":"felt"}]},"message":{"from":"0x06abd599ab530c5b3bc603111bdd20d77890db330402dc870fc9866f50ed6d2a","timestamp":1722013819,"alias":"0x0fdC188BdAb37b82928D1e87dAfb6c8654d777a4"},"primaryType":"SetAlias"}}' Looks like both use 2 value signature, so it's some other problem. |
Looks like Bravoos account is not deployed https://starkscan.co/contract/0x0679a64fb03683f0aea697da37e2b62549f5d527aadd7fa06f7cb4a0dd8f7f58 Signatures with non deployed accounts are not working. so we thought of disabling write actions with such accounts #537 |
@ChaituVR good point, got lost when trying different accounts across wallets. I can reproduce it with accounts that are deployed as well: Braavos, account deployed on sepolia: curl 'https://seq.snapshot.org/' \
-H 'accept: application/json' \
-H 'accept-language: en-GB,en-US;q=0.9,en;q=0.8,pl;q=0.7' \
-H 'content-type: application/json' \
-H 'origin: http://localhost:8080' \
-H 'priority: u=1, i' \
-H 'referer: http://localhost:8080/' \
-H 'sec-ch-ua: "Chromium";v="124", "Brave";v="124", "Not-A.Brand";v="99"' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'sec-ch-ua-platform: "macOS"' \
-H 'sec-fetch-dest: empty' \
-H 'sec-fetch-mode: cors' \
-H 'sec-fetch-site: cross-site' \
-H 'sec-gpc: 1' \
-H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36' \
--data-raw '{"address":"0x07c39c8912b61368aeb3111ad480fc661162798a7fe10be6fb880e2c18ccbc6f","sig":["0x1","0x6e34a42393e79d0b30b93badbe3781e909469e71e7756b811ec29513831094c","0x574c0bdac26626315725a01056a208074323d6eb3382b49751872e236fa9a56"],"data":{"domain":{"name":"sx-starknet","version":"0.1.0","chainId":"0x534e5f5345504f4c4941","verifyingContract":""},"types":{"StarkNetDomain":[{"name":"name","type":"felt252"},{"name":"version","type":"felt252"},{"name":"chainId","type":"felt252"},{"name":"verifyingContract","type":"ContractAddress"}],"SetAlias":[{"name":"from","type":"ContractAddress"},{"name":"alias","type":"string"},{"name":"timestamp","type":"felt"}]},"message":{"from":"0x07c39c8912b61368aeb3111ad480fc661162798a7fe10be6fb880e2c18ccbc6f","timestamp":1722014767,"alias":"0x9C5eCC4F164AbA7fA284efafee4fFfb2101Ae0BC"},"primaryType":"SetAlias"}}' I don't have mainnet Braavos account at the moment. |
This payload pass when sent to testnet.seq.snapshot.org. Your account is only deployed on Sepolia, so only testnet.sequencer will be able to verify, and vice versa, sequencer mainnet will only be able to verify contract on mainnet |
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.
tACK
Regression from: #383 (but broken change commited by me).
Regression from: #383 (but broken change commited by me).
Summary
Closes: #372 and https://github.com/snapshot-labs/pitches/issues/83
This PR add starknet wallet support for
setAlias
on offchain networks.Once alias is created, a starknet account will be able to follow/unfollow a space and edit its user profile
With this PR, features on starknet accounts will be on par with EVM accounts
Changes
address
as a padded addressSignatureData
from sx/offchain/types, and use the global one from sx/typesHow to test
Waiting merging of snapshot-labs/snapshot-sequencer#400