Questions tagged [transactions]

The term "transaction" is used in Ethereum to refer to the signed data package that stores a message to be sent from an externally owned account.

140
votes
2answers
26k views

What is the difference between a transaction and a call?

What is the difference between a transaction and a call? In some interfaces, I can interact with contracts via calls or via transactions. What is the difference between the two, and can contracts also ...
202
votes
7answers
133k views

What is meant by the term “gas”?

An Ethereum application that I want to use talks about needing "gas" to run. What is gas, and where do I get it?
14
votes
1answer
17k views

How can I reverse or cancel a transaction or recover lost ethers?

Transactions (using a smart contract like a token or sending ether), by design, are immutable on the blockchain. What methods can be used to (more or less) unilaterally reverse a transaction made by ...
44
votes
8answers
21k views

How to get contract internal transactions

I'd like to get the contract internal transactions like: https://etherscan.io/address/0xd654bdd32fc99471455e86c2e7f7d7b6437e9179#internaltx I'm using web3 API. Is there any way to do it? Where do ...
55
votes
5answers
74k views

What number of confirmations is considered secure in Ethereum?

In Bitcoin, 6 confirmations are considered secure (very low probability of transaction/block reversal). What is the current number in Ethereum?
68
votes
8answers
12k views

Can contracts pay the gas instead of the message sender?

Is it possible for a contract to pay the gas costs (or part of it) that result from the contract being called? Or does the sender of a message always pay the resulting gas costs no matter what?
53
votes
2answers
16k views

What's the difference between 'msg.sender' and 'tx.origin'?

If either are used in the body of a Solidity function that may change the state of a contract (write call), what's the primary difference and/or benefit of using one over the other. For example: ...
16
votes
3answers
3k views

What is the default ordering of transactions during mining, in e.g. geth?

