Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
fd8f1df
MinerFi TSS library fork: security hardening, ZK witness support, and…
max-sanchez Mar 5, 2026
dd849d9
feat(tss): add CeremonyID field to SSID domain separation
marcopeereboom Mar 13, 2026
68e3555
feat(tss/keygen): add channel-free round functions
marcopeereboom Mar 13, 2026
68614e5
feat(tss/signing): channel-free round functions
marcopeereboom Mar 13, 2026
2d24fc3
feat(tss/resharing): channel-free round functions
marcopeereboom Mar 13, 2026
5b71f55
fix(tss/signing): auto-subset key for threshold
marcopeereboom Mar 13, 2026
637310f
refactor(tss): v3 module, delete channel API
marcopeereboom Mar 16, 2026
6b276f4
feat(tss/eddsa): keygen, signing, and resharing round functions
marcopeereboom Mar 16, 2026
dbb72e5
test(tss): negative and coverage tests across all packages
marcopeereboom Mar 17, 2026
9d5fd6e
added test workflow for CI
ClaytonNorthey92 Mar 17, 2026
882e75b
remove quotes
ClaytonNorthey92 Mar 17, 2026
4036071
setup go wtihout setting working-dir
ClaytonNorthey92 Mar 17, 2026
9801477
no fail-fast in CI
ClaytonNorthey92 Mar 17, 2026
4c9d47e
increase test timeout
ClaytonNorthey92 Mar 17, 2026
00a6ef3
separate go get from go test
ClaytonNorthey92 Mar 17, 2026
b8efc3b
fix package name
ClaytonNorthey92 Mar 17, 2026
66d6499
remove go get for now
ClaytonNorthey92 Mar 17, 2026
f48f4ec
re-add go get
ClaytonNorthey92 Mar 17, 2026
906ed61
bump tss-lib to 1.25
ClaytonNorthey92 Mar 17, 2026
be93de3
also get test modules
ClaytonNorthey92 Mar 17, 2026
5662de6
build(tss): bump golangci-lint to v2.11.3
marcopeereboom Mar 17, 2026
6f05c1d
test(tss): cover ValidateSaveData, CKD error paths
marcopeereboom Mar 17, 2026
77d0d73
fix(tss): suppress SA1019 and add legacy build tags for CI
marcopeereboom Mar 17, 2026
c7424cf
reduce eth-trie test example size
AL-CT Mar 17, 2026
2989c8d
address feedback
ClaytonNorthey92 Mar 17, 2026
5ac88ab
add tss to actions
ClaytonNorthey92 Mar 17, 2026
d763fad
go mod update in tss
ClaytonNorthey92 Mar 17, 2026
d12bf8d
introduce short-circuit
ClaytonNorthey92 Mar 17, 2026
8151eb1
bump to 60m timeout during tests
ClaytonNorthey92 Mar 17, 2026
971ca37
revert my forced bug
ClaytonNorthey92 Mar 17, 2026
4845299
go 1.25 + go mod tidy in tss
ClaytonNorthey92 Mar 17, 2026
6ad1b43
test(tss): restore MtA negative tests and enable lifecycle tests in CI
max-sanchez Mar 17, 2026
65f3b78
test(tss/keygen): add negative and edge-case tests for Rounds 1–4
max-sanchez Mar 18, 2026
a52543c
test(tss/signing): add negative and edge-case tests for SignRound1–Fi…
max-sanchez Mar 18, 2026
d5cba72
test(tss): add known-answer and commitment binding tests
marcopeereboom Mar 18, 2026
3a6dd37
fix(tss): lint fixes for unconvert and missing import
marcopeereboom Mar 18, 2026
9e4b6bf
test(tss/resharing): add negative and edge-case tests for ReshareRoun…
max-sanchez Mar 19, 2026
e76000b
ci: increase test timeout from 60m to 120m
max-sanchez Mar 19, 2026
55e74eb
test(tss): add culprit attribution assertions to 64 negative tests
max-sanchez Mar 19, 2026
dd04e5c
test(tss/keygen): fix isError comment and use tolerant culprit check
max-sanchez Mar 19, 2026
c48301c
test(tss): add SSID sensitivity tests for signing, keygen, and resharing
max-sanchez Mar 20, 2026
03d3723
test(tss): close remaining SSID input sensitivity gaps
max-sanchez Mar 20, 2026
2d9304c
revert: changes to tss/
joshuasing Mar 23, 2026
8862a07
tss-lib: clean up copyright headers
joshuasing Mar 23, 2026
4d73bcb
tss-lib: tidy up Makefile, re-run linter
joshuasing Mar 23, 2026
64aa75b
.github/workflows: update copyright year in go.yml
joshuasing Mar 23, 2026
54cf2e0
.github/workflows: remove tss from go.yml
joshuasing Mar 23, 2026
c32f2b7
.github/workflows: add Lint job to go.yml workflow
joshuasing Mar 23, 2026
07f0c8b
fix(tss): resolve all gosec findings
marcopeereboom Mar 24, 2026
d58480c
test(tss): use pre-computed preparams fixture
marcopeereboom Mar 26, 2026
810b475
refactor(eddsa/signing): drop binance-chain/edwards25519
marcopeereboom Mar 19, 2026
3cf2c33
fix(tss): flatten all wrapped function signatures
marcopeereboom Apr 23, 2026
c23bec7
refactor(tss-lib): remove testify dependency
marcopeereboom May 7, 2026
2c47d8d
fix(tss-lib): resolve gci import ordering and staticcheck findings
marcopeereboom May 12, 2026
94574ae
fix(ecdsa/signing): eliminate data race in round 2 and 3 error slices
marcopeereboom Jun 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Copyright (c) 2024-2026 Hemi Labs, Inc.
# Use of this source code is governed by the MIT License,
# which can be found in the LICENSE file.

