Hot answers tagged

45

Lots of answers here, but none of them has actually answered the question "what is a share?" In almost all mining pools, a share is a block "solution" not quite good enough to be published as an actual block, but still good enough that it's really hard to find them. This means that shares can be used to measure how much work you're doing, but just with ...


22

According to the Ethereum white paper: The current intent at Ethereum is to use a mining algorithm where miners are required to fetch random data from the state, compute some randomly selected transactions from the last N blocks in the blockchain, and return the hash of the result. This has two important benefits. First, Ethereum contracts can include ...


11

The Ethereum mining algorithm is outlined here and further detailed here. Participants in a mining pool only receive the parameters (block header parameters, etc..) required for them to compute the POW. However, as illustrated here, a block also includes a Merkle-Patricia state trie, a transaction Merkle tree, and a receipt Merkle tree. The pool miners do ...


10

The block header is the hash returned from generating a Merkle tree that is below the current difficulty target for the blocks data. What's a hash? In order to understand what the block header is you need to understand what a hashing function is. A hashing function is a one way(non invertible function) that maps a set of inputs to a set of outputs hash(s) -...


9

The Ethash DAG is not related to merkle trees (the word "merkle" does not appear on either wiki page). The Ethash DAG only serves as a big dataset (i.e. too big to fit in memory) for making Ethash mining be "memory-hard". Ethereum's merkle tree is what keeps track of the state of all accounts and contracts. The state of all accounts is not directly related ...


6

Though it's only a partial answer, this might shed some light: http://github.com/ethereum/wiki/wiki/Ethash-Design-Rationale . I seem to recall reading a blog post by vbuterin, but I can't locate it at the moment. The main points can be found in that link, and are as follows: IO saturation: The algorithm should consume nearly the entire available ...


6

There are two primary ways that the existing PoW based consensus algorithm combats mining centralisation. The first is by reducing losses due to orphaned blocks, which independent miners are more likely to experience. This portion of the Ethereum mining algorithm, a technique referred to as GHOST, includes the headers only of recently orphaned blocks in ...


5

A hash function is different to a proof-of-work algorithm. Much of the effort in following a proof-of-work algorithm involves making hashes, but they're distinct things. Ethash is the proof-of-work algorithm. Keccak-256 is the most commonly-used hash function. Keccak-256 is used internally in places like when making hashes for block headers, but the place ...


5

In the future there will be move to a proof of stake algorithm called Casper, which will require a hard fork because such changes are not backwards compatible. There has already been a hard fork: Homestead. Several consensus rules were changed, such as adding the DELEGATECALL opcode and increasing the price of gas for creating contracts via transactions ...


4

zanzu accurately describes the architecture that prevents pool miners from controlling the work delivered to the pool, but to answer your question: What exactly is a share? A share is the miner's portion of the reward block that is (generally) proportional to the amount of work they contributed to the overall effort of mining that individual block. This is ...


4

Ethash vs Equihash memory hardness isn't a constant - it changes with time - but I'll try to provide a (very basic and generalised) method that you could use to work out what it is at any point in time. Ethereum uses a generated DAG file which increases in size every 30,000 blocks (called an epoch). As of writing the current Ethereum epoch is #151 and the ...


3

FNV = Fowler–Noll–Vo hash function. From the main Ethash page (which contains a link to Wikipedia): We use an algorithm inspired by the FNV hash in some cases as a non-associative substitute for XOR. At the risk of defining what perhaps you already know... Associativity: Within an expression containing two or more occurrences in a row of the ...


3

I got the answer from Péter Szilágyi on go-ethereum gitter channel so I paste here for people who come by. If I remember correctly, the "shared PoW" is only used inside our tests. The idea was that generating a PoW DAG, even a small one for testing takes time. Since we have hundreds of thousands of random tests, even small times add up to giant test ...


3

