Implement UniFFI proc-macro FFI bindings for uts-core#67
Draft
Copilot wants to merge 3 commits intofeat/uniffifrom
Draft
Implement UniFFI proc-macro FFI bindings for uts-core#67Copilot wants to merge 3 commits intofeat/uniffifrom
Copilot wants to merge 3 commits intofeat/uniffifrom
Conversation
- Replace stub code with complete UniFFI proc-macro based FFI bindings - Add error types (UtsError with flat_error for clean FFI) - Add FFI enums: DigestOp, Attestation (with Bitcoin, EAS, Pending, Unknown variants) - Add FFI record: DigestHeader - Add DetachedTimestamp object with decode/encode/inspect/purge methods - Add utility functions: uts_execute_op, uts_validate_pending_uri, uts_digest_output_size, uts_opcode_name, uts_magic_bytes - Add 20 tests covering decode, encode, round-trip, attestation parsing, opcode execution, URI validation, and builder integration Co-authored-by: lightsing <15951701+lightsing@users.noreply.github.com>
…st module Co-authored-by: lightsing <15951701+lightsing@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add uniffi wrapper for uts-core FFI binding
Implement UniFFI proc-macro FFI bindings for uts-core
Mar 18, 2026
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.
Completes the
uts-ffi-bindingcrate with UniFFI proc-macro bindings, replacing the stub implementation. Exposes the core timestamp codec, attestation types, and opcode execution to foreign languages (Python, Kotlin, Swift).FFI surface
Derived from analyzing the common API surface across the TS/Python/Go/Rust SDKs:
DetachedTimestamp: opaque handle wrappingVersionedProof<DetachedTimestamp>behindRwLockfor thread-safe mutationnew(data)constructor (decode from OTS bytes)encode(),header(),attestations(),is_finalized(),display(),purge_pending()Attestation(Bitcoin/Eas/EasTimestamped/Pending/Unknown),DigestOp(Sha1/Ripemd160/Sha256/Keccak256)DigestHeader(kind + digest bytes)UtsErroras#[uniffi(flat_error)]with DecodeError/EncodeError/InvalidOperationuts_execute_op,uts_validate_pending_uri,uts_digest_output_size,uts_opcode_name,uts_magic_bytesUsage
Pure proc-macro flavor — no UDL files, no
build.rs:Changes
crates/ffi-binding/Cargo.toml— addedthiserrordep,sha2dev-dep,"lib"crate-type for testingcrates/ffi-binding/src/lib.rs— full rewrite with UniFFI proc-macro annotations, type conversions between core and FFI-safe types, 20 unit tests💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.