Skip to content

feat: canonical Sidetree v1 protocol-parameter table + CI (closes #30)#34

Merged
LiranCohen merged 1 commit into
masterfrom
feat/protocol-params
Jun 4, 2026
Merged

feat: canonical Sidetree v1 protocol-parameter table + CI (closes #30)#34
LiranCohen merged 1 commit into
masterfrom
feat/protocol-params

Conversation

@LiranCohen

Copy link
Copy Markdown
Contributor

Summary

Closes #30. Adds params.go — the verbatim Sidetree v1 protocol parameters from the reference implementation (decentralized-identity/sidetree v1.0.6 protocol-parameters.json + Operation.ts + spec) as the single source of truth for reader enforcement and writer pre-flight. This repo previously had no constants at all, and the consensus-critical 100 no-lock op limit appeared nowhere.

Key values (all pinned by params_test.go):

  • MaxOperationsPerBatch = 10000 (hard per-anchor ceiling)
  • MaxNumberOfOperationsForNoValueTimeLock = 100 (the consensus-critical no-lock cap — ION mainnet runs lock-disabled, so every canonical anchor is ≤100 ops)
  • NormalizedFeeToPerOperationFeeMultiplier = 0.001, ValueTimeLockAmountMultiplier = 60000
  • MaxDeltaSizeInBytes=1000, MaxCASURILength=100, MaxEncodedRevealValueLength=50, MaxWriterLockIDInBytes=200
  • file caps 1MB / 1MB / 2.5MB (shared proof) / 10MB; MaxMemoryDecompressionFactor=3
  • per-block 300 txs / 600000 ops; SHA256MultihashCode=18

Subsequent PRs wire these into the reader (#28/#29 op-limit enforcement, #31/#32 size/field caps) so our resolved DID state stops diverging from canonical ION.

Also adds .github/workflows/ci.yml (gofmt + vet + build + test -race + coverage) — this repo had no CI, so this gates this and every following PR.

Testing

params_test.go pins the consensus-critical values (a deliberate-change guard). go build/vet/test -race green; additive (no behavior change yet).

Post-Deploy Monitoring & Validation

No additional operational monitoring required: pure constants + CI; no runtime behavior change until the enforcement PRs land.

🤖 Generated with Claude Code

Adds params.go with the verbatim Sidetree v1 protocol parameters from the
reference implementation (decentralized-identity/sidetree v1.0.6
protocol-parameters.json + Operation.ts + spec), the single source of truth for
reader enforcement and writer pre-flight:

  MaxOperationsPerBatch = 10000              (hard per-anchor ceiling)
  MaxNumberOfOperationsForNoValueTimeLock=100 (the consensus-critical no-lock cap)
  NormalizedFeeToPerOperationFeeMultiplier = 0.001
  ValueTimeLockAmountMultiplier = 60000
  MaxDeltaSizeInBytes=1000, MaxCASURILength=100, MaxEncodedRevealValueLength=50,
  MaxWriterLockIDInBytes=200
  file caps: core 1MB / provisional 1MB / proof 2.5MB (shared) / chunk 10MB
  MaxMemoryDecompressionFactor=3
  per-block: 300 transactions / 600000 operations
  SHA256MultihashCode=18

These were ignored entirely (no constants existed in this repo); subsequent PRs
wire them into the reader (#28/#29 op-limit, #31/#32 caps) so our resolved DID
state stops diverging from canonical ION on >100-op / oversized anchors.

Also adds .github/workflows/ci.yml (gofmt + vet + build + race tests + coverage)
— this repo had no CI. params_test.go pins the consensus-critical values so a
change to them is deliberate.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@LiranCohen LiranCohen merged commit 58a2b11 into master Jun 4, 2026
1 check passed
@LiranCohen LiranCohen deleted the feat/protocol-params branch June 4, 2026 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

P0: Add canonical Sidetree v1 protocol-parameter constant table

1 participant