Skip to content
Afribit-KiberaPublic

About

Afribit NFC: a React Native and backend prototype for Bitcoin contactless card setup with NTAG424 and BTCPay Server integrations.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Afribit NFC Setup App - Complete Documentation

Project Status: βœ… Research Complete - Ready to Implement

Timeline: 8-10 weeks | Budget: $25K-$65K | Team: 1-2 developers


πŸ“‹ Quick Navigation

Document Description Priority
IMPLEMENTATION_ROADMAP.md Start here! Week-by-week plan, getting started guide πŸ”΄ CRITICAL
TECH_STACK_ANALYSIS.md Complete technology stack analysis and architecture πŸ”΄ CRITICAL
NTAG424_IMPLEMENTATION.md NFC card programming guide with code examples 🟠 HIGH
BOLT_CARD_FACTORY_API.md BTCPay Server plugin API documentation 🟠 HIGH
RENDER_DEPLOYMENT_GUIDE.md Backend deployment and remote access setup 🟑 MEDIUM

🎯 What You're Building

A React Native mobile app that automates Bitcoin "Bolt Card" (NTAG424 DNA) provisioning:

Current Process (Manual):

  • Requires laptop + USB NFC writer
  • Manual API key generation
  • Switching between 3 different websites
  • Technical knowledge required

Your Solution (Automated):

  • Mobile app with "scan and tap" workflow
  • Connects to merchant's Blink account
  • Programs NFC cards via phone's antenna
  • No technical knowledge needed

βœ… Prerequisites You Have

Based on your message:


πŸš€ Critical Discovery: You Can Start Immediately!

1. NTAG424 Library Already Exists πŸŽ‰

Found: https://github.com/boltcard/bolt-nfc-android-app

This React Native app has complete NTAG424 implementation:

  • Ntag424.js - All APDU commands
  • Cmac.js - AES-128 cryptography
  • apdu.js - Command builders

Action: Port these 3 files = saves 2-3 weeks of development!

2. BTCPay Plugin API Documented βœ…

Endpoints discovered:

POST /plugins/boltcards/factories/{factoryId}/cards
GET  /plugins/boltcards/balance/{cardUid}
POST /plugins/boltcards/reset/{cardUid}

Authentication: BTCPay API Key (Bearer token)

See BOLT_CARD_FACTORY_API.md for details.

3. Backend Architecture Defined βœ…

  • Node.js/Express on Render.com
  • PostgreSQL database (hosted by Render)
  • JWT authentication
  • Complete deployment guide ready

See RENDER_DEPLOYMENT_GUIDE.md for setup.


πŸ› οΈ Tech Stack Summary

Mobile App

React Native 0.72+ (TypeScript)
β”œβ”€β”€ react-native-nfc-manager (NFC operations)
β”œβ”€β”€ NTAG424 library (ported from bolt-nfc-android-app)
β”œβ”€β”€ react-native-crypto (AES encryption)
β”œβ”€β”€ React Query (API state management)
β”œβ”€β”€ Zustand (local state)
└── React Native Paper (UI components)

Backend

Node.js 18 + TypeScript
β”œβ”€β”€ Express.js (REST API)
β”œβ”€β”€ PostgreSQL (Render hosted)
β”œβ”€β”€ Sequelize (ORM)
β”œβ”€β”€ JWT (authentication)
└── Axios (external API calls)

External Services

BTCPay Server (your instance)
β”œβ”€β”€ Bolt Card Factory plugin
└── Greenfield API v1

Blink (Galoy)
└── GraphQL API

πŸ“… 8-Week Development Plan

Phase Duration Focus Deliverable
Phase 1 Week 1-2 Foundation Backend API + Mobile skeleton
Phase 2 Week 3-4 NFC Integration Card detection and reading
Phase 3 Week 4-5 BTCPay Integration Store creation and registration
Phase 4 Week 5-7 Card Programming Full NTAG424 writing
Phase 5 Week 7-8 User Interface Complete mobile UI
Phase 6 Week 8-9 Testing Hardware validation
Phase 7 Week 9-10 Deployment App Store submission

Detailed breakdown: See IMPLEMENTATION_ROADMAP.md


πŸ’» Quick Start (Today!)

Step 1: Clone Repositories

# Your main repo
git clone https://github.com/Afribit-Africa/nfc.git
cd nfc

# Reference repo (for NTAG424 code)
git clone https://github.com/boltcard/bolt-nfc-android-app.git ../bolt-reference

Step 2: Setup Backend

mkdir backend
cd backend
npm init -y
npm install express cors helmet dotenv pg sequelize jsonwebtoken bcryptjs axios

# Follow templates in RENDER_DEPLOYMENT_GUIDE.md

Step 3: Setup Mobile

npx react-native init AfribitNFC --template react-native-template-typescript
cd AfribitNFC
npm install react-native-nfc-manager react-query zustand

# Copy NTAG424 files from bolt-reference
mkdir -p src/lib/ntag424
cp ../bolt-reference/Ntag424.js ./src/lib/ntag424/Ntag424.ts
cp ../bolt-reference/Cmac.js ./src/lib/ntag424/Cmac.ts

Step 4: Test NFC

import NfcManager, { NfcTech } from 'react-native-nfc-manager';

async function testNFC() {
  await NfcManager.start();
  await NfcManager.requestTechnology(NfcTech.IsoDep);
  const tag = await NfcManager.getTag();
  console.log('Card detected:', tag);
  await NfcManager.cancelTechnologyRequest();
}

