All Questions

Filter by
Sorted by
Tagged with
249 votes
8 answers
78k views

`external` vs `public` best practices

Apart from the public modifier Ethereum introduces the external one. Both may be called outside of the contract and inside (the later one by this.f() pattern). Moreover, according to the docs: ...
user avatar
246 votes
8 answers
187k 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?
user avatar
215 votes
20 answers
86k views

How can I securely generate a random number in my smart contract?

If I am writing a smart contract for some kind of (gambling) game, how can I generate a random number securely? What are the best practises and security trade-offs to be aware of?
user avatar
  • 8,201
179 votes
2 answers
48k 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 ...
user avatar
  • 7,226
178 votes
13 answers
49k views

Upgradeable smart contracts

If the contract issuer wants to have a way to upgrade the contract code, so that account data and other things carry over, can Ethereum provide this? Also can this be done without changing the ...
user avatar
166 votes
7 answers
130k views

What are the Ethereum disk space needs?

How fast is Ethereum blockchain growing and how big is it likely to get in the future? Is it still about 1 GB per month? Are there any data pruning or compression algorithms in place or planned to be ...
user avatar
  • 1,761
159 votes
4 answers
39k views

Are there well-solved and simple storage patterns for Solidity?

Simple and appropriate data organization can challenge Solidity newcomers. It wants us to organize everything in ways many of us aren’t accustomed to. Are there well-solved general patterns for ...
user avatar
  • 51.4k
153 votes
9 answers
93k views

What is an ABI and why is it needed to interact with contracts?

ABI is referenced in many places including the official Ethereum website. What is an ABI and why is it necessary to use?
user avatar
143 votes
6 answers
109k views

How are ethereum addresses generated?

What criteria does a valid Ethereum address need to fulfill? Is it just a random number in hexadecimal? Or does it need to be derived in a specific way, according to some cryptographic algorithms? ...
user avatar
  • 2,114
139 votes
1 answer
52k views

What is Swarm and what is it used for?

What is Swarm and what is it used for? And what is Swarm's relationship with Whisper?
user avatar
  • 78.3k
136 votes
5 answers
44k views

Why does Ethereum plan to move to Proof of Stake?

The initial version of Ethereum (Frontier) uses a Proof of Work based consensus algorithm, but I see that there are plans to implement a Proof of Stake based consensus algorithm called "Casper" in a ...
user avatar
134 votes
2 answers
59k views

Comparison of the different TestNets

The Metamask wallet allows access to four test networks: Ropsten Kovan Rinkeby Goerli I'm curious: What are the similarities/differences between them? Which use cases are best for each network Are ...
user avatar
  • 2,877
128 votes
6 answers
146k views

What is a DApp?

There are new terms in Ethereum like smart contract. What is a DApp and how is it different from smart contracts?
user avatar
  • 78.3k
121 votes
9 answers
37k views

How can a contract run itself at a later time?

In my blockchain application, I would like to have an event triggered at a later time, hours or perhaps even days after the application has most recently received a transaction from a user. How can I ...
user avatar
115 votes
6 answers
55k views

How is the address of an Ethereum contract computed?

How is the address of an Ethereum contract computed? What use cases are there for knowing a contract's address in advance?
user avatar
  • 78.3k
114 votes
11 answers
83k views

How would I explain Ethereum to a non-technical friend?

I've recently attempted to explain Ethereum to several non-techy friends. My explanation usually involves starting with a comparison to Bitcoin, but this quickly becomes complicated as I then have ...
user avatar
112 votes
2 answers
81k views

Which cryptographic hash function does Ethereum use?

Many sources refer to the use of the "SHA3" cryptographic hash function within Ethereum, but the Ethereum project began before the SHA3 standard was finalised, and there was some confusion/controversy ...
user avatar
106 votes
4 answers
106k views

What is Geth's "fast" sync, and why is it faster?

One of the answers to this question suggested using Geth's --fast flag to help quickly synchronise the block data. How does the flag work, and how does using it speed up the synchronisation? Are we ...
user avatar
105 votes
7 answers
83k views

Ethereum block architecture

Where can I find a description (preferably a diagram like below) showing the block structure in an Ethereum blockchain? Credits: Wikipedia
user avatar
  • 5,030
104 votes
5 answers
52k views

What is the difference between Swarm and IPFS?

IPFS seems a little slow on existing dapps. will Swarm load content more quickly? Also- is there a roadmap for swarm?
user avatar
  • 1,864
103 votes
7 answers
36k views

How can an Ethereum contract get data from a website?

What is the process/workflow behind the process where an Ethereum contract gets some data from a website?
user avatar
  • 1,917
100 votes
2 answers
40k views

When should I use calldata and when should I use memory?

I have seen people use both memory and calldata keywords when writing Solidity. Specifically, they are used when declaring function parameters that take dynamic types like 'structs' or 'arrays'. When ...
user avatar
96 votes
5 answers
39k views

Difference between require and assert and the difference between revert and throw

I was looking at the docs and I'm looking for clarification on the difference between require and assert and throw and revert. assert(bool condition): abort execution and revert state changes if ...
user avatar
  • 1,481
96 votes
5 answers
41k views

Difference between CALL, CALLCODE and DELEGATECALL

CALL and CALLCODE take the same number of operands (in the execution stack). For the exception flag being pushed on top of the stack: 0 means exception, 1 means successful execution. CALL is easy to ...
user avatar
  • 1,873
94 votes
3 answers
35k views

What is an uncle/ommer block?

The Ethereum blockchain is described as containing "ommer" blocks, usually called "uncle" blocks by the general public. What is an ommer/uncle block, and why are they needed?
user avatar
93 votes
12 answers
46k views

Common useful JavaScript snippets for geth

