Ethereum: How much time it takes to verify a Bitcoin signature in the Satoshi client?

Ethereum: How long does it take to check a bitcoin signature in the Satoshi client

As one of the main cryptocurrencies on the blockchain, Ethereum is based on the concept of decentralized verification through the signatures. One of these signature verification methods used by the Ethereum network is the use of digital signatures. In this article, we will explore how long it takes the current Ethereum client (Satoshi) to check a Bitcoin signature.

What are the bitcoin signatures?

A Bitcoin signature is a digital imprint that acts as proof of the property and authenticity of a transaction. It is essentially a hash of a transaction that includes the sender’s private key, the TimesTamp and other relevant data. The process of creating and verifying these signatures is complex and is based on cryptographic techniques to guarantee their integrity.

The current Ethereum client (Satoshi)

To simulate the verification process in the Satoshi client, we will use an average modern computer with a single thread that performs the complete blockchain. We will not use external bookstores or tools that could potentially accelerate the verification process.

hypothesis

Ethereum: How much time it takes to verify a Bitcoin signature in the Satoshi client?

  • The signature is not in the signature … this might seem like a paradox, but in reality it is a simplification to make this example more accessible.

  • The Satoshi client uses the OpenSSL library for cryptographic operations.

Here are the step-by-step processes that we will follow:

  • Create a new bitcoin transaction with a random Nonce (a unique value used in each block) and hash

  • Calculate the digital signature of the transaction using the recipient’s private key

  • Hash the digital signature to create a new message (this is what is called “signature”)

  • Generates a random Nonce and has it again

Passo-Passo verification process

  • Creation of transactions

`c

// Create a new bitcoin transaction with a random Nonce

Char Nonce not signed [8];

Hash160 Hash160;

`

  • Calculate the digital signature

c

// Calculate the digital signature of the transaction using the recipient’s private key

I sign unformed Char [EVP_MD_SIZE (EVP_SHA256 ())];

// …

`

  • Digital signature hash

c

// hash the digital signature to create a new message (signature)

Char Signature_Hash Unsigned [EVP_MD_Size (EVP_SHA256 ())];

Hash160.copy_from (& signature, signature);

`

  • generates Nonce and random hash

c

// generates a random Nonce and has the hash again

Nonce [0] = Rand () % 1000000;

hash160.copy_from (& Nonce, Nonce);

`

Simulated verification process

To check the Bitcoin signature, we must calculate the digital signature using the recipient's private key. Since this process is complex and takes time for a single thread, we use approximation.

Suppose that it takes about 100 milliseconds to create a new transaction, hash160 and then calculate the digital signature. Suppose also that the random Nonce generation process requires about 500 microseconds (0.5 ms).

c

// simulated verification process

Insigned int Transation_Hash = Create_transation ();

char transactions_data unsigned transacta = (unsigned char *) transaction_hash;

Hash160 Hash160 (Transaction_data, 16);

I sign unformed Char [EVP_MD_SIZE (EVP_SHA256 ())];

EVP_MD_CTX *CTX = EVPMD_CTX_NEW ();

EVP MD_INIT_EX (CTX, “Sha-256”, 0, Null);

// generates random and random hash again

Unsigned int Nonce = Rand () % 1000000;

hash160.copy_from (& Nonce, Nonce);

``

Estimation of the verification time

Based on the above simulations, it takes us approximately:

  • 1 second to create a new transaction (ca.)

  • 5 microseconds to generate a random Nonce

  • 16 Memory bytes for transactions data

By adding these, we get an estimated total verification time of about
0.00016 seconds .

Related Posts