Skip to content

feat: external-signer public uploads + single-chunk prepare/finalize across 15 SDKs#90

Merged
Nic-dorman merged 15 commits into
mainfrom
feat/public-data-and-chunks
May 18, 2026
Merged

feat: external-signer public uploads + single-chunk prepare/finalize across 15 SDKs#90
Nic-dorman merged 15 commits into
mainfrom
feat/public-data-and-chunks

Conversation

@Nic-dorman
Copy link
Copy Markdown
Collaborator

@Nic-dorman Nic-dorman commented May 14, 2026

Summary

Propagates two external-signer surfaces — already shipped in antd (the daemon) and antd-go via #61 — across the remaining 15 client SDKs so every binding has parity.

Public uploads (external-signer):

  • prepare_upload(path, visibility="public") + a prepare_upload_public(path) convenience wrapper that bundles the DataMap chunk into the same external-signer payment batch.
  • data_map_address field on the finalize-upload result — populated when prepare was public, this is the shareable retrieval handle for the file.
  • data_map field also surfaced on finalize (always returned by the daemon).

Single-chunk publish (external-signer):

  • POST /v1/chunks/prepare wrapper returning a new PrepareChunkResult model. Two response shapes, both supported: already_stored:true (no payment / finalize needed) and the full wave-batch payment intent.
  • POST /v1/chunks/finalize wrapper returning the stored chunk address.

15 commits, one per SDK; each commit is independently revertable.

SDKs covered

SDK Files Tests
antd-cpp 6 2 ctest suites pass
antd-csharp 5 33 xUnit pass
antd-dart 3 49 dart test pass
antd-elixir 3 66 ExUnit pass (incl. 2 stale-assertion fixes on pre-existing data_cost/file_cost tests that already expected the legacy string return)
antd-java 5 (+1 new) 44 JUnit pass
antd-js 4 56 vitest pass
antd-kotlin 5 35 JUnit pass
antd-lua 4 31 busted pass
antd-mcp 3 (+2 new) 7 pytest pass — additive at the FastMCP tool layer over antd-py
antd-php 2 (+4 new) 29 PHPUnit pass
antd-py 4 26 pytest pass
antd-ruby 3 32 minitest pass (120 assertions)
antd-rust 3 60 cargo test pass
antd-swift 5 13 swift test pass
antd-zig 4 34 zig test pass

All test counts are from a single dev2 host with the toolchain matrix described in the testbox README. Every SDK exercises the new surfaces against a mock daemon.

Test plan

  • Per-SDK mock-daemon tests cover: visibility forwarded (public), visibility omitted (preserves pre-public wire shape), explicit private; data_map_address surfaces on public finalize and is empty otherwise; prepare_chunk_upload already-stored and wave-batch branches; finalize_chunk_upload returns address and forwards body.
  • All SDKs built and tested on the shared dev2 testbox against the existing antd daemon binary (current main).
  • CI per-SDK matrix run (kicked by this PR).
  • Optional: end-to-end against a live testnet for one or two SDKs after merge — most languages don't have a full external-signer EVM harness yet, so the mock-daemon surface tests are the primary gate.

Notes

  • gRPC surfaces for the new endpoints are deferred; *GrpcClient stubs throw UnsupportedOperationException/NotSupportedException to match the existing pattern.
  • The antd-elixir commit also includes two trivial assertion-shape fixes for pre-existing data_cost/2 and file_cost/3 tests that had drifted from the current UploadCostEstimate return type — unrelated to this PR's surfaces but on the same file.
  • Built on the reference impl in feat(antd, antd-go): external-signer single-chunk publish #61 (daemon + Go client).

🤖 Generated with Claude Code

Nic-dorman and others added 15 commits May 14, 2026 18:29
Mirror the antd + antd-go reference impl for the new external-signer
surfaces in the C++ SDK:

- prepare_upload / prepare_data_upload gain an optional
  std::optional<std::string> visibility; prepare_upload_public
  is the convenience wrapper.
- FinalizeUploadResult gains data_map and data_map_address (both
  parsed from the daemon's finalize response — data_map_address
  is set when prepare was called with visibility="public").
- New PrepareChunkResult struct + prepare_chunk_upload /
  finalize_chunk_upload on both Client and AsyncClient.
- 6 doctest cases cover already-stored vs wave-batch branches,
  visibility forwarding (public / private / omitted), and
  data_map_address surfacing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add the new external-signer surfaces from the antd + antd-go
reference impl:

- Optional visibility on prepare-upload + a prepare-upload-public
  convenience wrapper.
- data_map + data_map_address fields on the finalize-upload result
  (data_map_address is populated when prepare was called with
  visibility="public" — the DataMap chunk was bundled into the same
  external-signer payment batch).
