feat: merkle batch payment external signer support - #18
Merged
Nic-dorman merged 1 commit intoApr 6, 2026
Conversation
…all SDKs
Extends the two-phase upload (prepare/finalize) flow to support merkle
batch payments for large files (>= 64 chunks). The daemon now auto-selects
between wave_batch and merkle based on chunk count, returning a
payment_type discriminator in the prepare response.
Daemon (antd):
- PrepareUploadResponse gains payment_type field ("wave_batch" | "merkle")
- Merkle responses include depth, pool_commitments, merkle_payment_timestamp,
and merkle_payments_address for the payForMerkleTree() contract call
- FinalizeUploadRequest accepts either tx_hashes (wave) or winner_pool_hash (merkle)
- Handler validates request fields match the stored payment variant
- 6 unit tests for serialization/deserialization of both variants
- Updated ant-core to include merged PR #12, evmlib bumped to 0.8.0
All 16 SDK language bindings updated:
- Go, Python, JS/TS, Rust, C#, C++, Java, Kotlin, Swift, Ruby, Dart,
Lua, Elixir, MCP — new types, updated prepare parsing, finalize_merkle_upload
method, backward-compat default (payment_type defaults to wave_batch)
- Tests added for Go (4), Python (3), JS/TS (6), Rust (3), C# (3),
C++ (4), Java (3), Ruby (3), Lua (3), Elixir (7)
Docs: openapi.yaml, llms.txt, llms-full.txt, skill.md updated with
both payment variants and new finalize_merkle_upload flow.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
wave_batchandmerklebased on chunk count, returning apayment_typediscriminator in the prepare responsefinalize_merkle_uploadmethod, and backward compatibilityDaemon changes
PrepareUploadResponsegainspayment_typefield ("wave_batch"|"merkle")depth,pool_commitments,merkle_payment_timestamp,merkle_payments_addressFinalizeUploadRequestaccepts eithertx_hashes(wave) orwinner_pool_hash(merkle)SDK changes (all 16 languages)
PoolCommitmentEntry,CandidateNodeEntryPrepareUploadResultwith merkle fieldsfinalize_merkle_uploadmethodpayment_typedefaults to"wave_batch"when absentTests added
Go (4), Python (3), JS/TS (6), Rust (3), C# (3), C++ (4), Java (3), Ruby (3), Lua (3), Elixir (7)
Test plan
cargo test— 6/6 daemon tests passgo test ./...— 43/43 Go SDK tests passpytest— 17/17 Python tests passnpm test— 44/44 JS/TS tests passcargo test --lib— 53/53 Rust SDK tests passdotnet test— 24/24 C# tests pass./gradlew test— Java tests passruby test/test_client.rb— 24/24 Ruby tests pass🤖 Generated with Claude Code