> For the complete documentation index, see [llms.txt](https://lashae.gitbook.io/lashae-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lashae.gitbook.io/lashae-docs/the-protocol/merkle-trails.md).

# merkle trails

A trail is a long sequence of footprints. Anchoring each one individually is honest, but wasteful. A **merkle trail root** lets a walker prove *the entire trail* existed with a single Solana memo.

## the construction

* each **leaf** is the SHA-256 `content_hash` of a footprint.
* each **internal node** is `SHA-256(a | b)`, where `a` and `b` are the two child hashes, **sorted lexicographically** so proofs need no direction bits.
* the **root** is a single 32-byte hash.

Anchored with memo prefix `LASHAE_TRAIL`, one transaction covers the whole path.

## proofs without the app

For any footprint on the trail, a **merkle proof** is a list of sibling hashes. Anyone can verify:

```
acc = footprint_hash
for sib in proof:
    acc = sha256(sorted(acc, sib) joined by 0x1f)
assert acc == recorded_root
```

If it matches, that footprint provably belonged to the trail whose root was anchored on-chain.

## when to use it

* **long trails** — anchor each footprint if you like, or anchor only the root at the end.
* **quiet trails** — anchor no footprints individually, only the root. cheap, but still verifiable.
* **compressed histories** — every re-anchoring writes a new root. the field keeps them all.

## the philosophical part

A single hash for a whole journey.\
A number small enough to carry.\
A trail small enough to remember, large enough to have taken.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://lashae.gitbook.io/lashae-docs/the-protocol/merkle-trails.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
