A modern, responsive Bitcoin SV (BSV) faucet built with React, TypeScript, and the latest @bsv/sdk. Features a clean UI, bonus system, and rate limiting capabilities.
- 🚀 React 18 - A JavaScript library for building user interfaces
- 📘 TypeScript - Type-safe JavaScript
- ⚡ Vite - Next Generation Frontend Tooling
- 💎 @bsv/sdk v1.3+ - Modern TypeScript SDK for Bitcoin SV
- 🎨 CSS3 - Custom styling with modern CSS features
- 🎯 Clean, responsive UI with modern CSS
- 💎 Random bonus rewards system
- 🔒 Rate limiting capabilities
- 📝 Transaction metadata via OP_RETURN
- ⚡ Real-time balance updates
- 🔄 Automatic UTXO management
- 🛡️ Type-safe BSV operations with @bsv/sdk
- Click the "Deploy to Netlify" button above
- Connect your GitHub account
- Configure the following environment variables:
VITE_PRIVATE_KEY=your_private_key VITE_FAUCET_AMOUNT=1000 VITE_BONUS_RANGE=500-2000 VITE_FAUCET_IDENTIFIER=your_faucet_identifier
# Clone the repository
git clone https://github.com/dnh33/simple-bsv-faucet
cd simple-bsv-faucet
# Install dependencies
npm install
# Create and configure environment variables
cp .env.example .env
# Start development server
npm run dev
VITE_PRIVATE_KEY
: Your BSV private key in WIF format (Keep this secure!)VITE_FAUCET_AMOUNT
: Base amount for each claim (in satoshis)VITE_BONUS_RANGE
: Range for bonus rewards (format: "min-max")VITE_FAUCET_IDENTIFIER
: Identifier added to OP_RETURN
The faucet includes built-in rate limiting for specific addresses. Modify the delay in src/App.tsx
:
if (recipientAddress === "your_address") {
setStatus("Processing claim...");
await new Promise((resolve) => setTimeout(resolve, 30000)); // 30 second delay
throw new Error("This address is rate limited");
}
Each transaction includes OP_RETURN data with your faucet identifier:
lockingScript: new Script([
{ op: OP.OP_FALSE },
{ op: OP.OP_RETURN },
{
op: OP.OP_PUSHDATA1,
data: Array.from(new TextEncoder().encode(FAUCET_IDENTIFIER)),
},
]);
- Never expose your private key in client-side code in production
- Consider implementing server-side rate limiting for production use
- Test thoroughly on testnet before deploying to mainnet
- Monitor your faucet balance and set up alerts
Modify src/App.css
to customize the appearance:
:root {
--background: #13111c;
--primary: #8b5cf6;
--text: #ffffff;
/* Add your custom variables */
}
Adjust bonus probability and amounts in src/utils/hooks.ts
:
const BONUS_PROBABILITY = 0.05; // 5% chance
const BONUS_RANGE = [500, 2000]; // in satoshis
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
If you find this project helpful, consider donating to: 1KaMouXsastUR5kdoiWUaHmpBuBnY9Xevg
Built with ❤️ for the Bitcoin community