<p>A nonce is just a value that you keep changing in the hope that after you hash all the data the hash will be less than the target value. See <a href="https://en.bitcoin.it/wiki/Block_hashing_algorithm" rel="nofollow">https://en.bitcoin.it/wiki/Block_hashing_algorithm</a> (litecoin is similar only uses scrypt instead of sha256 hash function.)</p>

CC BY-SA 3.0
2013-05-09T03:26:17.010Z
It's also worth noting that nonce is a general term in cryptography, referring to any number or bit string used only once. The word "nonce" is still in use outside the U.S. as a simple English word meaning "time being." Of course in certain parts of the world it's also slang for a pedophile, so maybe it's better if we leave etymology out of this one...
David Perry
CC BY-SA 3.0
2013-05-09T05:31:35.077Z
Okay, so when I try to resolve a block, I use first 160 hex chars from data in getdata and than have worker try to resolve it doing scrypt hashing of it. So my nonce starts with 1 and goes up by one till I rich the value specified in bits? I hash little endian version of previous block hash+merkleroot+timestamp+nonce? Correct me if Im wrong, Im just trying to figure out how this works.
if __name__ is None
CC BY-SA 3.0
2013-05-09T00:46:55.023Z
2013-05-09T00:46:55.023Z
nanotube
<p>I'm trying to learn how litecoins work (and learn new programming language at same time by writing a crappy little miner).</p>

<p>I'm stuck with <code>getdata</code>. Here <a href="http://litecoin.info/wiki/Scrypt" rel="nofollow">http://litecoin.info/wiki/Scrypt</a> 
it says that data is 160 characters long. But its not. Its quite a bit longer than that.</p>

<p>So my questions are:</p>

<ul>
<li>1.) What is <code>nonce</code> and how do I use it?</li>
<li>2.) What is <code>bits</code>?</li>
<li>3.) What are all the 0's after the <code>bits</code>.</li>
</ul>

<p>EDIT: Ok, I think I have to use just first 160 characters of <code>data</code> and ignore the rest. Correct?</p>

<litecoin><difficulty><terminology><nonce><getwork>
What does nonce mean?
if __name__ is None
# What does nonce mean?

(Asked by: username_0 on 2013-05-09)

I'm trying to learn how litecoins work (and learn new programming language at same time by writing a crappy little miner).

I'm stuck with `getdata`. Here <http://litecoin.info/wiki/Scrypt>
it says that data is 160 characters long. But its not. Its quite a bit longer than that.

So my questions are:

* 1.) What is `nonce` and how do I use it?
* 2.) What is `bits`?
* 3.) What are all the 0's after the `bits`.

EDIT: Ok, I think I have to use just first 160 characters of `data` and ignore the rest. Correct?

**Tags:** litecoin, difficulty, terminology, nonce, getwork


---

## 1 answers

### Answer by username_1 on 2013-05-09. Score: 1

A nonce is just a value that you keep changing in the hope that after you hash all the data the hash will be less than the target value. See <https://en.bitcoin.it/wiki/Block_hashing_algorithm> (litecoin is similar only uses scrypt instead of sha256 hash function.)

> **Comments:**
> **username_2**: It's also worth noting that nonce is a general term in cryptography, referring to any number or bit string used only once. The word "nonce" is still in use outside the U.S. as a simple English word meaning "time being." Of course in certain parts of the world it's also slang for a pedophile, so maybe it's better if we leave etymology out of this one...  
> **username_0**: Okay, so when I try to resolve a block, I use first 160 hex chars from data in getdata and than have worker try to resolve it doing scrypt hashing of it. So my nonce starts with 1 and goes up by one till I rich the value specified in bits? I hash little endian version of previous block hash+merkleroot+timestamp+nonce? Correct me if Im wrong, Im just trying to figure out how this works.  

---

