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

Add signMessage and signTransaction Lit Action exports for Wrapped Keys #504

Conversation

spacesailor24
Copy link
Contributor

@spacesailor24 spacesailor24 commented Jun 11, 2024

NOTE Before this PR is merged, we need to pin the bundled Lit Action code via Lit's official Pinata account (or similar), as they are currently pinned via my personal Pinata account


Adds two exported consts from wrapped-keys package:

  1. signTransactionWithSolanaEncryptedKeyLitActionIpfsCid
    • This CID refers to the bundled Lit Action code to sign and submit a Solana transaction using a decrypted private key within the Lit Action
    • This Lit Actions accepts the parameters:
      accessControlConditions,
      ciphertext,
      dataToEncryptHash,
      serializedTransaction,
      broadcast,
      solanaNetwork,
      
      • serializedTransaction by required a serialized transaction, we can support any Solana transaction signing (i.e. transfers or contract executions)
      • broadcast determines whether or not the signed transaction is submitted to the solanaNetwork
      • solanaNetwork is the Solana network to connect to
        • Options are: mainnet-beta, testnet, and devnet
  2. signMessageWithSolanaEncryptedKeyLitActionIpfsCid
    • This CID refers to the bundled Lit Action code to sign a message using a decrypted private key within the Lit Action
    • This Lit Actions accepts the parameters:
      accessControlConditions,
      ciphertext,
      dataToEncryptHash,
      messageToSign
      
      • messageToSign can be any string and is not expected to be encoded any specific way (it will be converted to a Buffer before signing within the Lit Action)

I tested that the sign tx and submit Lit Action works manually by providing it a testnet private key to the testSignTransactionWithSolanaEncryptedKey test and enabled broadcast (tx receipt)


For organizational purposes, I renamed the Eth Lit Actions file to ethereum.ts and moved it under a new litActions directory. The Solana Lit Actions are located under litActions/Solana

@CLAassistant
Copy link

CLAassistant commented Jun 11, 2024

CLA assistant check
All committers have signed the CLA.

@spacesailor24 spacesailor24 marked this pull request as ready for review June 14, 2024 22:50
@spacesailor24 spacesailor24 changed the title Wyatt/add solana actions Add signMessage and signTransaction Lit Action exports for Wrapped Keys Jun 14, 2024
@spacesailor24 spacesailor24 requested a review from DashKash54 June 14, 2024 23:01
@DashKash54
Copy link
Collaborator

solanaNetwork is the Solana network to connect to

Let's add it to the SolanaLitTransaction interface? Then it can be part of the unsigned transaction params?

Copy link
Collaborator

@DashKash54 DashKash54 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a bunch of comments. The idea is that I use these LitAction (ipfs_cid) in the functions: signTransactionWithEncryptedKey, signMessageWithEncryptedKey

@DashKash54
Copy link
Collaborator

Also the Linter is failing, please run yarn prettier

spacesailor24 and others added 4 commits June 14, 2024 14:37
…eWithSolanaEncryptedKey.js

Co-authored-by: DashKash54 <115020815+DashKash54@users.noreply.github.com>
Signed-off-by: Wyatt Barnes <me@wyatt.email>
…ctionWithSolanaEncryptedKey.js

Co-authored-by: DashKash54 <115020815+DashKash54@users.noreply.github.com>
Signed-off-by: Wyatt Barnes <me@wyatt.email>
…eWithSolanaEncryptedKey.js

Co-authored-by: DashKash54 <115020815+DashKash54@users.noreply.github.com>
Signed-off-by: Wyatt Barnes <me@wyatt.email>
…ctionWithSolanaEncryptedKey.js

Co-authored-by: DashKash54 <115020815+DashKash54@users.noreply.github.com>
Signed-off-by: Wyatt Barnes <me@wyatt.email>
…eWithSolanaEncryptedKey.js

Co-authored-by: DashKash54 <115020815+DashKash54@users.noreply.github.com>
Signed-off-by: Wyatt Barnes <me@wyatt.email>
@spacesailor24 spacesailor24 requested a review from DashKash54 June 15, 2024 01:15
Copy link
Collaborator

@DashKash54 DashKash54 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few more comments

@DashKash54 DashKash54 merged commit 486a0e4 into feature/lit-3125-sdk-for-wrapping-up-walletx-2 Jun 19, 2024
3 of 4 checks passed
@DashKash54 DashKash54 deleted the wyatt/add-solana-actions branch June 19, 2024 07:14
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.

3 participants