Skip to content

Commit 14e0d06

Browse files
Wizard1209claude
andcommitted
Forge tz5 / ML-DSA-44 public keys in reveals (GAP-1)
forge_public_key/unforge_public_key stopped at BLpk (tag \x03), so a tz5 reveal (which embeds an mdpk ML-DSA-44 public key) raised "Unrecognized key type: #mdpk". Add the mdpk <-> tag \x04 branch, matching the tz5 public-key-hash tag scheme. Greens the GAP-1 tests. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 92ba7e3 commit 14e0d06

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/pytezos/michelson/forge.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,8 @@ def forge_public_key(value: str) -> bytes:
248248
return b'\x02' + res
249249
elif prefix == 'BLpk':
250250
return b'\x03' + res
251+
elif prefix == 'mdpk':
252+
return b'\x04' + res
251253

252254
raise ValueError(f'Unrecognized key type: #{prefix}')
253255

@@ -263,6 +265,7 @@ def unforge_public_key(data: bytes) -> str:
263265
b'\x01': b'sppk',
264266
b'\x02': b'p2pk',
265267
b'\x03': b'BLpk',
268+
b'\x04': b'mdpk',
266269
}
267270
return base58_encode(data[1:], key_prefix[data[:1]]).decode()
268271

0 commit comments

Comments
 (0)