Skip to content

Add Stellar and Algorand signing support#1066

Open
0xh3rman wants to merge 4 commits intomainfrom
algo-stellar-sign
Open

Add Stellar and Algorand signing support#1066
0xh3rman wants to merge 4 commits intomainfrom
algo-stellar-sign

Conversation

@0xh3rman
Copy link
Copy Markdown
Collaborator

  1. common Address trait and Base32Address
  2. Add sha256_512 to gem_hash
  3. Tests against wallet core fixtures

Adds native Rust signers for Algorand and Stellar, replacing the
WalletCore-based implementations:

- gem_algorand: AlgorandAddress with Algorand checksum, AlgorandTransaction
  with Payment/AssetTransfer/AssetOptIn operations, canonical MessagePack
  serialization, TX-tagged Ed25519 signing
- gem_stellar: StellarAddress with CRC-16 XMODEM checksum, StellarTransaction
  with CreateAccount/Payment/ChangeTrust, XDR-style serialization, envelope
  signing with network passphrase
- primitives: generic Address trait (try_parse, as_bytes, encode) with
  default from_str/is_valid impls; AddressError type
- signer: shared Base32Address, ED25519_KEY_TYPE constant, InvalidInput
  extension trait for ergonomic error mapping
- gem_encoding: add encode_base32
- gemstone: wire AlgorandChainSigner and StellarChainSigner into dispatch

Test vectors from WalletCore.
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 transaction signing for the Algorand and Stellar blockchains. It introduces a common Address trait in the primitives crate, adds address parsing and validation logic for both chains, and implements the required serialization formats (MessagePack for Algorand and XDR for Stellar) to support native transfers, token transfers, and account actions. The changes also include refactoring gem_near to use shared encoding utilities and registering the new signers in the main gemstone crate. Feedback focuses on ensuring compatibility with older Rust versions by avoiding recently stabilized functions, making the Stellar network passphrase configurable for testnet support, and maintaining a clear separation between transaction-level metadata and operation-specific data.

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.

2 participants