Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

♻️ Encode the challenge in base64 on-chain #6

Merged
merged 1 commit into from
Aug 7, 2023

Conversation

qd-qd
Copy link
Member

@qd-qd qd-qd commented Aug 4, 2023

You may probably ask why we encode the challenge in base64 on-chain instead of of sending it already encoded to save some gas. This library is opinionated and assumes that it is used in the context of Account Abstraction. In this context, valuable information required to proceed with the transaction correctly will be stored in the challenge field meaning we need the challenge in clear to use later in the flow. That's why we decided to encode it here.

@github-actions
Copy link

github-actions bot commented Aug 4, 2023

Changes to gas cost

Generated at commit: 7ecb7708f06632f8b6e0a31f75ba9242eee976c5, compared to commit: 274550095ec0b0ea3d9495409e087082dc0bcb23

🧾 Summary (20% most significant diffs)

Contract Method Avg (+/-) %
WebAuthnImplementation generateMessage
verify
+2,137 ❌
+2,138 ❌
+69.47%
+0.78%

Full diff report 👇
Contract Deployment Cost (+/-) Method Min (+/-) % Avg (+/-) % Median (+/-) % Max (+/-) % # Calls (+/-)
WebAuthnImplementation 1,114,960 (+64,066) generateMessage
verify
5,213 (+2,137)
277,910 (+2,138)
+69.47%
+0.78%
5,213 (+2,137)
277,910 (+2,138)
+69.47%
+0.78%
5,213 (+2,137)
277,910 (+2,138)
+69.47%
+0.78%
5,213 (+2,137)
277,910 (+2,138)
+69.47%
+0.78%
1 (0)
1 (0)

@qd-qd qd-qd marked this pull request as draft August 4, 2023 19:25
Base automatically changed from webauthn-refacto to main August 7, 2023 09:56
@qd-qd qd-qd force-pushed the webauthn-refacto-base64-encoding branch from e960646 to 0e690d9 Compare August 7, 2023 12:54
@qd-qd qd-qd changed the title ♻️ Variant of the refactoring with Base64 encoding ♻️ Encode the challenge in base64 on-chain Aug 7, 2023
You may probably ask why we encode the challenge in base64 on-chain
instead of of sending it already encoded to save some gas. This library
is opinionated and assumes that it is used in the context of Account
Abstraction. In this context, valuable information required to proceed
with the transaction correctly will be stored in the challenge field
meaning we need the challenge in clear to use later in the flow. That's
why we decided to encode it here.
@qd-qd qd-qd force-pushed the webauthn-refacto-base64-encoding branch from 0e690d9 to 3d59ac7 Compare August 7, 2023 12:57
@qd-qd qd-qd marked this pull request as ready for review August 7, 2023 12:59
@qd-qd qd-qd merged commit 3d59ac7 into main Aug 7, 2023
@qd-qd qd-qd deleted the webauthn-refacto-base64-encoding branch August 7, 2023 13:00
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