Repository navigation
Conversation
mina_sdk.itn is a client for the daemon's ITN GraphQL server, with the documents of spec/itn-operations.graphql: ed25519 request signing (ItnKey), the auth handshake, sequence numbers (one request at a time, a new auth after HTTP 412) and no repeat after a transport error, as in the Rust, Go and JS SDKs. It needs the new extra `itn` (cryptography). MinaDaemonClient.execute_query runs a custom document, as the other SDKs' custom-query methods do. spec/ is mina-sdk-spec v0.1.1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E9VzXg2bJYonrX5xBfmLMr
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
This PR adds the ITN client to the Python SDK. With it, all four SDKs implement both parts of mina-sdk-spec: the daemon API and the ITN API.
mina_sdk.itnhasItnClient,ItnKey, the input types and the errors. It uses the documents ofspec/itn-operations.graphql. The protocol is the same as in Rust, Go and JS:authhandshake;authand one repeat of the request;itn, addscryptography. Without the extra,import mina_sdk.itnfails with an error that tells you to installmina-sdk[itn]. The daemon client does not need the extra.execute_query:MinaDaemonClient.execute_queryruns a custom document, as the custom-query methods of the other SDKs do.SPEC.md(v0.1.1) names it.spec/is mina-sdk-spec v0.1.1. That version ofITN.mdstill shows "–" in the Python column. Spec v0.1.2 will add the Python ITN names, and then I re-sync the four SDKs.Test plan
ruff, mypy, bandit: pass. 71 unit tests pass on Python 3.12 and 3.10.
tests/test_itn.py: a mock ITN server that verifies each signature, the UUID and the sequence number as the daemon does. It covers:As a check, I changed the client to pack the sequence number little-endian, and the tests failed.
Conformance:
tests/test_spec.pyalso checks the ITN documents againstspec/itn-operations.graphql.Live, against devnet daemon
4.0.0-6965b50withITN_FEATURES=1: the 7 tests oftests/test_itn_integration.pypass. They are the same 7 tests as in the other SDKs. TheslotsWontest accepts the GraphQL error that the daemon gives while its VRF evaluation runs, as the Go test does.🤖 Generated with Claude Code
https://claude.ai/code/session_01E9VzXg2bJYonrX5xBfmLMr