Context
STELLAR_GATEWAY_PUBLIC (src/config.rs) and merchant_id/addresses are accepted as raw strings. A typo in the gateway key silently produces unpayable intents; invalid input is never rejected.
Tasks
- Add strkey validation (correct
G... prefix, length, base32 + CRC16 checksum) — via the stellar-strkey crate or a small local validator.
- Reject startup if
STELLAR_GATEWAY_PUBLIC is set but invalid.
- Validate any user-supplied Stellar addresses at the API boundary.
Acceptance criteria
- Invalid gateway key fails fast at boot with a clear error.
- Unit tests cover valid and corrupted strkeys.
Context
STELLAR_GATEWAY_PUBLIC(src/config.rs) andmerchant_id/addresses are accepted as raw strings. A typo in the gateway key silently produces unpayable intents; invalid input is never rejected.Tasks
G...prefix, length, base32 + CRC16 checksum) — via thestellar-strkeycrate or a small local validator.STELLAR_GATEWAY_PUBLICis set but invalid.Acceptance criteria