Skip to content

fix(wallet): encode certificate ciphertext as Base64 JSON - #8

Merged
rohenaz merged 1 commit into
mainfrom
codex/brc100-certificate-json-base64
Aug 31, 2026
Merged

fix(wallet): encode certificate ciphertext as Base64 JSON#8
rohenaz merged 1 commit into
mainfrom
codex/brc100-certificate-json-base64

Conversation

@rohenaz

@rohenaz rohenaz commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • encode BRC-100 certificate field ciphertext as canonical padded Base64 instead of interpreting arbitrary bytes as UTF-8
  • decode through CertificateCiphertext(base64:maximumByteCount:) so limits apply to decoded ciphertext bytes
  • cover acquire-result, list-result, and prove-request JSON paths without changing acquire request or keyring revealer behavior

Regression evidence

  • exact bytes 00 ff 80 01 7f a5 42 c3 encode as AP+AAX+lQsM= and decode byte-for-byte
  • exact canonical acquire-result JSON is asserted
  • a signed BRC-52 certificate retains the same unsigned preimage and verifies after JSON transport
  • the 8-byte limit accepts a 12-character Base64 value while rejecting a 9-byte value with the same 12-character encoded length

Verification

  • swift test --filter WalletBRC100JSONCodecTests — 12 passed
  • swift test — 822 Swift Testing tests passed; XCTest suites also passed; external Go-oracle tests report their existing environment-based unavailable skips when BSV_GO_SDK_PATH is unset
  • git diff --check

@rohenaz
rohenaz marked this pull request as ready for review August 31, 2026 06:34
@rohenaz
rohenaz merged commit 941557a into main Aug 31, 2026
8 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