Skip to content

Commit

Permalink
disable tss
Browse files Browse the repository at this point in the history
  • Loading branch information
forcodedancing committed May 13, 2022
1 parent 31e6326 commit ac5084e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 415 deletions.
21 changes: 6 additions & 15 deletions crypto/keys/keybase.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ var (
// ErrUnsupportedLanguage is raised when the caller tries to use a
// different language than english for creating a mnemonic sentence.
ErrUnsupportedLanguage = errors.New("unsupported language: only english is supported")

// ErrTssUnsupported is raised when the caller tries to use TSS, which is not supported.
ErrTssUnsupported = errors.New("tss unsupported: tss is not supported")
)

// dbKeybase combines encryption and storage implementation to provide
Expand Down Expand Up @@ -170,7 +173,7 @@ func (kb dbKeybase) CreateLedger(name string, path crypto.DerivationPath, algo S
}

func (kb dbKeybase) CreateTss(name, tssHome, tssVault string, pubkey tmcrypto.PubKey) (info Info, err error) {
return kb.writeTssKey(name, tssHome, tssVault, pubkey)
return nil, ErrTssUnsupported
}

// CreateOffline creates a new reference to an offline keypair
Expand Down Expand Up @@ -263,11 +266,8 @@ func (kb dbKeybase) Sign(name, passphrase string, msg []byte) (sig []byte, pub t
return
}
case tssInfo:
linfo := info.(tssInfo)
priv, err = crypto.NewPrivKeyTss(linfo.Home, linfo.Vault, passphrase, fmt.Sprintf("%x", msg))
if err != nil {
return
}
err = ErrTssUnsupported
return
case offlineInfo:
linfo := info.(offlineInfo)
_, err := fmt.Fprintf(os.Stderr, "Bytes to sign:\n%s", msg)
Expand Down Expand Up @@ -460,15 +460,6 @@ func (kb dbKeybase) writeLedgerKey(pub tmcrypto.PubKey, path crypto.DerivationPa
return info
}

func (kb dbKeybase) writeTssKey(name, tssHome, tssVault string, pubkey tmcrypto.PubKey) (Info, error) {
if info, err := newTssInfo(name, tssHome, tssVault, pubkey); err == nil {
kb.writeInfo(info, name)
return info, nil
} else {
return nil, err
}
}

