We’re rewarding the question askers & reputations are being recalculated! Read more.
50

Update Oct 21 2017 There are some changes with the Byzantium fork - getTransactionReceipt(...).status now returns 0 for a failed transaction and 1 for a successful transaction. EtherScan.io displays this status in the TxReceipt Status: field for transactions. See How do I detect a failed transaction after the Byzantium fork as the REVERT opcode does not ...


38

From George Hallam: 12 confirmations; however, exchanges and entities handling very large amounts of Ether frequently are still encouraged to run two different Ethereum implementations and only accept transactions that have been confirmed by both for maximum security (e.g. Go & C++). For reference, 12 confirmations is approximately 3 minutes.


21

The geth client waits 5 blocks for confirmation of fresh minted blocks (around 1 minute). I0201 19:07:07.354260 9098 worker.go:349] 🔨 Mined block (#1483 / a2648b58). Wait 5 blocks for confirmation To make sure a block is no uncle or a transaction included in a block does not hang up in an ommer, I would suggest waiting 7 confirmations (around 2 ...


14

Ethereum theoretically approaches finality in less time than Bitcoin, due to the GHOST protocol. This means that, with a 15 second block time, roughly 40 blocks are needed to match the 60 minutes that 6 Bitcoin blocks takes. Therefore, assuming no major consensus bugs, 40 confirmations should be more secure than 6 confirmations in bitcoin. In practice, ...


12

When you send a transaction, you will receive back a transaction hash. Use the command getTransactionByHash({transaction hash}) to retrieve the transaction details. Your blockNumber should be non-null if the transaction has been mined and included into a block. The call is documented in https://github.com/ethereum/wiki/wiki/JSON-RPC#...


10

From Vitalik Buterin says in Ethereum blog at 2015/09/14 about the topic of discussing "On Slow and Fast Block Times" https://blog.ethereum.org/2015/09/14/on-slow-and-fast-block-times/ only a small number of extra confirmations (to be precise, around two to five) on the faster chain is required to bridge the gap; hence, the 17-second blockchain will ...


9

It's called the Transaction Pool, or TxPool in the code. From go-ethereum - tx_pool.go, lines 35 to 62: var ( // Transaction Pool Errors ... ) const ( maxQueued = 64 // max limit of queued txs per address ) ... // TxPool contains all currently known transactions. Transactions // enter the pool when they are received from the network or ...


8

I've seen exchanges use 375 confirmations. But as the difficulty increased and the network got more decentralized, it's safe to go way below this. Of course it depends on how critical the transaction is. As a rule of thumb, wait at least 5 confirmations for amounts higher than $500. Then, add 5 confirmations for each $1000 the transaction is worth.


8

Latest means the latest block that is already inside your own chain. All transactions contained within can be considered successfully executed. Security wise of course there can be reorgs, but in general they are executed transactions. Pending on the other hand is the collection of transactions that can be executed by the network (that your own node knows ...


6

Blockchains based on Proof of Work are probabilistic, and as more blocks are built upon the block containing a transaction, the probability of a chain reorganization removing that block and transaction becomes extremely low. can/should I check it regularly, and if it still not exists after a "big" number of blocks, alert the user that their transaction is ...


6

I can provide a high-level summary that will help things make more sense as you google around for the details. They are separate concerns. Validation is concerned with deciding if the transaction is allowed. For example, I can send a transaction that transfers all your ether to my account. Validators will notice that my transaction isn't signed with your ...


5

getBalance With A Block Number You can pass in the block number as part of the parameter. Here is Kraken's address: 0x2910543af39aba0cd09dbb2d50200b3e800a63d2. Let's check what the latest block number is: > eth.blockNumber 1456129 Let's get the latest balance for Kraken: > eth.getBalance("0x2910543af39aba0cd09dbb2d50200b3e800a63d2", "latest") 4....


5

Instead of the chain of ownership and UTXOs used in Bitcoin to identify which transactions are correctly formed and which are not, Ethereum uses an account model, and transactions are sent with ECDSA signatures that verify against that account. The 'state' of each account is kept track of, and the transactions are checked to see both that the signature ...


4

No, you can only control the confirmation time through the difficulty of the blockchain which in turn depends on the mining resources allocated for the respective private net. You can set a "small" difficulty in the genesis block and see the average confirmation time for a block (you'll have to run a few tests with the miner of your choice). Adjust the ...


4

Example here using filters: How do I know when I've run out of gas programmatically? and also here by busy polling: https://github.com/barkthins/ether-pudding/blob/master/index.js#L375 I use busy polling, because I've found the filters to be unreliable (fails about 1:1000 times) EDIT: Also, how MANY blocks to wait for confirmation is debatable, ...


4

At some point, the local Geth node reported tx 2e7a57c55a7cb28d0e233d7745210dba93c09f14c5df4e879db1a530a79a842a in the block 1369316 on testnet. It then disappeared from the chain at some point during the next 1-12 blocks. The local geth node shows the transaction data relative to its current copy of the block chain; even if the transaction with the ...


4

Here are the answers to the 3 questions on confirmations, checking for confirmations, and double spends. 1. What number of confirmations is considered secure in Ethereum? 12 confirmations; however, exchanges and entities handling very large amounts of Ether frequently are still encouraged to run two different Ethereum implementations and only accept ...


4

It's basically impossible to guarantee a transaction occurs in a given block. There's too many factors--network latency, the block gas limit, uncles, miners who mine empty blocks, other transactions, etc. Chances are, by the time you're actually looking at block X, it's too late to get in block X+1, since a miner may have already decided what transactions to ...


4

Actually confirmations showing in the transactions log are the number of block added over the block containing same transaction. So you can get hundreds of confirmations in a 4 node private net. It's fine. For more detail on confirmation : What number of confirmations is considered secure in Ethereum?


4

If you're using web3j/web3js, you can do it programmatically. I use web3j and I have this in my code: web3j.transactionObservable().subscribe( tx -> { if( credentials.getAddress().equals( tx.getTo() )) { Logger.info( "This is my money! -> addr: {}, amt: {}", credentials.getAddress(), tx.getValue() ); }...


4

Yes, you can do this. With web3.js 0.2x.x, note from https://github.com/ethereum/wiki/wiki/JavaScript-API#contract-methods that all calls to contracts take an optional block number. So the following will get the balance of an account at a specific block number: tokenContract.balanceOf(account, {}, blockNumber); I believe the syntax for web3.js 1.0.0-beta ...


4

When a transaction is mined, the receipt is available for use, at this point confirmation number is 0, as more block are added to the blockchain, confirmation number increases. With higher confirmation number, we will have more confidence that transaction is on the longest path and can’t be undone. Suppose you accept transactions with a certain number of ...


3

Not sure what could have gone wrong. Are you connected to the network? Are you fully synced (if you are not fully synced your sender account might have the wrong nonce)?


3

Update 23th of June 2017 Since the ICO craze started which are often badly designed we now have the actual need to see unconfirmed transactions. With Geth you can use eth.pendingTransactions from the console (geth console or geth attach to an other running Geth instance. This will return all unconfirmed transactions sent from on of the local accounts. If ...


3

WARNING: This does not take into account the difficulty adjustments that arise when blocks are off the average block time. This means that in reality the standard deviation of multiple confirmations will not increase so much. How about a Monte Carlo Simulation? The Result is: The distribution of confirmation times gains high variability when you wait for ...


3

Yes, the same contract can be mined on both sides of the fork. I don't think it's correct that each instance of the contract creation would yield a different contract address. Contract addresses are assigned deterministically based on the address creating them and a per-account nonce, so the same transaction, received on both forks in the same order, would ...


3

Miners != Full nodes. Today there are no light client available on Ethereum. But to mine, you don't need a Full node (on BTC, it is the case. on Ethereum we will see). Full Node check the blocks for free, to be sure to have a valid blockchain. You have no reward. But Miners should have a Full Node to check they're working on real and valid datas. If you ...


3

When you send a transaction to a contract function, you get back the transaction hash: var txHash = myContract.myFunction(param1, { from: you }); If there is a transaction that you need to find, look into your sender address at etherscan.io.


3

Solidity and the web are different. Solidity itself does not have access to past transactions. For the web, you would use web3.js and see the code at How can a DApp detect a fork or chain reorganization using web3.js or additional libraries? which waits specified number of blocks and verifies the transaction receipt is still valid. In this method, the ...


3

This was mentioned in another question, also here Number of confirmations is the current block number minus the transaction's block number (if any). For web3, this can be found by the following command web3.eth.blockNumber - web3.eth.getTransaction(<txhash>).blockNumber I think the same would also work in Geth console after removing the web3.'s.


Only top voted, non community-wiki answers of a minimum length are eligible