You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(dip-18): use type bytes 0xb0/0x80 for P2PKH/P2SH
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 <[email protected]>
@@ -89,7 +89,7 @@ All Platform addresses are encoded as:
89
89
90
90
*`<HRP>` is network-specific (see table).
91
91
*`<data-part>` contains:
92
-
* one type byte (`0x00` P2PKH, `0x01` P2SH), followed by
92
+
* one type byte (`0xb0` P2PKH, `0x80` P2SH), followed by
93
93
* 20-byte HASH160 payload encoded as 5-bit groups via bech32 rules.
94
94
95
95
The checksum MUST be calculated using the [bech32m algorithm as defined in BIP-350](https://github.com/bitcoin/bips/blob/master/bip-0350.mediawiki#bech32m).
@@ -122,8 +122,8 @@ Type byte meaning:
122
122
123
123
| Address Type | Type byte |
124
124
| -------------- | --------- |
125
-
| Platform P2PKH |`0x00`|
126
-
| Platform P2SH |`0x01`|
125
+
| Platform P2PKH |`0xb0`|
126
+
| Platform P2SH |`0x80`|
127
127
128
128
### Validation
129
129
@@ -133,7 +133,7 @@ A Platform address is valid if:
133
133
2. HRP matches expected network.
134
134
3. bech32m checksum verifies.
135
135
4. Payload decodes to exactly 21 bytes.
136
-
5.`payload[0]` is `0x00` or `0x01`.
136
+
5.`payload[0]` is `0xb0` or `0x80`.
137
137
138
138
Wallets MUST reject Platform addresses when constructing Dash Core chain scripts and SHOULD present a clear warning if a user attempts to mix layers.
139
139
@@ -144,7 +144,7 @@ Wallets MUST reject Platform addresses when constructing Dash Core chain scripts
144
144
* Wallets MUST treat HRP as the network selector.
145
145
* Software wallets SHOULD label Platform balances separately from Core chain balances and SHOULD avoid auto-pasting Platform addresses into Core chain contexts.
146
146
* Wallets SHOULD derive payloads via [DIP-17](dip-0017.md) and then encode using these rules; no alternative prefixes are allowed.
147
-
* Hardware wallets MUST validate the HRP to confirm network identity and MUST enforce the type byte (`0x00` or `0x01`). Devices MUST display a user-facing descriptor: “Dash Platform address” for P2PKH and “Dash Platform script address” for P2SH.
147
+
* Hardware wallets MUST validate the HRP to confirm network identity and MUST enforce the type byte (`0xb0` or `0x80`). Devices MUST display a user-facing descriptor: “Dash Platform address” for P2PKH and “Dash Platform script address” for P2SH.
148
148
149
149
## Rationale
150
150
@@ -171,7 +171,7 @@ function encode_platform_address(hash160, type, network):
171
171
if len(hash160) != 20:
172
172
error("invalid hash160 length")
173
173
174
-
type_byte = 0x00 if type=="p2pkh" else 0x01 if type=="p2sh" else error()
174
+
type_byte = 0xb0 if type=="p2pkh" else 0x80 if type=="p2sh" else error()
175
175
176
176
hrp = {
177
177
"mainnet": "evo",
@@ -209,9 +209,9 @@ function decode_platform_address(addr):
209
209
type_byte = payload[0]
210
210
hash160 = payload[1:21]
211
211
212
-
if type_byte == 0x00:
212
+
if type_byte == 0xb0:
213
213
addr_type = "p2pkh"
214
-
else if type_byte == 0x01:
214
+
else if type_byte == 0x80:
215
215
addr_type = "p2sh"
216
216
else:
217
217
error("unknown type byte")
@@ -243,16 +243,16 @@ The HASH160 payloads in the following tables are derived from the mnemonic and p
0 commit comments