Understanding Ethereum Cryptography (2024)

Understanding the Basics of Cryptography: How Private and Public Keys are Generated

Understanding Ethereum Cryptography (3)

Ethereum has two different kinds of accounts: externally owned accounts (EOAs) and contracts. Ownership of ether is established through private keys, Ethereum addresses, and digital signatures. The private keys are at the centre of all user interactions with Ethereum. In fact, account addresses are derived directly from private keys: which uniquely determine a single Ethereum address, also known as an account.

A private key is a randomly-generated number that allows a user to control all funds associated with a corresponding Ethereum address, including access to contracts that authorize the address. The private key is used to create digital signatures that confirm the ownership of funds in a transaction.

It is crucial to keep the private key secure at all times, as revealing it to anyone would give them control over the ether and contracts. It is important to create a backup of the key and protect it from accidental loss, as it cannot be recovered if lost, resulting in the permanent loss of funds secured by it.

Generating a private key from a random number

The first and most crucial step in generating keys is to find a secure source of entropy, or randomness. Generating an Ethereum private key involves selecting a number between 1 and 2²⁵⁶. Ethereum software uses the operating system’s random number generator to generate 256 random bits.

A private key can be any non-zero number up to a large number slightly less than 2²⁵⁶ — a massive 78-digit number, approximately 1.158 * 10⁷⁷.

To generate a private key, it is important to do it offline and not communicate with the Ethereum network. It is not advisable to use a “simple” random number generator offered by a programming language or to write your own code to create a random number. This is because such methods may not provide true randomness and could potentially be exploited by attackers. It is best to use a secure method, such as the operating system’s random number generator, to ensure the randomness and security of the private key.

An Ethereum public key is a set of x and y coordinates on an elliptic curve that satisfy the elliptic curve equation. It is derived from two numbers that are generated from the private key using elliptic curve multiplication. This process is irreversible, meaning that the private key cannot be derived from the public key.

To generate the public key, the private key is used in an equation involving elliptic curve multiplication, which is irreversible. The equation is: K = k * G, where K is the public key, k is the private key, and G is the constant point (generator point).

Elliptic curve multiplication is different from normal multiplication. It is a one-way function that is easy to perform in one direction (multiplication) but impossible to do in the reverse direction (division). This makes it a useful tool for generating a public key from a private key, as it ensures that the private key cannot be derived from the public key.Elliptic Curve Cryptography

Asymmetric or public-key cryptography is based on the concept of the discrete algorithm problem, which involves performing addition and multiplication on the points of an elliptic curve. This type of cryptography, known as elliptic curve cryptography, is a promising potential form of cryptography that may be used in the future.

Ethereum uses the same elliptic curve, secp256k1, as Bitcoin.

Understanding Ethereum Cryptography (4)

Ethereum uses a specific elliptic curve and set of mathematical constants defined in a standard called secp256k1. The secp256k1 curve is defined by the following function, which generates an elliptic curve:

y ² = ( x³ + 7 ) over ( 𝔽 p )or:y ² |p| = ( x³ + 7 ) |p|

The mod p indicates that this curve is over a finite field of prime order p, where p = 2²⁵⁶–2³²–2⁹–2⁸–2⁷–2⁶–2⁴–1. This is a very large prime number, which makes this curve very reliable.

Ethereum address formats

Ethereum addresses are created by taking the Keccak-256 hash of the public key and representing it as a hexadecimal number. The last 20 bytes of the Keccak-256 hash are used to generate the address.

You can install the helpeth command-line tool using npm to create ICAP addresses.

npm install -g helpeth

If you don’t have npm, you may have to install it by following the instructions at https://nodejs.org.

helpeth keyGenerate

Output:

Address: 0xe16c1623c1aa7d919cd2241d8b36d9e79c1be2a2Address (checksum): 0xe16C1623c1AA7D919cd2241d8b36d9E79C1Be2A2ICAP: XE56 QBY1 TCEL SB4U 7BTR QQRC IOUY 8UNS DK2Public key: 0xaa931f5ee58735270821b3722866d8882d1948909532cf8ac2b3ef144ae8043363d1d3728b49f10c7cd78c38289c8012477473879f3b53169f2a677b7fbed0c7Private key: 0x227dbb8586117d55284e26620bc76534dfbd2394be34cf4a09cb775d593b6f2b

We will now use the given private key to generate a public key, as shown below:

