https://github.com/openzesame/zhip
iOS Wallet for Zilliqa
https://github.com/openzesame/zhip
cold-wallet coordinator-pattern cryptocurrency cryptography ios-wallet mvvm rxcocoa rxswift swift wallet zilliqa
Last synced: 12 months ago
JSON representation
iOS Wallet for Zilliqa
- Host: GitHub
- URL: https://github.com/openzesame/zhip
- Owner: OpenZesame
- License: mit
- Created: 2018-08-13T12:40:54.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2022-05-28T13:04:55.000Z (over 3 years ago)
- Last Synced: 2023-03-02T07:56:12.101Z (almost 3 years ago)
- Topics: cold-wallet, coordinator-pattern, cryptocurrency, cryptography, ios-wallet, mvvm, rxcocoa, rxswift, swift, wallet, zilliqa
- Language: Swift
- Size: 93.5 MB
- Stars: 35
- Watchers: 7
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README


[](LICENSE)
# Zhip
This is the open source code code for the [iOS wallet app Zhip (App Store link)](https://apps.apple.com/us/app/zhip/id1455248315). Zhip is the worlds first iOS wallet for Zilliqa. It uses the [Zilliqa Swift SDK "Zesame"](https://github.com/OpenZesame/Zesame).
# Getting started
- Xcode 12 (Xcode 11 might work as well.)
- Clone this repo
You can thus get started right away:
```sh
open Zhip.xcodeproj
```
## Optional
- Install [brew](https://brew.sh/)
- Install [SwiftLint](https://github.com/realm/SwiftLint) (using brew)
- Install [SwiftGen](https://github.com/SwiftGen/SwiftGen) (using brew)
# Architecture
This app uses a novel architecture named *SLC: Single-Line Controller*, I **strongly** suggest that you begin by reading [this medium article about it](https://medium.com/@sajjon/single-line-controller-fbe474857787) and make sure to [read the second part](https://medium.com/@sajjon/single-line-controller-advanced-case-406e76731ee6) as well.
It is a kind of MVVM where the `UIViewController` in most cases is one single line and all view and flow of data logic is put in the ViewModel. It also uses the [Coordinator pattern](http://khanlou.com/2015/10/coordinators-redux/).
# Dependencies
You will find all dependencies inside the list of SPM packages in Xcode -> Project *Zhip* -> *Swift Packages* (or by *Show the Project navigator* and under *Swift Package Dependencies*), but here are the most important ones.
## Zesame
This iOS wallet is entirely dependent on the [Zilliqa Swift SDK known as `Zesame`](https://github.com/OpenZesame/Zesame), without that this wallet couldn't exist. All cryptographic methods and all interaction with the Zilliqa Ledger through their [API](https://apidocs.zilliqa.com/#introduction) is done using `Zesame`.
## EllipticCurveKit
In turn, `Zesame` is dependent on the Elliptic Curve Cryptography of [EllipticCurveKit]((https://github.com/Sajjon/EllipticCurveKit)), for the generation of new wallets, restoration of existing ones, the encryption of your private keys into keystores and the signing of your transactions using [Schnorr Signatures](https://en.wikipedia.org/wiki/Schnorr_signature).
## Other
- [RxSwift](https://github.com/ReactiveX/RxSwift): The library uses RxSwift for async programming.
- [EFQRCode](https://github.com/EFPrefix/EFQRCode): Generate QR codes.
- [QRCodeReader.swift](https://github.com/yannickl/QRCodeReader.swift): Scanning QR codes.
# Privacy
When starting the app for the first time you will be asked to opt-in or opt-out for crashreporting.
If you chose to opt in and would like to opt out at a later time - or the other way around - you can do so from Settings at any time.
If you choose to opt out Crashlytics will not be initialized and no crash reports will be sent from your app.
If you chose to opt in it will make it easier to fix potential bugs in the apps, especially those crucial ones resulting in crashes. Crashlytics has been added for this sole purpose, make the app more reliable and less likely to crash.
## Disabled by default
Open the file [Zhip-Info.plist](Sources/Application/Zhip-Info.plist) and you will see that the value for the key `firebase_crashlytics_collection_enabled` is set to `false`, which is the [documented way of turning of crash reports by default](https://firebase.google.com/docs/crashlytics/customize-crash-reports)
When the app starts it checks if you accepted crash reporting, you can verify this by looking in the file [Bootstrap.swift](Sources/Application/Utils/Bootstrap.swift)
```swift
func setupCrashReportingIfAllowed() {
guard Preferences.default.isTrue(.hasAcceptedCrashReporting)
```
And searching in the code for [`"for .hasAcceptedCrashReporting"`](https://github.com/OpenZesame/Zhip/search?l=Swift&q=%22for%3A+.hasAcceptedCrashReporting%22) shows when and how the boolean flag `hasAcceptedCrashReporting` gets written.
## Analytics not used
In the function `setupCrashReportingIfAllowed` in `Bootstrap.swift` you will see calls to `Firebase`:
```swift
FirebaseConfiguration.shared.setLoggerLevel(FirebaseLoggerLevel.min)
FirebaseApp.configure()
Fabric.with([Crashlytics.self])
```
Firebase analytics is not used, but Crashlytics is setup using Firebase.
You can search for `Analytics.logEvent` or `Analytics.setScreenName` in the code and you will not find any search results.
# Donate
This **free** wallet and the foundation Zesame its built upon has been developed by the single author Alexander Cyon without paid salary in his free time - approximatly **a thousand hours of work** since May 2018 ([see initial commit in Zesame](https://github.com/OpenZesame/Zesame/commit/d948741f3e3d38a9962cc9a23552622a303e7ff4)).
**Any donation would be much appreciated**:
- ZIL: zil108t2jdgse760d88qjqmffhe9uy0nk4wvzx404t
- BTC: 3GarsdAzLpEYbhkryYz1WiZxhtTLLaNJwo
- ETH: 0xAB8F0137295BFE37f50b581F76418518a91ab8DB
- NEO: AbbnnCLP26ccSnLooDDcwPLDnfXbVL5skH
# License
**Zhip** is released under the [MIT License](LICENSE).
# Acknowledgments
Sound effect when transaction is sent is called ["RADAR"](https://freesound.org/people/MATTIX/sounds/445723/) by [Mattias "MATTIX" Lahoud](https://freesound.org/people/MATTIX/) under [CreativeCommons](https://creativecommons.org/licenses/by/3.0/), thanks a lot!