digital cash, for everyone. tap is a user-first mobile cash app designed for mainstream adoption.
Submission to 2023 Solana Grizzlython Submission by:
- Aaron Milano (amilz) (GitHub, LinkedIn)
- Austin Milt (GitHub, LinkedIn)
- Special Thanks to Matcha Design Labs for 🔥 UI/UX design work
- SSO with Gmail
- Multi-sig “semi-custodial” cash account
- Credit Card onramp
- Feeless peer-to-peer transfers
- Parsed Solana Transactions Activity Feed
- Live on Solana Devnet
- Live on Android
- Anchor: Bank program that manages user accounts and multi-sign USDC wallets
- TypeScript: Program SDK
- Web3 Auth SDK: Single sign-in with Google and non-custodial signing wallet
- React-Native: mobile UI/UX
- Circle SDK: Credit Card on-ramp
- Google Firestore: Database for storing user public info
- Google Cloud Functions: Serverless API backend
- NextJs: Landing Page
New Users
Users create an account by logging in with gmail account.
- Users are authenticated and receive a non-custodial Solana wallet via Web3 Auth.
- On account initiation, the tap program (Devnet:
TAPAPp2YoguQQDkicGyzTzkA3t4AgECvR1eL1hbx9qz
) initiates a new Member PDA for the Tap "Bank". - A user "Checking" account is created (seeded on the member PDA), and a USDC ATA owned by the member account is initiated.
- All initiation fees and rent are paid by the Tap Bank.
Deposits
- Users deposit funds to their account a credit card using the Circle payments API
- Currently, devnet assigns a random credit card to the user (manual credit card entry is disabled)
- On confirmation of payment, funds are transferred from tap account to users USDC token account
- Balance is updated on users homepage and the transaction on recent activity (custom parsed Solana transaction history)
Transfers
- Users can initiate a peer to peer transfer via the "Send" button on the home page.
- Users query other tap members via a search that looks up other members by email via our Google Backend.
- Users select a user and amount and send the transaction to our backend.
- The program transfer function requires 3 signatures: the Program, the tap Bank authority, and the user.
- Once the transaction is confirmed on chain, balance and transfer are updated on the user homepage.
- Some features currently disabled on devnet:
- Cash withdrawals
- Add/remove payment methods (we use random dummy credit cards for devnet)
- Currently in-app transfers limited to other users on the platform. This is intentional for early release, but not a limitation of our future capabilities. In an effort to simplify the UX, we are activity avoiding introducing any reference to crypto, blockchain, public/secret keys, gas, Solana, etc.
- Similarly, because tap is targetted to a non-crypto native user, we did not build in the seed vault or incorporate exporting secret keys (though these are features that can easily be added at a later date when customer's are ready for such features)
- Current demo is limited to Android, however since we built with React Native, we should be able to add iOS in the near future
- The user must sign in through web3auth on every launch of the app. In the future we may encrypt the user's credentials on their device to reduce start times. Because USDC transfers are gated through our backend, users that lose their device would be able to disable their account. And because we use an OAuth provider for their wallet, they can use the same Google account across devices.
To deploy tap locally, you will need to set up the following:
- tap Solana Program (detailed setup and delpoyment instructions here))
- Backend (detailed setup and delpoyment instructions here)
- Frontend (detailed setup and delpoyment instructions below
Follow these directions https://reactnative.dev/docs/environment-setup but skip Creating a new application.
In a terminal in the project directory run npm install
- Set your environment
JAVA_HOME
to the location of the JRE, e.g."C:\Program Files\Android\Android Studio\jre"
- Copy
.env.example
to.env.local
- Set environment variables,
WEB3_AUTH_CLIENT_ID
and - Set
USDC_MINT_ADDRESS
to the address of the same USDC token mint asFAKE_USDC_ADDRESS
andUSDC_MINT_ADDRESS
in the ./backend/.env.example.yaml.
You must have run the setup steps already.
- Start the backend and local validator (./backend).
- In one terminal, run
emulator -avd Pixel_6_Pro_API_33
. ReplacePixel_6_Pro_API_33
with whatever AVD you are testing with. Alternatively, you can:- Run a device emulator from Android Studio or
- If you're testing on a physical device, get your physical device connected to
adb
.
- In a second terminal, start Metro:
npm start-windows
ornpm start
. Choose one of the options that pop up (probably pressinga
to run on Android).
The app's appearance and behavior may be different between "dev" mode and "release" mode. To turn off dev mode
- start the app
- press
d
in the metro terminal to open the developer menu - Go to Settings > uncheck
JS Dev Mode
Follow all setup steps above.
-
Get the keystore file, app signing password and .env files from one of the Tap devs, to use in the next step.
-
Follow the steps for Setting up Gradle Variables, using the password above for
MYAPP_UPLOAD_STORE_PASSWORD
andMYAPP_UPLOAD_KEY_PASSWORD
. Do NOT save the variables inandroid/gradle.properties
as the secret will be committed to git. -
In a terminal the repo root directory, run the command for generating the APK (see Testing the release build of your app):
# windows npm run build-apk-windows # unix npm run build-apk
This will create an APK in android/app/build/outputs/release
which you can then
sideload on your phone or distribute to others for testing.
Note:
-
Before installing, you need to uninstall other versions of the app running on your phone as this will prevent it from being installed. You will see an error like
Execution failed for task ':app:installRelease'. java.util.concurrent.ExecutionException: com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: INSTALL_FAILED_UPDATE_INCOMPATIBLE: Existing package com.tapcash signatures do not match newer version; ignoring!
-
This is not the APK you would upload to the app store. See Generating the release AAB for that.
-
This process will also open the emulator and run there. You can close the emulator and other windows.
- PROGRAM:
TAPAPp2YoguQQDkicGyzTzkA3t4AgECvR1eL1hbx9qz
- BANK:
AU88yciXy2Rz2DJkUUFu2gpYqaPRLngd3sevSfAH8KyS