webycash SDK
Native webcash protocol integration for every major platform. One Rust core, platform bindings on top.
Overview
The webycash SDK provides a complete interface to the webcash protocol: secret webcash strings, wallet insert / pay / merge / recover, proof-of-work mining, local SQLite storage, and server communication.
The core is written in Rust for safety and performance. Language bindings expose the same API surface through idiomatic wrappers for each target platform. No runtime dependencies beyond the native binary (or a published package that bundles it).
Prerequisites
Python
ctypes binding; pip install webycash-sdk.
Install Expand
pip install webycash-sdkAmount helpers (parse / format) Expand
from webycash_sdk import amount_parse, amount_format
wats = amount_parse("1.5") # 150_000_000
print(amount_format(wats)) # "1.5"Open or create wallet Expand
from webycash_sdk import Wallet
with Wallet("wallet.db") as w:
print("Balance:", w.balance())Balance & stats (wallet info) Expand
import json
from webycash_sdk import Wallet
with Wallet("wallet.db") as w:
print("Balance:", w.balance())
stats = json.loads(w.stats())
print("Unspent outputs:", stats["unspent_webcash"])
print("Total balance:", stats["total_balance"])Insert (receive secret webcash) Expand
from webycash_sdk import Wallet
# Full bearer secret string you received
with Wallet("wallet.db") as w:
w.insert("e1.00000000:secret:…")Pay (create payment line for recipient) Expand
from webycash_sdk import Wallet
with Wallet("wallet.db") as w:
payment_line = w.pay("0.5", "memo for recipient")
print(payment_line)Check (verify outputs with server) Expand
from webycash_sdk import Wallet
with Wallet("wallet.db") as w:
w.check()Merge (consolidate outputs) Expand
from webycash_sdk import Wallet
with Wallet("wallet.db") as w:
summary = w.merge(20)
print(summary)Recover (HD scan from master secret hex) Expand
from webycash_sdk import Wallet
# 64 hex chars =32-byte master secret (from backup / export_snapshot)
with Wallet("wallet.db") as w:
print(w.recover("aabb…64_hex_chars…", gap_limit=20))Export snapshot & encrypt seed Expand
from webycash_sdk import Wallet
with Wallet("wallet.db") as w:
backup_json = w.export_snapshot()
# store backup_json offline
w.encrypt_seed("strong-password")TypeScript / Node.js
koffi binding; build with npm run build in the package.
Install Expand
npm install webycash-sdkAmount helpers (parse / format) Expand
const sdk = require("webycash-sdk");
const wats = sdk.amountParse("1.5");
console.log(sdk.amountFormat(wats));Open or create wallet Expand
const { Wallet } = require("webycash-sdk");
const w = new Wallet("wallet.db");
try {
console.log(w.balance());
} finally {
w.close();
}Balance & stats (wallet info) Expand
const { Wallet } = require("webycash-sdk");
const w = new Wallet("wallet.db");
try {
console.log(w.balance());
console.log(JSON.parse(w.stats()));
} finally {
w.close();
}Insert (receive secret webcash) Expand
const { Wallet } = require("webycash-sdk");
const w = new Wallet("wallet.db");
try {
w.insert("e1.00000000:secret:…");
} finally {
w.close();
}Pay (create payment line for recipient) Expand
const { Wallet } = require("webycash-sdk");
const w = new Wallet("wallet.db");
try {
console.log(w.pay("0.5", "memo"));
} finally {
w.close();
}Check (verify outputs with server) Expand
const { Wallet } = require("webycash-sdk");
const w = new Wallet("wallet.db");
try {
w.check();
} finally {
w.close();
}Merge (consolidate outputs) Expand
const { Wallet } = require("webycash-sdk");
const w = new Wallet("wallet.db");
try {
console.log(w.merge(20));
} finally {
w.close();
}Recover (HD scan from master secret hex) Expand
const { Wallet } = require("webycash-sdk");
const w = new Wallet("wallet.db");
try {
console.log(w.recover("aabb…64_hex…", 20));
} finally {
w.close();
}Export snapshot & encrypt seed Expand
const { Wallet } = require("webycash-sdk");
const w = new Wallet("wallet.db");
try {
console.log(w.exportSnapshot());
w.encryptSeed("strong-password");
} finally {
w.close();
}Rust (webylib)
Use webylib directly for the full async API (recommended on Rust). FFI crate is webycash-sdk.
Install Expand
cargo add webylib
# Tokio async runtime required — add tokio with "macros", "rt-multi-thread"Amount helpers (parse / format) Expand
use webylib::Amount;
use std::str::FromStr;
let a = Amount::from_str("1.5")?;
assert_eq!(a.wats, 150_000_000);Open or create wallet Expand
use webylib::Wallet;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let w = Wallet::open("wallet.db").await?;
println!("{}", w.balance().await?);
Ok(())
}Balance & stats (wallet info) Expand
use webylib::Wallet;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let w = Wallet::open("wallet.db").await?;
println!("{}", w.balance().await?);
let s = w.stats().await?;
println!("unspent: {}", s.unspent_webcash);
Ok(())
}Insert (receive secret webcash) Expand
use webylib::{SecretWebcash, Wallet};
use std::str::FromStr;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let w = Wallet::open("wallet.db").await?;
let wc = SecretWebcash::parse("e1.00000000:secret:…")?;
w.insert(wc).await?;
Ok(())
}Pay (create payment line for recipient) Expand
use webylib::{Amount, Wallet};
use std::str::FromStr;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let w = Wallet::open("wallet.db").await?;
let msg = w.pay(Amount::from_str("0.5")?, "memo").await?;
println!("{}", msg);
Ok(())
}Check (verify outputs with server) Expand
use webylib::Wallet;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let w = Wallet::open("wallet.db").await?;
let r = w.check().await?;
println!("valid: {}, spent: {}", r.valid_count, r.spent_count);
Ok(())
}Merge (consolidate outputs) Expand
use webylib::Wallet;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let w = Wallet::open("wallet.db").await?;
println!("{}", w.merge(20).await?);
Ok(())
}Recover (HD scan from master secret hex) Expand
use webylib::Wallet;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let w = Wallet::open("wallet.db").await?;
println!("{}", w.recover("aabb…64_hex…", 20).await?);
Ok(())
}Export snapshot & encrypt seed Expand
use webylib::Wallet;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let w = Wallet::open("wallet.db").await?;
let snap = w.export_snapshot()?;
println!("backup {} chars", snap.master_secret.len());
w.encrypt_database_with_password("strong-password").await?;
Ok(())
}Swift
SwiftPM target WebycashSDK; link native library.
Install Expand
# Package.swift
.package(url: "https://github.com/webycash/webycash-sdk", from: "0.2.0")Open or create wallet Expand
import WebycashSDK
var w = try Wallet(path: "wallet.db")
defer { w.close() }
print(try w.balance())Balance & stats (wallet info) Expand
import WebycashSDK
var w = try Wallet(path: "wallet.db")
defer { w.close() }
print(try w.balance())
print(try w.stats())Insert (receive secret webcash) Expand
import WebycashSDK
var w = try Wallet(path: "wallet.db")
defer { w.close() }
try w.insert("e1.00000000:secret:…")Pay (create payment line for recipient) Expand
import WebycashSDK
var w = try Wallet(path: "wallet.db")
defer { w.close() }
print(try w.pay(amount: "0.5", memo: "memo"))Check (verify outputs with server) Expand
import WebycashSDK
var w = try Wallet(path: "wallet.db")
defer { w.close() }
try w.check()Merge (consolidate outputs) Expand
import WebycashSDK
var w = try Wallet(path: "wallet.db")
defer { w.close() }
print(try w.merge(maxOutputs: 20))Recover (HD scan from master secret hex) Expand
import WebycashSDK
var w = try Wallet(path: "wallet.db")
defer { w.close() }
print(try w.recover(masterSecretHex: "aabb…64_hex…", gapLimit: 20))Export snapshot & encrypt seed Expand
import WebycashSDK
var w = try Wallet(path: "wallet.db")
defer { w.close() }
print(try w.exportSnapshot())
try w.encryptSeed(password: "strong-password")Kotlin / JVM
JNA; Gradle dependency cash.weby:webycash-sdk.
Install Expand
implementation("cash.weby:webycash-sdk:0.2.8")Open or create wallet Expand
import cash.weby.sdk.Wallet
fun main() {
Wallet.open("wallet.db").use { w ->
println(w.balance())
}
}Balance & stats (wallet info) Expand
import cash.weby.sdk.Wallet
fun main() {
Wallet.open("wallet.db").use { w ->
println(w.balance())
println(w.stats())
}
}Insert (receive secret webcash) Expand
import cash.weby.sdk.Wallet
fun main() {
Wallet.open("wallet.db").use { w ->
w.insert("e1.00000000:secret:…")
}
}Pay (create payment line for recipient) Expand
import cash.weby.sdk.Wallet
fun main() {
Wallet.open("wallet.db").use { w ->
println(w.pay("0.5", "memo"))
}
}Check (verify outputs with server) Expand
import cash.weby.sdk.Wallet
fun main() {
Wallet.open("wallet.db").use { w ->
w.check()
}
}Merge (consolidate outputs) Expand
import cash.weby.sdk.Wallet
fun main() {
Wallet.open("wallet.db").use { w ->
println(w.merge(20))
}
}Recover (HD scan from master secret hex) Expand
import cash.weby.sdk.Wallet
fun main() {
Wallet.open("wallet.db").use { w ->
println(w.recover("aabb…64_hex…", 20))
}
}Export snapshot & encrypt seed Expand
import cash.weby.sdk.Wallet
fun main() {
Wallet.open("wallet.db").use { w ->
println(w.exportSnapshot())
w.encryptSeed("strong-password")
}
}Java
Same JAR as Kotlin; JNA loads webycash_sdk.
Install Expand
<!-- Maven -->
<dependency>
<groupId>cash.weby</groupId>
<artifactId>webycash-sdk</artifactId>
<version>0.2.8</version>
</dependency>Open or create wallet Expand
import cash.weby.sdk.WebycashSDK;
try (WebycashSDK.Wallet w = new WebycashSDK.Wallet("wallet.db")) {
System.out.println(w.balance());
}Balance & stats (wallet info) Expand
import cash.weby.sdk.WebycashSDK;
try (WebycashSDK.Wallet w = new WebycashSDK.Wallet("wallet.db")) {
System.out.println(w.balance());
System.out.println(w.stats());
}Insert (receive secret webcash) Expand
import cash.weby.sdk.WebycashSDK;
try (WebycashSDK.Wallet w = new WebycashSDK.Wallet("wallet.db")) {
w.insert("e1.00000000:secret:…");
}Pay (create payment line for recipient) Expand
import cash.weby.sdk.WebycashSDK;
try (WebycashSDK.Wallet w = new WebycashSDK.Wallet("wallet.db")) {
System.out.println(w.pay("0.5", "memo"));
}Check (verify outputs with server) Expand
import cash.weby.sdk.WebycashSDK;
try (WebycashSDK.Wallet w = new WebycashSDK.Wallet("wallet.db")) {
w.check();
}Merge (consolidate outputs) Expand
import cash.weby.sdk.WebycashSDK;
try (WebycashSDK.Wallet w = new WebycashSDK.Wallet("wallet.db")) {
System.out.println(w.merge(20));
}Recover (HD scan from master secret hex) Expand
import cash.weby.sdk.WebycashSDK;
try (WebycashSDK.Wallet w = new WebycashSDK.Wallet("wallet.db")) {
System.out.println(w.recover("aabb…64_hex…", 20));
}Export snapshot & encrypt seed Expand
import cash.weby.sdk.WebycashSDK;
try (WebycashSDK.Wallet w = new WebycashSDK.Wallet("wallet.db")) {
System.out.println(w.exportSnapshot());
w.encryptSeed("strong-password");
}Go
cgo; set CGO_LDFLAGS to find libwebycash_sdk.
Install Expand
go get github.com/webycash/webycash-sdk/goOpen or create wallet Expand
package main
import (
"fmt"
webcash "github.com/webycash/webycash-sdk/go"
)
func main() {
w, err := webcash.Open("wallet.db")
if err != nil { panic(err) }
defer w.Close()
b, _ := w.Balance()
fmt.Println(b)
}Balance & stats (wallet info) Expand
package main
import (
"fmt"
webcash "github.com/webycash/webycash-sdk/go"
)
func main() {
w, err := webcash.Open("wallet.db")
if err != nil { panic(err) }
defer w.Close()
b, _ := w.Balance()
fmt.Println(b)
s, _ := w.Stats()
fmt.Println(s)
}Insert (receive secret webcash) Expand
package main
import (
webcash "github.com/webycash/webycash-sdk/go"
)
func main() {
w, err := webcash.Open("wallet.db")
if err != nil { panic(err) }
defer w.Close()
_ = w.Insert("e1.00000000:secret:…")
}Pay (create payment line for recipient) Expand
package main
import (
"fmt"
webcash "github.com/webycash/webycash-sdk/go"
)
func main() {
w, err := webcash.Open("wallet.db")
if err != nil { panic(err) }
defer w.Close()
out, _ := w.Pay("0.5", "memo")
fmt.Println(out)
}Check (verify outputs with server) Expand
package main
import (
webcash "github.com/webycash/webycash-sdk/go"
)
func main() {
w, err := webcash.Open("wallet.db")
if err != nil { panic(err) }
defer w.Close()
_ = w.Check()
}Merge (consolidate outputs) Expand
package main
import (
"fmt"
webcash "github.com/webycash/webycash-sdk/go"
)
func main() {
w, err := webcash.Open("wallet.db")
if err != nil { panic(err) }
defer w.Close()
out, _ := w.Merge(20)
fmt.Println(out)
}Recover (HD scan from master secret hex) Expand
package main
import (
"fmt"
webcash "github.com/webycash/webycash-sdk/go"
)
func main() {
w, err := webcash.Open("wallet.db")
if err != nil { panic(err) }
defer w.Close()
out, _ := w.Recover("aabb…64_hex…", 20)
fmt.Println(out)
}Export snapshot & encrypt seed Expand
package main
import (
"fmt"
webcash "github.com/webycash/webycash-sdk/go"
)
func main() {
w, err := webcash.Open("wallet.db")
if err != nil { panic(err) }
defer w.Close()
snap, _ := w.ExportSnapshot()
fmt.Println(len(snap))
_ = w.EncryptSeed("strong-password")
}C# / .NET
NuGet Webycash.SDK; native DLL on PATH / beside app.
Install Expand
dotnet add package Webycash.SDKOpen or create wallet Expand
using WebycashSDK;
using var w = new Wallet("wallet.db");
Console.WriteLine(w.Balance());Balance & stats (wallet info) Expand
Console.WriteLine(w.Balance());
Console.WriteLine(w.Stats());Insert (receive secret webcash) Expand
w.Insert("e1.00000000:secret:…");Pay (create payment line for recipient) Expand
Console.WriteLine(w.Pay("0.5", "memo"));Check (verify outputs with server) Expand
w.Check();Merge (consolidate outputs) Expand
Console.WriteLine(w.Merge(20));Recover (HD scan from master secret hex) Expand
Console.WriteLine(w.Recover("aabb…64_hex…", 20));Export snapshot & encrypt seed Expand
Console.WriteLine(w.ExportSnapshot());
w.EncryptSeed("strong-password");C++
Header webycash_sdk.hpp; link webycash_sdk.
Install Expand
# Link libwebycash_sdk + include webycash.h / webycash_sdk.hpp
# See webycash-sdk/examples/cppOpen or create wallet Expand
#include <webycash_sdk.hpp>
webcash::Wallet w("wallet.db");
std::cout << w.balance() << "\n";Balance & stats (wallet info) Expand
std::cout << w.balance() << "\n";
std::cout << w.stats() << "\n";Insert (receive secret webcash) Expand
w.insert("e1.00000000:secret:…");Pay (create payment line for recipient) Expand
std::cout << w.pay("0.5", "memo") << "\n";Check (verify outputs with server) Expand
w.check_wallet();Merge (consolidate outputs) Expand
std::cout << w.merge(20) << "\n";Recover (HD scan from master secret hex) Expand
std::cout << w.recover("aabb…64_hex…", 20) << "\n";Export snapshot & encrypt seed Expand
std::cout << w.export_snapshot().size() << "\n";
w.encrypt_seed("strong-password");Core capabilities
Secret webcash
Work with bearer secret strings (e…:secret:…), amount
parsing / formatting, and HD derivation inside the wallet.
Replace
Split and merge outputs through the protocol replace endpoint (used internally for pay, merge, and insert).
Mining
SHA256 proof-of-work with configurable difficulty. CPU and GPU backends. Submit mining reports to the server.
Wallet management
Local wallet storage, balance tracking, and transaction history. Secrets never leave the client.