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

[version 3.0.0] Major version bump #266

Merged
merged 247 commits into from
Nov 28, 2023
Merged

[version 3.0.0] Major version bump #266

merged 247 commits into from
Nov 28, 2023

Conversation

joshLong145
Copy link
Collaborator

!! SDK VERSION 3.0.0 Release Branch !!
Changes from #145

ACC-based JWT Signing (V2): This new scheme simplifies the overall flow by baking into each dapp endpoint the required 

access control conditions directly. This means that there is no "store signing condition" step as dapp developers just write it into their dapp code and an additional check against the access control condition is performed there. 

When clients request for a signed JWT with claims of the specified access control condition, the signature of this JWT is only provided when the nodes determine that the user satisfy this access control condition. Read more in the spec here: https://www.notion.so/litprotocol/ACC-based-JWT-signing-V2-a4db1446bac54eea90b7ab08e5455246.

The BLS WASM (bls-sdk.ts) is entirely replaced with new code. Unit tests are added to this package.
The SDK no longer supports the jalapeno network moving forward. Developers can use the old SDK versions to continue using the old encryption and JWT signing schemes. serrano network is the new default.

Updated crypto package to be a lightweight wrapper over bls-sdk package with minor conversion logic.
Updated encryption package to replace the old encryption + JWT signing logic with the new schemes. This is becoming more a helper library over lit-node-client-nodejs and crypto.

Refactored params-validators to use a plugin-based approach with various *Validators.
Updated all manual tests in apps/html to use the new ID-based encryption and JWT signing schemes. You will notice quite a few test cases are removed since we no longer need to store encryption keys, or store signing conditions respectively.
demo-encrypt-decrypt-react:

Turned this into a TS project.

Updated this demo to use the new ID-based encryption scheme - just a encryptString and decryptToString call.
Implement demo-locked-express-app to demo the new JWT signing flow. Instructions in its README.md.
Made use of generics in a number of places, eg. IEither, SuccessNodePromises and benchmark()

Changes from #107

 - Adds support for new ECDSA implementation for
     - k256
     - p256
- Updates `ecdsa-sdk.ts` in `packages/ecdsa-sdk` with updated wasm bundle
- Adds  post build step to `ecdsa-sdk` for correcting a tic generation error
- Update `SIGTYPE` to include new ecdsa types
- Adds key recovery tests to `packages/crypto`

  • Adds computePubKey to lit-core which wraps an implementation in crypto for interfacing with a new wasm module for deriving HD public keys: for reference the implementation which is compiled to WASM is here: https://github.com/LIT-Protocol/lit-ecdsa-wasm-combine/blob/main/src/combiners/hd_ecdsa/mod.rs
  • Addition of claimKeyId method on lit-node-client-nodejs for deriving a key from an authMethod
    • Supports a new MintCallBack which is defined as async (params: ClaimKeyResponse): Promise<ClaimKeyResponse> which is called to route derived keys from a claim operation on chain.
  • New ClaimProcessor abstraction for specifying arguments to a callback implementation for forwarding aggregated claim responses from nodes to the Chronicle chain which can be done by a relayer or contract client implementation within the callback.

Ansonhkg and others added 23 commits November 9, 2023 16:08
* mint by auth method

* remove url

* feat: fix authmethod type 6

* add a note

* feat: add enums

* remove declare

* rename from 'mint' to 'mintWithAuth' for better clarity

* fix: ignore_dirs
…function (#254)

* feat: public static to get auth id by auth method

* fix: import
* WIP

* wip2 - awaiting verifyAndMintPKPThroughRelayer to be implemented

* fix: verifyAndMintPKPThroughRelayer with custom args

* update pkg

* remove comment

* rm lock

---------

Signed-off-by: Anson <ansonox@gmail.com>
Signed-off-by: VoR0220 <catalanor0220@gmail.com>
A hack was added a year ago to suppress a webpack complaint. Other packages import crypto and don't seem to contain this hack. The metro bundler doesn't allow for conditional requires / substitutions, and as such causes react-native to fail loading the crypto library. This PR removes the hack.

I have not checked if webpack still complains but am hoping Chris can chime in.
* feat: Store blockhash from handshake + use it in SIWE

* feat: Pass blockhash instead of client in authSig functions

* refac: Cleanup

* feat: Client getter for blockhash + Manual tests

* refac: Remove comments

* refac: latest_blockhash -> latestBlockhash

* test: Display result of manual tests

* test: Node E2E test for creating authSig by fetching the blockhash from the client
@CLAassistant
Copy link

CLAassistant commented Nov 25, 2023

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
6 out of 8 committers have signed the CLA.

✅ joshLong145
✅ Ansonhkg
✅ debbly
✅ glitch003
✅ vmc-crossmint
✅ ericlewis
❌ Adarsh-Kumar28
❌ VoR0220
You have signed the CLA already but the status is still pending? Let us recheck it.

@joshLong145 joshLong145 changed the title Merge/main into v3 [version 3.0.0] Major version bump Nov 25, 2023
glitch003 and others added 2 commits November 27, 2023 19:05
* it all works, yay

* gen contracts

* fix up tests

* remove unused thing

* add checkNodeAttestation boolean config option

* better attestation

* remove custom code to test on internaldev

* check ip and port against report

* check ip and port against attestation report

* remove unused params

* moving to get certs in js

* i built stuff

* it works

* fully working in nodejs and also browser

* fix valid cert test

* sync package version

* push readme changes

* add back attestation checking from bad merge

* add default for cayenne for attestation check

* add explicit attestation check disable in e2e tests

* fmt

---------

Co-authored-by: Josh Long <josh@litprotocol.com>
@joshLong145 joshLong145 merged commit 4bc5caa into master Nov 28, 2023
1 of 2 checks passed
@joshLong145 joshLong145 deleted the merge/main-into-v3 branch November 28, 2023 18:55
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.

None yet