Skip to content

Add account-bound BRC-116 token repository - #13

Merged
rohenaz merged 1 commit into
mainfrom
codex/permission-token-repository
Aug 31, 2026
Merged

Add account-bound BRC-116 token repository#13
rohenaz merged 1 commit into
mainfrom
codex/permission-token-repository

Conversation

@rohenaz

@rohenaz rohenaz commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a narrow account-bound PermissionTokenWallet read/crypto seam without claiming full WalletInterface conformance
  • add an actor-based BRC-116 repository that always queries canonical spendable admin-basket state, paginates beyond the default page, and validates every candidate against its source BEEF before decoding
  • enforce exact DPACP/DBAP scope, DCAP requested-field subset semantics, and greatest-single-token DSAP selection
  • permanently invalidate repositories across in-flight awaits and retain verified source identity for later renew/revoke work

Security properties

  • list tags and optional locking-script metadata are never authorization evidence
  • missing or inconsistent BEEF is a typed integrity error, not a missing grant
  • malformed/decryption-failing/non-1-sat/non-spendable candidates cannot authorize
  • the repository derives its immutable account ID from the wallet seam, preventing split account/backend binding
  • canonical matches cannot be fabricated by downstream callers (PermissionTokenMatch construction is package-scoped)
  • storage-reported totals and cumulative scanning are bounded to 10,000 candidates, preventing hostile pagination exhaustion
  • no positive permission result is cached

Verification

  • swift test --filter PermissionTokenRepositoryTests (12 tests, 0 failures)
  • swift test (243 tests, 10 expected live-test skips, 0 failures)

@rohenaz
rohenaz force-pushed the codex/permission-token-repository branch from 210b9f4 to a53d549 Compare August 31, 2026 16:26
@rohenaz
rohenaz merged commit dc282f9 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