Verify signer control on setPublicKey
#922
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #469, #818.
I propose not adding a 2step flow, but to add a
signature: Span<felt252>
param tosetPublicKey
(*) used to validate that we control the new owner, and that it "accepts" this ownership -- all in a single step.To make this more user-friendly, i'm using SNIP-12 (aka Starknet's EIP712) and defining the
AddOwner
operation for theAccount.add_owner
application.Even though the
account
is already present in the hash as required by SNIP-12 and thatowner
is already known by the owner, I decided to make the struct overly explicit so users know what they're signing, even if it adds a bit of cost/redundancy/complexity.If we move forward with this proposal, we should probably tackle #409 first.
*: i'd probably go even further an rename it
set_owner
, since that's the term we're using in theOwnerAdded
and that I'm using here too.