-
Notifications
You must be signed in to change notification settings - Fork 133
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
Add updates to keyless integration guide #343
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
✅ Deploy Preview for aptos-developer-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move this guide to Nextra see the guide here https://preview.aptos.dev/en/developer-platforms/contribute
|
||
Eventually your EphemeralKeyPair will expire or the JWK used to validate the token will be rotated. In these cases the KeylessAccount must be refreshed with a new JWT token. To detect errors, use a try catch on sign and submit and switch on the KeylessError.type. | ||
|
||
```tsx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to ts
Developers may opt to use their own pepper service/scheme and can override use of the labs hosted pepper service. | ||
|
||
Example | ||
```tsx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to ts
Certain dApps may want to use 'email' instead of the default 'sub' claim to identify user. This allows dApps to mint NFTs to a user's email even if the user has not created an account yet. Note that this also means that if a user changes their emails with respect to the IdP, they may love access to their account. | ||
|
||
Example | ||
```tsx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to ts
|
||
Eventually your EphemeralKeyPair will expire or the JWK used to validate the token will be rotated. In these cases the KeylessAccount must be refreshed with a new JWT token. To detect errors, use a try catch on sign and submit and switch on the KeylessError.type. | ||
|
||
```tsx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
```tsx | |
```ts |
## Example Implementaion | ||
|
||
You can find an example app demonstrating how to do basic Keyless integration with Google in the repository below. Follow the directions in the README to get started quickly with Keyless. For more detailed instructions please read the rest of the integration guide. | ||
|
||
https://github.com/aptos-labs/aptos-keyless-example/ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## Example Implementaion | |
You can find an example app demonstrating how to do basic Keyless integration with Google in the repository below. Follow the directions in the README to get started quickly with Keyless. For more detailed instructions please read the rest of the integration guide. | |
https://github.com/aptos-labs/aptos-keyless-example/ | |
## Example Implementaion | |
You can find an example app demonstrating basic Keyless integration with Google in the [aptos-keyless-example repository](https://github.com/aptos-labs/aptos-keyless-example/). Follow the directions in the README to start with the example. For more detailed instructions on keyless, please read the rest of this integration guide. | |
Developers may opt to use their own pepper service/scheme and can override use of the labs hosted pepper service. | ||
|
||
Example | ||
```tsx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
```tsx | |
```ts |
Certain dApps may want to use 'email' instead of the default 'sub' claim to identify user. This allows dApps to mint NFTs to a user's email even if the user has not created an account yet. Note that this also means that if a user changes their emails with respect to the IdP, they may love access to their account. | ||
|
||
Example | ||
```tsx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
```tsx | |
```ts |
|
||
## SDK Configurable Options | ||
|
||
The Keyless SDK provides several configurable options for Keyless Account derivation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Keyless SDK provides several configurable options for Keyless Account derivation | |
The Keyless SDK provides several options for Keyless Account derivation. |
Fetching the proof may take a few seconds and can be done in the background to allow for a more responsive user experience. To enable asyncronous proof fetching just provide a callback to be invoked on proof fetch completion. | ||
|
||
Example | ||
```tsx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
```tsx | |
```ts |
By default, the expiry time of the EphemeralKeyPair is set to be maximum allowed time in the future, now + 10000000 seconds. To avoid proofs that are long lived which can be a security risk, | ||
```tsx | ||
const ephemeralKeyPair = EphemeralKeyPair.generate({expiryDateSecs: 1721397500}); | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't describe the purpose of this well. And I think it's taking some jumps assuming the user knows what these mean. It says security risk, and it says to avoid it, but why?
By default, the expiry time of the EphemeralKeyPair is set to be maximum allowed time in the future, now + 10000000 seconds. To avoid proofs that are long lived which can be a security risk, | |
```tsx | |
const ephemeralKeyPair = EphemeralKeyPair.generate({expiryDateSecs: 1721397500}); | |
``` | |
By default, the expiry time of the EphemeralKeyPair is set to be the maximum allowed time in the future, now + 10000000 seconds. To reduce the amount of time that a proof expires, you can override the expiration date seconds. | |
```ts | |
const ephemeralKeyPair = EphemeralKeyPair.generate({expiryDateSecs: 1721397500}); |
|
||
## Pepper Service API | ||
|
||
The pepper service is an Aptos Labs hosted API that computes a pepper as a result of a verifiable unpredictible function (VUF). The inputs to the VUF are the iss, uid_key (defaults to sub), uid_val, aud. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay... there are like 10 abbreviations here, and it doesn't read well. Should we describe what a pepper is?
Pepper service makes peppers, but why?
The pepper service is an Aptos Labs hosted API that computes a pepper as a result of a verifiable unpredictible function (VUF). The inputs to the VUF are the iss, uid_key (defaults to sub), uid_val, aud. | |
The pepper service is an Aptos Labs hosted API that computes a pepper as a result of a verifiable unpredictible function (VUF). The inputs to the VUF are the `iss`, `uid_key` (defaults to `sub`), `uid_val`, `aud`. |
|
||
## Prover Service API | ||
|
||
The prover service is an Aptos Labs hosted API that computes zero-knowledge proofs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
proofs for what?
|
||
The prover service is an Aptos Labs hosted API that computes zero-knowledge proofs. | ||
|
||
The input to the prover consists of the same request to the pepper service with the addition of the pepper and the max expiry horizon. The inputs to the prover must satisfy the circuit relation for secret witness generation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prover must satisfy circuit relation is a weird sentence
The input to the prover consists of the same request to the pepper service with the addition of the pepper and the max expiry horizon. The inputs to the prover must satisfy the circuit relation for secret witness generation. | |
The prover service takes the same request as the pepper service with two additional inputs, the pepper and the max expiry horizon. The inputs to the prover must satisfy the circuit relation for secret witness generation. |
Description
Checklist
pnpm spellcheck
?pnpm fmt
?pnpm lint
?