# MazeXChain Wallet Extension

This directory contains the native MazeXChain browser wallet extension.

## Install Locally

1. Open Chrome or Edge.
2. Open `chrome://extensions` or `edge://extensions`.
3. Enable `Developer mode`.
4. Choose `Load unpacked`.
5. Select this `extension` directory.
6. Open `http://localhost:3000` or `https://mazex.net`.
7. Click `MazeX Wallet` on the MazeXChain page and approve the connection.

## Wallet Model

- Entry Screen: locked users see only `Register` and `Login`.
- Register Screen: creates a native MazeXChain account, shows the recovery phrase, and requires phrase confirmation before storing the vault.
- Login Screen: supports local password unlock, recovery phrase login, and advanced private key login.
- Account Screen: displays address, balance, nonce, native MAZEX asset, local custom assets, account creation, token addition, refresh, and lock actions.
- Settings Screen: manages node URL, connected sites, account backup, and local vault removal.
- Signature Approval: every site-requested payload opens an extension approval window before signing.

## Share With Others

Run this command from the project root:

```powershell
npm run package:extension
```

The package will be created at:

```text
dist/mazexchain-wallet-extension.zip
```

Recipients can unzip it and load the extracted folder with `Load unpacked`.

## Production Distribution

For public release, publish the same extension package through Chrome Web Store and Microsoft Edge Add-ons. The unpacked ZIP is useful for testing and early closed distribution.

## Security Note

The extension signs MazeXChain payloads locally after explicit user approval. The page receives only the public address and signed payload. Vaults are encrypted in extension storage, and the decrypted wallet is kept only in extension session storage after unlock.
