Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

CryptoWallet.si — iOS

iOS (SwiftUI) port of the CryptoWallet.si Android wallet.
Electrum-server based mobile wallet for LanaCoin ($LANA) and TajCoin ($TAJ).

Architecture

Layer Android (Original) iOS (This Port)
UI Android XML + Fragments SwiftUI
Key Management bitcoinj (BIP39/BIP44) CryptoKit + CommonCrypto
Network Electrum JSON-RPC over TCP NWConnection (Network.framework)
Storage SQLite + SharedPreferences Keychain + Encrypted Files
Signing bitcoinj ECKey / secp256k1 libsecp256k1 (needs binding)

Project Structure

CryptowalletSi/
├── CryptowalletSiApp.swift          # @main entry point
├── Info.plist                        # App configuration
├── Assets.xcassets/                  # Icons & colors
├── Core/
│   ├── Crypto/
│   │   ├── KeyManager.swift          # BIP39 mnemonic + BIP44 HD derivation
│   │   └── TransactionBuilder.swift  # Raw transaction construction & signing
│   ├── Network/
│   │   └── ElectrumClient.swift      # Stratum/Electrum JSON-RPC client
│   ├── Models/
│   │   ├── CoinType.swift            # LANA & TAJ network parameters
│   │   └── WalletModels.swift        # Account, Address, Transaction, UTXO
│   └── Storage/
│       └── WalletStorage.swift       # Keychain seed + encrypted file storage
├── ViewModels/
│   └── AppState.swift                # Main wallet state & business logic
└── Views/
    ├── RootView.swift                # Navigation router
    ├── MainTabView.swift             # Tab bar (Wallet/Send/Receive/Settings)
    ├── Onboarding/
    │   ├── OnboardingView.swift      # Create / Restore wallet flow
    │   └── UnlockView.swift          # Password + Face ID unlock
    ├── Wallet/
    │   └── WalletView.swift          # Balance, coin selector, tx history
    ├── Send/
    │   └── SendView.swift            # Send coins with address/amount/confirm
    ├── Receive/
    │   └── ReceiveView.swift         # QR code + address display
    └── Settings/
        └── SettingsView.swift        # Backup seed, servers, about, delete

Building

Requirements

  • Xcode 15+ (Swift 5.9)
  • iOS 16.0+ deployment target
  • macOS Ventura or later

Steps

  1. Open CryptowalletSi.xcodeproj in Xcode
  2. Resolve Swift Package Manager dependencies (File → Packages → Resolve)
  3. Select a simulator or device target
  4. Build & Run (⌘R)

BIP39 Wordlist

Download the English wordlist and add it to the bundle:

curl -o CryptowalletSi/bip39_english.txt \
  https://raw.githubusercontent.com/bitcoin/bips/master/bip-0039/english.txt

Before Production Release

Critical TODO items:

  1. secp256k1 binding — Replace the placeholder Secp256k1 helper with a real C library binding:

  2. RIPEMD-160 — The hash160() function needs a real RIPEMD-160 implementation:

  3. Transaction signing — Complete the SIGHASH_ALL serialization in TransactionBuilder:

    • For each input, serialize the tx with that input's scriptPubKey, double-SHA256 hash, ECDSA sign
    • Build the scriptSig: <signature> <pubkey>
  4. Electrum import CryptoKit — The addressToScriptHash function has an inline import that should be moved to the file top

  5. QR Code scanning — Add camera-based QR scanning using AVFoundation or the CodeScanner SPM package

  6. App icon — Design and add a 1024×1024 app icon

  7. Testnet support — Add testnet coin parameters for development testing

  8. Unit tests — Add tests for key derivation, address generation, and transaction building

Electrum Servers

The wallet connects to the same backend Electrum servers as the Android app:

Coin Server Port Protocol
LANA electrum1-lana.cryptowallet.si 50001 TCP
LANA electrum2-lana.cryptowallet.si 50001 TCP
TAJ electrum1-taj.cryptowallet.si 50001 TCP
TAJ electrum2-taj.cryptowallet.si 50001 TCP

License

GPL-3.0 — same as the original Android project.

Links

About

Claude AI to Switft

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages