tss-lib icon indicating copy to clipboard operation
tss-lib copied to clipboard

will you offer a complete demo code with network module for gen Key and address, sign, verify ?

Open powellsz opened this issue 3 years ago • 6 comments

powellsz avatar Aug 18 '22 10:08 powellsz

as the binary tss in https://github.com/bnb-chain/node-binary/tree/master/cli/prod/0.6.2-TSS-0.1.2.

powellsz avatar Aug 18 '22 10:08 powellsz

bump 👍

0xYao avatar Aug 29 '22 01:08 0xYao

I tried to make it work my way (https://github.com/bnb-chain/tss-lib/issues/204), but unfortunately unable to get it. I am able to find an implementation that works, and it's here https://github.com/seemenkina/tss-lib-test

Here's how to use it

go.mod

module github.com/org/mpc-api-tsslib

go 1.16

replace github.com/agl/ed25519 => github.com/binance-chain/edwards25519 v0.0.0-20200305024217-f36fc4b53d43

require (
	github.com/binance-chain/tss-lib v1.3.2 // indirect
	github.com/ipfs/go-log v1.0.4 // indirect
	github.com/seemenkina/tss-lib-test v0.0.0-20200616040000-a1406bde7c52 // indirect
)

main.go

package main

import (
	"encoding/json"
	"fmt"
	"io"
	"log"
	"math/big"
	"net/http"
	"strings"

	"github.com/binance-chain/tss-lib/ecdsa/keygen"
	logging "github.com/ipfs/go-log"
	"github.com/seemenkina/tss-lib-test/tssInterface"
)

func keyGen(userIds []big.Int, threshold int) keygen.LocalPartySaveData {
        x := tssInterface.GenerateKeys(threshold, len(userIds), "hello")
        return x

}

r4881t avatar Aug 31 '22 03:08 r4881t

I tried to make it work my way (#204), but unfortunately unable to get it. I am able to find an implementation that works, and it's here https://github.com/seemenkina/tss-lib-test

Here's how to use it

go.mod

module github.com/org/mpc-api-tsslib

go 1.16

replace github.com/agl/ed25519 => github.com/binance-chain/edwards25519 v0.0.0-20200305024217-f36fc4b53d43

require (
	github.com/binance-chain/tss-lib v1.3.2 // indirect
	github.com/ipfs/go-log v1.0.4 // indirect
	github.com/seemenkina/tss-lib-test v0.0.0-20200616040000-a1406bde7c52 // indirect
)

main.go

package main

import (
	"encoding/json"
	"fmt"
	"io"
	"log"
	"math/big"
	"net/http"
	"strings"

	"github.com/binance-chain/tss-lib/ecdsa/keygen"
	logging "github.com/ipfs/go-log"
	"github.com/seemenkina/tss-lib-test/tssInterface"
)

func keyGen(userIds []big.Int, threshold int) keygen.LocalPartySaveData {
        x := tssInterface.GenerateKeys(threshold, len(userIds), "hello")
        return x

}

Thanks a lot.It's just a single instance. We need multi instances to communicate with each other and finish mpc .

powellsz avatar Sep 03 '22 12:09 powellsz

The actual implementation of network will depend on your use case. Out of curiosity, how does it look like?

r4881t avatar Sep 03 '22 17:09 r4881t

the lib only has local test. You need to build network connection module or code , then connect the logic with the party update.

oday0311 avatar Sep 26 '22 02:09 oday0311