helpeth keyDetails \
-p 0x227dbb8586117d55284e26620bc76534dfbd2394be34cf4a09cb775d593b6f2b

Output:

Address: 0xe16c1623c1aa7d919cd2241d8b36d9e79c1be2a2Address (checksum): 0xe16C1623c1AA7D919cd2241d8b36d9E79C1Be2A2ICAP: XE56 QBY1 TCEL SB4U 7BTR QQRC IOUY 8UNS DK2Public key: 0xaa931f5ee58735270821b3722866d8882d1948909532cf8ac2b3ef144ae8043363d1d3728b49f10c7cd78c38289c8012477473879f3b53169f2a677b7fbed0c7

“The Interchange Client Address Protocol (ICAP) provides a flexible, checksummed, and interoperable encoding system for Ethereum addresses. ICAP addresses can encode Ethereum addresses or common names registered with an Ethereum name registry. The compatibility of ICAP with the International Bank Account Number (IBAN) encoding makes it an useful tool for encoding Ethereum addresses.”

Manual method

Manually calculating a public key from a private key using the Elliptic Curve Digital Signature Algorithm (ECDSA) and the secp256k1 curve is a complex process that is best left to specialized libraries or tools. However, for those who are interested in the mathematical details, the formula for deriving the public key is as follows:

Public Key = Private Key * G

Where G is a fixed generator point on the secp256k1 curve, and Private Key is the 256-bit private key in hexadecimal format.

The coordinates of this point are specified in the standard and widely used in most of the implementations. The coordinates of Gin secp256k1 are:

x = 55066263022277343669578718895168534326250603453777594175500187360389116729240
y = 32670510020758816978083085130507043184471273380659243275938904335757337482424

This point is used as the base point for generating public keys. It is also used as a reference point to perform mathematical operations on other points on the curve.

This operation is performed using the mathematical operations defined by the secp256k1 curve, such as point addition and scalar multiplication. Please note that the above formula is a high-level representation of the process, the actual computation is much more complex and usually done by specialized libraries or tools.

[1]: Mastering Ethereum: Building Smart Contracts and DApps by Andreas M. Antonopoulos, Gavin Wood.

Understanding Ethereum Cryptography (2024)

FAQs

What cryptography is used in Ethereum? ›

Ethereum uses the Keccak-256 cryptographic hash function in many places. Keccak-256 was designed as a candidate for the SHA-3 Cryptographic Hash Function Competition held in 2007 by the National Institute of Science and Technology.

How does Ethereum work for dummies? ›

Ethereum is a digital platform that lets people build and use decentralized applications on the internet. Think of it like your smartphone's app store, where you can download all sorts of apps to help you do different things.

How much ETH does Vitalik have? ›

Vitalik Buterin currently holds 278,524 ETH (~$1M) and 256 WETH ($919K), which makes him one of the largest holders of ETH. He currently holds 0.23% of all ETH in existence. Besides ETH, his two largest holdings are $21.7M in USDC and $782K in KNCL. KNCL is the legacy token of Kyber Network to which he is an advisor.

Can someone explain Ethereum to me? ›

Ethereum is a decentralized global software platform powered by blockchain technology. It is most commonly known by investors for its native cryptocurrency, ether (ETH), and by developers for its use in blockchain and decentralized finance application development.

What is the secret key in Ethereum? ›

An Ethereum private key is a 256-bit number usually represented in hexadecimal format (32 bytes or 64 characters when represented in hexadecimal). It serves as a digital identity that enables you to sign transactions and securely manage your Ethereum assets.

What code does ETH use? ›

Ethereum primarily uses a programming language called Solidity for developing smart contracts and decentralized applications (DApps).

What is Ethereum in layman's terms? ›

Ethereum is a decentralized blockchain platform that establishes a peer-to-peer network that securely executes and verifies application code, called smart contracts. Smart contracts allow participants to transact with each other without a trusted central authority.

Is it easy to learn Ethereum? ›

Ethereum development can be challenging, but with the right resources and guidance, anyone can get started. By learning Solidity, the programming language used to write smart contracts for Ethereum, you'll be able to unlock the full potential of the Ethereum blockchain.

Is Ethereum backed by anything? ›

In contrast, Ethereum – and most other popular cryptocurrencies – are backed by nothing at all.

What person owns the most Ethereum? ›

The largest individual holder of ETH is co-founder Vitalik Buterin, who holds 245.8K ETH.

Can Ethereum reach $100,000? ›

