Does the nonce have to be a number?

2

Since we're just trying to produce a specific hash output, couldn't the nonce also include letters or otherwise random bits?

pinhead

Posted 2013-04-23T17:03:20.690

Reputation: 2 356

it needs to be increasing, so using a number or more specifically a date makes this easierLoourr 2013-04-23T18:07:47.077

Answers

5

The nonce is an arbitrary string of bits with no particular meaning. Typically they are converted into an unsigned integer for convenience. Every possible set of nonce bits has a corresponding integer in this representation.

To get letter in a nonce, you'd have to present the bits in the nonce in some encoding scheme that had some way to encode letters. There is no such scheme in common use.

David Schwartz

Posted 2013-04-23T17:03:20.690

Reputation: 46 931

3

Technically, the nonce is just 4 bytes that are ignored. There's no reason why the block couldn't contain "Nick" in ASCII, or somebody's phone number.

That being said:

  1. the fastest way to mine is to start with a nonce of all 0's, then increment it.
  2. an easier way to embed data into the blockchain is to use fields in the coinbase.

Nick ODell

Posted 2013-04-23T17:03:20.690

Reputation: 26 536

So are there any blocks with letters in the nonce? I understand your 2 points, would it increase the probability of solving a block if your miner actually incremented 0-9 then a-z and A-Z, etc?pinhead 2013-04-23T17:24:10.720

@pinhead So are there any blocks with letters in the nonce? Probably. One in every thousand blocks has a nonce of all letters. There are 200 thousand.

Nick ODell 2013-04-23T17:29:41.880