# Cryptography

> Hash functions, tagged hashes, Merkle trees, elliptic curves, Schnorr and XMSS signatures and zero-knowledge proofs, as Pearl uses them.

Source: https://pearlcodex.com/technical/cryptography/ · Last updated: 2026-10-20 · Checked against Pearl's source code at v1.5.5

Cryptography is what lets thousands of strangers agree on one ledger without trusting each other. Nobody has to take anyone’s word for anything: every claim comes with math anyone can check.

Pearl uses four kinds of it. **Hashes** fingerprint data. **Merkle trees** fold many fingerprints into one. **Signatures** prove who approved a payment. And, new in Pearl, a **zero-knowledge proof** in every block proves the mining work was done.

## What’s in this group?

Read in order: each page builds on the one before.

| Page                                                                                   | What you’ll learn                                                                                                   |
| -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| [Hash functions](https://pearlcodex.com/technical/cryptography/hash-functions/)        | SHA-256, SHA256d and BLAKE3: what they guarantee and where Pearl uses each.                                         |
| [Tagged hashes](https://pearlcodex.com/technical/cryptography/tagged-hashes/)          | How a label keeps hashes made for different jobs apart.                                                             |
| [Merkle trees](https://pearlcodex.com/technical/cryptography/merkle-trees/)            | One hash for a whole block, and a short proof for any transaction in it (7 hashes in a real 115-transaction block). |
| [Elliptic curves](https://pearlcodex.com/technical/cryptography/elliptic-curves/)      | The one-way math from private key to public key, worked on a toy curve.                                             |
| [Schnorr signatures](https://pearlcodex.com/technical/cryptography/schnorr/)           | How a 64-byte signature is made and checked, and why the nonce must never repeat.                                   |
| [XMSS](https://pearlcodex.com/technical/cryptography/xmss/)                            | Pearl’s optional post-quantum signatures, built only from hashes.                                                   |
| [Zero-knowledge proofs](https://pearlcodex.com/technical/cryptography/zero-knowledge/) | What the \~60 KB certificate proves, how it’s built, and how fast it checks.                                        |

## What does Pearl change?

Less than you might think, and in a few precise places.

| Topic         | Bitcoin                      | Pearl                                                                                    |
| ------------- | ---------------------------- | ---------------------------------------------------------------------------------------- |
| Hashes        | SHA-256, SHA256d, RIPEMD-160 | The same, **plus BLAKE3** for mining                                                     |
| Proof of work | Block hash below the target  | A **BLAKE3 ticket** below target × tile work, proved by a **zero-knowledge certificate** |
| Curve         | secp256k1                    | secp256k1, unchanged                                                                     |
| Signatures    | ECDSA and Schnorr            | **Schnorr only**, plus optional **XMSS**                                                 |
| Tagged hashes | Seven BIP-340/341 tags       | The same seven, no new ones                                                              |

> **Tip**
>
> New to all this? Start with [hash functions](https://pearlcodex.com/technical/cryptography/hash-functions/). Everything else on this list is built out of hashes.

## In this group

1. [Hash functions](https://pearlcodex.com/technical/cryptography/hash-functions/): A fingerprint for any data, impossible to fake
2. [Tagged hashes](https://pearlcodex.com/technical/cryptography/tagged-hashes/): SHA-256 with a label on it, so no hash can be mistaken for another
3. [Merkle trees](https://pearlcodex.com/technical/cryptography/merkle-trees/): One hash that vouches for thousands, and a short proof for any one of them
4. [Elliptic curves](https://pearlcodex.com/technical/cryptography/elliptic-curves/): Easy to multiply, impossible to divide
5. [Schnorr signatures](https://pearlcodex.com/technical/cryptography/schnorr/): 64 bytes that prove you hold the key, for one exact message
6. [XMSS](https://pearlcodex.com/technical/cryptography/xmss/): Signatures made only of hashes, built to outlast quantum computers
7. [Zero-knowledge proofs](https://pearlcodex.com/technical/cryptography/zero-knowledge/): Proving the work was done without showing the work

## In short

- Hash functions give every piece of data a fingerprint. Pearl uses SHA-256 (from Bitcoin) and BLAKE3 (for mining).
- Merkle trees fold thousands of hashes into one, with short proofs for any item.
- Keys and signatures come from elliptic-curve math on secp256k1: Schnorr signatures, as in Bitcoin’s Taproot.
- XMSS adds optional signatures built only from hashes, meant to survive quantum computers.
- A zero-knowledge certificate on every block proves the mining work was done without revealing the matrices.

## Read the code

- [The tagged-hash tags](https://github.com/pearl-research-labs/pearl/blob/v1.5.5/node/chaincfg/chainhash/hash.go#L21-L58) `node/chaincfg/chainhash/hash.go:21-58`
- [The secp256k1 curve](https://github.com/pearl-research-labs/pearl/blob/v1.5.5/node/btcec/btcec.go#L23-L41) `node/btcec/btcec.go:23-41`
- [XMSS parameters](https://github.com/pearl-research-labs/pearl/blob/v1.5.5/xmss/src/xmss.cpp#L11-L31) `xmss/src/xmss.cpp:11-31`
- [The zero-knowledge circuit](https://github.com/pearl-research-labs/pearl/blob/v1.5.5/zk-pow/src/circuit/pearl_circuit.rs#L1-L76) `zk-pow/src/circuit/pearl_circuit.rs:1-76`

## Sources

### Pearl docs

- [Pearl INT whitepaper](https://pearlresearch.ai/research/int-whitepaper)

### Bitcoin standards

- [BIP-340: Schnorr signatures and tagged hashes](https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki)

### Other

- [learnmeabitcoin: Cryptography](https://learnmeabitcoin.com/technical/cryptography/)
