Skip to content

Add BRC-116 permission token codec - #11

Merged
rohenaz merged 2 commits into
mainfrom
codex/brc116-permission-token-codec
Aug 31, 2026
Merged

Add BRC-116 permission token codec#11
rohenaz merged 2 commits into
mainfrom
codex/brc116-permission-token-codec

Conversation

@rohenaz

@rohenaz rohenaz commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add strict typed DPACP, DBAP, DCAP, and DSAP permission-token models
  • encode/decode encrypted signed PushDrop locks using the BRC-116 admin protocol, key ID 1, self/forSelf, and TS-compatible lock-before layout
  • verify the trailing signature and wallet-owned locking key, require authenticated decryption for every field, and strictly validate semantic fields
  • fail closed with a typed field index on decryption failure; no plaintext token fallback is authoritative
  • cover normative field order, baskets, crypto arguments, all token round trips, expiry boundaries, DCAP subset behavior, DSAP shape, validation failures, and a concrete DBAP field-boundary repartition attack

Verification

  • swift test --filter PermissionTokenCodecTests (10 passed)
  • swift test (219 executed, 10 expected live-test skips, 0 failures)

Security note

PushDrop signs the concatenation of fields, which does not commit to field boundaries. The DBAP adversarial test preserves the signed concatenation while moving a byte between ciphertext fields and proves authenticated per-field decryption rejects the collision.

Scope

Codec/models only. No repository, RemoteWallet adapter, manager, UI, or WalletInterface conformance.

@rohenaz
rohenaz merged commit 0e29cc5 into main Aug 31, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant