<p>You can also get it from command line with <code>bitcoin-cli</code>, <code>litecoin-cli</code> etc. </p>

<p>For litecoin in regtest mode for example, first get the hash of the genesis block (<code>height = 0</code>):</p>

<p><code>
$ litecoin-cli getblockhash 0
</code></p>

<p>which returns <code>530827f38f93b43ed12af0b3ad25a288dc02ed74d6d7857862df51fc56c416f9</code>.</p>

<p>Then get the genesis block using its hash:</p>

<p><code>
$ litecoin-cli getblock 530827f38f93b43ed12af0b3ad25a288dc02ed74d6d7857862df51fc56c416f9
</code></p>

<p>which returns:</p>

<p><code>
{
  "hash": "530827f38f93b43ed12af0b3ad25a288dc02ed74d6d7857862df51fc56c416f9",
  "confirmations": 1,
  "strippedsize": 280,
  "size": 280,
  "weight": 1120,
  "height": 0,
  "version": 1,
  "versionHex": "00000001",
  "merkleroot": "97ddfbbae6be97fd6cdf3e7ca13232a3afff2353e29badfab7f73011edd4ced9",
  "tx": [
    "97ddfbbae6be97fd6cdf3e7ca13232a3afff2353e29badfab7f73011edd4ced9"
  ],
  "time": 1296688602,
  "mediantime": 1296688602,
  "nonce": 0,
  "bits": "207fffff",
  "difficulty": 4.656542373906925e-10,
  "chainwork": "0000000000000000000000000000000000000000000000000000000000000002"
}
</code></p>

<p>Notice there is no <code>nextblockhash</code> property because I have a freshly initialized regtest chain i.e. it has no blocks other than the genesis. But even if I were to generate blocks with say <code>generate</code> or <code>generatetoaddress</code>, I'd still have all the fields remain as shown above. Only additional field would be a <code>nextblockhash</code>.</p>

<p>As @MeshCollider said in his answer, given that the genesis block has a single coinbase tx, its txid and the merkeRoot coincide.</p>

CC BY-SA 4.0
2018-07-09T14:18:39.580Z
2018-07-09T14:18:39.580Z
thalisk
<p>The genesis block's coinbase transaction hash will be the same as the blocks merkle root because the coinbase transaction should be the only transaction in the genesis block. You should be able to find it in chainparams.cpp if the codebase is still similar to bitcoin, like so:
<a href="https://github.com/bitcoin/bitcoin/blob/master/src/chainparams.cpp#L125" rel="nofollow noreferrer">https://github.com/bitcoin/bitcoin/blob/master/src/chainparams.cpp#L125</a></p>

<pre><code>assert(genesis.hashMerkleRoot == uint256S("0x4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b"));
</code></pre>

CC BY-SA 3.0
2018-02-13T21:51:53.957Z
It is forked from litecoin so it should be similar. So essentially, the genesis_tx is the merkleroot?
Nixxed
CC BY-SA 3.0
2018-02-14T04:33:48.207Z
@Nixxed Yep that's what I said ;)
meshcollider
CC BY-SA 3.0
2018-02-13T02:45:18.000Z
2018-02-13T02:45:18.000Z
meshcollider
<p>Is there a way to determine the genesis transaction (genesis_tx) hash? I know the genesis block number but how do you determine genesis_tx? I am looking for this hash for an altcoin which was forked from litecoin.</p>

<altcoin><altcoin-development><genesis-block>
Determining the genesis transaction value or genesis_tx
Nixxed
# Determining the genesis transaction value or genesis_tx

(Asked by: username_0 on 2018-02-12)

Is there a way to determine the genesis transaction (genesis\_tx) hash? I know the genesis block number but how do you determine genesis\_tx? I am looking for this hash for an altcoin which was forked from litecoin.

**Tags:** altcoin, altcoin-development, genesis-block


---

## 2 answers

### Answer by username_1 on 2018-07-09. Score: 1 | Accepted answer

You can also get it from command line with `bitcoin-cli`, `litecoin-cli` etc.

For litecoin in regtest mode for example, first get the hash of the genesis block (`height = 0`):

`$ litecoin-cli getblockhash 0`

which returns `530827f38f93b43ed12af0b3ad25a288dc02ed74d6d7857862df51fc56c416f9`.

Then get the genesis block using its hash:

`$ litecoin-cli getblock 530827f38f93b43ed12af0b3ad25a288dc02ed74d6d7857862df51fc56c416f9`

which returns:

`{
"hash": "530827f38f93b43ed12af0b3ad25a288dc02ed74d6d7857862df51fc56c416f9",
"confirmations": 1,
"strippedsize": 280,
"size": 280,
"weight": 1120,
"height": 0,
"version": 1,
"versionHex": "00000001",
"merkleroot": "97ddfbbae6be97fd6cdf3e7ca13232a3afff2353e29badfab7f73011edd4ced9",
"tx": [
"97ddfbbae6be97fd6cdf3e7ca13232a3afff2353e29badfab7f73011edd4ced9"
],
"time": 1296688602,
"mediantime": 1296688602,
"nonce": 0,
"bits": "207fffff",
"difficulty": 4.656542373906925e-10,
"chainwork": "0000000000000000000000000000000000000000000000000000000000000002"
}`

Notice there is no `nextblockhash` property because I have a freshly initialized regtest chain i.e. it has no blocks other than the genesis. But even if I were to generate blocks with say `generate` or `generatetoaddress`, I'd still have all the fields remain as shown above. Only additional field would be a `nextblockhash`.

As @MeshCollider said in his answer, given that the genesis block has a single coinbase tx, its txid and the merkeRoot coincide.


---

### Answer by username_2 on 2018-02-13. Score: 1

The genesis block's coinbase transaction hash will be the same as the blocks merkle root because the coinbase transaction should be the only transaction in the genesis block. You should be able to find it in chainparams.cpp if the codebase is still similar to bitcoin, like so:
https://github.com/bitcoin/bitcoin/blob/master/src/chainparams.cpp#L125
assert(genesis.hashMerkleRoot == uint256S("0x4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b"));

> **Comments:**
> **username_0**: It is forked from litecoin so it should be similar. So essentially, the genesis_tx is the merkleroot?  
> **username_2**: @username_0 Yep that's what I said ;)  

---

