Ethereum: What BIP32 derivation path does Electrum use?
Under the rooms of the paths in Electum
As a developer, you are a likely interest in understanding 2.0 and later versions of Ethereum, which deal with the specification of the brain computer interface (GDP) 0032 (GDP). In art art, we immerse yourself with the derivations used by Electum to create the addresses of the addresses.
What the hell 32? *
Before we continue, let us check what BIP32 see the brain computer interface (GDP) 0032 is specified in such a way that the basic address is generated with a number of rats and algorithms to produce Ethereum addresses. It is an alternative to the translation of the Merkle-based addressing generator approach for electrum.
BIP032 Submit paths
Use Toget Ethereum addresses BIP0322, electrum uses several derivation paths. The paths are defined in the specification of the GDP 0032 and contain a publication of public complaints, cryptographers and other parameters. It is different from the Denivation of the Pak usage of electrum:
P2SH(Private Key To Script Hash)
- Spv ‘(fuel public verion)
- Script
- Sectpubey
Eltectums evening paths **
ELECTUM in particular uses the successors BIP032 derivation paths to create Etherreum addresses:
- P2SH / SPV : This is a common combination by using the yays by using the yays. Use the m.
- Script / ScripterpubKey : This use of addresses based on the signature of a transaction, which contains the public yash that contains transaction jash and other information.
IMPLE code
In order to generate an Ethereum address using BIP032 -discharge paths with electrum 2.0 or higher, you can use the following code as a amazing point:
`Comfort
Import Hashlib
Drift_dress (private_eyy):

Extra the public keen ’32 bytest 32 bytes)
public_key = private_y [: 32]
Derived the script Sing P2SH and SPV financing
scripts_hash = drift_script_ey (p public_ke)
Combine short WIT transaction signature to generate an address
Address = f “{script_hash.x () jitprite_key [32:]}”
Call
weakened by the dens_script_eye):
Generate random sessions (assuming 16 bytes)
Session_y = = * 16
The public script leads the key and the sessions.
scripts_hash = Sha256 (Sitation + Public_Key). This
Return of script_has ()
Lod private file or genre rate
private_eyy = b ‘\ x01 \ x04 \ x04 \ x07 \ x07 \ x07 \ x07 \ x07 \ x07 \ x08 ’
Generate an Ethereum address using BIP0032 -Designed paths
address = danivate_dress (private_key)
Print (dress) #utper: a uniqueness of Etherum address (e.g. 0x123456789000098989890BCDEF)
“ S
Note that this code is only a frightening point, and you have to change it in your sumary and specify the sum of your case. In the case of addational influences, sleep in the generation of Ethereum addresses using BIP032 -discharge paths can complete the stool and require addictive crayptographic experiments.
*Diploma
In conclusions, Electum 2.0 and later versions use the derivation of BIP0032 specifications -PAK (P2SH / SPV, scripts / scripts script, script / scripter address) to generate older addresses in general. While he observes the code, it is a profit to underline how the work through the development of your utility for applications uses the underlying Ethereum protocol.
Bir cevap yazın