blocto / solana-go-sdk

Solana Golang SDK
https://blocto.github.io/solana-go-sdk/
MIT License
373 stars 96 forks source link

Add KeccackSecp256k1 Instruction #33

Closed Aphoh closed 2 years ago

Aphoh commented 2 years ago

New lil module with code to generate KeccakSecp256k1 Instructions for both a single signature and multiple signatures with a test against known good rust code.

Only thing that might be a blocker is the use of ethereum/go-ethereum as a dependency for signing, hashing, and getting an ethereum address. If you'd like me to I can try to find alternative dependencies (was thinking I might try and use sha3 and the native crypto/ecdsa instead).

yihau commented 2 years ago

Thank for this PR! That's very awesome. Yup, as you say. It would be better if you can get rid of ethereum/go-ethereum but current is an acceptable version. Let me know if you want to try to find an alternative or you want to remain current version.

Aphoh commented 2 years ago

@yihau Found a reasonable alternative in ipsn/go-secp256k1. The go.sum looks much more reasonable now. Tests should all pass. I'm happy with this if you are.

Aphoh commented 2 years ago

^ just a lil change, made the Sign method private. Better not to expose it.

yihau commented 2 years ago

The lib looks good. I prefer to use it! Thank you🙏

Aphoh commented 2 years ago

@yihau anything blocking this from being merged?

yihau commented 2 years ago

@Aphoh Sorry. I though you still have something to update so I was waiting for you until you told me you have done. Seems there is a misunderstanding haha. Thank you for this contribution!!!