<p>The <code>getblock</code> RPC command includes the nonce in its JSON output:</p>

<pre><code>{
    "result": {
        "hash": "00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09",
        "confirmations": 543325,
        "strippedsize": 216,
        "size": 216,
        "weight": 864,
        "height": 1000,
        "version": 1,
        "versionHex": "00000001",
        "merkleroot": "fe28050b93faea61fa88c4c630f0e1f0a1c24d0082dd0e10d369e13212128f33",
        "tx": [
            "fe28050b93faea61fa88c4c630f0e1f0a1c24d0082dd0e10d369e13212128f33"
        ],
        "time": 1232346882,
        "mediantime": 1232344831,
        "nonce": 2595206198,
        "bits": "1d00ffff",
        "difficulty": 1,
        "chainwork": "000000000000000000000000000000000000000000000000000003e903e903e9",
        "previousblockhash": "0000000008e647742775a230787d66fdf92c46a48c896bfbc85cdc8acc67e87d",
        "nextblockhash": "00000000a2887344f8db859e372e7e4bc26b23b9de340f725afbf2edb265b4c6"
    },
    "error": null,
    "id": null
}
</code></pre>

<p>You could even pull it out of the raw hex, but <code>bitcoind</code> will do the heavy lifting for you here.</p>

CC BY-SA 4.0
2018-10-04T08:26:07.197Z
2018-10-04T08:26:07.197Z
Raghav Sood
<p>I need to know how to read a block header in particular its nonce. </p>

<p>How can I read a block nonce? what command line is used?</p>

<nonce>
How to read a block nonce in command line?
user153465
# How to read a block nonce in command line?

(Asked by: username_0 on 2018-10-04)

I need to know how to read a block header in particular its nonce.

How can I read a block nonce? what command line is used?

**Tags:** nonce


---

## 1 answers

### Answer by username_1 on 2018-10-04. Score: 1

The getblock RPC command includes the nonce in its JSON output:
{
    "result": {
        "hash": "00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09",
        "confirmations": 543325,
        "strippedsize": 216,
        "size": 216,
        "weight": 864,
        "height": 1000,
        "version": 1,
        "versionHex": "00000001",
        "merkleroot": "fe28050b93faea61fa88c4c630f0e1f0a1c24d0082dd0e10d369e13212128f33",
        "tx": [
            "fe28050b93faea61fa88c4c630f0e1f0a1c24d0082dd0e10d369e13212128f33"
        ],
        "time": 1232346882,
        "mediantime": 1232344831,
        "nonce": 2595206198,
        "bits": "1d00ffff",
        "difficulty": 1,
        "chainwork": "000000000000000000000000000000000000000000000000000003e903e903e9",
        "previousblockhash": "0000000008e647742775a230787d66fdf92c46a48c896bfbc85cdc8acc67e87d",
        "nextblockhash": "00000000a2887344f8db859e372e7e4bc26b23b9de340f725afbf2edb265b4c6"
    },
    "error": null,
    "id": null
}

You could even pull it out of the raw hex, but bitcoind will do the heavy lifting for you here.


---

