Skip to content

Register GroupElement.expUnsigned in the method descriptor table#874

Open
mwaddip wants to merge 1 commit into
ergoplatform:developfrom
mwaddip:fix/group-element-expunsigned-deser
Open

Register GroupElement.expUnsigned in the method descriptor table#874
mwaddip wants to merge 1 commit into
ergoplatform:developfrom
mwaddip:fix/group-element-expunsigned-deser

Conversation

@mwaddip

@mwaddip mwaddip commented Jun 3, 2026

Copy link
Copy Markdown

GroupElement.expUnsigned (method id 6, v6/V3) had a descriptor and an eval fn but was never added to SGroupElement's METHOD_DESC. So SMethod::from_ids rejected it with UnknownMethodId(6, 7) — any ErgoTree calling expUnsigned failed to deserialize, while sigma-state parses + evaluates it. A crafted tree using it is accepted by a JVM node and rejected by a sigma-rust node — a consensus divergence.

Fix: add EXPONENTIATE_UNSIGNED_METHOD_DESC to METHOD_DESC (V3-gated via its existing min_version). exponentiate/multiply stay out — they serialize as dedicated ops, not method calls.

Verified against the v6 spec vectors: G^1→G, G^0/G^order→identity, all now parse + eval. Adds a from_ids regression test.

GroupElement.expUnsigned (method id 6, v6 / ErgoTreeVersion::V3) had a
descriptor and an eval fn, but was never added to SGroupElement's METHOD_DESC
registry. So ErgoTree deserialization (SMethod::from_ids) rejected it with
UnknownMethodId(6, 7): any tree calling expUnsigned failed to parse, while the
JVM (sigma-state) parses and evaluates it. That is a consensus divergence — a
crafted tree using expUnsigned is accepted by a JVM node and rejected by a
sigma-rust node.

Add EXPONENTIATE_UNSIGNED_METHOD_DESC to METHOD_DESC (V3-gated via its existing
min_version). exponentiate/multiply stay out: they serialize as dedicated
Exponentiate/MultiplyGroup ops, not method calls.

Verified against the blessed v6 vectors (GroupElement.expUnsigned): G^1 -> G,
G^0 -> identity, G^order -> identity all now parse + evaluate (cost 999),
matching sigma-state. Adds a from_ids regression test.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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