You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.
I think we need to give close agreements identifiers that are separate to their iteration number. The iteration number is related to where in the history of the channel the close agreement exists. The value is an indicator of the state of the channel, from the proposer's perspective, that came prior but it doesn't provide any uniqueness. As part of the problem described in #287 it is likely that we need some way to uniquely identifier payments. This is also something @nikhilsaraf called out early that we need a unique identifier for a payment, based off what he saw in research of other payment channel designs.
Given that the close agreement is ultimately rendered as a set of transactions, I think the simplest method for constructing an identifier would be to concatenate the transaction hashes from the transaction set in a predefined order, e.g. declaration then closing, using the same hash function that Stellar uses for its transaction hashes, i.e. SHA-256. The result will be unique not only for an iteration number but for the agreement captured in the transactions that get built.
Alternatively we could construct a payload to hash off the close details, but that seems like more work with no benefits that I can see, other than we could include peripheral information like payment amount that aren't captured in the transactions.
Add a memo field to close agreements that is optional. The memo is a string with unspecified bounds. The memo is not included in the final transaction so its contents does not leak to the public ledger when the channel is closed. Subsequently the signatures for close agreements to do not cover the memo.
Payments should have memos so they can be identifiable on the terms of the participants. Participants may communicate about a payment ahead of sending a payment and the memo will provide a way to annotate or identify the payment in whatever way they require.
Note that this is similar but different to #339. #339 is concerned with uniquely identifying payments with an identifier that the state machine attaches to close agreements. That would not be useful in the situation described above where an identifier must be assigned prior to the payment being made.
This is useful for things like buffered channels, something I'm experimenting with right now for #340.
I think we need to give close agreements identifiers that are separate to their iteration number. The iteration number is related to where in the history of the channel the close agreement exists. The value is an indicator of the state of the channel, from the proposer's perspective, that came prior but it doesn't provide any uniqueness. As part of the problem described in #287 it is likely that we need some way to uniquely identifier payments. This is also something @nikhilsaraf called out early that we need a unique identifier for a payment, based off what he saw in research of other payment channel designs.
Given that the close agreement is ultimately rendered as a set of transactions, I think the simplest method for constructing an identifier would be to concatenate the transaction hashes from the transaction set in a predefined order, e.g. declaration then closing, using the same hash function that Stellar uses for its transaction hashes, i.e. SHA-256. The result will be unique not only for an iteration number but for the agreement captured in the transactions that get built.
Alternatively we could construct a payload to hash off the close details, but that seems like more work with no benefits that I can see, other than we could include peripheral information like payment amount that aren't captured in the transactions.
This will be required for #338.
Refs:
The text was updated successfully, but these errors were encountered: