-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Allow sending transactions from an Ethereum address derived account id #8757
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
Merged
Merged
Changes from 5 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
e274409
Add Eth address variant to MultiSignature
athei 8c1626e
Update substrate/primitives/runtime/src/lib.rs
athei 00f2778
Update from github-actions[bot] running command 'prdoc --audience run…
github-actions[bot] 7f69a25
Remove duplicate lines
athei a6c624a
Merge branch 'master' into at/eth_addr
athei 62753a2
Add missing FromEntropy
athei 659ef0b
Make Pair and Signature generic over Hasher
athei 714f5cd
Use keccak hash for the new eth signature
athei 31d44f7
Merge branch 'master' into at/eth_addr
athei 4516382
fix non-std build
athei 17ce288
Fix features
athei 5fbf328
Update prdoc
athei 52c153e
Merge branch 'master' into at/eth_addr
athei 101bd02
Merge branch 'master' into at/eth_addr
athei 9a960aa
Major because the type alias is observeable
athei c0ce388
Use generic signature
athei a41adc7
Seal recover
athei bb3108b
Merge branch 'master' into at/eth_addr
athei 216c1c2
Make public generic
athei 2f5f817
Merge branch 'master' into at/eth_addr
athei ae3f2b1
Merge branch 'master' into at/eth_addr
athei c2af62d
Merge branch 'master' into at/eth_addr
athei 3b494f5
Add ProofOfPossesion
athei File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| title: Allow sending transactions from an Ethereum address derived account id | ||
| doc: | ||
| - audience: Runtime Dev | ||
| description: |- | ||
| We always allowed signing transactions using an Bitcoin/Eth style SECP256k1 key. The account in this case is simply the blake2 hash of the public key. | ||
|
|
||
| This address derivation is problematic: It requires the public key in order to derive the account id. On Ethereum you simply can't know the public key of an address. This is why the mapping in pallet_revive is defined as `address <-> account_id`. | ||
|
|
||
| This PR adds a new signature variant that allows signing a transaction with an account id as origin that matches this mapping. | ||
|
|
||
| ## Why is this important? | ||
|
|
||
| ### Example1 | ||
| A wallet contains an SECP256k1 key and wants to interact with native Polkadot APIs. It can sign the transaction using this key. However, without this change the origin of that transaction will be different than the one it would appear under if it had signed an Ethereum transaction. | ||
|
|
||
| ### Example2 | ||
| A chain using an Ethereum style address (like Mythical) wants to send some tokens to one of their users account on AssetHub. How would they know what is the address of that user on AssetHub? With this change they can just pad the address with `0xEE` and rely on the fact that the user can interact with AssetHub using their existing key. | ||
|
|
||
| ## Why a new variant? | ||
| We can't modify the existing variant. Otherwise the same signature would suddenly map to a different account making people lose access to their funds. Instead, we add a new variant that adds control over an additional account for the same signature. | ||
| crates: | ||
| - name: sp-runtime | ||
| bump: major |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Uh oh!
There was an error while loading. Please reload this page.