Open jharveyb opened 6 months ago
Just to clarify: would the negotiation process happen before the transaction is actually sent on chain?
Do you mean negotiation for the specific asset IDs sent?
Re-reading the original sketch, I think there were no provisions for negotiating at all (like an allow/denylist of specific assetIDs in a group). Before the transfer, the sender just needs the invoice (no different than addresses right now).
Spinoff of #291.
Invoices are an extension of our existing address format, that include an expiry time. Using invoices requires more interaction with a hashmail courier service than addresses, but they allow for receiving a balance of a grouped asset.
From an invoice, we can compute a unique ID. This commits to most invoice fields, but excludes
asset.AssetCommitmentKey()
so that any member of an asset group could satisfy an invoice.To send a grouped asset, the sender needs to communicates a
LeafMap
to the receiver. This provides the missing information to compute the on-chain output for the transfer.With an invoice, we can compute a unique ID. The sender can use the ID + information from the asset transfer inputs to upload a leaf map to a hashmail courier. The receiver polls the hashmail courier, and once they fetch the leaf map they can reconstruct the on-chain output for the send.
Specifically, on the sender side:
For the receiver: