All Questions

Filter by
Sorted by
Tagged with
47
votes
1answer
47k 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 ...
58
votes
8answers
42k 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 ...
24
votes
1answer
12k views

Ethereum ecrecover signature verification and encryption

The question of signing and verifying signatures with Solidity has been asked in these questions, both of which I have tried to study: How can I sign a piece of data with the private key of an ...
25
votes
3answers
6k 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 ...
26
votes
6answers
15k 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 ...
35
votes
3answers
26k 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 ...
32
votes
2answers
50k 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?
25
votes
1answer
4k 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). ...
19
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 ...
37
votes
10answers
27k 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?
14
votes
2answers
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**...
16
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 ...
13
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" + " /// ...
7
votes
2answers
4k views

What is GHOST and what is its relationship to Frontier and Casper?

As high-level as possible without losing important meaning, what's the intuition behind GHOST? How is it currently implemented in Frontier? What will be different with GHOST in Casper?
15
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 ...
15
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') ...
16
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....
73
votes
6answers
272k 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 ...
87
votes
2answers
20k views

Comparison of the different TestNets

The Metamask client allows access to three test networks: Ropsten Kovan Rinkeby I'm curious: What are the similarities / differences between them? Which use cases are best for each network Are ...
72
votes
5answers
117k 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?
27
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 ...
79
votes
6answers
159k 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 ...
19
votes
3answers
5k 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 ...
25
votes
2answers
19k 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 ...
41
votes
3answers
10k 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 ...
26
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. ...
32
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.
26
votes
1answer
8k 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....
22
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 ...
24
votes
1answer
19k views

What are the valuable benefits of having a node?

Supposedly I'd like to help Ethereum to expand (in terms of the World Computer), so I'd like to setup a Linux machine which can run smart contracts. What kind of benefits I can get from doing that? ...
16
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 ...
21
votes
3answers
4k views

TheDAO hack FAQ: How did the attack happen on 17 June 2016?

Can anyone explain that how the DAO attack happened? Vitalik Buterin explained here that it was performed by splitting a DAO from the main DAO but calling the split function recursively. We know that ...
15
votes
1answer
7k views

Member function “transfer” not found or not visible after argument-dependent lookup in contract?

I am having a problem with my smart contract making value transfers. My current environment: Truffle v5.0.0-beta.2 (core: 5.0.0-beta.2) Solidity v0.5.0 (solc-js) Node v8.11.1 I created the ...
8
votes
1answer
1k views

How can I take a snapshot of Ganache or Truffle Develop state and reload later?

I would like to be able to save the state of my local Ganache or Truffle Develop chains into some sort of file. At a later time, I would like to be able to restart Ganache or Truffle Develop and apply ...
24
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?
4
votes
2answers
4k views

Remix Warning - No visibility specified, Violate Checks-Effects-Interaction pattern, Function state mutability can be restricted to pure - Can ignore?

Two months ago, I wrote a smart contract with Remix.ethereum.org. Line 1 of my code has: pragma solidity ^0.4.11; It compiled fine with no errors and nor warnings. I tested every function in ...
104
votes
11answers
80k 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 ...
88
votes
2answers
50k 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 ...
66
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 ...
47
votes
3answers
31k 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 ...
28
votes
3answers
3k views

Concurrency patterns for account nonce

The account nonce is the only element in the transaction structure that prevents replay attack (as explained in this very good answer). It essentially forces sequentialisation of an account's ...
25
votes
3answers
15k 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 ...
37
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?
24
votes
3answers
3k 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 ...
25
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 ...
10
votes
3answers
16k 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 =...
29
votes
4answers
10k 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 ...
12
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 ...
23
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?
21
votes
2answers
11k views

How can you call a payable function in another contract with arguments and send funds?

I have a contract named Call: contract Call { ... function () payable { // TODO: Call the call function in the main contract // and forward all funds (msg.value) sent to this contract ...

15 30 50 per page