Skip to content

Add iris-ffi: native uniffi bindings, API-parallel to iris-wasm#26

Open
thomas-kroes wants to merge 4 commits into
mainfrom
feat/mobile-2
Open

Add iris-ffi: native uniffi bindings, API-parallel to iris-wasm#26
thomas-kroes wants to merge 4 commits into
mainfrom
feat/mobile-2

Conversation

@thomas-kroes

Copy link
Copy Markdown
Contributor

New crates/iris-ffi for the iris-mobile (consumed via uniffi-bindgen-react-native; see iris-mobile docs/MOBILE_STRATEGY.md §3):

  • Mirrors the iris-wasm surface actually used by the extension/mobile TS layer (~30 functions + PrivateKey/TxBuilder/SpendBuilder/GrpcClient objects). Complex types cross as JSON strings — the workspace tsify is in JSON mode, so JS sees byte-identical shapes to the wasm boundary.
  • GrpcClient implements gRPC-web unary over HTTPS (reqwest + rustls), matching the protocol rpc.nockbox.org actually speaks; framing and trailer parsing unit-tested. Plain-gRPC remains possible later via the existing tonic client without changing the FFI surface.
  • 17 unit tests pin the same golden vectors as iris-crypto's tests and iris-mobile's jest suite (the cross-runtime parity gate), including the atom<->belts round-trip that is broken in published iris-wasm 0.2.0.

Workspace tests: 71 passing. Deferred items documented in the README (TxBuilder.spend/allSpends, private-api, pagination).

claude and others added 4 commits June 11, 2026 10:58
New crates/iris-ffi for the iris-mobile React Native app (consumed via
uniffi-bindgen-react-native; see iris-mobile docs/MOBILE_STRATEGY.md §3):

- Mirrors the iris-wasm surface actually used by the extension/mobile TS
  layer (~30 functions + PrivateKey/TxBuilder/SpendBuilder/GrpcClient
  objects). Complex types cross as JSON strings — the workspace tsify is
  in JSON mode, so JS sees byte-identical shapes to the wasm boundary.
- GrpcClient implements gRPC-web unary over HTTPS (reqwest + rustls),
  matching the protocol rpc.nockbox.org actually speaks; framing and
  trailer parsing unit-tested. Plain-gRPC remains possible later via the
  existing tonic client without changing the FFI surface.
- 17 unit tests pin the same golden vectors as iris-crypto's tests and
  iris-mobile's jest suite (the cross-runtime parity gate), including the
  atom<->belts round-trip that is broken in published iris-wasm 0.2.0.

Workspace tests: 71 passing. Deferred items documented in the README
(TxBuilder.spend/allSpends, private-api, pagination).

https://claude.ai/code/session_0117mqP3av4v5y2Wsj2J4zvB
Live transport tests (grpcurl + tonic + the shim, 2026-06-12) showed both
rpc.nockbox.org and nockchain-api.zorp.io accept plain gRPC over HTTP/2 +
TLS — the 'gRPC-web only' assumption was outdated. Simplifications:

- iris-ffi GrpcClient now uses tonic's generated NockchainServiceClient
  directly (per-call connect, same FFI surface, same pb-JSON response
  shapes); the hand-rolled gRPC-web framing module is deleted
- reqwest dependency dropped from iris-ffi
- iris-grpc-proto native tonic dep gains tls + tls-webpki-roots, enabling
  the existing PublicNockchainGrpcClient against https endpoints too

14 iris-ffi tests passing (frame-parsing tests removed with the shim).

https://claude.ai/code/session_0117mqP3av4v5y2Wsj2J4zvB
Hermes invokes UBRN exports on a small pthread stack; Cheetah signing,
SLIP-10 derivation, Noun hashing, and tx building overflowed the guard
region in TestFlight builds. Centralize offloading in crypto_stack and
wrap all high-risk synchronous FFI exports.

Co-authored-by: Cursor <cursoragent@cursor.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.

2 participants