Strategy spec
The file format for bWalletX strategies, what the wallet enforces, and how strategies are sold as encrypted NFTs. Version 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"
}
]
}
| Field | Required | Meaning |
|---|---|---|
format | yes | Always "bwalletx.strategy/1". |
name, version | yes | Up to 60 and 20 characters. Version like software: 1.0, 1.1… |
goals | yes | Plain language for the AI: what to aim for and how to behave. Up to 4,000 characters. |
rules | yes | Exact limits the wallet enforces (section 2). |
spec | to sell | The 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.
| Rule | Required | Meaning |
|---|---|---|
tokens | yes | Tickers or BSV-21 token ids the agent may touch. Never "any". A ticker matches the token's symbol; use the id to be exact. |
actions | yes | Any of buy, sell, send, list. |
maxPerTradeUsd | yes | Most one action may spend, in dollars. |
maxPerDayUsd | Most per UTC day while loaded. | |
maxTotalUsd | Most in total while loaded. | |
buyBelowUsd | Buy only at or below this price per token. | |
sellAboveUsd | Sell or list only at or above this price per token. | |
sendTo | if send | Addresses or paymails it may send to; nobody else. |
stop.holdTokens | Finished once it holds this many of its tokens. | |
stop.downPct | Finished 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.
| Field | Shown as | Example |
|---|---|---|
trades | What it trades | $B0ASEX; BSV-21 only |
risk | Seller's risk rating | Low · Medium · High · Experimental |
spends | Most it will spend | $10/day, $200 total |
often | How often it acts | A few times a day |
stops | When it stops | Holds 100k tokens, or down 30% |
needs | Needs | Agent 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"
}
- Publish: the author mints the first copy (the original) and gives the content key to the key service, proving they hold that copy. The key must hash to
keyHash. - Buy: one transaction mints the buyer's copy of the same envelope, pays
priceUsdin BSV topayTo, and pays the 1% market fee. - Unlock: the owner of a copy signs
bwalletx strategy unlock: <outpoint>: <ms timestamp>with the key that holds it. The service checks the copy on chain (unspent, locked to that key), finds its origin, and returns the content key if the origin is the original or a paid copy within the edition size. Payment is checked against the published terms, so a re-minted envelope with a lower price is refused. - Resell or give: send the NFT. The new owner unlocks it the same way.
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.
The CLI uses the same format: bwalletx strategy load file.json. Source: github.com/b0ase/bwalletx-cli. Questions: support@bwalletx.com