Soroban smart contracts powering MiHashport — chat, build, and pay on Stellar, all from inside WhatsApp.
MiHashport is split across three repositories:
- MiHashport-Frontend
- MiHashport-Backend
- MiHashport-Contract (this repo) — the on-chain layer
WhatsApp is where billions of people already chat, but not where they hold or move money on a public blockchain. MiHashport bridges that gap: a user texts a WhatsApp bot to send, receive, or swap Stellar assets, or deploy a contract — never touching a wallet app, a seed phrase UI, or a block explorer directly. The backend turns each chat command into a signed Stellar/Soroban transaction; this repo defines what those transactions can actually do on-chain.
The central problem this repo solves: a phone number is not a Stellar address. Every contract here exists to let the backend resolve "the person texting from this WhatsApp number" to "this Stellar account," safely and on-chain, and to build the send/receive/swap/deploy primitives on top of that mapping.
A Cargo workspace of Soroban contracts:
contracts/
identity-registry/ # phone_hash -> Address binding (register/resolve/update/unregister)
identity-registry is the foundation contract: it never stores a raw phone
number (the backend hashes it off-chain first), only a BytesN<32> hash
bound to a Stellar Address, with events emitted on every change so the
backend can keep its own view in sync. Later phases (see
docs/PLAN.md) add payments, swaps, and a contract-deployment
factory on top of this mapping.
MiHashport's contracts hold and move real user funds — the more eyes on that code, the safer it is. Open-sourcing this repo lets the community audit the auth checks and storage logic before real value flows through them, lets other builders reuse the phone-hash-identity pattern for their own chat-native or non-custodial-onboarding products, and keeps the project honest about what it actually does on-chain versus what happens off-chain in the backend.
- A reusable identity pattern. Mapping an off-chain identifier (phone
number, email, username) to a Stellar address via a hashed on-chain
registry is a pattern any chat-native or social-login Stellar app can
copy directly from
identity-registry. - Real-world contract usage, not a toy demo. These contracts are meant to route actual payments initiated from WhatsApp — a concrete example of Soroban handling consumer-facing, non-technical-user transaction flows.
- Tooling exercised end-to-end. The workspace exercises the standard
Soroban toolchain (soroban-sdk,
wasm32v1-nonebuilds,testutils-based auth mocking) in a CI pipeline other teams can copy wholesale. - Onboarding new Soroban developers. A small, well-scoped registry contract with full test coverage is an approachable first contract for developers new to Soroban — and the phased plan in docs/PLAN.md is designed to produce small, single-issue contributions a newcomer can pick up.
- Rust (edition 2021, pinned via
rust-toolchain.toml) - soroban-sdk v22
- Cargo workspace,
wasm32v1-nonecompilation target - GitHub Actions for CI
- rustup (the pinned toolchain and
wasm32v1-nonetarget are installed automatically viarust-toolchain.tomlthe first time you runcargoin this repo) - Optionally, the Stellar CLI
(
stellar/sorobancommand) for deploying to testnet
git clone https://github.com/MiHashport/MiHashport-Contract.git
cd MiHashport-ContractNo separate install step is needed — cargo will fetch dependencies on
first build.
# Native build (fast, for iterating on logic)
cargo build
# Contract WASM build (what actually gets deployed)
cargo build --target wasm32v1-none --releasecargo testThere's no long-running server here — contracts are deployed to a Stellar network. Once you have the Stellar CLI installed and a funded testnet identity:
stellar contract deploy \
--wasm target/wasm32v1-none/release/identity_registry.wasm \
--source <your-identity> \
--network testnet.
├── contracts/
│ └── identity-registry/
│ ├── src/lib.rs # contract logic
│ ├── src/test.rs # unit tests
│ └── Cargo.toml
├── docs/
│ └── PLAN.md # 6-phase implementation plan
├── .github/
│ ├── workflows/ci.yml
│ ├── ISSUE_TEMPLATE/task.md
│ └── PULL_REQUEST_TEMPLATE.md
├── Cargo.toml # workspace root
└── rust-toolchain.toml
- docs/PLAN.md — the 6-phase implementation plan
- CONTRIBUTING.md — how to contribute
- AGENTS.md — rules for AI coding agents working in this repo
MIT — see LICENSE.