<p>The hash algorithm is Blake2b 256 and it is calculated on the raw metadata bytes.</p>
<p>I do not know where it is in <code>cardano-node</code>, but in <code>cardano-db-sync</code> its calculated at <a href="https://github.com/input-output-hk/cardano-db-sync/blob/master/cardano-db-sync/src/Cardano/DbSync/Era/Shelley/OffChain/Http.hs#L153" rel="nofollow noreferrer">https://github.com/input-output-hk/cardano-db-sync/blob/master/cardano-db-sync/src/Cardano/DbSync/Era/Shelley/OffChain/Http.hs#L153</a></p>

CC BY-SA 4.0
2023-12-13T21:05:25.537Z
2023-12-13T21:05:25.537Z
Erik de Castro Lopo
<p>I know how to use the CLI to compute the hash of stake pool metadata file, what I'm not sure of is how the hash is actually computed. What hash algorithm is used? Is the file hashed as raw bytes? Pointers to the cardano-node source code where this is accomplished is also appreciated.</p>

<cardano-cli><stake-pool><metadata>
How is the hash of a stake pool metadata file calculated?
# How is the hash of a stake pool metadata file calculated?

(Asked by: username_0 on 2023-12-13)

I know how to use the CLI to compute the hash of stake pool metadata file, what I'm not sure of is how the hash is actually computed. What hash algorithm is used? Is the file hashed as raw bytes? Pointers to the cardano-node source code where this is accomplished is also appreciated.

**Tags:** cardano-cli, stake-pool, metadata

---

## 1 answers

### Answer by username_1 on 2023-12-13. Score: 1 | Accepted answer

The hash algorithm is Blake2b 256 and it is calculated on the raw metadata bytes.

I do not know where it is in `cardano-node`, but in `cardano-db-sync` its calculated at <https://github.com/input-output-hk/cardano-db-sync/blob/master/cardano-db-sync/src/Cardano/DbSync/Era/Shelley/OffChain/Http.hs#L153>


---