# GitHub Actions workflow to lint, build and test.
name: "Go"
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

concurrency:
group: "go-${{ github.workflow }}-${{ github.event.number || github.ref }}"
cancel-in-progress: "${{ github.event_name == 'pull_request' }}"

env:
# renovate: datasource=github-releases depName=golangci/golangci-lint versioning=semver
GOLANGCI_LINT_VERSION: "v2.11.3"

permissions:
contents: read

jobs:
test:
name: "Test"
runs-on: "ubuntu-latest"
timeout-minutes: 150
strategy:
fail-fast: false # if one of these fails, still run the others
matrix:
module:
- eth-trie
- merkle
- tss-lib
steps:
- name: "Checkout repository"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: "Setup Go"
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
with:
go-version-file: "${{ matrix.module }}/go.mod"

- name: "go get"
working-directory: ${{ matrix.module }}
run: go mod download && go mod verify

- name: "go test"
working-directory: ${{ matrix.module }}
run: go test -tags tssexamples -timeout 120m -v -cover ./...

lint:
name: "Lint"
runs-on: "ubuntu-latest"
strategy:
fail-fast: false
matrix:
module:
- tss-lib
steps:
- name: "Checkout repository"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: "Setup Go"
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
with:
go-version-file: "${{ matrix.module }}/go.mod"

- name: "golangci-lint"
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
with:
working-directory: "${{ matrix.module }}"
version: "${{ env.GOLANGCI_LINT_VERSION }}"

- name: "golangci-lint fmt"
working-directory: "${{ matrix.module }}"
run: golangci-lint fmt --diff ./...
10 changes: 6 additions & 4 deletions eth-trie/trie_test.go
Comment thread
joshuasing marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ import (
"github.com/hemilabs/x/eth-trie/triedb/pathdb"
)

