Open
Description
Pointed out by @hdevalence:
If someone creates an address with a transmission key that is not a valid decaf377 encoding, sending an output to that address will crash the transaction plan's build step — validation only happens at the key agreement step, and the code .expect()s it.
Outputs to invalid transmission keys won't end up on chain because you can't construct a valid output proof to an invalid transmission key as the AddressVar
associated with a NoteVar
requires it to be a valid decaf377 element. However, transaction building shouldn't crash if one is given an invalid address, so we could either:
- Decompress the transmission key in
Address::from_components
returningNone
if it's invalid. Clean but expensive. - Add some one off validation in the Planner API. Concretely we could make
Planner::output
returnResult<&mut self>
as the swaps do, and then in that method check the transmission key is valid. It's a little messy though.
Metadata
Metadata
Assignees
Type
Projects
Status
Backlog