# [Semaphore Network] ETHSim Hardware Wallet PSE Grant Proposal
- **Project** Use feature phones as the frontend to a hardware wallet inside SIM cards.
## Project Overview :page_facing_up:
### Deliverables
- SIM Card Based Hardware Wallet
- SIM card-based Hardware Wallet Functionality
(PIN, Secure Element, On-card keypair generation, import of previous wallet)
- SIMToolkit/ Phone Application UI to manage normal Hardware Wallet Capabilities
- Possibly use SEEK/BIP to create nicer looking smart phone app (iOS/Android app)
### Overview
**Hardware**:
Almost everyone is familiar with what a SIM card is; that is the small little chip you put into your phone to get service with your telecom provider.
SIM Cards run what's known as the Javacard Runtime. Readily avaialbe and cheap versions of these cards have, for the past decade, been able to do the same type of cryptography that is at the core of EVM blockchains. Many manufacturers offer these cards for less than $5 (in even small MOQ) and also carry crypto certificatons like EAL5+.
**Software**:
As part of the GSM specification; all modern cell phones from feature phones (think <$50 cheap phones for emerging markets) up to highend market segments (iPhone 14+) support communicating with the inserted SIM card' various applications as well as cretaing user interfaces to interact such applications stored on a SIM card. Called SIMToolkit. SEEK and BIP are more advanced implementations that may be explored for Android and iOS respectively.
**TLDR**
Ultimately, we want to scale public goods adoption for Ethereum ecosystem by providing fully opensource vendor agnostic SIM card based hardware wallets. This should enable individual SIM hardware wallets for <$5 and be able to be managed on any cellphone.
### Details
Create an opensource [mini/micro/nano]SIM Ethereum Wallet. It Should be usable on "Feature Phones" (Phones without a full OS like Android/iOS), building assuming these will have limited or no internet connection but can still serve as an offline ledger-type device.
**Hardware Specifications of “Feature Phone”**:
* Has “T9” Keyboard or better
* limited/no Internet Connection
* Has non HD screen
* No Apps platform
## EthSIM Wallet ##
*Precedent*
We, as well as various Ethereum ecosystem projects ex. Status Keycard, GridPlus Phonon have opensource code that create hardware wallet functionality, namely secure key generation, storage and usage on the "Javacard" platform. The SIM card application used for cellular service run inside this platform, therefore almost every phone has support to use a SIM card based hardware wallet.
LoE: "Practially Done" personally understand and have implemented similar code.
### Wallet-Phone Interface/UX:
To my knowledge no opensource projects provide hardware wallets in this form-factor (SIM size) or UI compatible with feature phone hardware.
In order to create a basic UX to interact with hardware wallet features, we will leverage part of the GSM standard called SIM Toolkit (STK/UCAT). This will give us capabilities to create and display a menu subsystem for using the wallet's keypairs as well as QR Code generation [although extra constrained devices may have a problem with this as there will be some screen resolution minimum]. The functionalities should be similar to what you can get from a ledger hardware wallet
**This Interface and submenu system should feature:**
* **"Create Wallet"**:
INPUT: *PIN to protect the wallet.
* **"Send ETH"**:
INPUT:
* Use phone to enter ethereum address and amount to send
* Use phone keyboard to select amount of Token/ETH
* PIN Entry that protects the stored wallet key
OUTPUT:
* Display On-screeen QR code of signed transaction, possibly send via app
* **“Receive ETH”:**
OUTPUT:
* Display User's ETH public address
LoE: Medium, some examples using QR<>STK exist. New-to-me code, but straight forward enough.
https://github.com/alan-turing-institute/SIMple-ID
Notes: Status is making a smartphone app with features that could support this on Android ( via SEEK)
### Team :busts_in_silhouette:
### Team members
- **Name**: Marcus H
- **Email**: marcus@semaphore.network
- **Telegram handle**: @marcush25
### Team Website
N/A
### Team's experience
- Smart contract development since 2017ish
- Embedded hardware dev for various telcos
- Full-stack web2/3 development
### Team Code Repos
- [GitHub](https://github.com/SeiyaKobayashi/traininig-optimization-on-ml-model-with-zkp)
## Development Roadmap :nut_and_bolt:
### Overview
* **Total Estimated Duration:** 2 months
* **Full-time equivalent (FTE):** 1 in Februrary (2022); 1 afterwards or until completion
* **Total Costs:** $25,000
### Milestones
#### Milestone #1: Design & Documentation
- **Estimated Duration:** 2 weeks
- **FTE:** 0.5
- **Costs:** $6250
- **Estimated delivery date**: 02/23/2023
| # | Deliverable | Specification |
| -: | ----------- | ------------- |
| 1. | Setup | We will set up our GitHub repo determining directory structure and provide bare minimum documentation in project's `README`. |
| 2. | Design & Documentation | We will design overall structure of our application as well as the interface of each function of our on the card. We will then provide documentation of how to use it (run it locally) in project's wiki `Wiki`. |
#### Milestone #2: Implementation Of EthSIM Hardware Wallet Functionality
- **Estimated Duration:** 1 month
- **FTE:** 1.25
- **Costs:** $15,625
- **Estimated delivery date**: 03/23/2023
| # | Deliverable | Specification |
| -: | ----------- | ------------- |
| 1. | Functionality: `EthSIM Hardwallet Applet` | We will write an applet that allows for basic ETH hardware wallet functionality specifically for SIM card platform, designed to use in cellphones. Basic setup to emulate parts of SIM card functionality, so the phone will play nicely. |
| 2. | Functionality: `Key Import/Storage/Generation ` | We will include functionality to import store and generate secp256k1 keypairs securely on the card. |
| 3. | Functionality: `Send ETH to Address` | We wiil write a piece of code that allows you to input an ethereum address and get a signed output to be sent to chain |
| 4. | Functionality: `Recieve ETH` | We will write a piece of code (in Solidity) that will use SIMToolkit to display your wallets ETH address (preferrably in QR format). |
#### Milestone #3: Further Polish and Exploration
- **Estimated Duration:** 2 weeks
- **FTE:** 0.25
- **Costs:** $3,125
- **Estimated delivery date**: 04/07/2023
| # | Deliverable | Specification |
| -: | ----------- | ------------- |
| 1. | Standardization | Communicate findings with other ecosystem stakeholders, ledger, GridPlus, Status, Kong etc. to work on standardization. Possibly using intra-app keystore that's been audited by Status for examle|
| 2. | Integration | Integrate ETHSim into Semaphore USIM for usage on decentralized cell networks|
| 3. | Privacy Functionality | Explore using ZK curves and paradigms to create privacy preserving transactions on the card. |