The algorithm The algorithm is explained in detail, using (Python) pseudo-code, on the Ethash wiki page. There's also a related Design Rationale page. Those pages are nicely written, concise, and should cover everything you need to know, so I won't rehash them here. (Pun not intended, but I'll pretend it was.) Instead I'll concentrate on the code locations,...


3

It seems impossible to do so, because Ethash requires a 16 MB pseudorandom cache. This would be expensive to store on the blockchain, as each Ethereum transaction only holds a maximum of 89kB (3 million gas).


3

To mine a block mining pool, you need to find a "good" nonce for the header. The header includes a field "beneficiary", which has to be set to the account to receive the block reward. If the beneficiary was not set to the mining pool address, then all my "bad" nonces cannot be turned in as "shares". If I find a block for the pool, I can't go and simply ...


3

Below are the steps to calculate blockHash, given a blockNumber: Step1. eth.getBlock(400000) Output:{ difficulty: '6022643743806', extraData: '0xd583010202844765746885676f312e35856c696e7578', gasLimit: 3141592, gasUsed: 0, hash: '0x5d15649e25d8f3e2c0374946078539d200710afc977cdfc6a977bd23f20fa8e8', logsBloom: '...


2

The thing is that here, nonce is an integer I think it's actually of type bytes - it's not a true numeric type like int is. So here nonce is being treated as a byte array. So how should header and nonce be? as hex string? integers? As above. You could try using the bytes() or bytearray() to convert what you have.


2

You can just use eth_blockNumber


2

Yes it would be possible, but you would have to make every one follow your fork. Why would we do this ? Ethash is nice and Casper proof of stake algorithm will come soon (I hope) so mining will be over.


2

Every 30,000 blocks - where 30,000 blocks is called an epoch - a new DAG file is generated. This mechanism provides the Ethash algorithm something fresh to work on. At the end of 30,000 blocks, clients want to switch from their current DAG to the next one as quickly as possible. To this end, the next DAG file is generated in advance. From the ...


2

Ethash is the Proof-of-Work algorithm used by Ethereum. Design rationale and an explanation of the algorithm in pseudo-code can be found on the wiki (and has been discussed in previous questions - see: What proof of work function does Ethereum use?). Clique is the protocol used in Ethereum's Proof-of-Authority testnet, named Rinkeby. If you're really ...


2

You make sure that the information is correct by putting all the fields in a Header RLP object, generating the hash, and comparing it against the block hash. Two of those header fields are the transaction root hash and the state root hash. You verify all fields at the same time. There is a header object in py-evm that you could use, or you could build a ...


2

First of all, in bitcoin and subsequently in every other blockchain nonce is shortcut for nonsense. It does not make any sense to the block data but it is there. Lets see why is it there? A Block basically should have 1) Previous block hash, and 2) List of transactions to be mined in that block With these values no matter how many times you calculate ...


2

Your understanding is correct about both nonces. The block nonce is what miners keep changing to compute a solution to Proof of Work (in Ethereum, it's Ethash). Miners probably start with a value of 0 (all bits set to 0) and then keep incrementing it by 1 until they find a solution. A definition of nonce is "occurring, used, or made only once or for a ...


1

The general route that the algorithm takes is as follows: There exists a seed which can be computed for each block by scanning through the block headers up until that point. From the seed, one can compute a 16 MB pseudorandom cache. Light clients store the cache. From the cache, we can generate a 1 GB dataset, with the property that each ...


1

I've found an answer here at the Ethash wiki. def calc_dataset_item(cache, i): n = len(cache) r = HASH_BYTES // WORD_BYTES # initialize the mix mix = copy.copy(cache[i % n]) mix[0] ^= i mix = sha3_512(mix) # fnv it with a lot of random cache nodes based on i for j in range(DATASET_PARENTS): cache_index = fnv(i ^ j, ...


1

Do not use POW, use Proof of Authority and problem solved. Reason being POA requires no DAG generation, therefore is suitable for low end devices.


1

Let A = blocksPerMonth = nSecondsPerMonth / blockTime = 2592000 / 15 = 172800 B = chanceOfWinning = yourHashPower / totalHashPower = 74.525 / 30728202.35 = 0.00000242529644758083 The chance of winning a single block is then: A * B = chanceOfWinningOneBlock = 172800 * 0.00000242529644758083 = 0.419091226141968 This is the number ...


1

I have a hd7950 recently purchased used to fiddle with AMD mining, as I have only used Nvidia 1060 on Ubuntu up to now. Mine runs around 11.5Mhs stock. I havent tried to overclock it yet, but I believe its that slow as the DAG has grown. BTW 3G is fine for the DAG, Im mining right now, dual mining Eth and Sia on that card at the same time with Claymores dual ...


Only top voted, non community-wiki answers of a minimum length are eligible