Skip to content

docs(world-id): fix on-chain action hash to use field-reduced value - #191

Merged
soamdesai-tfh merged 5 commits into
mainfrom
docs-audit/world-id-onchain-hash-fix
Sep 23, 2026
Merged

soamdesai-tfh merged 5 commits into
mainfrom
docs-audit/world-id-onchain-hash-fix

Conversation

@soamdesai-tfh

@soamdesai-tfh soamdesai-tfh commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Fix invalid on-chain action hash.

  • world-id/idkit/onchain-verification.mdx: use hash_to_field(action) instead of raw keccak256(action) in the verify() mapping. Warn that an unreduced hash can exceed the BN254 field and revert with PublicInputNotInField; below-field raw hashes still differ from the proof's field-reduced action.

- world-id/idkit/onchain-verification.mdx: change the minimal-mapping guidance for computing verify()/verifyAndExecute() args from raw action = keccak256(action) to the field-reduced action = hash_to_field(action) (keccak256(action) >> 8), and add a warning that a raw hash exceeds the BN254 scalar field and reverts with PublicInputNotInField
@mintlify

mintlify Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
world 🟢 Ready View Preview Sep 23, 2026, 10:06 PM

💡 Tip: Enable Automations to automatically generate PRs for you.

@soamdesai-tfh

Copy link
Copy Markdown
Contributor Author

Follow-up style pass: tightened the wording added in the earlier commit (the action mapping bullet and the new Warning callout) to match the terse, declarative tone used elsewhere in this doc. No technical content changed — same field-reduction, same PublicInputNotInField failure mode, same values.

- action mapping: hash_to_field(utf8(action)) over the UTF-8 bytes of the
  top-level action string, matching how IDKit builds the proof's action
- warning: give the Solidity form, uint256(keccak256(bytes(action))) >> 8
@soamdesai-tfh
soamdesai-tfh merged commit 964ecb3 into main Sep 23, 2026
9 checks passed
@soamdesai-tfh
soamdesai-tfh deleted the docs-audit/world-id-onchain-hash-fix branch September 23, 2026 23:48

This branch was successfully deployed

1 active deployment
staging — 79654aa6 Deployed Sep 23, 2026 by mintlify[bot]
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.

2 participants