-
Notifications
You must be signed in to change notification settings - Fork 7
feat: Vincent Wrapped Keys (Platform User) #410
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
Conversation
- Removed intended-to-be-private ABI export, contract address, and `getPkpTokenId()` method
- Renamed `decryptVincentWrappedKey` -> `exportPrivateKey` to match existing wrapped keys SDK terminology - Resolved `TS80009` errors by removing `@Typedef` from tsdocs - Updated APIs for `evmContractConditions` - Updated APIs for `delegatorAddress` both in inputs and returned outputs from storage backend - Added explicit exported types for exportPrivateKey inputs and outputs (now matches our existing APIs structures) - Removed unused sessionSigs helper code from the api layer - Removed unused getDecryptedKeyToSingleNode - Renamed `delegateeSessionSigs` arg in generate methods to `delegatorSessionSigs`, since only delegators are allowed to generate sessionSigs per current spec - Paramaterized `evmContractConditions` in `getSolanaKeyPair()` -- this is now stored along with other wrapped key metadata and should _not_ be assumed to be static. - Updated REST API paths and arguments in `service-client` to match current paths - Removed unused devDependency on @lit-protocol/lit-node-client (we only use its type) - Use `removeSaltFromDecryptedKey()` in all places where we need to remove salt from the decrypted key (both exporting and inside of helper for solana wrapped keypair composition) - Updated `exportPrivateKey` API to match existing wrapped key behaviour patterns -- it now fetches the encrypted wrapped key from the storage backend using the `id` instead of expecting the consumer to use the service-client directly to fetch it
…to include the ability to decrypt access-control-condition restricted resources - Facilitates Vincent Wrapped keys abilities being able to decrypt wrapped keys
…new API paradigm - Compose delegator sessionSigs to export the private key - Add TODOs where API changes are still pending (needs the agent PKP's owner to be an actual PKP)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Pull Request Overview
This PR introduces support for Vincent Wrapped Keys at the platform user level, enabling both delegatees and platform users to decrypt wrapped keys. It replaces PR #365 with updated APIs matching recent backend changes.
Key changes:
- Renamed
delegateeSessionSigstodelegatorSessionSigsthroughout to reflect that delegators generate keys - Updated REST API paths from
/delegatee/encryptedto/delegated/encrypted - Added
exportPrivateKey()API for decrypting previously stored wrapped keys - Implemented dual access control conditions supporting both delegatees and platform user (PKP owner) decryption
- Renamed
accessControlConditionsparameter toevmContractConditionsfor consistency - Added
evmContractConditionsfield to encrypted key storage and retrieval
Reviewed Changes
Copilot reviewed 42 out of 49 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/libs/wrapped-keys/src/lib/types.ts | Updated type definitions with new parameter naming and added ExportPrivateKey types |
| packages/libs/wrapped-keys/src/lib/api/export-private-key.ts | New API function to export/decrypt wrapped keys |
| packages/libs/wrapped-keys/src/lib/api/generate-private-key.ts | Updated to use new getVincentWrappedKeysAccs for access control conditions |
| packages/libs/wrapped-keys/src/lib/service-client/client.ts | Updated REST API paths from /delegatee/ to /delegated/ and parameter names |
| packages/libs/wrapped-keys/src/lib/lit-actions-client/*.ts | Renamed parameters from accessControlConditions to evmContractConditions |
| packages/libs/contracts-sdk/src/internal/wrapped-keys/getVincentWrappedKeysAccs.ts | New function generating dual access control conditions for delegatees OR platform users |
| packages/libs/app-sdk/src/abilityClient/execute/generateVincentAbilitySessionSigs.ts | Added AccessControlConditionDecryption ability to session sig requests |
| packages/apps/ability-sol-transaction-signer/src/lib/*.ts | Updated to accept and use evmContractConditions parameter |
| packages/apps/abilities-e2e/test-e2e/solana/*.ts | New E2E test suite for Solana transaction signing with wrapped keys |
| pnpm-lock.yaml | Updated @LIT-Protocol dependencies to 7.3.1 versions |
| packages/libs/wrapped-keys/package.json | Version bump to 0.6.0 |
| packages/libs/contracts-sdk/package.json | Moved dependencies from devDependencies to dependencies |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/libs/contracts-sdk/src/internal/wrapped-keys/getVincentWrappedKeysAccs.ts
Outdated
Show resolved
Hide resolved
packages/apps/abilities-e2e/test-e2e/solana/solana-transaction-signer.spec.ts
Show resolved
Hide resolved
|
Merged with the intention of following up with a PR to finish the E2E test implementation - want to avoid this PR getting state with other unrelated changes getting merged into |
Description
This PR replaces #365; it contains some of the changes from that PR, further updates and enhancements based on API changes made since #365 was opened, and is rebased to our current master branch.
Changes vs. existing PR in 365:
Updated the app-sdk sessionSig creation's
resourceAbilityRequestscomposition to include the ability to decrypt access-control-condition restricted resources, which facilitates Vincent Wrapped keys abilities being able to decrypt wrapped keysdecryptVincentWrappedKey->exportPrivateKeyto match existing wrapped keys SDK method namesTS80009errors by removing@Typedeffrom tsdocsevmContractConditionsnaming (exists partially in Platform User Auth for Wrapped Keys #365)delegatorAddressboth in inputs and returned outputs from storage backendgetDecryptedKeyToSingleNode()delegateeSessionSigsarg in generate methods todelegatorSessionSigs, since only delegators are allowed to generate sessionSigs per current spec.evmContractConditionsingetSolanaKeyPair()-- this is stored along with other wrapped key metadata and should not be assumed to be static based on the SDK method (composition of the access control conditions is an internal concern of the generate methods only)service-clientto match current pathsremoveSaltFromDecryptedKey()in all places where we need to remove salt from the decrypted key (both exporting and inside of helper for solana wrapped keypair composition)exportPrivateKeyAPI to match existing wrapped key behaviour patterns -- it now fetches the encrypted wrapped key from the storage backend using theidinstead of expecting the consumer to use the service-client directly to fetch it; this was previously taking raw inputs and did not use the service client at allType of change
How Has This Been Tested?
Checklist:
nx release plan) describing my changes and the version bump