-
Notifications
You must be signed in to change notification settings - Fork 27
Update session key documentation #88
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
base: main
Are you sure you want to change the base?
Conversation
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.
few comments
- Create a normal transaction that transfers some ETH to the SK. The amount depends on how many "moves" the user is prepared to prepay for. | ||
- Ask the user to sign this transaction with their normal wallet, and submit it to the network using the library of your choice. | ||
- Once the receipt is received, call ``sessionkeys_Activate``. | ||
- Call the RPC `eth_getStorageAt` with address `0x0000000000000000000000000000000000000003` (CreateSessionKeyCQMethod) - this will return the hex-encoded address of the SK. |
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.
I'm not sure "CreateSessionKeyCQMethod" means anything for an external dev
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.
true, removed
- Create a normal transaction that transfers some ETH to the SK. The amount depends on how many "moves" the user is prepared to prepay for. | ||
- Ask the user to sign this transaction with their normal wallet, and submit it to the network using the library of your choice. | ||
- Once the receipt is received, call ``sessionkeys_Activate``. | ||
- Call the RPC `eth_getStorageAt` with address `0x0000000000000000000000000000000000000003` (CreateSessionKeyCQMethod) - this will return the hex-encoded address of the SK. |
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.
mention that the dapp must store the sk address
|
||
When a game ends, you have to move the remaining funds back to the main address and deactivate the key. | ||
- Create a transaction that moves the funds back from the SK to the main address. Submit it unsigned using the SendUnsignedTxCQMethod, because the funds are controlled by the SK. | ||
- Call `eth_getStorageAt` with address `0x0000000000000000000000000000000000000004` (DeleteSessionKeyCQMethod) to permanently remove the session key. |
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.
same for all these DeleteSessionKeyCQMethod
and the others.
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.
removed
|
||
### Key Benefits | ||
|
||
- **No Activation/Deactivation**: Session keys are implicitly active when created and remain active until deleted |
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 mean anything for a user who reads this for the first time
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.
removed
- **Multiple Session Keys**: Users can have up to 100 session keys (one per dApp) | ||
- **Simplified API**: Uses `eth_getStorageAt` with custom addresses instead of separate RPC methods | ||
- **Secure Management**: Session keys are managed by TEEs, eliminating the risk of losing private keys | ||
- **Base64 Transaction Encoding**: Unsigned transactions must be base64 encoded when sent via SendUnsignedTxCQMethod |
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.
not sure how these are benefits.
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.
removed
No description provided.