All Questions

22
votes
4answers
14k views

Where is the state data stored?

This question was asked on Reddit a while ago: Where is the state data actually stored though? On the hard drive of each node? Separate from or within the blockchain? — Reddit: Basic ...
32
votes
6answers
27k views

How to get ether on public testnet?

I am a newbee to Ethereum and doing some research. I have installed the Ethereum Wallet app and synchronized the testnet. However, to deploy my first contract in testnet, it requires some Ether, so ...
25
votes
6answers
14k views

How to compile Solidity contracts with Geth v1.6?

I tried to compile the following contract within geth: pragma solidity ^0.4.8; contract Test { uint256 public value; function Test() { value = 123; } } using the following ...
28
votes
2answers
47k views

how to unlock the account with geth?

when I use the web3 interface to sign on msgs, it tell me that the account should be unlocked, how can I manage this with geth and what exactly does unlocking mean?
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 ...
22
votes
1answer
3k views

When can BLOCKHASH be safely used for a random number? When would it be unsafe?

I've seen more complicated ways for a contract to generate a random number. But the Ethereum Yellow Paper itself suggests a "trivial solution" using the BLOCKHASH opcode (see below, bold is mine). ...
35
votes
10answers
26k views

How can I find out what the highest block is?

I'm syncing up a new node. How can I find out what the latest block is so that I know how far I've got to go?
13
votes
1answer
6k views

How does the Ethereum Homestead difficulty adjustment algorithm work?

From From EIP 2, the Homestead difficulty adjustment algorithm is: block_diff = parent_diff + parent_diff // 2048 * max(1 - (block_timestamp - parent_timestamp) // 10, -99) + int(2**...
18
votes
5answers
10k views

How do I import my presale wallet?

I purchased ether during the presale. Is there an easy way to import those ether and start using them?
12
votes
2answers
4k views

How to load Solidity source file into geth

Is it possible to load Solidity source file .sol file to go-ethereum. I am using the 'loadScript' method by saving a .js file like the following and loads it. source = "contract test {\n" + " /// ...
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 ...
14
votes
1answer
2k views

Getting the wrong address back from ecrecover

When I sign a string using the following code I get back a different address to the one I signed with. The address returned is different for different strings. const util = require('ethereumjs-util') ...
13
votes
2answers
1k views

How would a miner cope with a huge block time?

Given that: According to the white and yellow paper a block's timestamp must be bigger than the parent's. According to the white paper a block's timestamp can be within 15 min of the parent ...
23
votes
4answers
11k views

How can I represent decimal values in Solidity?

I just started writing some solidity and I noticed that there are no decimal values such as double or float. What do you guys do when you need to return send to a wallet let's say 1.57 ether? Or when ...
13
votes
2answers
3k views

Can a contract listen to events of another contract?

I read that to listen to events you need to use web3.js. Are there other ways of doing it? Can a contract even somehow listen to events of another contract? Thanks!
15
votes
2answers
9k views

How do I convert my The DAO tokens into ethers on the Ethereum Classic chain?

According to Whitehat Withdrawal contract - Update and Next Steps and Whitehat Withdrawal contract - Last update before deployment, the Goodies will be deploying the withdrawal contracts whetcwithdraw....
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 ...
12
votes
1answer
6k views

Are pending transactions “dropped” and “reinstated”?

I tried a simple transfer of ether between two accounts using geth, but set quite a low gas price (2 gwei). After two hours the transaction was still showing in geth under eth.pendingTransactions - I ...
72
votes
6answers
271k 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 ...
71
votes
5answers
115k 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?
44
votes
1answer
44k views

Which TCP and UDP ports are required to run an Ethereum client?

The geth CLI options suggest that per default the client listens on TCP port 30303. This page, additionally suggests that UDP port 30301 is used for node discovery. Is this all that is required or ...
75
votes
5answers
158k 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 ...
54
votes
7answers
39k 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 ...
17
votes
3answers
4k views

How to programmatically detect and accept ETH and ERC20 deposits

I'm looking to replicate the functionality provided by cryptocurrency exchanges such as Kraken and Poloniex when it comes to depositing ETH and tokens. Namely: Users can generate and send funds to ...
22
votes
3answers
5k views

Can a contract safely rely on block.timestamp?

