Hub funding protocol
Whatever is the underlying implementation (shared address or wallet or something else), the funding protocol will work more or less in the same way.
Imagine a scenario where one client wants to send some assets to another client without possessing the required bytes for creating the transaction. We have the following actors:
Client A with a private address (#A) where some assets are stored.
Client B with a private address (#B) used for asset exchanges
Exchange Hub 1 with a public address (#1).
Client A has one only choice: using an exchange hub to fuel its transaction. A must find a hub, whose list can be possibly included in the code or through a discovery service. From each hub A receives an address richly endowed with bytes to include in its wallet.
When A wants to send some assets to B, it creates a transaction setting as paying address the one received from the hub and asks the hub for a quote (an exchange rate to estimate the final price). The fee at this point is not final yet. 16 Client Hub Final acceptance and signature Accepts the fee (adds an output) and signs Preliminary acceptance and fee proposal Proposes a transaction
The hub 1 proposes a quote which the client may accept of refuse (in that case it must find a different hub to proceed)
A adds an output to the transaction containing a transfer of assets to the hub address equivalent to the amount of bytes required by the transaction if they were converted using the hub proposed exchange rate. Then it signs it. The fee in bytes in this moment is final.
The hub verifies that the transaction is correct (size, fee, exchange rate) and, if everything is as it should be, cosigns it, validating the transaction
Last updated