SEP-10 / Soroban-compatible authentication patterns & examples (#260) - #285
Open
A6dulmalik wants to merge 1 commit into
Open
SEP-10 / Soroban-compatible authentication patterns & examples (#260)#285A6dulmalik wants to merge 1 commit into
A6dulmalik wants to merge 1 commit into
Conversation
…s (issue StelTade#260) - Offline SEP-10 challenge/response primitives: canonical payload construction, dual server+client ed25519 verification, validity-window checks, strkey codec with CRC16 validation - HMAC session tokens (JWT analogue) with explicit expiry - Sep10Gate integration layer: session-gated contract intents and a fee-sponsored relayer flow with client-signed intents - Replay protections at every stage (challenge nonce, intent tuples) - 14 vitest tests covering accepted/rejected auth flows and replay; tsc --noEmit strict-clean - Developer README documenting the step-by-step flow and GrantFox/ Stellar adoption guidance
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.
Closes #260
Summary
Adds
examples/sep10-auth— a dependency-light (tweetnacl only), fully offline TypeScript reference implementation of SEP-10 tailored to SwapTrade:src/sep10.ts): canonical payload construction mirroring SEP-10'smanage_datasemantics, verification of both server and client ed25519 signatures, 15-minute validity window, and a StellarG...strkey codec with CRC16-xmodem checksums.src/gating.ts): two patterns — session gate (backend relays Soroban invocations only for valid tokens, passing the verified account into the authorization entry) and fee-sponsored relayer (clients sign canonical intent payloads; relayer verifies against the claimed account)..gitignoreexcludes*.json, so the example'spackage.json/tsconfig.jsonare force-added intentionally.Acceptance criteria mapping
README.mdquick start + flow sectionsSep10Gate.authorizeWithToken/authorizeSignedIntent__tests__/Validation
npm test: 14/14 passingnpx tsc --noEmit(strict): clean