Passkeys and largeblobs

I was exploring some limits around passkeys for manifest.page, and ran into some gaps that didn't seem to be fully documented anywhere. In no particular order, here's what I ran into while testing across Safari and Chrome:

  • Sync is capped under 1 MB. With Apple Passwords, a blob written in Safari on my Mac synced to my iPhone at 1020 KB. At 1 MB it never arrived. The limit is on the raw bytes, so if you want more, compress it first.
  • Writes over the sync cap succeed. The write reports success, the data reads back fine on the device that wrote it, but it never syncs. It can also cause a previously synced passkey to dissapear.
  • Local storage is bigger, and inconsistent. Safari on macOS saved and read back 16 MB. Safari on iOS worked at 4 MB. 16 MB worked once, then on a second run it saved fine and failed to read back. 32 MB saved and never read back at all. Writes should always be verified.
  • Sync can take a minute or two. Blobs near 1 MB showed up on the other device 1 to 3 minutes after the write.
  • Chrome caps writes at 2 KB. In Helium (Chromium), anything over 2 KB threw NotSupportedError: The 'largeBlob' extension's 'write' parameter exceeds the maximum allowed size (2kb). That cap comes from the Chromium. It showed up when the passkey lived in the browser's own password manager.
  • A failed write doesn't break the passkey. After a big write failed, a small write to the same passkey worked and synced normally.

The practical budget for anything that has to sync between devices using iCloud Keychain is to stay under 1 MB of raw data, compress before, and verify after writing.