From 810b4df73ef161e91b5ef10819e589e21e90b9ab Mon Sep 17 00:00:00 2001 From: pythcoiner Date: Thu, 18 Jun 2026 04:38:58 -0400 Subject: [PATCH] bip-138: specify BIP388 wallet policy backup content --- bip-0138.md | 53 +++++++++++- bip-0138/test_vectors/bip388.json | 92 +++++++++++++++++++++ bip-0138/test_vectors/encrypted_backup.json | 17 ++++ 3 files changed, 161 insertions(+), 1 deletion(-) create mode 100644 bip-0138/test_vectors/bip388.json diff --git a/bip-0138.md b/bip-0138.md index fc2d2872..38c50cc5 100644 --- a/bip-0138.md +++ b/bip-0138.md @@ -404,6 +404,54 @@ the ranged derivation indexes covered by the descriptor set. lower bound for when the descriptor set may have received funds. Importing wallets MAY use this value as a scanning hint. +#### BIP388 Wallet Policy Backup Content + +When `CONTENT` is `TYPE = 0x01` with `DATA = 0x0184` (BIP388), `PLAINTEXT` is a +UTF-8 JSON wallet policy backup document. A BIP388 wallet policy is a descriptor +template plus a vector of key information items, as defined in BIP388. + +Test vectors are in +[`bip388.json`](./bip-0138/test_vectors/bip388.json). + +The document is one of two forms: + +- A single policy, a JSON object `{ "keys": [...], "policy": "