Time-Lock Puzzles allow one to hide a message in a cryptographic puzzle that can only be solved after performing an operation
The repository includes two Time-Lock Puzzle implementations.
The first implementation is the Time-Lock Puzzle construction which was introduced by Rivest et al. in "Time-Lock Puzzles and Timed-Release Crypto". Using this scheme, one can hide a message in a puzzle which is recoverable after time
The second implementation is the Linearly Homomorphic Time Lock Puzzle construction that was introduced by Malavolta et al. in "Homomorphic Time-Lock Puzzles and Applications". This scheme is special in that it allows for the combination of multiple puzzles into one puzzle which, once solved, reveals the sum of the individual puzzles that were combined.
Note that the code was written for educational purposes only. The project wasn't audited and shouldn't be used in production.
git clone <url>
cd <name>
go run ./cmd/tlp
go test ./...
GOOS=js GOARCH=wasm go build -o ./frontend/src/assets/main.wasm cmd/wasm/main.go
cd frontend
npm install
npm run dev
- http://localhost:5173
go run <package-path>
go build [<package-path>]
go test [<package-path>][/...] [-v] [-parellel <number>]
go test -bench=. [<package-path>] [-count <number>] [-benchmem] [-benchtime 2s] [-memprofile <name>]
go test -cover [<package-path>]
go test -race [<package-path>] [-count <number>]
go test -shuffle on [<package-path>]
go test -cover
go test -coverprofile <name> [<package-path>]
go test -run FuncName/RunName
go tool cover -html <name>
go tool cover -func <name>
go tool pprof -list <name> <profile-name>
go fmt [<package-path>]
go vet [<package-path>]
go clean [<package-path>]
go help <command-name>
go mod init [<module-path>]
go mod tidy
go mod vendor
go mod download
go work init [<module-path-1> [<module-path-2>] [...]]
go work use [<module-path-1> [<module-path-2>] [...]]
go work sync
# Adjust dependencies in `go.mod`.
go get <package-path>[@<version>]
go get <package-path>@none
# Build and install commands.
go install <package-path>[@<version>]
go list -m [all]
# Has to be run only once.
cp "$(go env GOROOT)/misc/wasm/wasm_exec.js" ./frontend/src/assets
# Run from project's root directory.
GOOS=js GOARCH=wasm go build -o ./frontend/src/assets/main.wasm cmd/wasm/main.go