Skip to content

Upgrade to Sigma 6.0 (EIP-50) with Prover-Evaluated Tests (Closes #250)#253

Open
a-shannon wants to merge 4 commits into
ergoplatform:developfrom
a-shannon:sigma-6.0-upgrade
Open

Upgrade to Sigma 6.0 (EIP-50) with Prover-Evaluated Tests (Closes #250)#253
a-shannon wants to merge 4 commits into
ergoplatform:developfrom
a-shannon:sigma-6.0-upgrade

Conversation

@a-shannon
Copy link
Copy Markdown

@a-shannon a-shannon commented Mar 26, 2026

Fixes #250.

Summary

Upgrades Appkit to sigma-state 6.0.2 and ergo-wallet 6.0.0 so Appkit can compile and prove Sigma 6 / EIP-50 scripts while preserving legacy v5 script behavior.

Supersedes #251.

Main Changes

  • Replaces Sigma 5 package usages with the Sigma 6 AST, data, and serialization APIs.
  • Adds blockVersion-aware ErgoScript compilation. Contexts with blockVersion >= 4 compile v6 scripts as ErgoTree v3 via VersionContext; older contexts keep the legacy path.
  • Replaces removed or fragile Iso collection conversions with explicit Scala/Java conversion helpers.
  • Adds prover-evaluated Sigma 6 feature coverage using v6 node mock parameters and input-box guard scripts.

Test Coverage

  • Sigma 6 feature tests cover bitwise and shift ops, serialize, deserializeTo, fromBigEndianBytes, startsWith, lazy getOrElse paths, Box.getReg, Header.checkPow, UnsignedBigInt / toUnsignedMod, and v5/v6 tree-version behavior.
  • Conversion coverage covers SigmaProp / ErgoTree bytes, ContextVar / ContextExtension including duplicate-id rejection, spending-proof context vars, token/register conversions through box and transaction paths, and ScalaBridge transaction conversions.
  • Focused local checks passed for the common, libImpl, and appkit suites listed in the latest PR comment.

Comment thread refactor_imports.py Outdated
Comment thread README.md Outdated
Comment thread lib-impl/src/main/java/org/ergoplatform/appkit/impl/SignedTransactionImpl.java Outdated
Comment thread lib-impl/src/main/java/org/ergoplatform/appkit/impl/SignedInputImpl.java Outdated
Comment thread lib-impl/src/main/java/org/ergoplatform/appkit/impl/ScalaBridge.scala Outdated
Comment thread docs/design-contracts/flowcards.pptx
@a-shannon a-shannon force-pushed the sigma-6.0-upgrade branch from ba38396 to 0c642fc Compare May 23, 2026 11:41
@a-shannon a-shannon force-pushed the sigma-6.0-upgrade branch from 0c642fc to 145871a Compare May 23, 2026 11:57
@a-shannon
Copy link
Copy Markdown
Author

Thanks, all requested changes should now be addressed:

  • removed refactor_imports.py
  • removed the README Sigma 6.0 section
  • reverted the unchanged PPTX
  • standardized Java/Scala conversion style
  • replaced the map entry loop with forEach
  • combined the ScalaBridge sigma.ast imports

I also re-ran the local checks and publication guard. Could you re-review when you have a chance?

@a-shannon
Copy link
Copy Markdown
Author

Thanks. I pushed a focused conversion coverage pass in 482f1e1.

Added/confirmed tests for each explicit runtime conversion family touched by #253:

  • SigmaProp/ErgoTree byte conversion, including invalid input rejection
  • ContextVar <-> ContextExtension conversion, including duplicate id failure
  • SpendingProof/SignedInput context variable conversion with real signed inputs
  • Token id/value conversions through box candidate, input, output, and signed transaction paths
  • Scala/Java bridge conversions for spending proofs, context extension values, transaction inputs/data inputs/outputs, tokens, and registers
  • v6 blockVersion/treeVersion activation and prover-evaluated Sigma 6.0 scripts via the existing Sigma60FeaturesSpec
  • token burn conversion via the existing reducer negative tests

Checks run:

  • sbt ++2.13.16 "common/testOnly org.ergoplatform.appkit.ErgoValueSpec org.ergoplatform.appkit.ErgoTreeTemplateSpec org.ergoplatform.appkit.ReducedErgoLikeTransactionSpec" "libImpl/testOnly org.ergoplatform.appkit.impl.ScalaBridgeTest" "appkit/testOnly org.ergoplatform.appkit.AddressSpec org.ergoplatform.appkit.TxBuilderSpec org.ergoplatform.appkit.ErgoAuthSpec org.ergoplatform.appkit.JavaHelpersSpec org.ergoplatform.appkit.ApiClientSpec org.ergoplatform.appkit.Sigma60FeaturesSpec org.ergoplatform.appkit.ChangeOutputSpec org.ergoplatform.appkit.AppkitProvingInterpreterSpec org.ergoplatform.appkit.MultiProveDlogSpec org.ergoplatform.appkit.MultiProveDHTSpec org.ergoplatform.appkit.DHTProverSpec" - pass
  • publication guard on staged diff and pushed range - pass

I also tried full sbt ++2.13.16 test; the focused Appkit/common/libImpl suites above pass, but the full aggregate run still includes existing generated/live-node UtxoApiTest failures and existing SecretStorageSpec file-state failures on this environment.

@a-shannon
Copy link
Copy Markdown
Author

@satsen pushed one final cleanup in 680f29c: Address.getPublicKey() now keeps the precise ProveDlog type exposed by Sigma 6, removing the remaining cast.

I also resolved the six May 23 review threads after confirming they are addressed:

  • removed refactor_imports.py
  • removed the README Sigma section
  • reverted the unchanged PPTX
  • standardized Scala/Java conversions through ScalaBridge
  • used forEach for signed-input context vars
  • combined the ScalaBridge sigma.ast imports

Focused common/libImpl/appkit release-readiness checks passed again on current head. Could you re-review when you have a chance?

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.

Update Sigma dependency to 6.0, check 6.0 features support

2 participants