I know that the yellow paper does not specify how transactions are to be ordered in a block and this is up to the miner to decide. But I am interested in how this is practically handled (I assume not ...
17
votes
2answers
2k views

In a private blockchain, why do miners keep adding empty blocks to the blockchain?

I have been working on a private blockchain and observed that a miner, when started, keeps on adding empty blocks with no transactions to the blockchain. Why is this happening? It doesn't make any ...
37
votes
2answers
21k views

Is there a limit for transaction size?

Is there a theoretical limit for transaction data size when you send a transaction to Ethereum network? Ref. Is there a (theoretical) limit for amount of data that a contract can store?
38
votes
6answers
18k views

Create and sign OFFLINE raw transactions?

I'm looking to create a raw transaction, sign it, and broadcast it using the eth.sendRawTransaction RPC method. I would like to do this offline using code or an open-source library OR online but ...
25
votes
3answers
12k views

What are the limitations to estimateGas and when would its estimate be considerably wrong?

web3.eth.estimateGas and JSON-RPC estimateGas can be used to see how much gas should be specified for a transaction, before crafting the transaction. Since it is an estimate, are there any ...
20
votes
4answers
8k views

How can the transaction status from a thrown error be detected when gas can be exactly the same as the gasUsed for a successful transaction?

This question arose from answering Transaction Status. In the following example, I am sending gas of 21,000 (the amount required for a regular transaction). In this situation gas == gasUsed, and so ...
25
votes
2answers
17k 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 ...
15
votes
1answer
6k views

How much does it cost to use a contract?

Still new to ethereum and would like to know the price for a contract.
28
votes
1answer
24k views

Transaction Status

A very elementary question, how do I get a transaction status after firing the transaction? I mean suppose I do a sendTransaction where I transfer some amount of ether from 1 account to other, how can ...
35
votes
3answers
12k views

What are the pros and cons of Ethereum balances vs. UTXOs?

Ethereum has a simpler model by not having UTXOs (Unspent Transaction Outputs) like Bitcoin. What does Ethereum "give up" by not having UTXOs, and what does it gain?
8
votes
5answers
9k views

Sent ETH to my Wallet, but it did not show up

Note: This question was initially asked for Mist, but is in general also true for all other wallets like Ethereum Wallet, Etherwall, Parity, Harmony, etc. I sent ETH from MyEtherWallet to my Mist ...
17
votes
4answers
12k views

workflow on signing a string with private key, followed by signature verification with public key

I know this question has been asked and answered, but while trying to get everything to work, I've come across some problems. This is what I'm trying to do: 1. take a target string 'Schoolbus' 2. ...
23
votes
4answers
6k views

Does every node execute the contract code for each transaction?

This question was asked on Reddit a while ago: When a node sends a transaction to the network and has the receiver as a contract, does every node execute the contract bytecode with the inputs to ...
18
votes
3answers
17k views

How to list transactions from account address?

I have a small service where people can exchange cryptocurrencies. Every user has its own Bitcoin, Litecoin, etc address for balance deposit. Now I want to add Ethereum. So I thought I will create ...
32
votes
3answers
24k views

Normal transactions VS. Internal transactions in etherscan

On etherscan: -->> accounts >> contract accounts >> selecting one contract, There are two types of transactions mentioned under No Of Transactions: Normal transactions and ...
14
votes
2answers
5k views

How to conditionally send ethers to another account post-hard-fork to protect yourself from replay attacks

The DAO contract was attacked on 17th June 2016 where the attacker drained about USD 50 million worth of ethers using a recursive call vulnerability in The DAO contract code. The attacker drained ...
4
votes
3answers
6k views

Invalid JSON RPC response error for sendTransaction on Infura + Ropsten node + Truffle console

Calls work but transactions throw the error - Error: Invalid JSON RPC response: "" I am using web3 v0.19.0 & Truffle v3.4.9. Deploying contract using truffle, truffle migrate --network ...
23
votes
2answers
18k views

How to explore all transactions for a given account?

After beeing able to check account balances, I am looking for a method to list all transactions for a given Ethereum account through json-rpc protocol. I haven't found any method suitable for that on ...
24
votes
1answer
7k views

Is it possible to get the transaction hash from within a Solidity function call?

Within a Solidity function, is the transaction hash available as a global variable from within the contract? I would have thought it would be something like tx.hash in the same way you can do tx....
29
votes
1answer
4k views

Where is the private key for a contract stored?

This is a question that I am asked often by developers who assume that a contract has a private key of its own to sign any transactions that it makes.
15
votes
1answer
1k views

What is the order and concurrency behavior of multiple calls to a contract in a single transaction?

Suppose a contract has three call APIs that have side effects. What's the behavior if I try to: Call all three APIs from one address (i.e. issue three transactions if from nodejs). Are all three ...
9
votes
1answer
2k views

Does Solidity's constant keyword do anything?

It seems that the purpose of function foo() constant {} is to indicate that a function does not change the contract's state. And yet, as it states here, the compiler doesn't actually enforce this. So ...
28
votes
3answers
10k views

What happens when a transaction nonce is too high?

From Design Rationale: One weakness of the account paradigm is that in order to prevent replay attacks, every transaction must have a "nonce", such that the account keeps track of the nonces used ...
35
votes
2answers
10k views

How do I detect a failed transaction after the Byzantium fork as the REVERT opcode does not consume all gas?

Pre Byzantium fork, I could use gas == gasUsed to detect when a transaction has failed (further details in How can the transaction status from a thrown error be detected when gas can be exactly the ...
15
votes
3answers
5k views

How does the Ethereum ETH accounting system work and prevent double-spends?

In Bitcoin, the BTC accounting system is based on UTXOs (Unspent Transaction Outputs), which prevents the same BTC from being spent multiple times. I heard that Ethereum has a simpler account balance ...
24
votes
2answers
2k views

Is it a good practice to log an event every time I throw in Solidity?

In Solidity (0.3.2) I am aware that there is no way to throw specific exceptions. (Everything is an invalid JUMP error.) It seems beneficial to have a way to log specific errors. Does it make sense to ...
17
votes
4answers
5k views

Is there any safe way to send money from a cold wallet, using an untrusted computer?

You have 2 computers. One is 100% offline and, thus, trusted. Other is online. Private keys are stored on the offline computer and the online computer has no access to it. Is there any way to sign a ...
13
votes
1answer
1k views

What if I had the private key that had the public address of a contract?

Could I spend the money a contract owns if I had the private key that goes to the public address that a contract resides at? (I realize that I'd have a better chance of being struck by lightning ...
14
votes
2answers
2k views

What happens when a smart contract gets several similar calls in the same block?

What happens when a smart contract gets several similar calls in the same block? Consider for instance this greeter: contract greeter { string name; function setName(string name_) { ...
16
votes
2answers
21k views

Can I set the gas price to whatever I want?

The default gas price is 0.02e12 Wei. But while creating transactions on the command line or Geth's Javascript console you can define your own gasPrice: web3.eth.sendTransaction({/* ... */, gasPrice: ...
17
votes
4answers
14k views

How do I send an arbitary message to an Ethereum address?

How can I send a message to another Ethereum address? And how would that user receiving know that its a message? Is there an Ethereum wallet that will show that I sent a message to that address? And ...
17
votes
3answers
24k views

Unlocking accounts and making transactions in web3.js

This question is related to this one and this one. It also has a partial answer here and here. In the third link the account is being unlocked for a period of time using web3.js: web3.personal....
11
votes
2answers
1k views

Does Ethereum have a replace by fee option similar to Bitcoin?

If I send an Ethereum transaction that has not yet been confirmed by the network can I rebroadcast the same transaction with a higher fee and a new destination address?
5
votes
1answer
955 views

How to replicate Bitcoin's OP_RETURN functionality on Ethereum?

I know Ethereum is more advanced, and allows for more interesting things than associating data to a transaction. But let's say I have a legacy system that uses Bitcoin's OP_RETURN. What options do I ...
3
votes
3answers
2k views

How to recover my ether.li wallet with any other wallet software?

I am facing the following problem with my ether.li wallet, I never had Problems in the past with sending transactions but for the last two days transactions stopped working for me. Whenever I try to ...
6
votes
1answer
1k views

What underlying protocols are used to send packets between nodes, and how are messages encrypted?

In Ethereum, when we make transactions, which underlying protocol is used to send the packages over the network? And another question, are those messages are encrypted or not? TCP, UDP, others? All? ...
10
votes
1answer
1k views

Why do some blocks contain no transactions?

While poking through my Geth logs I noticed that block 1,000,006 doesn't actually contain any transactions. Why is that?
10
votes
3answers
2k views

How to prevent a replay attack between two competing chains?

After the recent hardfork we have a winning chain and a much shorter losing chain left. However, if you are pro or agains the fork, you could still mine and use one chain or the other. Now, there is ...
21
votes
2answers
15k views

How do I know how much gas to use when calling a contract?

When I am calling (sending a transaction to) a contract how do I determine how much gas to use? Is there a way to calculate this upfront & what happens if I send too much / too few gas?
7
votes
1answer
1k views

Does a mining reward transaction have a hash?

I can't find a mining reward transaction hash for a given block. I can see the block hash, all the transactions inside the block, etc. But the mining reward transaction is not listed among the details....
3
votes
1answer
4k views

How long to wait for pending transactions?

Is there any timeout for pending transactions? How long to wait before re-sending the transaction. I am sending multiple transactions and need to track the status of all those transactions. But I am ...
23
votes
1answer
8k views

Cannot perform write functions in smart contract - invalid address?

I have the following simple smart contract... contract SimpleStorage { uint storedData; function set(uint x) { storedData = x; } function get() constant returns (uint retVal) ...
15
votes
1answer
3k views

What is the exact meaning of a transaction's new receipt 'status' field?

In this answer (https://ethereum.stackexchange.com/a/6010/1529) it seems to say that the status field will always be '1' unless the transaction failed, in which case it will be '0'. In the summary ...