Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [nonce]

A random number that is only used once. It is generated at the beginning of a communication by one communication partner and has to be sent back by the other one in order to prevent replay attacks.

1
vote
1answer
32 views

account nonce - what if it did not exist? [duplicate]

I can't understand how account nonce actually avoids double spending. Every answer about this on the internet follow the pattern "If you only have 50 Eth and try to send 50 to A and 50 to B with ...
1
vote
1answer
38 views

Why store account nonce on chain instead of using timestamp to prevent replay attacks?

Why store account nonce on chain instead of using timestamp to prevent replay attacks, or any other random bit of information that will change thr hash and differentiate the transaction? As far as I ...
0
votes
2answers
32 views

Is there a service to guarantee that transactions are successful?

I have a node which I use to send transactions to the network. Those transactions are really important. They must go through at all cost. If I simply send the transactions, there is a chance that one ...
0
votes
0answers
26 views

How to calculate hash for ETHash from header, nonce and mix? (PHP)

Code below results in certain wrong hex number output, i.e. b22b58ba71c1d4b77df0032d5a0aec8ba9a91b86f4864885503155c1c0df2e90 or something. The data is real and the correct answer is ...
2
votes
1answer
34 views

Can anyone tell what might had gone wrong with the transaction below?

May I know what does this transaction mean? I am running this inside my private node. Running the same transaction repeatedly none stop. Sending on average 10 transactions / sec. So I had to keep ...
3
votes
1answer
21 views

A doubt about forks and mining

Suppose I'm mining a block, and I still don't find the nonce. Suddenly I receive the mined block from another node. But when I try to validate it, I find it's not right. So I discard it. What happens ...
2
votes
0answers
41 views

Usage of web3 provider in multiple processes

I have web application and background queue that executes long lasting tasks. Both of them using truffle-privatekey-provider with same private key to sign/send transactions. Now I ma experiencing ...
0
votes
1answer
262 views

Deploy to mainnet with Truffle + Infura: nonce too low

I'm trying to deploy a very simply ERC20 token contract using Truffle and Infura and getting this: Running migration: 1_initial_migration.js Deploying Migrations... ... ...
0
votes
1answer
111 views

Transaction done, but nonce does not update and call to a function returns zero

I've used web3py to deploy a contract and send some transactions to it. I calculate the nonce this way: nonce = web3.eth.getTransactionCount(account, "pending") When I deploy the contract, ...
0
votes
1answer
79 views

Account nonce limit/maximum

I've been reading about an account's nonce, that it's supposed to be an incremental number that increments with every transaction. I found about transactions pool and queue, about what happen if you ...
0
votes
1answer
26 views

Transaction Pending and Dropped

I have a transaction pending from 4 days. I have tried to unlock following this answer: MyEtherWallet is pending and dropping. It looks like it is stuck in a loop for 2 days? Now the current nonce is ...
1
vote
1answer
33 views

Account nonce — Incremental, i.e., Deterministic or Arbitrary

In cryptography, a nonce is an arbitrary number that can be used just once. But in Ethereum, the account nonce is deterministic. Deterministic vs Arbitrary -- How can both be true at the same time?
1
vote
1answer
333 views

What does a position means in an ethereum Tx?

There are 2 fields in the following Ethereum Tx, named nonce & {position}. What does position mean?
0
votes
2answers
63 views

Nonce in Layer 2 State Channels

In Layer 2 Solution of Ethereum (State Channels), what I don't get is what about nonces? If we signed a state channel Tx with 13 nonce and don't put it on the chain for now, then if I make another Tx ...
2
votes
1answer
652 views

How to properly set nonce in a web3 contract invocation?

