A MetaMask Snap that enables secure Hive blockchain interactions directly through your MetaMask wallet. This Snap allows you to sign Hive transactions using keys derived from your MetaMask wallet's seed phrase.
- Derive Hive keys from MetaMask wallet
- Sign Hive transactions securely
- Encode / decode buffer using derived Hive keys
- No private key exposure
This Snap requires the following permissions:
snap_getBip44Entropy
: For deriving Hive keys from MetaMask seed phraseendowment:rpc
: For Snap communication with dAppssnap_dialog
: For user confirmation when signing transactions or encrypting/decrypting bufferendowment:webassembly
: For WebAssembly support in our Hive libraries: Wax and Beekeeper
All permissions are used with the principle of least privilege. No private keys are stored in memory or exposed to the client.
- Keys are derived only when needed and immediately cleared from memory after usage
- No network requests are made
- Input validation is performed on all transaction data
- No sensitive data is stored in browser storage
├── src/ # Source code
│ ├── assets/ # Snap assets, e.g. icons
│ ├── hive/ # Hive libraries configuration functions
│ ├── index.ts # Main Snap entry point
│ ├── rpc.ts # RPC method types
│ ├── snap/ # RPC method handlers code
│ └── priviledged-apis/ # Only part in Snap's code where we use Bip44 entropy functions
- Node.js >= 20.18.1
- pnpm = 10.0.0
- MetaMask Flask
⚠️ You cannot have other versions of MetaMask installed
# Clone the repository and its submodules
git clone --recurse-submodules https://gitlab.syncad.com/hive/metamask-snap.git
# Install dependencies
pnpm install --ignore-scripts --frozen-lockfile
# Start development server
pnpm start
# Build the Snap
pnpm build
# Lint the project
pnpm lint
# Run tests
pnpm test
- Install MetaMask Flask
- Run
pnpm start
- Connect to the Snap, either:
- See the demo site and use our official Snap distribution
- Host your own version of the dApp and use
local:http://localhost:8080
- Install Snap using dApp
- Approve the requested permissions
- Use the Snap to sign Hive transactions, encrypt/decrypt buffers and retrieve your underlying public keys
Tip
Here is a quick showcase of how to install and use this Snap with the official dApp: https://www.youtube.com/watch?v=zKT1GXO6G-0
Contributions are welcome! Please follow these steps:
- Create a feature branch
- Commit your changes
- Push to your branch
- Open a Pull Request
- Follow TypeScript strict mode guidelines
- Ensure all tests pass
- Add tests for new features
- Update documentation as needed
- Ensure snapper passes:
pnpm prebuild