Skip to content

Feat/81 offline stellar signing#108

Merged
truthixify merged 3 commits into
wraith-protocol:developfrom
Hollujay:feat/81-offline-stellar-signing
Jun 27, 2026
Merged

Feat/81 offline stellar signing#108
truthixify merged 3 commits into
wraith-protocol:developfrom
Hollujay:feat/81-offline-stellar-signing

Conversation

@Hollujay

Copy link
Copy Markdown
Contributor

Closes #81

PR Summary

Offline Signing Workflow for Stellar

Adds three functions for cold-signing Stellar stealth payments:

  • prepareOfflineStellarTransaction — builds an unsigned transaction envelope offline, returns a serializable OfflineStellarEnvelope with XDR, network passphrase, and hash
  • signOfflineStellarTransaction — signs an envelope with either a Stellar secret key (S...) or a stealth private scalar (bigint + stealthPubKey for the signature hint)
  • submitOfflineStellarTransaction — POSTs the signed XDR to Horizon via getDeployment

New Files

File Description
src/chains/stellar/offline-sign.ts 3 exported functions + OfflineSignParams / OfflineStellarEnvelope types
test/chains/stellar/offline-sign.test.ts 11 unit tests (no mocks, real Keypair)
docs/offline-signing.md Cold-signing workflow guide with stealth address compat and security best practices

Changes to Existing Files

  • src/chains/stellar/index.ts — re-exports the new module
  • src/chains/stellar/stealth.ts — removes duplicate computeAnnouncementViewTag declaration (pre-existing bug fix)
  • .prettierignore — adds announcements.ts (pre-existing syntax error)

Test Coverage

  • Valid envelope fields (transactionXdr, networkPassphrase, hash)
  • Input validation (empty source, ops, sequence, passphrase)
  • Regular secret key signing
  • Stealth scalar + stealthPubKey signing (full deriveStealthKeysgenerateStealthAddressderiveStealthPrivateScalarsignOfflineStellarTransaction flow)
  • Missing stealthPubKey error
  • Invalid envelope error
  • submitOfflineStellarTransaction existence as separate async function
  • End-to-end: prepare → sign → parse → verify ops and signatures.

Hollujay added 2 commits June 26, 2026 12:55
…ctions (wraith-protocol#81)

Add prepareOfflineStellarTransaction, signOfflineStellarTransaction, and
submitOfflineStellarTransaction for cold-signing Stellar stealth payments.

Three exported functions:
- prepareOfflineStellarTransaction - build unsigned envelope offline
- signOfflineStellarTransaction - sign with secret key or stealth scalar
- submitOfflineStellarTransaction - POST signed XDR to Horizon

Includes 11 unit tests covering: valid envelope construction, input
validation, regular key signing, stealth scalar + stealthPubKey signing,
and full end-to-end prepare -> sign -> verify flow.

Also fixes a pre-existing duplicate computeAnnouncementViewTag declaration
in stealth.ts, adds announcements.ts to .prettierignore for the pre-existing
syntax error, and adds docs/offline-signing.md documenting the cold-signing
workflow with security best practices.
@drips-wave

drips-wave Bot commented Jun 26, 2026

Copy link
Copy Markdown

@Hollujay Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@truthixify

Copy link
Copy Markdown
Contributor

Almost there. After #99 just landed, conflicts in .prettierignore and src/chains/stellar/index.ts.

git fetch origin
git rebase origin/develop
# .prettierignore: keep both sets of entries
# index.ts: keep develop's sdk-react exports, then add your offline-sign export
git add -u
git rebase --continue
git push --force-with-lease

@Hollujay Hollujay force-pushed the feat/81-offline-stellar-signing branch from 281eaae to db7a1e2 Compare June 27, 2026 08:34
@Hollujay

Copy link
Copy Markdown
Contributor Author

@truthixify Rebased on develop and force pushed. Conflicts resolved

@truthixify

Copy link
Copy Markdown
Contributor

Clean merge after rebase. 211-line offline-sign + 231-line tests + 244-line docs. Hardware-wallet / cold-storage workflow is exactly what was asked. Thanks @Hollujay.

@truthixify truthixify merged commit b321c0c into wraith-protocol:develop Jun 27, 2026
0 of 5 checks passed
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.

Stellar offline transaction signing helper

2 participants