https://github.com/fabohax/kapu
Browser Wallet for Bitcoin & L2s
https://github.com/fabohax/kapu
bitcoin lightning-network liquid-network rootstock stacks wallet
Last synced: 10 months ago
JSON representation
Browser Wallet for Bitcoin & L2s
- Host: GitHub
- URL: https://github.com/fabohax/kapu
- Owner: fabohax
- License: other
- Created: 2025-07-14T22:21:00.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-07-31T05:06:27.000Z (11 months ago)
- Last Synced: 2025-07-31T08:31:27.926Z (11 months ago)
- Topics: bitcoin, lightning-network, liquid-network, rootstock, stacks, wallet
- Language: TypeScript
- Homepage: https://kapu-btc.vercel.app/
- Size: 156 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# kapu
## π‘οΈ A Browser Wallet for Bitcoin & Layer 2s
**kapu** is a lightweight in-browser wallet designed to onboard users to the Bitcoin ecosystem and its main Layer 2 protocols like Lightning Network, Stacks, and Rootstock. Built for Web2 simplicity with Web3 power.
---
## βοΈ Features
* π **In-browser wallet generation** (seed phrase + private key)
* π§ **Secure email backup** with password-based encryption
* π **Connect to external wallet extensions** (e.g. Hiro Wallet, MetaMask Snap for BTC)
* β‘ **Supports Bitcoin L1 + LN, Stacks, and Rootstock**
* πͺ **Smooth onboarding for non-crypto users**
* π **Session-based login with local storage**
* π **Password-protected wallet recovery via email**
* π
Built with **Next.js**, **TypeScript**, and **TailwindCSS**
---
## π§© Stack
* **Framework**: Next.js + TailwindCSS
* **Wallet Logic**: BitcoinJS, Stacks.js, RIF libraries
* **Extensions Support**: Hiro Wallet, MetaMask Snap (via adapters), LNURL clients (soon)
---
## π Getting Started
```bash
git clone https://github.com/fabohax/kapu
cd kapu
npm install
```
---
## π§ Email Backup Configuration
For the secure email backup feature, you'll need to set up Resend (email service):
1. **Get Resend API Key**:
- Sign up at [resend.com](https://resend.com)
- Create a new API key in your dashboard
2. **Configure Environment Variables**:
```bash
cp .env.example .env.local
```
Edit `.env.local` with your values:
```bash
RESEND_API_KEY=your_resend_api_key_here
RESEND_FROM_EMAIL=Kapu Wallet
NEXT_PUBLIC_BASE_URL=http://localhost:3000
```
3. **Domain Setup** (for production):
- Add your domain to Resend
- Verify DNS records
- Update `NEXT_PUBLIC_BASE_URL` to your production URL
---
## π§ͺ Run Locally
```bash
npm run dev
```
---
## π§ How It Works
* **Create Wallet**: Generate a secure wallet for BTC, Stacks, and Rootstock in-browser. Seed phrase and keys are shown once, then stored in session (not on-chain).
* **Email Backup**: Optionally encrypt your wallet with a password and receive a recovery link via email.
* **Connect Wallet**: Use existing browser extensions like Hiro Wallet or MetaMask Snap (BTC L1).
* **Login with Seed Phrase**: Restore wallets by importing a saved seed phrase.
* **Wallet Recovery**: Use the email recovery link and your password to restore your wallet anywhere.
* **Session Management**: Keeps users logged in using localStorage, no backend required.
## π Security Features
* **Client-side Encryption**: Your wallet is encrypted with AES-256 using your password
* **Secure Key Derivation**: PBKDF2 with 10,000 iterations and random salt
* **No Password Storage**: Passwords are never stored - only you can decrypt your wallet
* **Permanent Recovery**: Recovery links never expire for your convenience
* **One-time Use**: Recovery links are deleted after successful use for security
---
## πΊοΈ Roadmap
* [ ] Lightning Network key management (LNURL, Lightning address)
* [ ] Multi-account support
* [ ] dApp signing for Bitcoin L2s
* [ ] Fiat onramp integration
* [ ] Mobile-ready version
---
Made with <3 by [@fabohax](https://hax.pe)