Install
As a Rust dependency:
[]
= "0.2"
CLI tool (macOS / Linux):
|
CLI tool (Windows PowerShell):
iwr https://raw.githubusercontent.com/webycash/webylib/main/install.ps1 -UseB | iex
From source (requires Rust 1.85+):
Quick Start
Rust
use ;
async
C / FFI
WebyWallet *wallet = NULL;
int rc = ;
if
char *balance = NULL;
;
;
;
;
CLI
Features
- HD Wallet — BIP32-style 4-chain derivation (Receive, Pay, Change, Mining)
- SQLite + WAL — Crash-safe local storage with Write-Ahead Logging
- Encryption — Argon2 + AES-256-GCM for seed and database encryption
- Full FFI — C ABI exports for Python, Node.js, .NET, Go, Swift, Java, Kotlin, C++
- Zeroize — All secret material zeroed on drop
- No OpenSSL — Pure Rust TLS (rustls), cross-compiles everywhere
- Exchange-ready — Transactional safety, optional seed injection, structured error codes
Platform Support
| Platform | Architecture | Artifact |
|---|---|---|
| Linux | x86_64, aarch64 | .so + .a + CLI |
| macOS | x86_64, aarch64 | .dylib + .a + CLI |
| Windows | x86_64 (MSVC) | .dll + .lib + CLI |
| iOS | aarch64, aarch64-sim | .a (static lib) |
| Android | aarch64, armv7, x86_64 | .so (shared lib) |
| FreeBSD | x86_64 | CLI (test only) |
Feature Flags
| Flag | Default | Description |
|---|---|---|
bundled-sqlite |
yes | Compile SQLite from source (no system dep) |
cli |
yes | Build the webyc command-line tool |
ffi |
no | Build C FFI exports (cdylib + staticlib) |
passkey |
no | WebAuthn/passkey decryption support |
Module Structure
src/
├── lib.rs # Crate root — re-exports only
├── protocol.rs # VERSION, TERMS_OF_SERVICE
├── amount.rs # 8-decimal Amount type (wats)
├── webcash.rs # SecretWebcash, PublicWebcash, SecureString
├── crypto.rs # SHA256, HMAC-SHA512, CryptoSecret, AES-256-GCM
├── hd.rs # HDWallet, ChainCode (4-chain derivation)
├── error.rs # Error enum, Result type alias
├── server.rs # ServerClient, ServerClientTrait, endpoints
├── biometric.rs # BiometricEncryption, password encryption
├── wallet/
│ ├── mod.rs # Wallet struct, open/open_with_seed/open_memory
│ ├── schema.rs # DB schema, WAL mode, migrations
│ ├── operations.rs # insert, pay, merge, recover, check, balance
│ ├── encryption.rs # Database and seed encryption
│ └── snapshot.rs # JSON export/import for backup
└── ffi/
├── mod.rs # FFI module root and memory rules
├── error.rs # WebyErrorCode, thread-local error messages
├── types.rs # C string conversions, weby_free_string
└── wallet_ops.rs # All extern "C" wallet operations
Documentation
| Document | Description |
|---|---|
| Architecture | System design, trust model, transaction flows |
| FFI Reference | Complete C API reference with examples for 8 languages |
| Protocol | Webcash protocol specification and API endpoints |
| Security | Threat model, cryptographic guarantees, compliance |
| Development | Build from source, run tests, CI pipeline |
| CONTRIBUTING | Pull request process, commit format, design principles |
| CHANGELOG | Version history and release notes |
Building the FFI Library
# Shared library (.so / .dylib / .dll)
# Static library (.a / .lib)
# Generate C header
# Both are produced in target/release/
License
This project is licensed under the MIT License — see the LICENSE file for details.
Related Projects
- Webcash Protocol — Official server and specification
- kanzure/webcash — Python reference implementation
- harmoniis-wallet — Marketplace wallet built on webylib