While Ethereum can hit $100,000 after 2030, it is not realistic to expect ETH to reach 100k before 2030. It's nearly impossible. There is no path for Ethereum to hit 100k before 2030, it's impossible. ETH can realistically hit $10,000 in the coming years, either in 2025 or in 2026.

What is the highest Ethereum has ever been? ›

$4,891.70

Can Ethereum get hacked? ›

There have been several 51% attacks on cryptocurrency blockchains like Bitcoin Satoshi Vision (BSV), Bitcoin Gold (BTG), and Ethereum Classic (ETC). More recently, the now-bankrupt exchange FTX was hacked shortly after declaring bankruptcy in November 2022.

What is the point of owning Ethereum? ›

Ethereum enables developers to build and deploy smart contracts and decentralized applications (dApps) without downtime, fraud, control, or interference from a third party.

Does Ethereum use elliptic curve cryptography? ›

The Elliptic Curve Digital Signature Algorithm (ECDSA) is a cryptographic algorithm used in Ethereum to ensure that funds can only be spent by their owners. It is a variant of the Digital Signature Algorithm (DSA) which uses elliptic-curve cryptography.

Why does Ethereum use ECDSA? ›

In blockchain networks like Bitcoin and Ethereum, ECDSA is used extensively to sign transactions before they are broadcasted to the network. Each transaction includes the sender's digital signature, which proves ownership of the associated cryptocurrency funds.

Is RSA used in Ethereum? ›

A popular public-private key implementation known as Rivest-Shamir Adelman (RSA) algorithm is used for the Bitcoin and Ethereum Blockchain.

What encoding does Ethereum use? ›

Recursive Length Prefix (RLP) serialization is used extensively in Ethereum's execution clients. RLP standardizes the transfer of data between nodes in a space-efficient format.

Top Articles
Checking Windows Activation Status on Active Directory Computers | Windows OS Hub
Closing the sale - the most important steps
The Largest Banks - ​​How to Transfer Money With Only Card Number and CVV (2024)
The Idol - watch tv show streaming online
Calamity Hallowed Ore
Visustella Battle Core
Dark Souls 2 Soft Cap
Southland Goldendoodles
How Many Slices Are In A Large Pizza? | Number Of Pizzas To Order For Your Next Party
2024 U-Haul ® Truck Rental Review
Chastity Brainwash
60 X 60 Christmas Tablecloths
Noaa Ilx
Account Suspended
Hdmovie 2
Joan M. Wallace - Baker Swan Funeral Home
Bethel Eportal
MyCase Pricing | Start Your 10-Day Free Trial Today
Caring Hearts For Canines Aberdeen Nc
Reicks View Farms Grain Bids
Foodsmart Jonesboro Ar Weekly Ad
Unable to receive sms verification codes
Sandals Travel Agent Login
3 Ways to Format a Computer - wikiHow
Osrs Important Letter
3473372961
Ridge Culver Wegmans Pharmacy
Boondock Eddie's Menu
Sitting Human Silhouette Demonologist
Rocketpult Infinite Fuel
Does Iherb Accept Ebt
Merge Dragons Totem Grid
Case Funeral Home Obituaries
Sams La Habra Gas Price
Streameast.xy2
Claim loopt uit op pr-drama voor Hohenzollern
Joey Gentile Lpsg
Sabrina Scharf Net Worth
World Social Protection Report 2024-26: Universal social protection for climate action and a just transition
Ross Dress For Less Hiring Near Me
Jetblue 1919
Leland Nc Craigslist
Thotsbook Com
Craigslist Com St Cloud Mn
Underground Weather Tropical
Maurices Thanks Crossword Clue
Sj Craigs
Edict Of Force Poe
What Is The Gcf Of 44J5K4 And 121J2K6
Psalm 46 New International Version
Asisn Massage Near Me
E. 81 St. Deli Menu
Latest Posts
Article information

Author: Prof. An Powlowski

Last Updated:

Views: 6272

Rating: 4.3 / 5 (64 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Prof. An Powlowski

Birthday: 1992-09-29

Address: Apt. 994 8891 Orval Hill, Brittnyburgh, AZ 41023-0398

Phone: +26417467956738

Job: District Marketing Strategist

Hobby: Embroidery, Bodybuilding, Motor sports, Amateur radio, Wood carving, Whittling, Air sports

Introduction: My name is Prof. An Powlowski, I am a charming, helpful, attractive, good, graceful, thoughtful, vast person who loves writing and wants to share my knowledge and understanding with you.