Skip to content

Conversation

@thephez
Copy link
Collaborator

@thephez thephez commented Jan 20, 2026

  • Change type bytes to 0xb0 (P2PKH) and 0x80 (P2SH) for visually distinct prefixes:
    • P2PKH addresses start with k (e.g., evo1k...)
    • P2SH addresses start with s (e.g., evo1s...)
  • Update test vectors and reference implementation

Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com

Summary by CodeRabbit

  • Documentation

    • Address encoding specification updated with new type-byte scheme, expanded "Type byte meaning" table, visual-address-pattern examples, reserved type-byte ranges, and guidance for hardware displays.
  • Tests

    • Address test vectors and payload examples updated for mainnet and testnet to reflect revised type-byte values.
  • Other

    • Hardware wallet address validation and display guidance updated; added a type-byte calculation utility reference.

✏️ Tip: You can customize this high-level summary in your review settings.

Change type bytes to produce distinct address prefixes:
- P2PKH: 0xb0 -> addresses start with "k"
- P2SH: 0x80 -> addresses start with "s"

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@coderabbitai
Copy link

coderabbitai bot commented Jan 20, 2026

📝 Walkthrough

Walkthrough

Updated Dash address type-byte encoding from 0x00/0x01 to 0xb0/0x80 across spec and implementation; adjusted bech32 mappings, test vectors, payload construction, validation rules, hardware-wallet guidance, and added a type-byte calculation utility script.

Changes

Cohort / File(s) Summary
Specification Documentation
dip-0018.md
Replaced type-byte references 0x00/0x01 with 0xb0/0x80 throughout; updated payload construction, bech32m handling, validation checks, first-character/type table, reserved ranges, examples, test vectors, and hardware wallet display guidance.
Bech32 Implementation
dip-0018/bech32.py
Updated TYPE_TO_BYTE mapping (p2pkh: 0x000xb0, p2sh: 0x010x80) and regenerated BYTE_TO_TYPE mapping and test expectations accordingly.
Type-byte Tooling
dip-0018/type_byte_calc.py
Added new helper script with CHARSET, convertbits, find_type_byte_for_char, and show_encoding_for_type_byte to search and display type-bytes that produce desired first bech32 characters; includes demonstration output.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: introducing distinct type byte prefixes (0xb0 for P2PKH and 0x80 for P2SH) to enable visually distinct address formats.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@thephez
Copy link
Collaborator Author

thephez commented Jan 20, 2026

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Jan 20, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

…anges

- Explain why type byte values were chosen
- Add reserved type byte ranges to prevent future collisions
- Add type_byte_calc.py utility for finding type bytes that map to desired characters
@thephez
Copy link
Collaborator Author

thephez commented Jan 20, 2026

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Jan 20, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@thephez thephez marked this pull request as ready for review January 21, 2026 16:12
@thephez thephez merged commit e58bdf3 into dashpay:feat/dip17 Jan 21, 2026
2 checks passed
@thephez thephez deleted the feat/dip17-type-byte branch January 21, 2026 16:26
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.

1 participant