MMDRZA Guideline Portal
HomeProductsGithub
  • Guide
    • Install Python
    • Rich Address Downloader
    • Code Signing
      • How to Sign an .exe File in Windows
  • Cryptofuzz
    • Example
      • 🗝️Decimal
      • 📝Mnemonic
      • 🔐Private Key (HEX)
      • 🔑Private Key (Wif)
    • Private Key To Bitcoin
    • Private Key To Ethereum
    • Private Key to Tron (trx)
    • Private Key To Dogecoin
    • Private Key To DASH
    • Private Key To Litecoin
    • Private Key To Bitcoin Gold
    • Private Key To Digibyte
    • Private Key To Ravencoin
  • SECP256K2
    • Profile Test
    • Decimal To Private Key (Wif)
    • Decimal to Address
    • Decimal To Ethereum
    • Decimal to RIPEMD160
    • wif Private Key To Private Key (hex)
    • Convert Private Key To Wif Compressed and Uncompressed
    • Wif to Decimal
    • Private Key (decimal) To RIPEMD160 (h160)
    • Decimal To Compressed and uncompressed Address
Powered by GitBook
On this page

Was this helpful?

  1. SECP256K2

Profile Test

Test Speed Generate Key With Secp256k2 and Convert to Compressed and Uncompressed Bitcoin Address Wallet

import os, timeit

setup_code = """
from os import urandom
from secp256k2 import Contactor

cont = Contactor()

def test_Profile_1():
    numd = urandom(32)[0]
    caddr = cont.privatekey_to_address(0, True, numd)
    uaddr = cont.privatekey_to_address(0, False, numd)
"""

# // Total Generated 
num = 10000

time1 = timeit.timeit("test_Profile_1()", setup=setup_code, number=num)


print(f"Generated & Convereted {format(num, ',')} Key To : {time1:.6f} sec")

Output

Generated & Convereted 10,000 Key To : 0.393369 sec

Performance Benchmark

The benchmark measures the efficiency of generating and converting 10,000 cryptographic keys using the secp256k2 library in Python. The test was run on Google Colab to leverage its computing resources. The setup includes initializing a Contactor object for key generation and conversion processes. The urandom function generates a 32-byte number for each key to ensure randomness.

Test Setup:

  • Library: secp256k2

  • Function: Generating and converting cryptographic keys

  • Environment: Google Colab

  • Iterations: 10,000 keys

Benchmark Code:

The test measures the total time taken to generate and convert 10,000 keys. The snippet below illustrates the setup and execution of the benchmark test:

import os, timeit
setup_code = """
from os import urandom
from secp256k2 import Contactor
cont = Contactor()
def test_Profile_1():
    numd = urandom(32)[0]
    caddr = cont.privatekey_to_address(0, True, numd)
    uaddr = cont.privatekey_to_address(0, False, numd)
"""
num = 10000
time1 = timeit.timeit("test_Profile_1()", setup=setup_code, number=num)
print(f"Generated & Convereted {format(num, ',')} Key To : {time1:.6f} sec")

Results:

The execution of the benchmark resulted in the following outcome:

Generated & Convereted 10,000 Key To : 0.393369 sec

Conclusion:

PreviousSECP256K2NextDecimal To Private Key (Wif)

Last updated 1 year ago

Was this helpful?

Deploy and Running Test From

The benchmark demonstrates high performance and efficiency in handling cryptographic key generation and conversion on using the secp256k2 library, completing 10,000 operations in approximately 0.393369 seconds. This indicates the library's capability to manage large-scale cryptographic operations within a short timeframe, making it suitable for applications requiring high-security measures and fast performance.

Google Colab
Google Colab