- New PrepareChunkResult model + prepare-chunk-upload /
  finalize-chunk-upload methods for the single-chunk external-signer
  publish path.
- Mock-daemon tests cover the already-stored and wave-batch branches
  of chunks/prepare plus visibility forwarding (public, private,
  omitted) and data_map_address surfacing on finalize.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add the new external-signer surfaces from the antd + antd-go
reference impl:

- Optional visibility on prepare-upload + a prepare-upload-public
  convenience wrapper.
- data_map + data_map_address fields on the finalize-upload result
  (data_map_address is populated when prepare was called with
  visibility="public" — the DataMap chunk was bundled into the same
  external-signer payment batch).
- New PrepareChunkResult model + prepare-chunk-upload /
  finalize-chunk-upload methods for the single-chunk external-signer
  publish path.
- Mock-daemon tests cover the already-stored and wave-batch branches
  of chunks/prepare plus visibility forwarding (public, private,
  omitted) and data_map_address surfacing on finalize.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add the new external-signer surfaces from the antd + antd-go
reference impl:

- Optional visibility on prepare-upload + a prepare-upload-public
  convenience wrapper.
- data_map + data_map_address fields on the finalize-upload result
  (data_map_address is populated when prepare was called with
  visibility="public" — the DataMap chunk was bundled into the same
  external-signer payment batch).
- New PrepareChunkResult model + prepare-chunk-upload /
  finalize-chunk-upload methods for the single-chunk external-signer
  publish path.
- Mock-daemon tests cover the already-stored and wave-batch branches
  of chunks/prepare plus visibility forwarding (public, private,
  omitted) and data_map_address surfacing on finalize.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add the new external-signer surfaces from the antd + antd-go
reference impl:

- Optional visibility on prepare-upload + a prepare-upload-public
  convenience wrapper.
- data_map + data_map_address fields on the finalize-upload result
  (data_map_address is populated when prepare was called with
  visibility="public" — the DataMap chunk was bundled into the same
  external-signer payment batch).
- New PrepareChunkResult model + prepare-chunk-upload /
  finalize-chunk-upload methods for the single-chunk external-signer
  publish path.
- Mock-daemon tests cover the already-stored and wave-batch branches
  of chunks/prepare plus visibility forwarding (public, private,
  omitted) and data_map_address surfacing on finalize.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add the new external-signer surfaces from the antd + antd-go
reference impl:

- Optional visibility on prepare-upload + a prepare-upload-public
  convenience wrapper.
- data_map + data_map_address fields on the finalize-upload result
  (data_map_address is populated when prepare was called with
  visibility="public" — the DataMap chunk was bundled into the same
  external-signer payment batch).
- New PrepareChunkResult model + prepare-chunk-upload /
  finalize-chunk-upload methods for the single-chunk external-signer
  publish path.
- Mock-daemon tests cover the already-stored and wave-batch branches
  of chunks/prepare plus visibility forwarding (public, private,
  omitted) and data_map_address surfacing on finalize.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add the new external-signer surfaces from the antd + antd-go
reference impl:

- Optional visibility on prepare-upload + a prepare-upload-public
  convenience wrapper.
- data_map + data_map_address fields on the finalize-upload result
  (data_map_address is populated when prepare was called with
  visibility="public" — the DataMap chunk was bundled into the same
  external-signer payment batch).
- New PrepareChunkResult model + prepare-chunk-upload /
  finalize-chunk-upload methods for the single-chunk external-signer
  publish path.
- Mock-daemon tests cover the already-stored and wave-batch branches
  of chunks/prepare plus visibility forwarding (public, private,
  omitted) and data_map_address surfacing on finalize.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add the new external-signer surfaces from the antd + antd-go
reference impl:

- Optional visibility on prepare-upload + a prepare-upload-public
  convenience wrapper.
- data_map + data_map_address fields on the finalize-upload result
  (data_map_address is populated when prepare was called with
  visibility="public" — the DataMap chunk was bundled into the same
  external-signer payment batch).
- New PrepareChunkResult model + prepare-chunk-upload /
  finalize-chunk-upload methods for the single-chunk external-signer
  publish path.
- Mock-daemon tests cover the already-stored and wave-batch branches
  of chunks/prepare plus visibility forwarding (public, private,
  omitted) and data_map_address surfacing on finalize.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add the new external-signer surfaces from the antd + antd-go
reference impl:

- Optional visibility on prepare-upload + a prepare-upload-public
  convenience wrapper.
- data_map + data_map_address fields on the finalize-upload result
  (data_map_address is populated when prepare was called with
  visibility="public" — the DataMap chunk was bundled into the same
  external-signer payment batch).
- New PrepareChunkResult model + prepare-chunk-upload /
  finalize-chunk-upload methods for the single-chunk external-signer
  publish path.