func (kb dbKeybase) writeOfflineKey(pub tmcrypto.PubKey, name string) Info {
info := newOfflineInfo(name, pub)
kb.writeInfo(info, name)
Expand Down
18 changes: 0 additions & 18 deletions crypto/keys/types.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package keys

import (
"github.com/binance-chain/tss/client"

"github.com/tendermint/tendermint/crypto"

ccrypto "github.com/cosmos/cosmos-sdk/crypto"
Expand Down Expand Up @@ -209,22 +207,6 @@ func (i tssInfo) GetAddress() types.AccAddress {
return i.PubKey.Address().Bytes()
}

func newTssInfo(name, home, vault string, pubkey crypto.PubKey) (Info, error) {
if pubkey == nil {
if key, err := client.LoadPubkey(home, vault); err == nil {
pubkey = key
} else {
return nil, err
}
}
return &tssInfo{
Name: name,
PubKey: pubkey,
Home: home,
Vault: vault,
}, nil
}

// encoding info
func writeInfo(i Info) []byte {
return cdc.MustMarshalBinaryLengthPrefixed(i)
Expand Down
39 changes: 0 additions & 39 deletions crypto/tss.go

This file was deleted.

74 changes: 1 addition & 73 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,11 @@ go 1.17
require (
github.com/bartekn/go-bip39 v0.0.0-20171116152956-a05967ea095d
github.com/bgentry/speakeasy v0.1.0
github.com/binance-chain/tss v0.1.2
github.com/binance-chain/tss-lib v1.0.0
github.com/btcsuite/btcd v0.20.1-beta
github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d
github.com/go-kit/kit v0.9.0
github.com/gorilla/mux v1.7.3
github.com/hashicorp/golang-lru v0.5.3
github.com/ipfs/go-log v0.0.1
github.com/mattn/go-isatty v0.0.10
github.com/mitchellh/go-homedir v1.1.0
github.com/pelletier/go-toml v1.4.0
Expand All @@ -35,7 +32,6 @@ require (
require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d // indirect
github.com/coreos/go-semver v0.3.0 // indirect
github.com/cosmos/ledger-go v0.9.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/etcd-io/bbolt v1.3.3 // indirect
Expand All @@ -44,99 +40,31 @@ require (
github.com/gogo/protobuf v1.3.1 // indirect
github.com/golang/protobuf v1.3.2 // indirect
github.com/golang/snappy v0.0.1 // indirect
github.com/google/uuid v1.1.1 // indirect
github.com/gorilla/websocket v1.4.0 // indirect
github.com/hashicorp/errwrap v1.0.0 // indirect
github.com/hashicorp/go-multierror v1.0.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/huin/goupnp v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/ipfs/go-cid v0.0.3 // indirect
github.com/ipfs/go-datastore v0.0.5 // indirect
github.com/ipfs/go-ipfs-util v0.0.1 // indirect
github.com/ipfs/go-todocounter v0.0.1 // indirect
github.com/jackpal/gateway v1.0.5 // indirect
github.com/jackpal/go-nat-pmp v1.0.1 // indirect
github.com/jbenet/go-temp-err-catcher v0.0.0-20150120210811-aac704a3f4f2 // indirect
github.com/jbenet/goprocess v0.1.3 // indirect
github.com/jmhodges/levigo v1.0.0 // indirect
github.com/koron/go-ssdp v0.0.0-20180514024734-4a0ed625a78b // indirect
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515 // indirect
github.com/libp2p/go-addr-util v0.0.1 // indirect
github.com/libp2p/go-buffer-pool v0.0.2 // indirect
github.com/libp2p/go-conn-security-multistream v0.1.0 // indirect
github.com/libp2p/go-eventbus v0.1.0 // indirect
github.com/libp2p/go-flow-metrics v0.0.1 // indirect
github.com/libp2p/go-libp2p v0.3.0 // indirect
github.com/libp2p/go-libp2p-autonat v0.1.0 // indirect
github.com/libp2p/go-libp2p-circuit v0.1.1 // indirect
github.com/libp2p/go-libp2p-core v0.2.2 // indirect
github.com/libp2p/go-libp2p-discovery v0.1.0 // indirect
github.com/libp2p/go-libp2p-kad-dht v0.2.0 // indirect
github.com/libp2p/go-libp2p-kbucket v0.2.0 // indirect
github.com/libp2p/go-libp2p-loggables v0.1.0 // indirect
github.com/libp2p/go-libp2p-mplex v0.2.1 // indirect
github.com/libp2p/go-libp2p-nat v0.0.4 // indirect
github.com/libp2p/go-libp2p-peerstore v0.1.3 // indirect
github.com/libp2p/go-libp2p-record v0.1.1 // indirect
github.com/libp2p/go-libp2p-routing v0.1.0 // indirect
github.com/libp2p/go-libp2p-secio v0.2.0 // indirect
github.com/libp2p/go-libp2p-swarm v0.2.0 // indirect
github.com/libp2p/go-libp2p-transport-upgrader v0.1.1 // indirect
github.com/libp2p/go-libp2p-yamux v0.2.1 // indirect
github.com/libp2p/go-maddr-filter v0.0.5 // indirect
github.com/libp2p/go-mplex v0.1.0 // indirect
github.com/libp2p/go-msgio v0.0.4 // indirect
github.com/libp2p/go-nat v0.0.3 // indirect
github.com/libp2p/go-openssl v0.0.2 // indirect
github.com/libp2p/go-reuseport v0.0.1 // indirect
github.com/libp2p/go-reuseport-transport v0.0.2 // indirect
github.com/libp2p/go-stream-muxer-multistream v0.2.0 // indirect
github.com/libp2p/go-tcp-transport v0.1.0 // indirect
github.com/libp2p/go-ws-transport v0.1.0 // indirect
github.com/libp2p/go-yamux v1.2.3 // indirect
github.com/magiconair/properties v1.8.1 // indirect
github.com/mattn/go-colorable v0.1.4 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 // indirect
github.com/minio/sha256-simd v0.1.0 // indirect
github.com/mitchellh/mapstructure v1.1.2 // indirect
github.com/mr-tron/base58 v1.1.2 // indirect
github.com/multiformats/go-base32 v0.0.3 // indirect
github.com/multiformats/go-multiaddr v0.0.4 // indirect
github.com/multiformats/go-multiaddr-dns v0.0.3 // indirect
github.com/multiformats/go-multiaddr-fmt v0.0.1 // indirect
github.com/multiformats/go-multiaddr-net v0.0.1 // indirect
github.com/multiformats/go-multibase v0.0.1 // indirect
github.com/multiformats/go-multihash v0.0.7 // indirect
github.com/multiformats/go-multistream v0.1.0 // indirect
github.com/opentracing/opentracing-go v1.1.0 // indirect
github.com/otiai10/primes v0.0.0-20180210170552-f6d2a1ba97c4 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 // indirect
github.com/prometheus/common v0.6.0 // indirect
github.com/prometheus/procfs v0.0.3 // indirect
github.com/rcrowley/go-metrics v0.0.0-20180503174638-e2704e165165 // indirect
github.com/rs/cors v1.6.0 // indirect
github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/spf13/afero v1.2.2 // indirect
github.com/spf13/cast v1.3.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/whyrusleeping/base32 v0.0.0-20170828182744-c30ac30633cc // indirect
github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1 // indirect
github.com/whyrusleeping/go-logging v0.0.1 // indirect
github.com/whyrusleeping/go-notifier v0.0.0-20170827234753-097c5d47330f // indirect
github.com/whyrusleeping/mafmt v1.2.8 // indirect
github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7 // indirect
github.com/zondax/hid v0.9.0 // indirect
go.opencensus.io v0.22.0 // indirect
golang.org/x/net v0.0.0-20191021144547-ec77196f6094 // indirect
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 // indirect
golang.org/x/text v0.3.2 // indirect
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898 // indirect
google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb // indirect
google.golang.org/grpc v1.23.0 // indirect
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
gopkg.in/yaml.v2 v2.2.4 // indirect
)

Expand Down
Loading

0 comments on commit ac5084e

Please sign in to comment.