<p>A Markov chain is a mathematical model for a random process that has only short-term dependence on its history: if you know the current state of the system (or perhaps its recent history), any further historical information will not improve any predictions about its future.</p>

<p>This could be a useful model for analyzing a (flawed) lottery in which there is some dependence between today's number and tomorrow's; it could help you determine the nature of that dependence, and let you use today's number to make a prediction about tomorrow's number that would improve your chances of winning.</p>

<p>However, in a truly fair and random lottery, no such dependence should exist.  Each number should be chosen in a manner that is not biased or affected in any way by past numbers.  In such a case, a prediction based on a Markov chain would be no better than a random guess; and indeed, given enough data, Markov chain techniques would tend to confirm that there is no dependence.  (In the short term, such techniques might appear to detect some dependence, but this would be erroneous.)  So if the lottery is in fact fair, you can't improve your odds using a Markov chain analysis or any other method.</p>

<p>My understanding is that the cryptographic community believes, based on all current evidence, that the Bitcoin mining algorithm behaves like a fair lottery.  Of course, the output of the SHA256 hash function does in fact depend on its input data, but it is believed that there is no computationally feasible way  to describe or gain information about this dependence short of actually computing the function.  If so, then SHA256 outputs are effectively independent of their inputs, and past history of Bitcoin hashing gives you no useful information about the future; it does not help you improve your odds compared to trying nonces in sequence or at random.</p>

<p>If you, or anyone else, is able to "improve Bitcoin mining" via Markov chain techniques, or any other method, it would mean that SHA256 is seriously flawed and should be abandoned.  Fortunately, as far as I know, there is no evidence to suggest that this is the case.</p>

CC BY-SA 3.0
2014-05-16T02:40:16.700Z
Hi,

Thank you both for your answers.

But actually according to the Wikipedia article definition for Markov Chain: [Markov Chain Definition][1]: there is no dependence on history.
So I agree with your conclusions but for different reasons.
And I realize now that construction the state transition matrix for the Markov chain - leading to a "win: correct nonce" and a loss: incorrect nonce' would be too computationally intensive   [1]: http://en.wikipedia.org/wiki/Markov_chain
user15799
CC BY-SA 3.0
2014-05-18T21:23:51.567Z
Markov chains don't depend on past history *other than the current state of the system*. For example, Markov modelling of text would predict the next word based on the current word, but not looking any further back than that (a hidden Markov model would look back further). On the other hand, Bitcoin mining is entirely random and doesn't even depend on the current state of the system. Markov models are useless for Bitcoin mining just like they are useless for predicting dice rolls.
Greg Hewgill
CC BY-SA 3.0
2014-05-16T02:07:06.613Z
2014-05-16T02:07:06.613Z
Nate Eldredge
<p>Discrete Markov chains have been used to approximate the probability distributions in games of chance in order to improve odds and do predictions e.g. winning numbers in a lottery. As long as the lottery,card game etc. meets certain conditions this will work or else the probability distribution will drift rendering the prediction useless.</p>

<p>Competing to find a nonce during mining is kind of like a lottery. Therefore theoretically Markov chains could be used to improve bitcoin mining as long as it satisfies conditions for discrete Markov chains. Has anyone ever explored this?</p>

<p>Thanks, Andrew</p>

CC BY-SA 3.0
2014-05-16T01:00:54.733Z
The probably distributions of hash algorithms are assumed to be completely uniform. I can't imagine how past information could in any way predict future outcomes.
Greg Hewgill
<bitcoind>
Usage of Markov chains to improve bitcoin mining
user15799
# Usage of Markov chains to improve bitcoin mining

(Asked by: username_0 on 2014-05-15)

Discrete Markov chains have been used to approximate the probability distributions in games of chance in order to improve odds and do predictions e.g. winning numbers in a lottery. As long as the lottery,card game etc. meets certain conditions this will work or else the probability distribution will drift rendering the prediction useless.

Competing to find a nonce during mining is kind of like a lottery. Therefore theoretically Markov chains could be used to improve bitcoin mining as long as it satisfies conditions for discrete Markov chains. Has anyone ever explored this?

Thanks, Andrew

**Tags:** bitcoind

> **Comments:**
> **username_1**: The probably distributions of hash algorithms are assumed to be completely uniform. I can't imagine how past information could in any way predict future outcomes.  

---

## 1 answers

### Answer by username_2 on 2014-05-16. Score: 8

A Markov chain is a mathematical model for a random process that has only short-term dependence on its history: if you know the current state of the system (or perhaps its recent history), any further historical information will not improve any predictions about its future.

This could be a useful model for analyzing a (flawed) lottery in which there is some dependence between today's number and tomorrow's; it could help you determine the nature of that dependence, and let you use today's number to make a prediction about tomorrow's number that would improve your chances of winning.

However, in a truly fair and random lottery, no such dependence should exist. Each number should be chosen in a manner that is not biased or affected in any way by past numbers. In such a case, a prediction based on a Markov chain would be no better than a random guess; and indeed, given enough data, Markov chain techniques would tend to confirm that there is no dependence. (In the short term, such techniques might appear to detect some dependence, but this would be erroneous.) So if the lottery is in fact fair, you can't improve your odds using a Markov chain analysis or any other method.

My understanding is that the cryptographic community believes, based on all current evidence, that the Bitcoin mining algorithm behaves like a fair lottery. Of course, the output of the SHA256 hash function does in fact depend on its input data, but it is believed that there is no computationally feasible way to describe or gain information about this dependence short of actually computing the function. If so, then SHA256 outputs are effectively independent of their inputs, and past history of Bitcoin hashing gives you no useful information about the future; it does not help you improve your odds compared to trying nonces in sequence or at random.

If you, or anyone else, is able to "improve Bitcoin mining" via Markov chain techniques, or any other method, it would mean that SHA256 is seriously flawed and should be abandoned. Fortunately, as far as I know, there is no evidence to suggest that this is the case.

> **Comments:**
> **username_0**: Hi,  Thank you both for your answers.  But actually according to the Wikipedia article definition for Markov Chain: [Markov Chain Definition][1]: there is no dependence on history. So I agree with your conclusions but for different reasons. And I realize now that construction the state transition matrix for the Markov chain - leading to a "win: correct nonce" and a loss: incorrect nonce' would be too computationally intensive   [1]: http://en.wikipedia.org/wiki/Markov_chain  
> **username_1**: Markov chains don't depend on past history *other than the current state of the system*. For example, Markov modelling of text would predict the next word based on the current word, but not looking any further back than that (a hidden Markov model would look back further). On the other hand, Bitcoin mining is entirely random and doesn't even depend on the current state of the system. Markov models are useless for Bitcoin mining just like they are useless for predicting dice rolls.  

---