Step 5: Test BTCPay

curl -H "Authorization: token YOUR_API_KEY" \
  https://your-btcpay-instance.com/api/v1/stores

Full getting started guide: IMPLEMENTATION_ROADMAP.md


πŸ“Š Success Metrics

Technical Milestones

  • Backend deployed to Render.com
  • Mobile app detects NTAG424 cards
  • BTCPay store created successfully
  • First card programmed end-to-end
  • Card works with Lightning wallet
  • 95%+ card write success rate

Business Milestones

  • 10 test cards programmed
  • 3 beta merchants onboarded
  • First production transaction
  • 100 cards in circulation
  • App Store approval

πŸ’° Budget Breakdown

Development (8-10 weeks)

  • Mobile Developer: 320 hours @ $75/hr = $24,000
  • Backend Developer: 160 hours @ $75/hr = $12,000
  • Testing & QA: 40 hours @ $50/hr = $2,000

Infrastructure (First Year)

  • Render.com: $84/year
  • BTCPay hosting: $300/year
  • Domain + SSL: $15/year

Hardware & Tools

  • NTAG424 cards (100): $150
  • Test devices: $500
  • App Store fees: $124

Contingency (20%)

  • Unexpected issues: $7,800

TOTAL: ~$47,000 first year


πŸŽ“ Required Skills

Mobile Developer

  • React Native (TypeScript)
  • NFC/APDU protocols
  • iOS/Android app deployment
  • Cryptography basics (AES)

Backend Developer

  • Node.js/Express
  • PostgreSQL/SQL
  • REST API design
  • JWT authentication
  • Bitcoin/Lightning basics

Bonus Skills

  • BTCPay Server administration
  • Blink API experience
  • Financial app security

πŸ› Common Pitfalls & Solutions

Issue Solution Document
"NFC not available" Run on physical device NTAG424_IMPLEMENTATION.md
"Tag lost during write" Add retry logic, hold 5+ seconds NTAG424_IMPLEMENTATION.md
"BTCPay API 401" Check API key permissions BOLT_CARD_FACTORY_API.md
"Database connection failed" Add ?sslmode=require to URL RENDER_DEPLOYMENT_GUIDE.md
"Keys don't match" Verify 16 bytes of 0x00 default NTAG424_IMPLEMENTATION.md

πŸ“š Learning Resources

Essential Reading

Video Tutorials

Community Support


πŸ” Security Considerations

Critical Requirements

  1. API Key Storage - Never store BTCPay admin keys in mobile app
  2. Key Encryption - Use AES-256 for card keys in database
  3. Transport Security - HTTPS/TLS 1.3 for all API calls
  4. Rate Limiting - Max 20 cards per hour per merchant
  5. NTAG424 Locking - Set read-only after programming

Full security guide: TECH_STACK_ANALYSIS.md


πŸ“ž Support & Communication

Primary Channels

  • GitHub Issues: Bug reports, feature requests
  • GitHub Discussions: General questions
  • Weekly sync: Progress updates

Emergency Contacts


🎯 Next Immediate Actions

For You (Project Owner)

  1. Add developer as GitHub collaborator
  2. Share Render.com account access
  3. Provide BTCPay API key
  4. Share Blink API key for testing
  5. Setup communication channel

For Developer

  1. Review IMPLEMENTATION_ROADMAP.md
  2. Clone repository
  3. Setup development environment
  4. Test BTCPay API connection
  5. Begin Phase 1

🏁 Definition of Done

Project is complete when:

βœ… Mobile app on App Store and Play Store βœ… Backend deployed and stable on Render βœ… 100 cards successfully programmed βœ… 3+ merchants actively using βœ… Documentation complete βœ… Zero critical bugs βœ… 99.9% uptime for 30 days βœ… Positive user feedback (4+ stars)


πŸ“ Project Status

Research Phase: βœ… Complete (November 25, 2025) Development Phase: 🟑 Ready to start Testing Phase: βšͺ Not started Deployment Phase: βšͺ Not started


πŸ“– Documentation Index

Core Documents (Start Here)

  1. IMPLEMENTATION_ROADMAP.md - Week-by-week development plan
  2. TECH_STACK_ANALYSIS.md - Technology decisions and architecture
  3. NTAG424_IMPLEMENTATION.md - NFC programming guide
  4. BOLT_CARD_FACTORY_API.md - BTCPay plugin integration
  5. RENDER_DEPLOYMENT_GUIDE.md - Backend hosting setup

Additional Resources


πŸŽ‰ Ready to Build!

All research is complete. All blockers resolved. Documentation is comprehensive.

You have everything needed to start development today.


πŸ“§ Questions?

If you need clarification on any document:

  1. Check the specific document first
  2. Search GitHub Issues
  3. Post in GitHub Discussions
  4. Contact via agreed communication channel

πŸ“„ License

MIT License - see LICENSE file


πŸ™ Acknowledgments

  • BTCPay Server team for the Bolt Card Factory plugin
  • Bolt Card community for reference implementations
  • React Native NFC Manager maintainers
  • Blink (Galoy) for Lightning infrastructure

Last Updated: November 25, 2025 Version: 1.0 Status: Research Complete βœ…

Let's build something amazing! πŸš€βš‘

About

Afribit NFC: a React Native and backend prototype for Bitcoin contactless card setup with NTAG424 and BTCPay Server integrations.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages