social-value

Give your AI agent a wallet. Efficient micropayments via Breez SDK — Liquid or Spark backend, Lightning passports in/out, near-zero internal transfers. Red-team tested.

pip install social-value[liquid]

What It Is

social-value creates its own Liquid or Spark wallet from a BIP39 mnemonic. It is NOT connecting to an existing wallet — it IS one. Lightning is the passport in and out. Internal transfers cost near-zero.

It ISIt is NOT
Its own wallet (mnemonic = wallet)A Lightning wallet (no channels, no routing)
Self-custodial (you hold the keys)Connecting to an existing wallet (that's NWC)
A Lightning gateway (bolt11 in/out)A Bitcoin on-chain wallet
Two backends: Liquid or SparkAn exchange or trading platform

Quickstart

from social_value import SocialValue, SocialValueConfig, SecretStr config = SocialValueConfig( breez_api_key=SecretStr("your-breez-key"), backend="liquid", # or "spark" ) with SocialValue(config=config, mnemonic=SecretStr("twelve words...")) as wallet: # Deposit from Lightning (passport IN) invoice = wallet.deposit(amount_sat=5000) print(f"Pay this: {invoice}") # Check balance (L-BTC on Liquid) print(f"Balance: {wallet.balance} sats") # Transfer (near-zero fee on Liquid) wallet.transfer("liquid-address", 100, memo="payout") # Withdraw to Lightning (passport OUT) wallet.withdraw("lnbc1...", 4000)

Two Backends, Same API

Choose your rail. The API is identical either way.

BackendInstallInternal FeeSwap FeeStatus
Liquidpip install social-value[liquid]~1 sat~47 satsProduction
Sparkpip install social-value[spark]~0 sats~10 satsBeta
# Switch backend via config — no code changes needed config = SocialValueConfig(breez_api_key=key, backend="spark")

Why Not Just Lightning?

Lightning routing fees are flat-ish. Small amounts get hit hardest.

ScenarioPure Lightningsocial-value
1 payment of 5,000 sats~3 sats (0.06%)~95 sats (1.9%) — Lightning wins
20 payments of 100 sats~60 sats (3%)~100 sats in/out + 20 sats internal = ~120 sats total
200 payments of 100 sats~600 sats (3%)~100 sats in/out + 200 sats internal = ~300 sats (1.5%)

The more transfers per session, the bigger the advantage. Deposit once, transfer many times, withdraw once.

API

MethodReturnsDescription
connect()NoneInitialize wallet via Breez SDK
disconnect()NoneClean up resources
get_state()WalletStateBalance, pending amounts
balanceintConfirmed balance in sats
deposit(amount_sat)strCreate Lightning invoice to fund wallet
transfer(dest, amount_sat, memo)TransferResultSend sats (Liquid or Lightning)
batch_transfer(items)tuple[TransferResult]Send to multiple destinations
withdraw(dest, amount_sat)TransferResultSend sats back to Lightning
estimate_fees(action, amount_sat)FeeEstimateEstimate without executing
list_payments(limit, offset)tuple[PaymentRecord]Payment history

Security

Configuration

VariableRequiredDescription
BREEZ_API_KEYYesBreez SDK API key (free at breez.technology/sdk)
SOCIAL_VALUE_MNEMONICYesBIP39 mnemonic — this IS the wallet
SOCIAL_VALUE_BACKENDNo"liquid" or "spark" (default: liquid)
SOCIAL_VALUE_NETWORKNo"mainnet" or "testnet" (default: mainnet)
SOCIAL_VALUE_WORKING_DIRNoSDK data directory (default: .breez_data)
SOCIAL_VALUE_MAX_BALANCENoMax sats to hold (default: 0 = no limit)

NWC vs social-value

They're different things that complement each other.

NWCsocial-value
What it isProtocol to control an existing walletIts own Liquid/Spark wallet
Who holds fundsYour wallet (Alby, Mutiny)The mnemonic holder
Best forSingle large paymentsMany small transfers
For an OC agent"Use my operator's wallet""I have my own wallet"

Part of the huje.tools Ecosystem

social-value is an outward skill (body to others) in the huje.tools taxonomy. It sits alongside social-alignment (ethics) and social-card (presentation) as the economic dimension of social existence.

First consumer: Medalloid — batch payouts for 20+ players per round at near-zero fees.

Built on Breez SDK (Liquid and Spark backends).