- Mock-daemon tests cover the already-stored and wave-batch branches
  of chunks/prepare plus visibility forwarding (public, private,
  omitted) and data_map_address surfacing on finalize.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add the new external-signer surfaces from the antd + antd-go
reference impl:

- Optional visibility on prepare-upload + a prepare-upload-public
  convenience wrapper.
- data_map + data_map_address fields on the finalize-upload result
  (data_map_address is populated when prepare was called with
  visibility="public" — the DataMap chunk was bundled into the same
  external-signer payment batch).
- New PrepareChunkResult model + prepare-chunk-upload /
  finalize-chunk-upload methods for the single-chunk external-signer
  publish path.
- Mock-daemon tests cover the already-stored and wave-batch branches
  of chunks/prepare plus visibility forwarding (public, private,
  omitted) and data_map_address surfacing on finalize.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add the new external-signer surfaces from the antd + antd-go
reference impl:

- Optional visibility on prepare-upload + a prepare-upload-public
  convenience wrapper.
- data_map + data_map_address fields on the finalize-upload result
  (data_map_address is populated when prepare was called with
  visibility="public" — the DataMap chunk was bundled into the same
  external-signer payment batch).
- New PrepareChunkResult model + prepare-chunk-upload /
  finalize-chunk-upload methods for the single-chunk external-signer
  publish path.
- Mock-daemon tests cover the already-stored and wave-batch branches
  of chunks/prepare plus visibility forwarding (public, private,
  omitted) and data_map_address surfacing on finalize.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add the new external-signer surfaces from the antd + antd-go
reference impl:

- Optional visibility on prepare-upload + a prepare-upload-public
  convenience wrapper.
- data_map + data_map_address fields on the finalize-upload result
  (data_map_address is populated when prepare was called with
  visibility="public" — the DataMap chunk was bundled into the same
  external-signer payment batch).
- New PrepareChunkResult model + prepare-chunk-upload /
  finalize-chunk-upload methods for the single-chunk external-signer
  publish path.
- Mock-daemon tests cover the already-stored and wave-batch branches
  of chunks/prepare plus visibility forwarding (public, private,
  omitted) and data_map_address surfacing on finalize.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add the new external-signer surfaces from the antd + antd-go
reference impl:

- Optional visibility on prepare-upload + a prepare-upload-public
  convenience wrapper.
- data_map + data_map_address fields on the finalize-upload result
  (data_map_address is populated when prepare was called with
  visibility="public" — the DataMap chunk was bundled into the same
  external-signer payment batch).
- New PrepareChunkResult model + prepare-chunk-upload /
  finalize-chunk-upload methods for the single-chunk external-signer
  publish path.
- Mock-daemon tests cover the already-stored and wave-batch branches
  of chunks/prepare plus visibility forwarding (public, private,
  omitted) and data_map_address surfacing on finalize.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add the new external-signer surfaces from the antd + antd-go
reference impl:

- Optional visibility on prepare-upload + a prepare-upload-public
  convenience wrapper.
- data_map + data_map_address fields on the finalize-upload result
  (data_map_address is populated when prepare was called with
  visibility="public" — the DataMap chunk was bundled into the same
  external-signer payment batch).
- New PrepareChunkResult model + prepare-chunk-upload /
  finalize-chunk-upload methods for the single-chunk external-signer
  publish path.
- Mock-daemon tests cover the already-stored and wave-batch branches
  of chunks/prepare plus visibility forwarding (public, private,
  omitted) and data_map_address surfacing on finalize.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add the new external-signer surfaces from the antd + antd-go
reference impl:

- Optional visibility on prepare-upload + a prepare-upload-public
  convenience wrapper.
- data_map + data_map_address fields on the finalize-upload result
  (data_map_address is populated when prepare was called with
  visibility="public" — the DataMap chunk was bundled into the same
  external-signer payment batch).
- New PrepareChunkResult model + prepare-chunk-upload /
  finalize-chunk-upload methods for the single-chunk external-signer
  publish path.
- Mock-daemon tests cover the already-stored and wave-batch branches
  of chunks/prepare plus visibility forwarding (public, private,
  omitted) and data_map_address surfacing on finalize.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Nic-dorman Nic-dorman merged commit a3cf4e4 into main May 18, 2026