How safe is it to use block.timestamp as contract expiration time? If a miner provides an incorrect timestamp in a block header, how much can it be off before it is rejected by other nodes? Is there a ...
33
votes
1answer
14k views

What's the difference between Accounts and Wallets in Mist?

In Mist, there are some addresses listed as accounts, and some listed as wallets. What's the difference? Which should I use? And why do I need Ether to create a Wallet?
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 ...
21
votes
2answers
4k views

What is the merit of creating new smart contract languages like Solidity instead of using other languages?

What is the pros and cons of creating new languages like Solidity for smart contracts instead of using other computer languages like Golang or Python?
28
votes
3answers
5k views

What is a replay attack?

During the launch of the frontier network, users were cautioned not to reuse keys from the Olympic testnet in order to prevent "replay attacks". What is a replay attack, and why would re-using a key ...
18
votes
3answers
4k views

Account uniqueness guaranteed?

When we create an account in the Ethereum main network, how does the protocol guarantee the unique address of an account? Since even if we are not connected to the network we can create an account, is ...
5
votes
3answers
14k views

How to properly create a raw transaction and sign it using web3 in browser

I want to create and sign a transaction in browser using web3. In order to create a raw transaction, I think I have to do something like this (hopefully you can fill the gaps of my knowledge) var pk =...
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.
21
votes
1answer
2k views

What are effective techniques to encrypt/decrypt data stored in a smart contract?

Rather than sending and storing plain text in a smart contract, the use case objective is to encrypt first and then subsequently access the data and decrypt at the point of use. What is the most ...
15
votes
3answers
7k views

Could we call a constant function without spending any gas inside a transaction function?

I have a sorted linked list that contains around 1000 items. When I receive a new item my goal is to push the item to the list keeping the sorted order. So if I receive very small value, I am required ...
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 ...
22
votes
4answers
4k views

Why does a Solidity throw consume all gas?

When you throw an exception, all gas is consumed. What is the rationale for this design decision?
84
votes
2answers
47k 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 ...
64
votes
5answers
50k 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 ...
25
votes
2answers
9k views

How to encrypt a message with the public-key of an Ethereum address

I am writing some code in nodejs/browser. I have successfully created ethereum-addresses with the secp256k1-library. I was also able to sign and verify messages. Now I want to encrypt/decrypt a ...
43
votes
2answers
29k 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 ...
22
votes
3answers
2k views

What is the exact “longest chain” rule implemented in the Ethereum “Homestead” protocol?

This paper from 2016 claims (in section 3.3.2, speaking about the actual Ethereum implementation as opposed to the specification) that: although uncle blocks that are included in a block receive a ...
33
votes
3answers
22k views

How can I create a multisignature address on Ethereum?

I want to store my ether in a form that requires more than one digital signature in order to authorise spends. How do I do on that on Ethereum?
39
votes
3answers
9k views

How were gas costs chosen for the Ethereum Virtual Machine instructions?

Different instructions of the EVM have different associated gas costs -- you can look at the list of the gas-prices in the appendix G of the yellow paper. While the rough magnitudes of those numbers ...
24
votes
6answers
7k views

How to make miner to mine only when there are Pending Transactions?

As of now the geth miner running on my system mines even empty blocks. All i wanted is miner should mine only when there are Transactions to mine, after mining the miner should immediately sleep. ...
22
votes
3answers
85k views

What is the current DAG size? When do we expect to hit GPU limits?

I have two mining rigs running, one with 2GB GPUs and one with 8GB cards. Recently, the rig with the 2GB cards failed due to the inability to upload the DAG to the GPU. What's the current DAG size ...
26
votes
4answers
9k views

How do I decrease the difficulty on a private testnet?

I've created a private test network. On the genesis.json file, I've changed the difficulty to 1. Yet, mining a block still takes hours on my CPU. I suspect that is due to some configuration related to ...
10
votes
4answers
4k views

How to Compile and Deploy a Smart Contract without running a full node?

I'm new to solidity and smart contract programming. I have already made and deploy smart contracts successfully, but always using Mist. Now I'm not able to do so, because I can't complete a node ...
21
votes
4answers
16k views

How can I empty the blockchain?

I am trying to do a fast sync using geth --fast but I am getting this message: blockchain not empty, fast sync disabled How can I empty the blockchain to allow for fast sync?

15 30 50 per page