Kotlin Multiplatform client for Vortex on Sui (Android + iOS).
- Deposit: creates a shielded UTXO by generating a ZK proof and submitting a Vortex
transactcall on Sui. - Private transfer: spends shielded UTXOs, generates a new proof, and sends encrypted outputs to the recipient.
- Registry: resolves and registers encryption keys for recipients.
- Inbox: scans commitment events, decrypts outputs, and keeps local state for pagination.
- Rust circuits and helpers live in
composeApp/src/commonMain/rustand are exposed to Kotlin via UniFFI. The generated bindings are used from Kotlin (uniffi.vortex.*) for Poseidon hashing and proof generation. - The Kotlin side builds inputs for the circuit, calls
prove(...)via the UniFFI bindings, and then assembles Sui transactions with the resulting proof and public inputs. ksuiis used for Sui transaction building, signing, execution, event queries, and GraphQL object queries. The client uses the PTB builder (ptb { ... }) to create the on-chain calls for deposit, transfer, registry, and inbox scans, and usesgetObjectfor registry resolution.- BCS is used when serializing data for Move calls. The app uses
xyz.mcxross.bcs.Bcsfor encoding byte vectors (for encrypted outputs and proofs) and a minimal custom BCS helper (Bcs_) for u256 values.
composeApp/src/commonMain/kotlin/xyz/mcxross/vortex/App.kthosts the Compose UI and orchestrates all flows.composeApp/src/commonMain/kotlin/xyz/mcxross/vortex/uicontains UI colors and reusable components.composeApp/src/commonMain/kotlin/xyz/mcxross/vortex/vortex/VortexClient.ktis the main client for deposit, private transfer, registry, and inbox scanning.composeApp/src/commonMain/kotlin/xyz/mcxross/vortex/vortex/VortexTypes.ktcontains keypairs, UTXO types, merkle tree, encryption helpers, and event parsing.composeApp/src/commonMain/kotlin/xyz/mcxross/vortex/vortex/VortexStore.ktprovides inbox and registry persistence with platform-specific storage.composeApp/src/commonMain/rustholds the Rust circuits and UniFFI bindings used for Poseidon and proving.composeApp/src/commonMain/composeResources/filescontains the proving/verification keys.- Package IDs and pool IDs are defined in
composeApp/src/commonMain/kotlin/xyz/mcxross/vortex/utils/Consts.kt.
Prereqs:
- JDK 17
- Android Studio and Android SDKs for Android builds
- Xcode for iOS builds
- Rust toolchain (stable) for UniFFI bindings
From the repo root:
./gradlew :composeApp:assembleDebugOr run from Android Studio using the composeApp configuration.
Open iosApp/iosApp.xcodeproj in Xcode and run the iosApp scheme.
You can also build the framework from Gradle:
./gradlew :composeApp:embedAndSignAppleFrameworkForXcode