Stack Exchange Network

Stack Exchange network consists of 175 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 [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.

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?
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 ...
67
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?
55
votes
5answers
73k 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?
52
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: ...
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 ...
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 ...
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?
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 ...
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?
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 ...
29
votes
2answers
4k views

Do contracts also have a nonce?

Do contracts also have a nonce and if so how is it calculated? Usual accounts have a nonce that is increased with every transaction. However, contracts can't make transactions, they can only make ...
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.
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 ...
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 ...
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 ...
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 ...
24
votes
2answers
15k views

What is the ethereum transaction data structure?

I'd like to know the detail of the Ethereum transaction data structure. What data is stored in transaction?
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 ...
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....
24
votes
2answers
13k views

How many transactions can the network handle?

The voting on ethereum analysis by Dominik Schiener calculated that it would take 40 days to hold the UK general elections on the ethereum blockchain due to the transaction and gas limits. I redid ...
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 ...
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) ...
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 ...
22
votes
2answers
10k views

Is it possible to cancel a transaction?

Is it possible to cancel a transaction broadcast to the blockchain? Suppose I broadcast a transaction and want to cancel it before it has been mined. Is this possible? This could be useful on ...
21
votes
1answer
10k views

What does v, r, s in eth_getTransactionByHash mean?

In Ethereum JSON-RPC I found the return is: Returns Object - A transaction object, or null when no transaction was found: hash: DATA, 32 Bytes - hash of the transaction. nonce: QUANTITY - the number ...
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?
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 ...
19
votes
1answer
60k views

Gas price in ETH unit

I am wondering if there's a website that provides the price of the standard gas limit (21000 Gas, transaction cost for sending ETH) in ETH unit. I checked Ether.Fund site, but it provides the gas ...
19
votes
1answer
5k views

What is and how to calculate 'cumulative gas used'?

When I see transactions in Etherscan (e.g., 0x7eb9a7454f9cd2f39a7ea7c6212833673165b35f352127ffb337df866897eb73), I see the field Cumulative Gas Used which isn't present in web3 response. In general, ...
18
votes
4answers
11k views

Does Web3.js have the functionality to create new accounts and unlock an account for a period of time for a series of transactions?

I want to create new accounts through my Dapp web interface and unlock a specific account so that transactions can be processed. I didn't see it in the web3.js documentation so wonder if that's on the ...
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 ...
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
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. ...
17
votes
6answers
23k views

How to decode input data from a transaction?

I'm sending a transaction to an account with some data with the following command: eth.sendTransaction({from:eth.accounts[0],to:eth.accounts[1],value:web3.toWei(1,"ether"),data:web3.toHex("http://...
17
votes
3answers
15k views

error: replacement transaction underpriced

Im trying to send a raw transaction using web3 to ropsten testnet and Im getting this error: replacement transaction underpriced where sometimes my tx works and sometimes I get this error. my tx ...
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 ...
17
votes
5answers
36k views

How to know if a transaction went through or not? (out of gas)

Apparently when sending transactions from an Account instead of a Wallet, the gas spent is small (21K), and not enough to send ether to a Contract Wallet (out of gas, so to speak). When this happens, ...
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....
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 ...
16
votes
6answers
27k views

Insufficient funds for gas * price + value

Sending Address has over 1 Eth in current Balance. Using the Geth console, I can send many transactions of any amount less than .033 eth.sendTransaction({to:'...
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: ...
16
votes
1answer
6k views

Are gas limit in transaction and block gas limit different?

What does gas limit mean? Are there two meanings of gas limit? gas limit in a transaction block gas limit
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 ...
15
votes
2answers
7k views

Geth - How to clear queued transactions?

When typing txpool on Geth I get: { status: { pending: 15, queued: 714 }, getStatus: function() } I don't even know why there are 714 queued transactions when there should be none. I ...
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 ...
15
votes
1answer
4k views

Can Proof of Stake (PoS) improve the number of Transactions per Second?

Currently Ethereum is using Proof of Work (PoW). From my understanding there is a limit of time between blocks for two reasons: Part of that time between blocks represents the time to solve the PoW ...
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.
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 ...
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 ...