-
Notifications
You must be signed in to change notification settings - Fork 2
Add TLSNotary Support #554
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
c844ac9
prepared branch
tcsenpai 001f5e6
feat: add TLSNotary backend integration for HTTPS attestation
tcsenpai 83388f8
versioning mainly
tcsenpai c3b4b93
feat(tlsnotary): add SDK discovery endpoint and auto-key generation
tcsenpai b1a5f85
refactor(tlsnotary): replace console.* with logger and fix host resol…
tcsenpai d75004e
feat(tui): add TLSN category for TLSNotary log filtering
tcsenpai 1292c44
fix(tlsnotary): resolve FFI pointer type errors in ffi.ts
tcsenpai e10e065
fix(tui): add TLSN and CMD to ALL_CATEGORIES for buffer initialization
tcsenpai c449f4d
feat(tui): add TLSNotary status display to TUI header
tcsenpai d71aeeb
fix(omniprotocol): switch from @noble/ed25519 to node-forge for Ed25519
tcsenpai fe49e0d
fix(omniprotocol): route hello_peer via NODE_CALL to manageHelloPeer
tcsenpai 7e6fe39
feat(tlsnotary): add debug and fatal modes for better debugging
tcsenpai 23bf461
feat(tlsnotary): add TCP proxy mode for debugging incoming data
tcsenpai 492f792
feat(tlsnotary): implement dynamic wstcp proxy manager for TLS attest…
tcsenpai ac7f655
feat(tlsnotary): add token manager + fix proxy spawn error handling
tcsenpai 7e217b8
fixed tlsnotary server config
tcsenpai c6d8f81
added wstcp for tlsn
tcsenpai 77538bf
managed tlsnotary server docker and logs
tcsenpai bc7a4dc
updated issues
tcsenpai bff37bb
integrated tlsnotary
tcsenpai 47b7666
improved code quality
tcsenpai c1e67ee
fix: address PR #554 review concerns
tcsenpai 16343e8
fix: address PR #554 CodeRabbit review round 2 feedback
tcsenpai 4bb9a15
beads issues
tcsenpai e5fd15e
fix: cast nativePayload in default case to avoid TS never narrowing
tcsenpai 4465190
fix(portAllocator): use module-level import and handle close errors
tcsenpai fb7e08a
fix(ffi): retain strong references to buffers passed to native code
tcsenpai 50c7d5f
fix(install-deps): add prerequisite checks and idempotency
tcsenpai 8070324
fix(tlsnotary): calculate proof byte size correctly for fee computation
tcsenpai 3e3b3f8
fix(gcr): normalize TLSNotary records for deterministic hashing
tcsenpai 05e1ea3
fix(omniprotocol): validate request.params is array before access
tcsenpai 7c5c970
fix(tlsnotary): remove duplicate token creation from handleNativeOper…
tcsenpai 0a1fa15
fix(tlsnotary): throw error on invalid URL for deterministic rejection
tcsenpai 2af85c0
fix(tlsnotary): refactor isPortAvailable for robust cleanup
tcsenpai a73c91b
fix(tlsnotary): stop server before destroying handle in destroy()
tcsenpai a67133d
fix(omniprotocol): clear buffer on oversized payload detection
tcsenpai d35ff49
fix(tlsnotary): use crypto.randomUUID for secure proxy IDs
tcsenpai 28a16d6
fix(tlsnotary): use wss:// for HTTPS origins to prevent mixed-content
tcsenpai bce535f
fix(tlsnotary): track and close debug proxy server on shutdown
tcsenpai 2f0ea12
fix(tui): add eraseLine before TLSNotary status to prevent stale chars
tcsenpai a3d7206
fix(tlsnotary): throw errors instead of break for tlsn_store validation
tcsenpai efba6d0
fix(tlsnotary): use string type for proofTimestamp to prevent bigint …
tcsenpai 6732278
fix(tlsnotary): dynamically determine WebSocket scheme in getInfo
tcsenpai 863bf8c
fix(tui): use dynamic tab lookup instead of hardcoded indices
tcsenpai 3b20a48
fix(tlsnotary): properly await proxy server close and listen
tcsenpai d88e2db
fix(tlsnotary): use try/finally in destroy to always reset serverRunning
tcsenpai cae8f8f
fix(tlsnotary): add timeout to isPortAvailable to prevent hanging
tcsenpai 5deced6
updated sdk version
tcsenpai 2c1c812
fix(tlsnotary): map proxy errors to appropriate HTTP status codes
tcsenpai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 0.42.0 | ||
| 0.43.0 |
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| # TLSNotary Backend Integration Context | ||
|
|
||
| ## Beads Tracking | ||
|
|
||
| - **Epic**: `node-6lo` - TLSNotary Backend Integration | ||
| - **Tasks** (in dependency order): | ||
| 1. `node-3yq` - Copy pre-built .so library (READY) | ||
| 2. `node-ebc` - Create FFI bindings | ||
| 3. `node-r72` - Create TLSNotaryService | ||
| 4. `node-9kw` - Create Fastify routes | ||
| 5. `node-mwm` - Create feature entry point | ||
| 6. `node-2fw` - Integrate with node startup | ||
| 7. `node-hgf` - Add SDK discovery endpoint | ||
| 8. `node-8sq` - Type check and lint | ||
|
|
||
| ## Reference Code Locations | ||
|
|
||
| ### Pre-built Binary | ||
| ``` | ||
| /home/tcsenpai/tlsn/demos_tlsnotary/node/rust/target/release/libtlsn_notary.so | ||
|
tcsenpai marked this conversation as resolved.
|
||
| ``` | ||
| Target: `libs/tlsn/libtlsn_notary.so` | ||
|
|
||
| ### FFI Reference Implementation | ||
| ``` | ||
| /home/tcsenpai/tlsn/demos_tlsnotary/node/ts/TLSNotary.ts | ||
| ``` | ||
| Complete working bun:ffi bindings to adapt for `src/features/tlsnotary/ffi.ts` | ||
|
|
||
| ### Demo App Reference | ||
| ``` | ||
| /home/tcsenpai/tlsn/demos_tlsnotary/demo/src/app.tsx | ||
| ``` | ||
| Browser-side attestation flow with tlsn-js WASM | ||
|
|
||
| ### Integration Documentation | ||
| ``` | ||
| /home/tcsenpai/tlsn/demos_tlsnotary/BACKEND_INTEGRATION.md | ||
| /home/tcsenpai/tlsn/demos_tlsnotary/INTEGRATION.md | ||
| ``` | ||
|
|
||
| ## FFI Symbols (from reference TLSNotary.ts) | ||
|
|
||
| ```typescript | ||
| const symbols = { | ||
| tlsn_init: { args: [], returns: FFIType.i32 }, | ||
| tlsn_notary_create: { args: [FFIType.ptr], returns: FFIType.ptr }, | ||
| tlsn_notary_start_server: { args: [FFIType.ptr, FFIType.u16], returns: FFIType.i32 }, | ||
| tlsn_notary_stop_server: { args: [FFIType.ptr], returns: FFIType.i32 }, | ||
| tlsn_verify_attestation: { args: [FFIType.ptr, FFIType.u64], returns: FFIType.ptr }, | ||
| tlsn_notary_get_public_key: { args: [FFIType.ptr, FFIType.ptr, FFIType.u64], returns: FFIType.i32 }, | ||
| tlsn_notary_destroy: { args: [FFIType.ptr], returns: FFIType.void }, | ||
| tlsn_free_verification_result: { args: [FFIType.ptr], returns: FFIType.void }, | ||
| tlsn_free_string: { args: [FFIType.ptr], returns: FFIType.void }, | ||
| }; | ||
| ``` | ||
|
|
||
| ## FFI Struct Layouts | ||
|
|
||
| ### NotaryConfig (40 bytes) | ||
| - signing_key ptr (8 bytes) | ||
| - signing_key_len (8 bytes) | ||
| - max_sent_data (8 bytes) | ||
| - max_recv_data (8 bytes) | ||
| - server_port (2 bytes + padding) | ||
|
|
||
| ### VerificationResultFFI (40 bytes) | ||
| - status (4 bytes + 4 padding) | ||
| - server_name ptr (8 bytes) | ||
| - connection_time (8 bytes) | ||
| - sent_len (4 bytes) | ||
| - recv_len (4 bytes) | ||
| - error_message ptr (8 bytes) | ||
|
|
||
| ## SDK Integration (Already Complete) | ||
|
|
||
| Package `@kynesyslabs/demosdk` v2.7.2 has `tlsnotary/` module with: | ||
| - TLSNotary class: initialize(), attest(), verify(), getTranscript() | ||
| - Located in `/home/tcsenpai/kynesys/sdks/src/tlsnotary/` | ||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| #!/usr/bin/env bash | ||
| set -e | ||
| set -u | ||
| set -o pipefail | ||
|
|
||
| # Verify prerequisites | ||
| command -v bun >/dev/null 2>&1 || { echo "Error: bun is not installed" >&2; exit 1; } | ||
| command -v cargo >/dev/null 2>&1 || { echo "Error: cargo is not installed" >&2; exit 1; } | ||
|
|
||
| bun install | ||
| bun pm trust --all || true | ||
|
|
||
| # Install wstcp only if not already present | ||
| if ! command -v wstcp >/dev/null 2>&1; then | ||
| echo "Installing wstcp..." | ||
| cargo install wstcp | ||
| else | ||
| echo "wstcp already installed, skipping" | ||
| fi | ||
|
|
||
| echo "All dependencies have been installed" | ||
|
|
||
|
tcsenpai marked this conversation as resolved.
|
||
Binary file not shown.
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.