Send only the required data in (P)SWAPs based on payback visibility (public/private)
- Ngôn ngữ chính
- Rust
- Star
- 132
- Fork
- 167
- Merge trung bình
- 1 ngày 23 giờ
- Pull request đã merge (30 ngày)
- 110
Mô tả
Alternative Title: Avoid leakage of (P)SWAP creator/target account id on private paybacks
On both Swap and PSwap in the case of public paybacks the consumer needs to be able to create the public `P2ID` note that (currently) goes to the Swap creator, for that purpose he needs the pre-image of the recipient, information that wouldn't have been necessary if the payback was private because with simply the hash it would've been enough.
The way in which we solve it is that the creator of the swap embeds the `creator_account_id` in the storage of the swap script so that when the consumer executes it they can use that data to compute the recipient. But for the case of private payback this data is not only unnecessary but also reveals information about the target of the swap. In current scenarios that information is revealed anyway because the target of the swap is always the creator but in the future it could be possible that a swap creator may want to receive funds in another account, so in that scenario a private payback would make it impossible for anyone else to know what the target account is. The proposed fix is to put in the storage of the (P)SWAP script the `target_account_id` (currently `creator_account_id` in PSwap) only in case of a public payback, and in a private payback we don't reveal that information.
Given that this change applies for both Swap and PSwap we should also consider unifying the behavior of both, but this is more cumbersome than the current issue and it may require its own separate issue, it's worth considering though as both scripts have behavior in common and there could potentially be only one of them.
Hướng dẫn đóng góp
Đánh giá
Issue này chưa được đánh giá.