// TestZKTrie is a basic example of how one could use the eth-trie for
// alternative data storage. It is a prototype for ZKTrie.
func TestZKTrie(t *testing.T) {
const (
blockCount uint64 = 1000000 // num of blocks
blockCount uint64 = 10 // num of blocks
// newOutsCount >= inCount + outCount
newOutsCount uint64 = 1500 // num of outs with new scripts
inCount uint64 = 1000 // num of ins
outCount uint64 = 500 // num of outs with previous scripts
newOutsCount uint64 = 10 // num of outs with new scripts
inCount uint64 = 0 // num of ins
outCount uint64 = 0 // num of outs with previous scripts
)

datadir := t.TempDir()
Expand Down
6 changes: 6 additions & 0 deletions tss-lib/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
bin/
.gocache/
pkg/
coverage.out
test.log
*.swp
74 changes: 74 additions & 0 deletions tss-lib/.golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
version: "2"
run:
tests: true

issues:
max-issues-per-linter: 0
max-same-issues: 0

linters:
enable:
- "asasalint" # Check for pass []any as any in variadic func(...any).
- "dupword" # Checks for duplicate words in the source code.
- "errcheck" # Checks for unchecked errors.
- "errorlint" # Verifies errors are properly wrapped.
- "errname" # Checks that sentinel errors are prefixed with the Err.
- "gocheckcompilerdirectives" # Checks that go compiler directives are valid.
- "gochecksumtype" # Run exhaustiveness checks on Go "sum types".
- "gomoddirectives" # Manages 'replace', 'retract' and 'excludes' directives.
- "gosmopolitan" # Report certain i18n/l10n anti-patterns.
- "govet" # Runs go vet.
- "ineffassign" # Detects when assignments to variables are not used.
- "makezero" # Finds slice declarations with non-zero initial length.
- "misspell" # Finds common typing mistakes.
- "nilerr" # Finds code that returns nil even if it checks error is not nil.
- "nolintlint" # Reports ill-formed or insufficient nolint directives.
- "prealloc" # Finds slice declarations that could be pre-allocated.
- "predeclared" # Find code that shadows predeclared identifiers.
- "staticcheck" # Runs staticcheck.
- "unconvert" # Checks for unnecessary type conversions.
- "usestdlibvars" # Detects the possibility to use stdlib vars/constants.
- "usetesting" # Reports use of functions with replacements in testing.
- "unused" # Checks for unused constants, variables, functions, types.
- "whitespace" # Checks for unnecessary newlines.
settings:
gomoddirectives:
replace-local: true # tss-lib fork not yet pushed.
nolintlint:
require-explanation: true
exclusions:
generated: "strict"
presets:
- "comments"
- "common-false-positives"
- "legacy"
- "std-error-handling"
rules:
- linters: [ "staticcheck" ]
text: "QF1001:" # "could apply De Morgan's law"
- linters: [ "staticcheck" ]
text: "QF1007:" # "could merge conditional assignment"
- linters: [ "staticcheck" ]
text: "SA1019:.*elliptic\\." # tss-lib requires raw curve arithmetic (Add, ScalarMult, etc.)
- linters: [ "staticcheck" ]
text: "SA1019:.*\\.Add has been deprecated" # elliptic.Curve.Add
- linters: [ "staticcheck" ]
text: "SA1019:.*\\.ScalarMult has been deprecated" # elliptic.Curve.ScalarMult
- linters: [ "staticcheck" ]
text: "SA1019:.*\\.ScalarBaseMult has been deprecated" # elliptic.Curve.ScalarBaseMult
- linters: [ "staticcheck" ]
text: "SA1019:.*\\.IsOnCurve has been deprecated" # elliptic.Curve.IsOnCurve

formatters:
enable:
- "gci" # Enforces package import order.
- "gofumpt" # Extended go fmt.
settings:
gci:
sections:
- "standard"
- "default"
- "blank"
- "dot"
- "localmodule"
custom-order: true
1 change: 1 addition & 0 deletions tss-lib/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
MIT License

Copyright (c) 2019 Binance
Copyright (c) 2026 Hemi Labs, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
86 changes: 51 additions & 35 deletions tss-lib/Makefile
Original file line number Diff line number Diff line change
@@ -1,48 +1,64 @@
MODULE = github.com/bnb-chain/tss-lib/v2
PACKAGES = $(shell go list ./... | grep -v '/vendor/')
# Copyright (c) 2026 Hemi Labs, Inc.
# Use of this source code is governed by the MIT License,
# which can be found in the LICENSE file.

all: protob test
PROJECTPATH = $(abspath $(dir $(realpath $(firstword $(MAKEFILE_LIST)))))

########################################
### Protocol Buffers
export GOBIN=$(PROJECTPATH)/bin
export GOCACHE=$(PROJECTPATH)/.gocache
export GOPKG=$(PROJECTPATH)/pkg

protob:
@echo "--> Building Protocol Buffers"
@for protocol in message signature ecdsa-keygen ecdsa-signing ecdsa-resharing eddsa-keygen eddsa-signing eddsa-resharing; do \
echo "Generating $$protocol.pb.go" ; \
protoc --go_out=. ./protob/$$protocol.proto ; \
done
# renovate: datasource=github-releases depName=golangci/golangci-lint versioning=semver
GOLANGCI_LINT_VERSION="v2.11.3"
# renovate: datasource=github-releases depName=joshuasing/golicenser versioning=semver
GOLICENSER_VERSION="v0.3.1"
# renovate: datasource=github-releases depName=mvdan/gofumpt versioning=semver
GOFUMPT_VERSION="v0.9.2"

build: protob
go fmt ./...
cmds = \
tss-ecdsa-demo \
tss-eddsa-demo \

########################################
### Testing
.PHONY: all clean deps go-deps $(cmds) build lint lint-deps tidy race test vulncheck vulncheck-deps

test_unit:
@echo "--> Running Unit Tests"
@echo "!!! WARNING: This will take a long time :)"
go clean -testcache
go test -timeout 60m $(PACKAGES)
all: tidy build lint test

test_unit_race:
@echo "--> Running Unit Tests (with Race Detection)"
@echo "!!! WARNING: This will take a long time :)"
go clean -testcache
go test -timeout 60m -race $(PACKAGES)
clean:
rm -rf $(GOBIN) $(GOCACHE) $(GOPKG)

test:
make test_unit
deps: lint-deps vulncheck-deps go-deps

go-deps:
go mod download
go mod tidy
go mod verify

$(cmds):
go build -trimpath -ldflags "$(GO_LDFLAGS)" -o $(GOBIN)/$@ ./cmd/$@

build:
go build ./...

########################################
### Pre Commit
lint:
$(shell go env GOPATH)/bin/golangci-lint fmt ./...
$(shell go env GOPATH)/bin/golangci-lint run --fix ./...

pre_commit: build test
lint-deps:
@echo "Installing with $(shell go env GOVERSION)"
GOBIN=$(shell go env GOPATH)/bin go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)
GOBIN=$(shell go env GOPATH)/bin go install mvdan.cc/gofumpt@$(GOFUMPT_VERSION)

########################################
tidy:
go mod tidy

race:
go test -v -race -timeout 60m ./...

test:
go test -timeout 30m -coverprofile=$(PROJECTPATH)/coverage.out -covermode=atomic ./...

# To avoid unintended conflicts with file names, always add to .PHONY
# # unless there is a reason not to.
# # https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html
.PHONY: protob build test_unit test_unit_race test
vulncheck:
$(shell go env GOPATH)/bin/govulncheck ./...

vulncheck-deps:
GOBIN=$(shell go env GOPATH)/bin go install golang.org/x/vuln/cmd/govulncheck@latest
Loading
Loading