I have this code, which works: MyToken.airdrop(wallets,amounts,{ gas: 1267051, gasPrice: 2000000000, },function(err,tx){ console.log('err is %s',err) console.log('tx is %s',tx) callback(err,...
0
votes
1answer
112 views

How does metamask manage the multiple transaction with same address?

I'm struggling to implement the functionality which sends multiple transactions using the same address. here the from address is same but the to addresses are different. When I did research on this, I ...
0
votes
1answer
58 views

What happens when two nodes have conflicting transaction nonce?

Let's say I have two geth nodes which run on two distant networks with slow connections between them, and I use the same newly created address (private key) to send two different transactions with the ...
0
votes
1answer
60 views

Is there any method in web3 through we can verify whether the nonce associated with any transaction or not of same from address?

How to get the new nonce of from address using web3? There shouldn't be any transaction associated with this. Is there any way to get this.
2
votes
0answers
60 views

How to set the nonce in offline transaction?

Let's suppose, I already executed 48 Tx onchain and I signed an offchain Tx with nonce 49. Now, If: I don't sign the offchain Tx with nonce, the transaction will be invalid because every Tx must ...
0
votes
0answers
86 views

Private network not incrementing NONCE and not mining

So I've set up a network with 10 nodes using Parity 1.10.4-20180514 stable. Ubuntu 16.04 on AWS. The node count says: 0 Active / 9 Connected The genesis json is: { "name": "private", "engine": { ...
0
votes
2answers
194 views

Ethereum blockchain node & block terminology

I was studying about the basic blockchain terminology and got confused the point of node & block. In some links, both seem similar whereas in some both explained differently. I don't exactly know ...
0
votes
1answer
206 views

Batch generating raw transactions nonce problem [duplicate]

I'd like to batch generate a large number of transactions for one account and sign them in a more secure environment. Ideally I would create a queue of unsigned transactions (here in my understanding ...
9
votes
2answers
2k views

Truffle + Infura on Mainnet: Nonce too low error

I have the following code: const Contract = artifacts.require('./Market.sol'); module.exports = async function(callback) { let instance = await Contract.deployed(); for(var i = 0; i <=200; i+...
2
votes
1answer
1k views

Reset MetaMask nonce

I am testing stuff on Ganache and am using Metamask to send transactions to simulate user behavior with the app. Now here's the issue. If I restart Ganache it resets all accounts (no problem with that)...
3
votes
3answers
587 views

send raw transaction without knowing nonce

I want to send raw transactions but I don't want to accidentally overwrite any transactions. Afaik when using eth.sendTransaction it automatically increments the nonce and doesn't overwrite any ...
0
votes
1answer
368 views

Webj3 erc20 specify nonce for token transfer

How do you specify a nonce when sending erc20 tokens using web3j?
0
votes
1answer
511 views

What's the difference between “pending” block and txpool?

Even though my parity node (private network) is not mining, it seems to have a pending block as well as a txpool. After sending some transactions, the web3.eth.getBlock("pending") call returns ...
0
votes
1answer
97 views

BlockCypher Account nonce too far behind transaction

I'm currently working on a DApp that involves sending transactions. I'm using BlockCypher to send the transactions since the API is fairly straight forward. One issue I'm finding is that when I run my ...
18
votes
3answers
2k views

Concurrency patterns for account nonce

The account nonce is the only element in the transaction structure that prevents replay attack (as explained in this very good answer). It essentially forces sequentialisation of an account's ...
0
votes
1answer
24 views

Combined transactions executed together?

If I'm correct the nonce is responsible for the order transactions are executed. Let assume you have two transactions T1 & T2. T1 depends on T2. So I want to have an order T1 then T2. This is done ...
2
votes
1answer
324 views

Send transaction with same nonce as another transaction but lower gas price

I want to send a transaction using web3, and I want this transaction to have the same nonce as other transactions - so far so good. The issue comes when I set a lower gasPrice than the other ...
1
vote
1answer
198 views

Why is there a nonce and mixHash value in the genesis file?

I may not fully understand the genesis file. Why is there a nonce and mixHash value in the file if nothing is being mined? It was my impression the genesis file is used to bootstrap block 0, then ...
0
votes
1answer
144 views

Can there be multiple transactions with the same nonce and from address?

I am trying to create a state-channel by signing transactions directly, and I was wondering that the nonce might be troubling in this case.
1
vote
1answer
797 views

How to queue up simultaneous signed transactions

I have written a simple API server in NodeJS that uses web3 (version 1 beta 27) to interact with a remote Parity node. The guts of the call is as follows const invoke = async (req, res) => { ...
0
votes
1answer
126 views

How get nonce of smart contract account with JSON RPC function? eth_getTransactionCount only for EXTERNAL accounts right?

How get nonce of smart contract account with JSON RPC function? (Number of new smart contract accounts created by a smart contract account?) eth_getTransactionCount only for EXTERNAL accounts so won'...
1
vote
0answers
2k views

Nonce Too Low, try incrementing nonce | Not able to send TRX

Can someone tell me how to correct a Nonce Too Low issue? I'm trying to send an ERC 20 TRX tokens that I have stored on my nano s ETC wallet and I'm not able to due to this low nonce. FYI I have ...
3
votes
1answer
743 views

Is it possible that the same address sends out two transactions at the same time

Several articles say that a transaction can be canceled or replaced with the same nonce and higher gas price. Then does this indicate that the same address can NOT send two transactions at the same ...
0
votes
0answers
31 views

Implementing multiple account balances per address

Say if one wanted to fork Ethereum's codebase and implement a second account balance per each address - a public key is now associated with the standard Ether balance but now also with another ...
0
votes
0answers
231 views

Ethereum, Parity balance 0 and same nonce

I am developing a method to send token using web3. I have parity installed on my local machine (MacOS). I am new to ethereum & parity. I am getting some errors dont make sense Can exists another ...
0
votes
0answers
115 views

help I need to get my funds back. I tried to transfer with metamask but it said error nonce too low

My question is about metamask and what does error nonce to low mean in metamask and how can i get my eth back?
0
votes
1answer
1k views

Getting and setting the nonce for a transaction

I'm using a javascript library (etheremjs) to sign a transaction. When creating it, it asks for the nonce field. I researched about it and partially understood it. But my main problem is: How do I ...
4
votes
1answer
221 views

Why does nonce have to increment by one? Wouldn't it be sufficient to require unique nonces?

For replay protection, it would be sufficient to require a unique nonce for every transaction from the same address. More precisely, it would be sufficient to consider a new transaction T from an ...
1
vote
1answer
386 views

cannot unmarshal non-string into Go value of type common.Address at Infura

i'm trying to call this function: const nonce = web3.eth.getTransactionCount(myAddress) On the testnet of this node: 'https://ropsten.infura.io/' But I get this error on this node: cannot ...
2
votes
2answers
420 views

Why do contracts start with nonce 1?

This is a follow-up to this question. The accepted answer says: Yes, contracts have nonces. A nonce of a contract is only incremented when that contract creates another contract [...]. When a ...
1
vote
1answer
268 views

Send back to back signed raw transaction

I have to send multiple signed transactions and from a specific account with nonce via web3.eth.getTransactionCount. Because the call may come parallel, I either get replacement transaction ...
1
vote
1answer
359 views

Would a pending transaction block all subsequent transactions?

I know that each ethereum transaction has a corresponding nonce, which is a positive increasing number. Say if tx1 with nonce 97 is still pending, would subsequent tx2 with nonce 98 also blocked until ...
0
votes
1answer
870 views

How to create a transaction with same nonce?

How do I create a new transaction that has the same nonce as a previous transaction? I sent a txn with 4Gwei gas price and I want to cancel it by sending a 0 Eth txn with the same nonce. I am ...
0
votes
1answer
525 views

How to get current nonce that I need to send along with a transaction?

I wish you send nonce with every transaction so that I can store my nonce in DB and can override a specific transaction if it is pending for a while. I know I can use eth.getTransactionCount("...
20
votes
2answers
13k views

What is nonce in Ethereum? How does it prevent double spending?

recently I got fascinated by blockchain, and started learning Ethereum. I came across the concept of the nonce in Ethereum. After researching I found out that nonce is used for two purposes. a. To ...
1
vote
2answers
289 views

What if a malicious party sends two transactions with same nonce?

It's said nonce is used to prevent reply/double-spending attack. But an adversary can send two transactions with the same nonce, and the rest of scenario will be the same as in Bitcoin. Question 1: ...