10
votes
How to convert a Substrate address to an Etherum address?
The Ethereum address correspond to the last 20 bytes of the keccak-256 hash of the (decompressed) secp256k1 public key.
For example, given the following key generated via subkey tool:
❯ subkey ...
6
votes
Accepted
How do ECDSA subkeys differ from Bitcoin/Ethereum keys?
The process of how the private keys are derived is slightly different. This applies to both the how the (parent) key is generated and then subsequent derivations on this.
In BTC/ETC and most (all ...
4
votes
Accepted
Process ethereum transactions in an offchain worker
You can use some of the tools from: https://github.com/rust-ethereum/.
Namely, if you're looking to create Ethereum transactions in an offchain worker then this should work:
https://github.com/rust-...
4
votes
Accepted
Polkadot Patricia Trie compatible with Ethereum implementation
Openethereum did use the same dependency but with a different node codec (https://github.com/openethereum/openethereum/tree/d8305c52ea805e62d7532c3ac76386873984d326/crates/db/patricia-trie-ethereum).
...
3
votes
which libp2p module do I use to broadcast data to peers in the network e.g blockchain? do I use mdns or kademlia for blockchain?
Kademlia and mDNS are different kinds of peer discovery mechanisms. For Kademlia you need at least one bootnode that you already know and from whom you can learn about other nodes of the network. mDNS ...
3
votes
Ethereum chain as a Substrate chain
Besides what has already been said, there was indeed a related thought experiment in the past exploring the flexibility of Substrate framework. We know Ethereum block structures vs Polkadot/Substrate ...
3
votes
How to Sign an Ethereum transaction from substrate?
You can not sign from your on chain code. Your on chain code needs to be deterministic. If you don't provide your private key to every node in the network, they could not import the block and while ...
3
votes
the trait `WrapperTypeEncode` is not implemented for `ethereum_types::H256` & `ethereum_types::U256`
Resolved after updating the version below two crates as
ethereum = { version = "0.12", default-features = false, features = ["with-codec"] }
ethereum-types = { version = "0....
2
votes
convert ethereum public key to substrate public key
The EVM works in a sandbox with its own accounts (and mapped accounts). So it is possible to access all tokens within the EVM sandbox with a Ethereum signer, while EVM accounts cannot make a ...
2
votes
How do ECDSA subkeys differ from Bitcoin/Ethereum keys?
In Substrate related blockchains the account id is derived from the public key using SS58 encoding. See here: https://docs.substrate.io/v3/advanced/ss58/
2
votes
Accepted
Ink smart contracts are giving build error when i am using ethabi rust crate
Add the following changes in your contact Cargo.toml
[dependencies]
ink = { version ="4.0.0-alpha.3", default-features = false }
ethabi = { path = "../ethabi", default-features = ...
2
votes
How to add evm and ethereum pallet from scratch into substrate node?
If you are totally new first take a look into the Substrate Documentation: Add a pallet to the runtime.
Then take a look into the Frontier Node Template, it is a template node that has this two ...
2
votes
Accepted
How do I use the AccountId20 and EthereumSignature Signer with polkadot.js.org?
There is an answer in Unified accounts with AURA.
But that question's title is too specific.
So, I try to answer this again.
I think you need this to make PolkadotJS adapt for your chain.
https://...
2
votes
Is it possible to turn a Frontier node into an Ethereum client?
Not a comprehensive answer, but I do not think this is trivial.
The first and most obvious issue to me would be networking support, as ETH uses devp2p and Substrate / Frontier uses libp2p.
2
votes
Ethereum chain as a Substrate chain
Substrate plus Frontier enables Ethereum compatibility. Substrate also has various Proof of Work implementations and tweaks to the default node template that one could configure to be compliant with ...
1
vote
Accepted
Error While Configuring EVM in Substrate Parachain: Conflict in 'syn' Crate
You will inevitably encounter this issue.
Your polkadot-sdk dependencies are at version https://github.com/sayyedkamran/blockguard-node/commit/69266c74ee67d29ff8337176cd225a47ed230554#diff-...
1
vote
Accepted
How to query the number of EVM contracts in a chain
One way is by querying chain state for all entries of EVM::AccountCodes or EVM::AccountCodesMetadata storages and counting them. For each deployed contract, its code is stored in AccountCodes.
Keep in ...
1
vote
Invalid transaction:1010 Invalid: Transaction has a bad signature
Follow the steps on this tutorial Access EVM Accounts, you have to Setting -> Developer in PolkadotJS UI and define the account information to create an EVM Account as the tutorial explain.
Check ...
1
vote
How can I create a bridge between a solo chain created with substrate and Ethereum blockchain?
Any parachain in Polkadot could benefit from BridgeHub systemchain, though in your case being a solo-chain I think you will want to look for solutions like https://github.com/ChainSafe/chainbridge-...
1
vote
Accepted
Troubleshooting Polkadot.js Recognition of Prefunded Dev Accounts on a Network Using EthereumSignature
Apps actually does have a dedicated set of ethereum-style dev accounts and it does know how to make ethereum-style signatures. The tricky part is that it only enables this feature on a few hard-coded ...
1
vote
Troubleshooting Polkadot.js Recognition of Prefunded Dev Accounts on a Network Using EthereumSignature
There is no recognition logic, just hardcoded values
https://github.com/polkadot-js/common/blob/master/packages/keyring/src/testing.ts
So you just should update the addresses of prefunded accounts to ...
1
vote
I Can't Generate The right AccountId from Ethereum(H160) Address
There isn’t Alice or Bob in H160.
Use these instead:
[
{
"name": "Alith",
"p": "...
1
vote
Derived H160 address is different than showing in metamask?
It depends on the deriving algorithm.
// sr25519
privatek --f(privatek)--> publick1
// ecdsa
privatek --g(privatek)--> publick2
// derived ecdsa (from sr25519)
privatek --f(privatek)--> ...
1
vote
Balance becomes zero after changing Account address type from Substrate address to Ethereum address
That's true.
You shouldn't see any balances.
Here is how the account data is stored:
Account StorageMap - 32 bytes -> account data
After the runtime upgrade it was changed to:
Account StorageMap - ...
1
vote
How to connect substrate node to metamask?
The HTTP RPC url is what you want, which is what you see at the beginning of the logs. By default this is localhost and port 9933, but you can change this with the flag --rpc-port
In terms of chainId,...
1
vote
Is there any way to compile ink contract to EVM bytecode?
I think it's not possible to compile ink smart contract to evm bytecode. As per ink doc here, ink contract can compile in ANY WASM VM and If anyhow if we try to compile then, I think we may face some ...
1
vote
deploy solidity ethereum to parachain with ExhaustsResources error
BlockWeights was set here.
Tips:
If you have sudo pallet on your chain. You could try sudo_unchecked_weight. To verify if this is the root cause.
1
vote
Accepted
How to make a Frontier demo for running Ethereum smart contracts?
[Solved] here are the steps to take:
Go into the Frontier repo
Fix the Substrate version to what you need: like polkadot-v0.9.24
Open this file repo/template/runtime/src/lib.rs
Change your default ...
1
vote
Accepted
How to connect my Parachain and Ethereum to ChainBridge?
You can take a look at this documentation.
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
ethereum × 35evm × 10
frontier × 10
substrate-node-template × 5
polkadot × 4
polkadot-js × 4
smart-contract × 3
account × 3
substrate-node × 2
parachain × 2
ink × 2
offchain-worker × 2
frontier-node-template × 2
moonbeam × 2
bridge × 2
client × 2
ecdsa × 2
chainbridge × 2
pallet × 1
rust × 1
blockchain × 1
rpc × 1
transactions × 1
scale-codec × 1
metadata × 1