-
Notifications
You must be signed in to change notification settings - Fork 12.1k
Closed
Description
🧐 Motivation
OZ has a great Base64 encoder. (And, as far as I can tell, the only audited one.)
There's a lot of interest in passkey-based wallets now, which offer an excellent self-custody UX. These rely on the WebAuthn standard, which uses Base64URL.
For that use case and for completeness, it would be great to have a canonical, audited onchain Base64URL encoder.
📝 Details
Encoding | Input | Output |
---|---|---|
Base64 | hello world |
aGVsbG8gd29ybGQ= |
Base64URL | hello world |
aGVsbG8gd29ybGQ |
I think this can be done with contract derived from Base64.sol
with two straightforward modifications:
- Change two characters in the lookup table
- Remove the trailing
=
padding
If there's interest, I'm happy to send a PR.