Skip to content

Add native TON transaction signing in Rust#1080

Open
0xh3rman wants to merge 8 commits intomainfrom
ton-signing
Open

Add native TON transaction signing in Rust#1080
0xh3rman wants to merge 8 commits intomainfrom
ton-signing

Conversation

@0xh3rman
Copy link
Copy Markdown
Collaborator

@0xh3rman 0xh3rman commented Apr 15, 2026

  • Replaces Trust Wallet Core for TON signing.
  • Adds a Bag-of-Cells implementation (cells/header/raw_cell/indexed_cell/builder/reader/writer)
  • WalletV4R2 transaction assembly, and wires sign_transfer / sign_token_transfer / sign_swap / sign_data on TonChainSigner.
  • Includes parity vectors against the wallet-core deploy test and Android transfer/jetton vectors.

Tests

  • Send TON
  • Send USDT (Jetton)
  • Swap TON <> USDT (stonfi provider)
  • Swap TON -> BSC USDT (near)
  • WalletConnect sign data / send message (ston.fi)

Replaces Trust Wallet Core for TON signing. Adds a Bag-of-Cells
implementation (cells/header/raw_cell/indexed_cell/builder/reader/writer),
WalletV4R2 transaction assembly, and wires sign_transfer / sign_token_transfer
/ sign_swap / sign_data on TonChainSigner. Includes parity vectors against
the wallet-core deploy test and Android transfer/jetton vectors.
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements TON transaction signing by adding a 'Bag of Cells' (BoC) implementation and refactoring the Address struct to use internal byte storage. It also updates gem_encoding with new base64 utilities. TonChainSigner now supports signing for transfers, token transfers, swaps, and generic data. Feedback recommends optimizing the cell indexing algorithm for better performance and removing a redundant string allocation in the fee parsing logic.

Comment thread crates/gem_ton/src/signer/cells/indexed_cell.rs
Comment thread crates/gem_ton/src/signer/transaction/signing.rs Outdated
Use BigInt::to_biguint() directly instead of parsing a stringified
BigInt. Negative values now error explicitly instead of failing the
decimal parse.
@0xh3rman 0xh3rman marked this pull request as draft April 15, 2026 13:28
@0xh3rman 0xh3rman marked this pull request as ready for review April 17, 2026 13:14
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.

1 participant