OpenZeppelin / OpenZeppelin/compact-contracts
crypto: document domain-tag position and arity rule
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 55
- Forks
- 29
- Avg merge
- 5d 7h
- Merged PRs (30d)
- 25
Description
Domain-separation tags sit in three different slots across the library, and no note states which is the rule:
- tag-first:
ElGamal.secretToScalar,ForwarderPrivate._calculateParentCommitment - tag-last:
ShieldedAccessControl.computeRoleCommitment/computeNullifier/computeAccountId,ZOwnablePK._computeOwnerCommitment, everyUtils.expandRandomnesscaller - tag-second:
ConfidentialFungibleToken._credit
Latent, not exploitable today. A tag-last derivation of the same arity has the shape of expandRandomness(seed, tag), so its tag can be supplied through the seed slot — secretToScalar moved to tag-first for exactly this reason (H-01, #818), and a module copying the ShieldedAccessControl shape for a private derivation would not know that.
Add one note, in Utils or a crypto/ conventions block, fixing the position library-wide (tag-first, matching ElGamal) plus the arity guidance. Existing call sites can migrate in their own PRs.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Inspect the Utils area and any crypto conventions block, then compare the listed call sites such as ElGamal.secretToScalar and Utils.expandRandomness callers. Add one note stating the tag-first convention and the arity guidance, without migrating existing call sites; done means the rule and its rationale are documented clearly.
Written by the indexing model from the issue text.
Assessment
- Domain
- cryptography, documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 76/100