3 checks passed
Nic-dorman added a commit that referenced this pull request May 19, 2026
…(V2-312) (#98)

Adds the first of 15 SDK examples for the external-signer flow added in PR #90.
Exercises both round-trips against `ant dev start --enable-evm`:

  1. Public file upload: prepare_upload_public -> approve+payForQuotes ->
     finalize_upload -> file_download_public, byte-equal assert.
  2. Single-chunk publish: prepare_chunk_upload -> approve+payForQuotes ->
     finalize_chunk_upload -> chunk_get, byte-equal assert. Includes the
     already_stored short-circuit branch.

Loads the bundled IPaymentVault.json (committed in V2-311) from
docs/abi/. Signs with anvil deterministic account #0; keys never leave the
SDK process - the daemon's only role is to hand over the PaymentIntent and
accept tx hashes on finalize.

Validated end-to-end on dev2:
  File:  4 chunks, data_map 57d41c2d..., total 0.059 antToken
  Chunk: 1 payment, addr 57060540..., round-trip OK

Adds the python adapter's `external_signer` short-name; `ant dev example
external_signer -l python` and `ant dev example all -l python` now pick it
up. Other 14 SDKs follow as separate fan-out PRs.
Nic-dorman added a commit that referenced this pull request May 21, 2026
Cuts v0.8.0 atop v0.7.1. Substantial breaking-change roll-up of the
put/get rename, the private-file PUT/GET gap close, and several minor
surface cleanups -- bundled here so the v1.0 cut can ship stable on top.

## Breaking (antd daemon)

- feat(antd)!: bind to 127.0.0.1 by default on REST and gRPC (#107).
  Previously bound 0.0.0.0; use --bind-rest / --bind-grpc to override.
- chore: remove dead graph_entry surface from antd proto + 5 SDKs (#92).
  GraphService and its 4 RPCs are gone; REST mounts dropped.
- chore: remove dir_upload_public / dir_download_public surface (#95).
  Use file_put_public on a directory path instead; the daemon recurses.
- feat(antd)!: normalize put/get convention + close private-file PUT and
  GET gaps (#115). Method renames across proto + REST + SDKs:
    data_put_private    -> data_put
    data_get_private    -> data_get
    file_upload_public  -> file_put_public
    file_download_public -> file_get_public
  New: file_put / file_get for the private file path (previously only
  the public variant existed). New typed results: DataPutResult,
  DataPutPublicResult, FilePutResult, FilePutPublicResult; PutResult
  is now annotated as chunk_put only.

## Additive

- feat(antd): honor payment_mode on gRPC put/cost paths and REST cost
  endpoints (#114). Optional kwarg threaded through every put/cost
  signature; empty/omitted maps to "auto" so older clients keep working.
- feat: external-signer public uploads + single-chunk prepare/finalize
  across 15 SDKs (#90).
- docs+spec: openapi.yaml refreshed for the v1.0 surface, including
  POST /v1/chunks/prepare and /v1/chunks/finalize for single-chunk
  external-signer publish (#126).

## SDK fan-out (PaymentMode + put/get convention, all 15)

#116 antd-go, #117 antd-py/ruby/elixir, #118 antd-rust, #119 antd-csharp,
#120 antd-java, #121 antd-swift, #122 antd-dart, #123 antd-kotlin,
#124 antd-cpp, #125 antd-js/php/zig/lua, #127 antd-mcp.

## SDK example + build fixes

- fix(antd-go): make 03-files example self-contained and runnable (#91)
- fix(examples): make 04-files runnable across cpp/rust/elixir/lua/php/ruby/zig (#93)
- fix(examples): runnable dart 04_files + java Example03Files; add java Example03Chunks (#94)
- feat: gRPC transport example for antd-py and antd-rust (#113)
- feat(antd-py): 07_external_signer example + ant-dev dispatcher entry (#98)
- feat(antd-js): 07-external-signer example + antd-py empty-payments fix (#99)
- feat(rust/go): 07-external-signer examples (#100)
- feat(antd-csharp): 07_external_signer example (#101)
- feat(antd-java): 07_external_signer example (#102)
- feat(antd-kotlin): 07_external_signer example (#103)
- feat(antd-dart): 07_external_signer example (#104)
- feat(antd-ruby): 07_external_signer example (#105)
- feat(antd-php): 07_external_signer example (#106)
- chore(antd-kotlin): drop stale GraphDescendant from local proto copy (#108)

## Docs / infra

- docs: external-signer flow reference + ABI + python smoke test (#97)
- docs: add SECURITY.md with threat model and disclosure policy (#109)
- docs!: refresh per-SDK READMEs + llms-full.txt + openapi.yaml for v1.0 surface (#126)
- ci: add Go lint + test + vuln scanning for antd-go (#112)
- ci: extend antd-rust to sibling-repo parity (fmt + clippy + audit + doc) (#111)
- ci: skip antd/openapi.yaml and llms-full.txt from triggering CI (#128)
- chore(scripts): add full-stack + integration sweep helpers (#96)
- fix(antd-rust): regenerate Cargo.lock to unbreak --locked CI (#110)

Co-Authored-By: Claude Opus 4.7 (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