In geth you can loadscript any .js file. I discovered this one on the wiki which I like a lot: function checkAllBalances() { var i =0; eth.accounts.forEach( function(e){ console.log(" eth....
91 votes
2 answers
48k views

What does the indexed keyword do?

What does the "indexed" keyword do in the below line of code? I'm guessing it just tells the event object that the following input should be logged? Can we use it other places ie outside of events? ...
user avatar
  • 1,055
88 votes
6 answers
172k views

What is the total supply of Ether?

In Bitcoin, the total supply is capped at 21 million BTC. Is the total supply of Ether capped? How much will be mined before the Proof of Stake (POS) transition, and how will POS affect the issuance ...
user avatar
  • 34.2k
85 votes
9 answers
22k 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?
user avatar
  • 7,226
84 votes
2 answers
33k 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: ...
user avatar
  • 6,033
82 votes
5 answers
158k views

What actually is a DAG?

I have tried googling it as well as finding it here. Many people here talk about it, but what actually is a DAG?
user avatar
  • 861
80 votes
9 answers
85k views

How can I check if an Ethereum address is valid?

I've read many times that you should never input an address by hand unless you want to accidentally send Ether into no-mans-land. I'd like to know what those checksums might be. Is there a way to tell ...
user avatar
  • 2,495
76 votes
6 answers
276k views

How do I buy Ethereum with USD?

I am a complete noob at investing. I have never bought stock or invested in anything before but I have $300 I would like to turn into Ethereum. Could someone please tell me step by step how to ...
user avatar
  • 761
76 votes
2 answers
24k views

ELI5 How does a Merkle-Patricia-trie tree work?

I understand that Merkle tree are Hashes of Hashes, they have the advantage that you can verify only a subtree. But what about Patricia? What does a trie mean? And how is it used in Ethereum?
user avatar
74 votes
2 answers
30k views

Solidity: What is the difference between `view` and `constant`?

Solidity 0.4.16 introduced the view and constant function modifiers. The documentation says: constant for functions: Same as view. Does this mean view is just an alias for constant? If so, why do ...
user avatar
  • 8,114
73 votes
9 answers
94k views

Help with very slow mist sync

I have seen other posts in reddit where users experienced slow sync times. I am using windows 10 and version 3.7 (I saw on gitter that other users on windows 10 had trouble with version 3.8 crashing). ...
user avatar
  • 739
72 votes
5 answers
51k views

What's the difference between proof of stake and proof of work?

The Ethereum frontier network currently uses a proof of work (PoW) consensus algorithm, while a future version of the network plans to utilise a proof of stake (PoS) algorithm instead. What's the ...
user avatar
72 votes
2 answers
37k views

What does each genesis.json parameter mean?

I'm trying to setup genesis.json for my private network. What does each parameter mean and what value can I set in genesis.json? nonce: any data? timestamp: any time? parentHash: any hash? extraData: ...
user avatar
71 votes
7 answers
66k views

How to concatenate strings in solidity?

I'm trying to concatenate two strings in solidity. I tried with + or . but neither option works. There is not much documentation on string concatenation yet. Is it even possible? If not, can I ...
user avatar
  • 31.4k
70 votes
3 answers
67k views

Is Ethereum wallet address case sensitive?

I sent some amount of ETH to a wallet. I checked the wallets balance on ether chain. I entered the address in the search field and noticed both lowercase and uppercase versions of the address seemed ...
user avatar
  • 761
68 votes
13 answers
49k 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 ...
user avatar
  • 2,463
68 votes
4 answers
57k views

<address>.send vs <address>.transfer best practice usage?

I noticed that address's offer two member functions that perform the transfer of ether to the specified address. send returns false upon failure and transfer raises an exception. In the Solidity ...
user avatar
  • 905
68 votes
1 answer
12k views

Why is the average block time 17 seconds?

The network stats show a constant average blocktime of around 17 seconds. Whenever you check it is around 16~18 seconds. Reading the blog post by vitalik buterin it states the block time should be 12 ...
user avatar
  • 31.4k
67 votes
7 answers
88k views

How do you get a json file (ABI) from a known contract address?

I want to watch a Solidity contract using the Mist browser. I know how to do that and it needs the address and the json. I have the address, but I don't have the json. I do have the source code. Can ...
user avatar
65 votes
5 answers
35k views

Why are selfdestructs used in contract programming?

I'm reading bits and pieces that selfdestructs within contracts are a good thing. Can someone explain what the benefits are of doing a contract selfdestruct when it comes to Ethereum programming? Is ...
user avatar
  • 4,628
65 votes
3 answers
17k views

Why can't contracts make API calls?

The model that contracts can only accept and process data, instead of also being able to retrieve data from the Internet, seems limiting (even if not, it's less direct). If a concern is that data or ...
user avatar
  • 78.3k
65 votes
6 answers
99k 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?
user avatar
  • 78.3k
65 votes
2 answers
51k views

What is the relationship between Mist and Ethereum Wallet?

In https://github.com/ethereum/mist/releases 0.3.6 the files are named Mist. Starting in 0.3.7 the files are named Ethereum-Wallet. Will files named Mist take over in the future, or will there be 2 ...
user avatar
  • 78.3k
63 votes
3 answers
25k views

What OPCODES are available for the Ethereum EVM?

The Ethereum virtual machine has a large number of operation codes and base level instruction sets. Is a complete listing available?
user avatar
62 votes
7 answers
163k views

What is the recommended way to safely store Ether?

There are several options for storing Ether : Accounts Mist/Geth accounts. Paper wallets. Icebox Air gapped offline signing of transactions Wallet Mist Multi-signature. In short there are a lot ...
user avatar
  • 3,272

15 30 50 per page
1
2 3 4 5
919