-
Notifications
You must be signed in to change notification settings - Fork 28
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 Sui Support #138
base: main
Are you sure you want to change the base?
Add Sui Support #138
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.
Overall looks good so far, would mostly need to further define CAIP specs, have others review and reflect those changes/specs here.
return Cacao.fromSiwSuiMessage(siwSuiMessage) | ||
} | ||
|
||
export async function getAccountId(suiProvider: any, address: string): Promise<AccountId> { |
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.
If it is not possible to request the network from the provider, then you can remove this function, and just use getAccountIdByNetwork
, as long as most of the networks are covered. All these functions are just optional helpers for each chain depending on implementation/needs
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.
Yes, this is possible. Will change this when I get clarity on the verifySuiSignature
method alternatives.
} | ||
} | ||
|
||
export function verifySuiSignature(cacao: Cacao, options: VerifyOptions) { |
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.
@zachferland Ive been looking into this more and it appears there is not currently a method to get the public key from the sui address to verify the signature. Im looking for insight from you to see what you would consider the best method for approaching this problem?
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.
is secp256k1 not also supported? then ecrecover from signature can be used (like eth)
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.
keys can be either ed25519, secp256k1, secp256r1
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.
do wallets support all three? is one default? how does that work typically
if these messages could just use secp256k1, that would be great
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.
Wallets can be one of the 3 and it is specified at account creation. It is set by a flag when the keypair is created programmatically.
Hi, is there any progress with Sui support? I'm considering using composedb with Sui chain. I may not be familiar with signing algorithms, but is there any further information I can learn or help with? |
[Add Sui Support]
Description
This PR is to add SUI wallet support. Sui is a new layer 1 blockchain developed by Mysten Labs, it is in the early stages of launching and is part of the Move ecosystem that originated from the development work around Diem created at Meta
The PR adds the
pkh-sui
package and additional changes to thecacao
package to support it.It is being added here as a draft in case the team wants to provide context or comments. Some unit testing is done but it is awaiting local development testing using Sui wallets and guidance around the addition of CAIP's for Sui network(see below)
How Has This Been Tested?
Local unit testing
Describe the tests that you ran to verify your changes. Provide instructions for reproduction.
PR checklist
Before submitting this PR, please make sure:
References:
Please list relevant documentation (e.g. tech specs, articles, related work etc.) relevant to this change, and note if the documentation has been updated.