bWalletX is in beta: test with small amounts.
bWalletX DownloadWeb →
bWalletX

Strategy spec

The file format for bWalletX strategies, what the wallet enforces, and how strategies are sold as encrypted NFTs. Version 1.

bwalletx.strategy/1→bwalletx.strategy-nft/1

1. The strategy file

A strategy is a JSON file loaded into an agent account. One strategy per account. It has goals for the AI, rules for the wallet, a public spec, and a version.

{
  "format": "bwalletx.strategy/1",
  "name": "Slow accumulator",
  "version": "1.0",
  "goals": "Build a position in $B0ASEX slowly. Buy small amounts a few times a day, only while the price is low. Never chase a pump: if the price runs up, wait.",
  "rules": {
    "tokens": [
      "B0ASEX"
    ],
    "actions": [
      "buy"
    ],
    "maxPerTradeUsd": 2,
    "buyBelowUsd": 0.001,
    "maxPerDayUsd": 10,
    "maxTotalUsd": 200,
    "stop": {
      "holdTokens": 100000
    }
  },
  "spec": {
    "trades": "$B0ASEX; BSV-21 only",
    "spends": "$10/day, $200 total",
    "often": "A few times a day",
    "stops": "Holds 100k tokens",
    "needs": "Agent account with at least $20",
    "risk": "Medium"
  },
  "changelog": [
    {
      "version": "1.0",
      "note": "First version"
    }
  ]
}
FieldRequiredMeaning
formatyesAlways "bwalletx.strategy/1".
name, versionyesUp to 60 and 20 characters. Version like software: 1.0, 1.1…
goalsyesPlain language for the AI: what to aim for and how to behave. Up to 4,000 characters.
rulesyesExact limits the wallet enforces (section 2).
specto sellThe public description buyers compare (section 4).
changelog[{"version","note"}], newest first.

Unknown fields are dropped on load, so a file can never carry instructions the wallet doesn't understand.

2. Rules the wallet enforces

Before any agent action is signed, the wallet checks, in order: Stop all agents and the account's own Stop, the account's daily cap, then these rules. A refused action is not signed and is written to the account's Activity log with the rule that refused it. The AI decides when and whether; it can never widen a rule.

RuleRequiredMeaning
tokensyesTickers or BSV-21 token ids the agent may touch. Never "any". A ticker matches the token's symbol; use the id to be exact.
actionsyesAny of buy, sell, send, list.
maxPerTradeUsdyesMost one action may spend, in dollars.
maxPerDayUsdMost per UTC day while loaded.
maxTotalUsdMost in total while loaded.
buyBelowUsdBuy only at or below this price per token.
sellAboveUsdSell or list only at or above this price per token.
sendToif sendAddresses or paymails it may send to; nobody else.
stop.holdTokensFinished once it holds this many of its tokens.
stop.downPctFinished if the account is down this % since loading.

3. Paper mode

Every strategy loads on paper first: live prices, a $100 simulated balance, nothing signed. Paper trades show in Activity as "Paper buy …". Run live (two taps) switches to the account's real balance. The same rules apply in both modes.

4. Selling: the spec

To publish, every field must be filled in. The wallet checks only that; it doesn't judge the strategy.

FieldShown asExample
tradesWhat it trades$B0ASEX; BSV-21 only
riskSeller's risk ratingLow · Medium · High · Experimental
spendsMost it will spend$10/day, $200 total
oftenHow often it actsA few times a day
stopsWhen it stopsHolds 100k tokens, or down 30%
needsNeedsAgent account with at least $50

5. Encrypted strategy NFTs

A strategy for sale is a 1Sat ordinal with content type application/vnd.bwalletx.strategy+json. Its content is a public envelope; the program inside is encrypted.

{
  "format": "bwalletx.strategy-nft/1",
  "name": "Slow accumulator", "version": "1.0",
  "description": "…",
  "spec": { "trades": "…", "risk": "Medium", "spends": "…", "often": "…", "stops": "…", "needs": "…" },
  "author": { "name": "…", "address": "1…" },
  "sale": { "priceUsd": 5, "copies": 100, "payTo": "1…" },
  "keyHash": "sha256 of the content key, hex",
  "iv": "base64, 12 bytes",
  "ciphertext": "base64: AES-256-GCM of the strategy file"
}

Key service: GET https://www.bwallet.space/api/strategies lists published strategies (public envelope fields, copies sold). ?origin=<outpoint> returns one, with the encrypted envelope. POST with {"action":"publish"|"unlock", outpoint, message, pubkey_hex, signature}.

6. Our part

Strategies are programs written and sold by users. bWalletX doesn't review, rate or recommend them. The wallet enforces each strategy's own rules; whether a strategy is any good is up to you.

Strategies CLI

The CLI uses the same format: bwalletx strategy load file.json. Source: github.com/b0ase/bwalletx-cli. Questions: support@bwalletx.com