bnb-chain / tss-lib

Threshold Signature Scheme, for ECDSA and EDDSA
MIT License
759 stars 261 forks source link

How Can i use TSS for cosmos based chains ? #268

Open vishal-kanna opened 10 months ago

levischechter commented 10 months ago

same way you do it with Bitcoin, Ethereum etc. cosmos chains use secp256k1 curve.

vishal-kanna commented 10 months ago

Can you share me the docs for it

levischechter commented 10 months ago

There are no docs, but you can watch This, And the corresponding signing test file to figure out how to do it.

vishal-kanna commented 10 months ago

@levischechter Thank you. As far I knew we have four steps for tss 1.valut creation 2.keygen 3.signing 4 verification

I didn't find all these

levischechter commented 10 months ago

What do you mean by vault? Keygen is the file i sent in the link. Signing is in the same file in the signing folder. Verification can be made with any ecdsa package. The public key, the message and the signature are public information so you can verify by yourself

vishal-kanna commented 10 months ago

@levischechter https://docs.bnbchain.org/docs/beaconchain/learn/threshold-signature-scheme#where-can-i-download-the-binance-tss-cli this is the link for the docs i think .They have mentioned about the vault .I think vault is for storing the keys

levischechter commented 10 months ago

It's not part of the tss protocol. The tss protocol consist of 3 methods:

  1. Keygen
  2. Signing
  3. Resharing

You can find the examples for it in the test files I've mentioned.

vishal-kanna commented 10 months ago

Thank you @levischechter .Do we have docs for using TSS for bitcoin or ethereum

levischechter commented 10 months ago

Basically the steps are:

  1. Do keygen
  2. Get the address from public key using the specific Blockchain guides
  3. Prepare message for signing
  4. Sign the message
  5. Broadcast the transaction with the signature to the Blockchain using the specific Blockchain format
vishal-kanna commented 10 months ago

I knew we have 3 steps 1.Keygen 2.Signing 3.Resharing My question is how should i start and from where

levischechter commented 10 months ago

you need to be more specific with your question.

vishal-kanna commented 10 months ago

How to use Tss for signing a cosmos based transaction

levischechter commented 10 months ago

do you have the massage you wanna sign already? or you still struggle with the message preparing stage? NOTE: by message I mean the raw byte of the transaction you need to sign.

vishal-kanna commented 10 months ago

Think of a message "hello" or any message .Now i want to use TSS for signing it

levischechter commented 10 months ago

I already sent you an example. signing example