The One Question bounty closes Thursday 10 December.

Join in
We Them Media logo We Them Media Support us

Web3bridge Students (cohort 11) Share What They’ve Learned: Account

The picture loads from YouTube. The player loads only when you press Play. Turn on captions in the player if you need them.

A student explains Ethereum accounts: externally owned accounts controlled by keys, and smart contract accounts controlled by code, and how they differ in creation cost. They then explain that a private key produces a public key and an address, and how a nonce counts transactions to stop replay attacks.

Not by We Them Media Channel: Web3Bridge. Published Tuesday 15 October 2024.

Titles are the owner’s. It plays from their channel.

Transcript

This transcript may contain errors. This video belongs to Web3Bridge. Letters mark each change of speaker.

These are the speakers’ own words. We have not checked their claims.

0:05 A: My name is Michael Nwachukwu Okwudili. We are going to be talking about accounts. Accounts are basically, is basically an entity that contains a balance and can send transactions to the network. So we have 2 types of accounts. We have an externally owned account or an EOA, and we have a smart contract account. An externally owned account is an account that usually has a balance, has an address, a nonce, has an optional storage and a code hash, and is controlled by the public and the private key. And whoever possesses this public and private key controls the account. And the smart contract account is usually controlled by code and is deployed to the network and people can interact with it. So the major difference between these 2 types of accounts is that Well, during account creation, an EOA or an externally owned account is basically created for free. You don't pay to create an EOA, but while creating a smart contract account, you have to deploy to a zero address and the fee is charged for creating such an address. And interacting- interactions between EOAs is basically a state value transfer, and it doesn't necessarily interact with the EVM, the Ethereum Virtual Machine. But interaction with the smart contract account Involves interacting with code basically built on the network, and it interacts with the EVM. Controlling, just like I said earlier, controlling an EOA basically involves having control over the public and the private key. But controlling the control of the smart contract account is just basically code living

1:54 B: As a newbie into the blockchain Web3 space, I had this idea that public key, with the name public key, is the same as address. But during the learning, I've been able to understand more that public key is not the same as address. So how is it? How do I understand this? So first of all, address is generated from the public key and then the public key is generated from the private key. So how is this done? Like, private keys are random number that are being generated. So like, um, from between the range of 1 to 2 raised to the power of 256. Say for instance, like, um, a coin. So you toss that coin up to 256 times. So you just pick a random number. It doesn't, um, how to pick that number doesn't matter, but, um, it shouldn't be, um, predictable or deterministic. So that's how a private key is being gotten. So, and as we know, private keys cannot be shared. So from that private key gotten, you can now generate your public key. And we'll do that by using the elliptic curve algorithm to generate that. And public keys are generated by multiplying the private key by the generator point, which is on the elliptic curve.

3:20 C: Nonces are numbers used once. They were introduced to solve the issue of double spending and replay attacks. Now, what are replay attacks? Replay attacks are situations where you initiate a transaction and then the transaction is held by an hacker or a malicious user, and then that transaction is re-executed over and over until your balance is exhausted. That's a replay attack. Now, how does the nonce work to stop this? The nonce is basically updated. The nonce starts at 0. It is updated for every transaction that is executed by an account. So starting off with 0, the first transaction that is executed comes in as 1, the other one comes in as 2, and then it is incremented based on the amount of transactions Another thing a nonce does is it orders- it brings order to transaction processing, basically.

4:34 B: And please do follow us on our social media handles and do like and share. Thank you.

More from this hub

Something wrong, or a video you want off this page? Write to wethem.xyz@gmail.com and it is fixed or taken down within 48 hours.