nuts-foundation / nuts-foundation/nuts-node

Consider removing ES256K (secp256k1) support

Open
#4,399 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
28
Forks
23
Avg merge
1d 10h
Merged PRs (30d)
76

Description

Summary

Consider dropping ES256K (secp256k1) support, which is gated behind the jwx_es256k build tag. It appears unused, is not built into the default binary, and carries maintenance cost.

Why

  • Opt-in only, likely unused. ES256K is only compiled when building with -tags jwx_es256k (see Makefile build target and crypto/jwx/jwx_es256k.go). The default binary does not include it. No known deployment enables it.
  • Untested / rotted. CI only builds with the tag, it never runs tests with it, so crypto/jwx/jwx_es256k_test.go has silently rotted:
    • it lives in package jwx but calls ParseJWT, which is in package crypto (would be an import cycle),
    • it passes the wrong number of arguments to ParseJWT,
    • it signs with a P-256 key (test.GenerateECKey()) for a secp256k1 algorithm.
      The test file has therefore not compiled for a long time and nobody noticed.
  • Maintenance cost. It's an extra code path that the jwx v2→v3 migration (#4383 / PR #4391) had to fix separately precisely because it's excluded from the normal build/test, so it's easy to miss.

Options

  1. Remove ES256K support entirely: delete crypto/jwx/jwx_es256k.go + _test.go, drop the jwx_es256k build tag from the Makefile, and remove the es256k/secp256k1 branches in vdr/didkey/resolver.go and the related test cases in vcr/credential, vcr/pe, vdr/didkey.
  2. Keep it but make it real: run the tagged tests in CI and fix the rotted test, so it can't silently break again.

Recommendation

Remove it (option 1) unless someone identifies an active consumer. secp256k1 is niche for did:web/IAM (our active focus), and an untested, build-tag-gated code path is a liability.

Context

Surfaced during the jwx v2→v3 migration (PR #4391): the jwa.ES256K constant→function change was missed initially because the file is excluded from the default build. The build is now fixed; the tagged test remains broken and was left as-is pending this decision.

Assisted by AI

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by checking crypto/jwx/jwx_es256k.go and crypto/jwx/jwx_es256k_test.go, then inspect the Makefile build target and the ES256K-related branches and tests in vdr/didkey/resolver.go, vcr/credential, and vcr/pe. Confirm whether any active consumer requires the tagged path; done means either removing the path and its build-tag references with the relevant tests updated, or making tagged CI tests compile and run.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cryptography
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.