协作头脑风暴
brainstorming
在实现前澄清需求、探索设计选择,并形成清晰的开发方向。
bitcoin-wallet-labels【开发与工程】BIP329 wallet labels portability: standard JSON Lines format for exporting/importing labels (addresses, txs, UTXOs, xpubs, inputs, outputs) across wallet software. USE WHEN: importing/exporting label sets, integrating with multiple wallets that should share annotations.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Wallets maintain user-supplied labels: "Coffee shop", "Friend Alice", "Cold storage 1". Pre-BIP329, labels were proprietary per wallet and lost on migration. BIP329 standardizes a portable JSON Lines format.
One JSON object per line (NDJSON / JSONL):
{"type":"tx","ref":"f91d0a8a78462bc59398f2c5d7a84fcff491c26ba54c4833478b202796c8aafd","label":"Coffee shop"}
{"type":"addr","ref":"bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh","label":"Friend Alice"}
{"type":"output","ref":"f91d0a8a...:0","label":"Sent to Alice"}
{"type":"input","ref":"a32f...:1","label":"Spent from cold storage"}
{"type":"xpub","ref":"xpub6CV2...","label":"Account 1"}
{"type":"pubkey","ref":"02f7e2...","label":"Cosigner Bob"}
| Type | ref semantics |
|---|---|
tx | txid |
addr | address |
pubkey | hex-encoded pubkey |
xpub | xpub serialization |
input | <txid>:<vin> |
output | <txid>:<vout> |
{
"type":"addr",
"ref":"bc1q...",
"label":"Customer 123",
"origin":"vendor-X", // optional source identifier
"spendable":true // for output: still spendable hint
}
For UTXOs that are part of a multi-step protocol (vault unvault, LN
HTLC, frozen for CoinJoin), the wallet may mark them "spendable":false.
Importing wallet sees this and excludes them from coin selection by
default.
<wallet_name>-labels.jsonl typical extension.
for line in file:
obj = json.loads(line)
if obj.type == "tx": wallet.set_tx_label(obj.ref, obj.label)
if obj.type == "addr": wallet.set_addr_label(obj.ref, obj.label)
...
Conflict resolution: import options:
BIP329 doesn't define encryption. Common practice:
.aes or .gpg versions natively.listlabels, getaddressesbylabel) but not BIP329-formatted yet.