← Back to list

manage-bap-backup
by b-open-io
Core BSV blockchain operations plugin for Claude Code
⭐ 1🍴 0📅 Jan 24, 2026
SKILL.md
name: manage-bap-backup description: This skill should be used when the user asks to "export BAP identity", "import BAP backup", "view BAP backup", "manage BAP backup", "backup BAP identity", or needs to work with BAP identity backup files using the bap CLI.
Manage BAP Backup
Export and import BAP identity backups using the bsv-bap library.
Installation
bun add bsv-bap @bsv/sdk
Export Identity
import { BAP } from "bsv-bap";
// Load existing identity
const bap = new BAP({ rootPk: storedWif });
bap.importIds(encryptedIds);
// Export for backup
const backup = bap.exportForBackup("My Identity");
// {
// ids: "QklFMQ...",
// createdAt: "2026-01-17T02:45:04.015Z",
// rootPk: "L1SJx4SfhuGkZHwjgYatQfe2yn8iqHpenvHxsDt9Vnsz7wMT8FqG"
// }
// Save to file
import { writeFileSync } from "node:fs";
writeFileSync("backup.json", JSON.stringify(backup, null, 2));
Import Identity
import { BAP } from "bsv-bap";
import { readFileSync } from "node:fs";
// Load backup
const backup = JSON.parse(readFileSync("backup.json", "utf-8"));
// Create BAP from backup
const bap = new BAP({ rootPk: backup.rootPk });
if (backup.ids) {
bap.importIds(backup.ids);
}
// Access identities
const idKeys = bap.listIds();
const identity = bap.getId(idKeys[0]);
console.log(identity.idName, identity.getIdentityKey());
List Identities
// List all identity keys
const idKeys = bap.listIds();
for (const key of idKeys) {
const identity = bap.getId(key);
console.log(`${identity.idName}: ${key}`);
console.log(` Root: ${identity.rootAddress}`);
console.log(` Current: ${identity.getCurrentAddress()}`);
}
Encrypted Backups (.bep)
For encrypted backup files using AES-256-GCM, use the bitcoin-backup CLI:
bun add -g bitcoin-backup
# Encrypt a backup
bbackup enc backup.json -p "password" -o identity.bep
# Decrypt a backup
bbackup dec identity.bep -p "password" -o decrypted.json
See encrypt-decrypt-backup skill for full bitcoin-backup reference.
CLI Option
For quick operations, use the bap CLI:
npm install -g bsv-bap
bap export # Export identity JSON to stdout
bap export > backup.json
bap import backup.json # Import from file
bap info # View current identity
Related Skills
create-bap-identity- Create new BAP identitiesencrypt-decrypt-backup- bitcoin-backup CLI for .bep fileskey-derivation- Type42 and BRC-43 key derivation
Related
BAP identities can be used for OAuth authentication with Sigma Identity. See @sigma-auth/better-auth-plugin for integration patterns.
Score
Total Score
50/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
Reviews
💬
Reviews coming soon