Altcoins Talks - Cryptocurrency Forum

Cryptocurrency Ecosystem => Ethereum Forum => Basics => Topic started by: admin on December 17, 2017, 01:09:45 AM

Title: Ethereum transaction : what is Nonce ?
Post by: admin on December 17, 2017, 01:09:45 AM
What is Nonce?

In Ethereum, every transaction has a nonce. The nonce is the order of transactions sent from a given address.

Each time you send a transaction, the nonce increases by 1.

 There are rules about what transactions are valid transactions and the nonce is used to enforce some of these rules. Specifically:

    Transactions must be in Order: You cannot have a transaction with a nonce of 1 mined before one with a nonce of 0.

    No Skipping! You cannot have a transaction with a nonce of 2 mined if you have not already sent transactions with a nonce of 1 and 0.



Why?

This field prevents double-spends as the nonce is the order the transactions go in. In order for a double-spend to be "successful", you typically...

    Send a transaction to one party

    Wait for it to register

    Collect something in return from this first transaction

    Quickly send another transaction with a high gas price

    Have this second transaction mined first, therefore invalidating the first transaction.

This is why exchanges wait for you to have a certain number of confirmations before allowing you to trade freshly-deposited funds.
In Ethereum, the above is not possible

In Ethereum, this method of "double-spending" is not possible because each transaction has a nonce included with it. Even if you attempt to do the above, it will not work as the second transaction (nonce of 3) cannot be mined before the first transaction (nonce of 2).


Title: Re: Ethereum transaction : what is Nonce ?
Post by: Paul3322 on February 22, 2018, 10:19:29 AM
Amazing coin! :o :o :o :o
Title: Re: Ethereum transaction : what is Nonce ?
Post by: sergio444 on March 30, 2018, 01:48:31 AM
Very informative! Ethereum is really more than a coin. there are a lot to know about how ethereum blockchain works.
Title: Re: Ethereum transaction : what is Nonce ?
Post by: RianDrops on March 31, 2018, 04:46:03 PM
WOah. Finally I know this. Thanks for sharing this admin.
Title: Re: Ethereum transaction : what is Nonce ?
Post by: rhegs27 on April 18, 2018, 10:41:08 AM
great coin finally  :)
Title: Re: Ethereum transaction : what is Nonce ?
Post by: kriptopoulin on March 01, 2022, 12:55:38 PM
Thanks for the amazing information.It would be really appreaciated.