desk/xe/encoding.py still sorts multisig keyset keys without lowercasing — the XE-0474 fix reached the DAO copy only, so the desk copy hashes a mixed-case multisig_open differently from the ledger
Report
Component: xeprotocol/desk @ ab9df7f — desk/xe/encoding.py:178 in marshal_block_canonical. Fixed counterpart: xeprotocol/dao @ 2efbfee — dao/xe/encoding.py:185.
Summary
XE-0474 (awarded, Minor) established that the Python xe package sorted multisig keyset keys as raw strings while the Go ledger lowercases every key before sorting (normalizeBlockHex), so a mixed-case keyset hashes differently in Python than on the ledger. The fix has since landed in the dao repo's copy; the desk repo's copy still sorts the raw spellings at its current HEAD, so the desk copy still attests a block hash no node accepts for such a keyset.
Mechanism
Desk copy, desk/xe/encoding.py:178:
keys = sorted(b.keyset["keys"])
DAO copy, dao/xe/encoding.py:182-185 (the XE-0474 fix, with its comment):
# The ledger lowercases hex before it sorts (normalizeBlockHex), so a mixed-case keyset must sort the
# same way here or the hash differs from the node's (XE-0474). Other hex fields decode to the same
# bytes whatever their case.
keys = sorted(k.lower() for k in b.keyset["keys"])
With keys F0… and e1…, the raw string sort puts F0… first (F < e); the ledger's lowercased sort puts e1… first (e < f). The canonical bytes — and therefore the block hash — differ.
Impact
The bound XE-0474 conceded still applies: nodes normalise their own emissions, so there is no consensus break and no victim account; what remains is a cross-implementation verification split on an accepted block type. Any tooling or check built on the desk repo's Python copy (the copy ships in the desk repo and is exercised by its wire tests, tests/test_xe_wire.py, which imports hash_block) computes a multisig_open/multisig_update hash the ledger rejects when the keyset arrives spelled with mixed case, e.g. from hand-built or foreign JSON; a multisig opened through that path cannot be created. The programme's invariant (audit assumptions §7.3 #17, cited by XE-0474) requires canonical encoding to round-trip byte-identically through the Go, TS and Python implementations.
Reproduction
Executed locally against both HEADs — one multisig_open block, keyset {"keys": ["F0"*32, "e1"*32], "threshold": 1}:
dao copy hash_block: fe93f3ff94b17cc3d6cb757992d438c29917c87120a7e5efd230383e9dea0af5
desk copy hash_block: 859f4386a5e6663f0e7b5295e253b63f502fb16cc4b53e92c43ab540900fbdcd
-> DIFFER
Distinctness
Searches run: q=lowercase (51 hits), q=keyset, q=encoding. XE-0474 is the only ticket on this mechanism; its body covers both copies "as shipped" at be43d38/32fd760, when the two files were byte-identical, and it is awarded/closed against that state. At the current HEADs the copies have diverged and only the dao copy carries the fix — the same residual shape as XE-3533 (a fix that reached one vendored copy only), filed and accepted as a new ticket. XE-2426 (mixed-case duplicate keys in the Go sys.dao_keyset verification) is a different component and mechanism.
Thread
Thanks. This is the same finding as an earlier report that is not public, which was filed first; the programme pays the first verifiable submission, so this one closes as a duplicate. If you believe it is a different bug, file a new report that links https://bounty.xe.network/XE-9596 and says what differs; it is read like any other.