Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/natureloved/DeadMan-Vault/llms.txt

Use this file to discover all available pages before exploring further.

Deadman Vault is a Next.js 15 application backed by Supabase and the FlowVault SDK. Getting a fully functional local environment — complete with vault creation, heartbeat check-ins, and keeper settlement — takes less than ten minutes if you have Node.js, the Supabase CLI, and a Stacks testnet wallet ready to go.
You will need a Stacks-compatible wallet extension installed in your browser — either Leather or Xverse — to sign USDCx transfer transactions during testing. If you have both installed simultaneously, disable one to avoid a known StacksProvider conflict (see the Troubleshooting section of the README).

Setup

1

Clone the repo and install dependencies

Clone the repository and install all Node.js dependencies with npm install:
git clone https://github.com/natureloved/DeadMan-Vault.git
cd DeadMan-Vault
npm install
The project uses Next.js 15 with Turbopack, TypeScript in strict mode, the FlowVault SDK (flowvault-sdk@0.1.2), and @stacks/connect for wallet integration.
2

Copy .env.example and fill in required variables

Copy the example environment file to .env.local, then fill in each required value:
cp .env.example .env.local
Open .env.local and provide the following variables:
VariableDescription
NEXT_PUBLIC_SUPABASE_URLYour Supabase project URL (from Project Settings → API)
NEXT_PUBLIC_SUPABASE_ANON_KEYYour Supabase anon/public key
SUPABASE_SERVICE_ROLE_KEYYour Supabase service role key (server-side only)
NEXT_PUBLIC_APP_URLThe base URL of the app (use http://localhost:3000 for local development)
RESEND_API_KEYAPI key from resend.com for lifecycle emails
RESEND_FROM_EMAILVerified sender address in your Resend account
CRON_SECRETA random secret used to authenticate Vercel Cron Job requests
KEEPER_ENCRYPTION_KEY32-byte hex key for encrypting per-vault keeper private keys at rest (see step 4)
The following FlowVault contract variables are pre-filled in .env.example and target the testnet deployment — leave those values as-is for local development:
VariablePre-filled value
NEXT_PUBLIC_FLOWVAULT_NETWORKtestnet
NEXT_PUBLIC_FLOWVAULT_CONTRACT_ADDRESSSTD7QG84VQQ0C35SZM2EYTHZV4M8FQ0R7YNSQWPD
NEXT_PUBLIC_FLOWVAULT_CONTRACT_NAMEflowvault-v2
NEXT_PUBLIC_FLOWVAULT_TOKEN_CONTRACT_ADDRESSST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
NEXT_PUBLIC_FLOWVAULT_TOKEN_CONTRACT_NAMEusdcx
KEEPER_FUNDING_PRIVATE_KEY is optional. If provided, it must be a funded testnet Stacks private key used to automatically drip a small amount of STX to each new vault’s keeper address for gas fees. If omitted, you will need to fund new keeper addresses manually from the Stacks testnet faucet.
3

Run database migrations

Apply the Supabase schema migrations to your project database. You can use either the npm script or the Supabase CLI directly:
# Using the npm script (maps to `supabase db push`)
npm run db:migrate

# Or directly with the Supabase CLI
supabase db up
This creates all required tables: vaults, beneficiaries, heartbeats, and notifications.
4

Generate KEEPER_ENCRYPTION_KEY

The keeper uses AES encryption to store each vault’s dedicated Stacks private key securely in Supabase. Generate a 32-byte hex key with OpenSSL and paste it into .env.local:
openssl rand -hex 32
Copy the output and set it as the value of KEEPER_ENCRYPTION_KEY in your .env.local file:
KEEPER_ENCRYPTION_KEY=your_64_character_hex_string_here
Never commit KEEPER_ENCRYPTION_KEY to version control. Any environment that processes vault settlements — local dev, staging, production — must use the same key, or decryption of existing keeper keys will fail.
5

Start the development server

Launch the Next.js dev server with Turbopack:
npm run dev
The app will be available at http://localhost:3000. Open it in a browser with your Stacks wallet extension active.

Get Testnet Tokens

Deadman Vault runs on Stacks testnet only. You will need testnet STX (for transaction fees) and testnet USDCx (to fund your vault). Visit the Hiro Testnet Faucet to get STX, then use the testnet USDCx faucet available through the FlowVault demo app at flowvaultx.vercel.app to obtain USDCx tokens.

Next Steps

Now that your environment is running, create your first vault and explore the full heartbeat cycle:

Create Your First Vault

Connect your wallet, set beneficiaries, choose a heartbeat interval, and make your first deposit.

How It Works

Understand the full lifecycle — from vault activation through keeper settlement and beneficiary claims.

Build docs developers (and LLMs) love