Skip to content

docs: Add Type ID generation and data encoding to LSP1 Notification Type IDs#1333

Open
emmet-bot wants to merge 1 commit intomainfrom
docs/type-ids-improvements
Open

docs: Add Type ID generation and data encoding to LSP1 Notification Type IDs#1333
emmet-bot wants to merge 1 commit intomainfrom
docs/type-ids-improvements

Conversation

@emmet-bot
Copy link
Contributor

Summary

Follow-up to #1332 based on review feedback from @CJ42.

Changes

Type ID generation explanation

  • Added top-level section explaining how Type IDs are computed: keccak256("TypeName")
  • Added TypeID generation row to every type ID table showing the keccak256 call
  • Includes Solidity and JavaScript examples for verification

Data encoding documentation

For each type ID, added a Data encoding section showing the exact abi.encode parameters from the source contracts:

  • LSP0: Empty bytes for ValueReceived; (previousOwner, newOwner) for ownership transfers
  • LSP7: (operator, from, to, amount, data) for sender/recipient; (tokenOwner, allowance, operatorNotificationData) for operator
  • LSP8: Same pattern as LSP7 but with bytes32 tokenId instead of uint256 amount; operator includes bool authorized flag
  • LSP9: Same patterns as LSP0
  • LSP14: Same ownership patterns
  • LSP26: Uses abi.encodePacked(address) (20 bytes) — noted as different from standard abi.encode

Renamed page

  • "Universal Receiver Type IDs" → "LSP1 Notification Type IDs" (both sidebar and title)
  • ⚠️ Pending Fabian's confirmation on this rename — see Discord discussion

All data encoding was verified against the lsp-smart-contracts source code.

- Add 'How Type IDs are generated' section explaining keccak256(name)
- Add 'TypeID generation' row to each type ID table
- Add 'Data encoding' section for each type ID showing abi.encode params
- Note LSP26 uses abi.encodePacked (20 bytes) vs abi.encode (32 bytes)
- Rename page title and sidebar: 'Universal Receiver Type IDs' -> 'LSP1 Notification Type IDs'

Follow-up to PR #1332 based on review from @CJ42.
@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

Deployed with Cloudflare Pages ☁️ 🚀 🆗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant