-
Notifications
You must be signed in to change notification settings - Fork 116
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
Add support for Ethereum Keypairs #141
Comments
I have looked into adding ECDSA keypairs to the library before, but it was a bit more work than I thought so set it aside for the time being. With the arriving of EVM compatible parachains it is indeed more relevant, it is on the todo list. Of course a proof of concept PR would also be appreciated! :) |
Generate ECDSA Keypairs and sign extrinsics on for example Moonriver
Support for ECDSA keypairs added in https://github.com/polkascan/py-substrate-interface/releases/tag/v1.1 Feedback would be appreciated.. |
Awesome. We will try a couple of things with it and let you know. |
I received some comments that there was some trouble submitting transactions to Moonbase Alpha testnet. I will look for a way to achieve this a bit more elegant, but for now you can config the lib correctly with: substrate = SubstrateInterface(
url=MOONBASE_ALPHA_WS_URL
)
substrate.init_runtime()
substrate.runtime_config.update_type_registry({
"types": {
"Address": "H160",
"LookupSource": "H160",
"AccountId": "H160",
"ExtrinsicSignature": "EcdsaSignature",
}
}) |
@hyd628 Did you ran into any issues? Otherwise I'll close the ticket.. |
Thanks, the changes look good, but I did run into a few issues:
Traceback (most recent call last): create_from_mnemonic works.
File "/Users/henryduong/Documents/workspace/pysubstrateinterface/sendtransaction.py", line 45, in Here is the test script I used: https://github.com/hyd628/pysubstrateinterface/blob/main/sendtransaction.py |
@hyd628 I think you made a typo when chosing the keypair = Keypair.create_from_private_key(privatekey, crypto_type=KeypairType.ECDSA) And it seems to work with the test script you provided. Could you confirm this? The feedback you got was confusing though, I'll improve this so this will be easier to debug. |
This should also work with Ethereum (Ecdsa) signatures |
Everything seems to be working now, thanks this is great! |
We would like to use this library with EVM compatible parachains such as Moonbeam, but need support for Ethereum Keypairs to be included.
In this PR to Substrate: paritytech/substrate#8615, the parachain's types will be included in the Substrate metadata, so the types can be obtained at runtime. Thus the only additional change for py-substrate-interface to work with EVM compatible parachains is to add support for Ethereum keypairs (ECDSA) here.
This would be a good feature to have given the popularity of Pallet EVM and Frontier and the number of parachains that have some compatibility with EVM and Ethereum keypairs.
The text was updated successfully, but these errors were encountered: