> For the complete documentation index, see [llms.txt](https://docs.tuum.tech/hedera-wallet-snap/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tuum.tech/hedera-wallet-snap/hedera-wallet-snap/snap-architecture.md).

# Snap Architecture

## What does Hedera Wallet Snap look like under the hood?

One of the primary benefits of developing and using a snap in an application is that it leverages the security of MetaMask itself. Snaps, like Hedera Wallet Snap, operate in an isolated environment inaccessible to other snaps, ensuring that data can only be accessed through the APIs exposed by the snap.

Hedera Wallet Snap's security is of utmost importance, as it stores private keys for both MetaMask and non-MetaMask(external) accounts that have been previously imported. By exposing only the essential APIs for interacting with the Hedera Ledger, the snap ensures that applications cannot access its internal state.

The private keys stored within Hedera Wallet Snap's state are used to sign transactions and interact with the snap's APIs. This security measure prevents applications from impersonating another user, as all actions are tied to the connected account's private key.

In summary, Hedera Wallet Snap takes advantage of MetaMask's inherent security to protect user data within an isolated environment, ensuring the integrity of actions related to Hedera transactions.

<figure><img src="/files/Vysa76LEuUjzIrGFeE3x" alt=""><figcaption></figcaption></figure>


---

# 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://docs.tuum.tech/hedera-wallet-snap/hedera-wallet-snap/snap-architecture.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.
