Cross-platform application that combines Solana Pay protocol with NFC technology and AI assistance. Tap two phones together to transfer SOL without QR codes or manual wallet addresses, with Jarvis AI to help manage your crypto operations.
This project demonstrates how NFC can make cryptocurrency payments work like contactless card payments, submitted to Solana Colosseum.
Crypto payments require:
- Manual copying/pasting of wallet addresses
- QR code scanning
- Risk of human error in address entry
- Multiple app switches
Tap two phones together to initiate a Solana Pay transaction. NFC transmits the payment request between devices.
- Cross-Platform Support: Available on both Android and iOS
- Twitter Authentication: Social login with unified wallet management through XReplyAgent
- NFC Payments: Tap phones together to transfer SOL (Android with full NFC support)
- QR Code Payments: Camera-based payment scanning (iOS implementation while awaiting Apple Wallet integration)
- Biometric Security: Hardware-backed encryption with biometric authentication
- Solana Pay Protocol: Transactions on Solana blockchain
- Jarvis AI Assistant: Voice-powered AI to help with crypto operations and Twitter wallet management
- Twitter Wallet Integration: Manage wallets and transactions via Twitter through XReplyAgent
- Multi-Chain Wallet Management: Support for multiple blockchain networks
- Modern UI: Jetpack Compose (Android) and SwiftUI (iOS)
- Multi-language Support: English and German
The application follows clean architecture principles across both platforms:
solana_pay_with_nfc/
├── android/ # Android application
├── ios/ # iOS application
├── XReplyAgent/ # Backend API (git submodule)
└── README.md # This documentation
The above diagram illustrates our comprehensive technology stack, showing how different components integrate:
- Mobile Apps (iOS/Android) with platform-specific technologies
- Backend Infrastructure powered by Docker and Kubernetes
- AI & Analytics featuring Jarvis Core with machine learning capabilities
- Blockchain Integration supporting multi-chain operations
- Security & Compliance with hardware-backed authentication
Our revolutionary Jarvis system provides each user with isolated Docker containers containing:
- Personal AI Agents with individual learning capabilities
- Crypto Operations Engine for automated portfolio management
- Portfolio Analytics with real-time insights
- Trading Bots for automated strategy execution
- Secure Data Storage isolated per user
com.dag.mypayandroid/
├── base/ # Core infrastructure & shared components
│ ├── helper/
│ │ ├── blockchain/ # Web3Auth & Solana integration
│ │ ├── security/ # NFC, Biometric & cryptographic operations
│ │ ├── audio/ # Speech recognition for Jarvis
│ │ └── system/ # System-level utilities
│ └── solanapay/ # Solana Pay protocol implementation
├── feature/ # Feature-specific modules
│ ├── home/ # Main payment interface
│ ├── login/ # Authentication flow
│ ├── settings/ # App configuration
│ └── jarvis/ # AI assistant feature
└── ui/ # Design system & themes
MyPayIos/
├── Base/ # Core infrastructure & shared components
│ ├── Components/ # Shared UI components
│ ├── Configuration/ # App configuration
│ ├── Navigation/ # Navigation system
│ ├── Network/ # API clients
│ ├── Security/ # Biometric authentication
│ ├── SolanaPay/ # Solana Pay protocol implementation
│ ├── Storage/ # Data storage
│ ├── ViewModels/ # Base view models
│ └── Wallet/ # Wallet management
├── Features/ # Feature-specific modules
│ ├── Home/ # Main payment interface
│ ├── Login/ # Authentication flow
│ ├── Settings/ # App configuration
│ ├── Splash/ # App initialization
│ └── Jarvis/ # AI assistant feature
└── Resources/ # Assets and configurations
Android (base/helper/blockchain/):
Authentication Helper (AuthHelper.kt, AuthHelperImpl.kt):
- Twitter OAuth integration for social authentication
- Ed25519 private key generation for Solana
- Session management with XReplyAgent backend
- Unified wallet management across Twitter and mobile app
interface AuthHelper {
suspend fun loginWithTwitter(): CompletableFuture<AuthResponse>
suspend fun logOut(): CompletableFuture<Void>
fun getSolanaPrivateKey(): String
fun getUserInfo(): UserInfo
suspend fun isUserAuthenticated(): Boolean
}Solana Helper (SolanaHelper.kt, SolanaHelperImpl.kt):
- Creates and manages Solana Pay URLs
- Handles SOL and SPL token transfers
- Integrates with Solana RPC for transaction processing
- Transaction signing and broadcasting
interface SolanaHelper {
fun prepareSolanaPay(
transferRequestField: TransferRequestURLFields,
onUrlReady: (tx: URI)-> Unit
)
suspend fun receiveSolanaPayAndMakePayment(
keypair: Keypair,
paymentUrl: String,
onSigned: (tx: Transaction)-> Unit
)
}iOS (Base/SolanaPay/, Base/Wallet/):
SolanaHelper (SolanaHelper.swift):
- Solana Pay URL creation and parsing
- Transaction building and signing
- RPC integration for blockchain interaction
- Multi-chain support
WalletManager (WalletManager.swift):
- Secure key storage using iOS Keychain
- Biometric authentication integration
- Multi-chain wallet support
- Hardware-backed security
Android (base/helper/security/):
NFC Communication (NFCHelper.kt, MyHostApduService.kt):
- Host Card Emulation (HCE) - converts phone to card terminal via HostApduService
- Reader and Tag modes for bidirectional communication
- APDU (Application Protocol Data Unit) command processing
- Custom AID (Application Identifier):
F0010203040506
enum class NFCMode { TAG, READER }
interface NFCListener {
fun onMessageReceived(message: String)
fun onNFCError(error: String)
fun onNFCStateChanged(mode: NFCMode)
}Biometric Security (BiometricHelper.kt):
- Android Keystore integration for hardware-backed security
- Support for fingerprint, face unlock, and device PIN
- AES-256-CBC encryption with biometric-protected keys
- Key generation with
setUserAuthenticationRequired(true)
iOS (Base/NfcHelper.swift, Base/Security/):
NFC Communication (NfcHelper.swift):
- CoreNFC framework integration
- ISO14443 and NDEF support
- HCE communication with Android devices
- Custom media type for payment data:
application/vnd.mypayios.solanapay
Biometric Security (BiometricHelper.swift):
- iOS Keychain Services integration
- Touch ID, Face ID, and passcode support
- Hardware-backed encryption
- Secure Enclave protection
Android (base/solanapay/):
URL Encoding/Decoding (EncodeURL.kt, ParseURL.kt):
- Solana Pay URL generation
- Transfer requests with metadata
- URL validation and parsing with error handling
- Standard Solana Pay format:
solana:<recipient>?amount=<amount>
Transaction Creation (CreateTransfer.kt):
- Builds Solana transactions for SOL and SPL tokens
- Associated Token Account (ATA) creation
- Transaction fees and recent blockhash
- Signs transactions with user's private key
data class TransferRequestURLFields(
val recipient: Recipient,
val amount: Amount,
val tokenDecimal: Int,
val splToken: SPLToken? = null,
val reference: References? = null,
val label: Label? = null,
val message: Message? = null,
val memo: Memo? = null
)iOS (Base/SolanaPay/):
URL Encoding/Decoding (SolanaPayURLEncoder.swift, SolanaPayURLParser.swift):
- Solana Pay URL generation and parsing
- Transfer request validation
- Error handling and type safety
- Protocol compliance
Transaction Creation (SolanaPayTransferCreator.swift):
- Transaction building for SOL transfers
- Multi-chain transaction support
- Fee calculation and optimization
- Signature management
Android (feature/jarvis/):
JarvisViewModel (JarvisVM.kt):
- Speech recognition management using Android Speech API
- Voice transcription and confirmation flow
- Backend communication with Jarvis API
- State management for listening, processing, and response states
JarvisView (JarvisView.kt):
- Voice wave animation during listening
- Touch-to-talk interface with visual feedback
- Status cards for user feedback
- Permission handling for microphone access
@HiltViewModel
class JarvisVM : BaseVM<JarvisVS> {
fun startListening()
fun stopListening()
fun confirmAndSend()
fun sendToBackend(input: String)
}iOS (Features/Jarvis/):
JarvisViewModel (JarvisViewModel.swift):
- Speech recognition using iOS Speech framework
- Audio session management with AVFoundation
- Real-time transcription and processing
- Backend API integration
JarvisView (JarvisView.swift):
- SwiftUI voice interface with animations
- Biometric authentication integration
- Voice wave visualization
- Alert-based confirmation dialogs
final class JarvisViewModel: BaseViewModel {
func startListening()
func stopListening()
func confirmAndSend()
func sendToBackend(transcription: String)
}Backend Integration:
- RESTful API communication with XReplyAgent (included as git submodule in
XReplyAgent/) - Twitter OAuth authentication and wallet management
- Real-time AI responses for crypto operations
- Twitter-based wallet operations and transaction management
- Secure token-based authentication
- Error handling and retry mechanisms
Android (base/helper/system/):
Activity Management (ActivityHolder.kt):
- Activity lifecycle management
- Current activity context for biometric operations
- Activity transitions and state management
Alert Dialog System (AlertDialogManager.kt):
- Dialog management
- Error handling and user feedback
- Various dialog types and actions
iOS (Base/Navigation/, Base/ViewModels/):
Navigation System (NavigationCoordinator.swift, AppRouter.swift):
- SwiftUI navigation management
- Deep linking support
- Route coordination between features
Base ViewModels (BaseViewModel.swift):
- Common ViewModel functionality
- State management patterns
- Error handling infrastructure
- User Authentication: User logs in via Twitter OAuth through XReplyAgent
- Amount Entry: User specifies amount to send in the ReceiveView
- NFC Tag Mode: App switches to NFC Tag mode (HCE)
- Solana Pay URL Generation: Creates standardized payment URL
- NFC Transmission: URL stored in SharedPreferences for HCE service
- Tap Detection: When another phone taps, HCE service responds with payment data
- NFC Reader Mode: Receiving phone operates as card reader
- Tag Discovery: Detects sender phone acting as card terminal via HostApduService
- APDU Communication: Sends SELECT command to HCE service
- Data Reception: Receives Solana Pay URL from sender
- URL Parsing: Validates and extracts payment details
- Transaction Creation: Builds Solana transaction
- Biometric Confirmation: User authenticates to access private key
- Transaction Signing: Signs transaction with recovered private key
- Blockchain Submission: Broadcasts transaction to Solana network
- Hardware Security Module: Android Keystore for key protection
- Biometric Authentication: Required for sensitive operations
- Encrypted Storage: Private keys encrypted with hardware-backed keys
- Session Management: Twitter OAuth session handling through XReplyAgent
- Input Validation: Validation of user inputs and URLs
- Error Handling: Error handling without exposing data
- Custom AID: Uses Application Identifier to avoid conflicts
- Data Validation: All received NFC data undergoes validation
- Timeout Mechanisms: NFC operations have timeouts
- Error Recovery: Error handling for NFC communication failures
- Android 6.0+ (API level 23+)
- NFC-enabled Android device
- Microphone permission for Jarvis AI
- Active internet connection
- Biometric authentication or device PIN set up
- iOS 13.0+
- NFC-enabled iPhone (iPhone 7 or newer)
- Microphone permission for Jarvis AI
- Camera permission for QR code scanning
- Active internet connection
- Touch ID, Face ID, or device passcode set up
git clone --recursive https://github.com/DogukanGun/solana_pay_with_nfc.git
cd solana_pay_with_nfcIf you already cloned the repository, initialize the submodules:
git submodule update --init --recursive- Navigate to the XReplyAgent directory:
cd XReplyAgent/ - Follow the setup instructions in
XReplyAgent/README.md - Run the backend server to enable Jarvis AI functionality
- Open Android project in Android Studio
- Configure Twitter OAuth credentials in your build configuration
- Set up Solana RPC endpoint (Mainnet/Devnet/Testnet)
- Configure XReplyAgent API endpoint (your local or deployed backend)
- Build and install on NFC-enabled Android devices
- Open
ios/MyPayIos.xcodeprojin Xcode - Configure App ID with NFC capability in Apple Developer Portal
- Set up Twitter OAuth credentials in app configuration
- Configure XReplyAgent API endpoint (your local or deployed backend)
- Build and install on NFC-enabled iOS devices (iPhone 7 or newer)
Update your local.properties or build configuration with:
TWITTER_API_KEY=your_twitter_api_key
TWITTER_API_SECRET=your_twitter_api_secret
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
XREPLYAGENT_API_URL=your_xreplyagent_backend_urlUpdate your app configuration with:
// Configuration constants
TWITTER_API_KEY = "your_twitter_api_key"
TWITTER_API_SECRET = "your_twitter_api_secret"
SOLANA_RPC_URL = "https://api.mainnet-beta.solana.com"
XREPLYAGENT_API_URL = "your_xreplyagent_backend_url"The application supports testing on Mainnet and Devnet:
- Devnet: For development and testing
- Testnet: For pre-production testing
- Mainnet: For production use with real SOL
- SOL transfers via NFC tap: Seamless phone-to-phone payments
- Twitter-based authentication: Social login integration through XReplyAgent for user onboarding
- Twitter wallet management: Manage wallets and execute transactions via Twitter
- Biometric wallet security: Hardware-backed key protection
- Multi-language support: English and German
- Settings management: Customizable app preferences
- Transaction metadata and memos: Rich payment information
- Reference tracking for payments: Transaction monitoring
- Jarvis AI Assistant: Voice-powered crypto assistant
- Host Card Emulation (HCE): Advanced NFC communication for tapless payments
- SPL token support: Multi-token transactions (testing in progress)
- Material Design 3: Modern Android UI with Jetpack Compose
- Google Play Store: Currently in the publishing process
- Jarvis AI Assistant: Voice-powered crypto assistant with Speech framework
- QR Code scanning: Camera-based payment initiation (temporary solution)
- Multi-chain wallet management: Support for multiple blockchain networks
- CoreNFC integration: Limited NFC capabilities (pending Apple Wallet integration)
- SwiftUI interface: Modern iOS UI patterns
Note: iOS app currently uses QR code scanning as we are planning to secure funding or grants to cover the licensing fees required for Apple Wallet integration, which would enable full tapless payment functionality similar to the Android version.
- Android: Full NFC implementation with Host Card Emulation, currently in Google Play Store publishing process
- iOS: QR code-based implementation while pursuing funding for Apple Wallet integration licensing
- Jarvis AI: Voice assistant integrated on both platforms with backend API support
Our comprehensive development timeline spans from Q1 2025 through Q1 2026, featuring:
Q1 2025: iOS wallet implementation with Apple Developer setup, Apple Wallet integration, and Secure Enclave implementation
Q2 2025: Jarvis container MVP launch with Kubernetes cluster setup and AI core integration
Q3 2025: Advanced AI features, multi-user container testing, and enterprise beta release
Q4 2025: Global scaling implementation, enterprise dashboard, and performance optimization
Q1 2026: Predictive AI models, cross-platform expansion, and full market launch
- Secure grants or funding to cover Apple Wallet integration licensing fees
- Enable full tapless payment functionality on iOS matching Android capabilities
- Expand multi-chain support across additional blockchain networks
This project demonstrates the integration of Twitter authentication, Solana Pay, and NFC technologies through XReplyAgent, submitted to Solana Colosseum.
This project bridges the gap between contactless payments and decentralized finance. By making crypto payments work through phone tapping, it removes barriers to cryptocurrency adoption and creates an intuitive payment experience.
The combination of Twitter authentication through XReplyAgent, Solana transactions, and NFC/QR capabilities creates a foundation for peer-to-peer payments across different platforms and technical constraints, enabling users to manage their crypto wallets both through the mobile app and Twitter interactions.


