|
2 | 2 |
|
3 | 3 | ## Overview |
4 | 4 |
|
5 | | -The TAP (Timeline Aggregation Protocol) facilitates a series of payments from a sender to a receiver, who aggregates these payments into a single payment. This aggregate payment can then be verified on-chain by a payment verifier, reducing the number of transactions and simplifying the payment process. |
| 5 | +The TAP (Timeline Aggregation Protocol) facilitates a series of payments from a |
| 6 | +sender to a receiver (TAP Receipts), who aggregates these payments into a single |
| 7 | +payment (a Receipt Aggregate Voucher, or RAV). This aggregate payment can then be |
| 8 | +verified on-chain by a payment verifier, reducing the number of transactions and |
| 9 | +simplifying the payment process. |
6 | 10 |
|
7 | 11 | ## Key Components |
8 | 12 |
|
9 | 13 | - **Sender:** Initiates the payment. |
10 | 14 | - **Receiver:** Receives the payment. |
11 | 15 | - **Signers:** Multiple signers authorized by the sender to sign receipts. |
12 | | -- **State Channel:** A one-way channel opened by the sender with the receiver for sending receipts. |
| 16 | +- **State Channel:** A one-way channel opened by the sender with the receiver |
| 17 | +for sending receipts. |
13 | 18 | - **Receipt:** A record of payment sent by the sender to the receiver. |
14 | | -- **ReceiptAggregateVoucher (RAV):** A signed message containing the aggregate value of the receipts. |
15 | | -- **tap_aggregator:** An entity managed by the sender that signs RAV requests. |
16 | | -- **EscrowAccount:** An account created in the blockchain to hold funds for the sender-receiver pair. |
| 19 | +- **ReceiptAggregateVoucher (RAV):** A signed message containing the aggregate |
| 20 | +value of the receipts. |
| 21 | +- **tap_aggregator:** A service managed by the sender that aggregates receipts |
| 22 | +on the receiver's request into a signed RAV. |
| 23 | +- **EscrowAccount:** An account created in the blockchain to hold funds for |
| 24 | +the sender-receiver pair. |
17 | 25 |
|
18 | 26 | ## Security Measures |
19 | 27 |
|
20 | | -- The protocol uses asymmetric cryptography to sign and verify messages, ensuring the integrity of receipts and RAVs. |
| 28 | +- The protocol uses asymmetric cryptography (ECDSA secp256k1) to sign and |
| 29 | +verify messages, ensuring the integrity of receipts and RAVs. |
21 | 30 |
|
22 | 31 | ## Process |
23 | 32 |
|
24 | | -1. **Opening a State Channel:** A state channel is opened via a blockchain contract, creating an EscrowAccount for the sender-receiver pair. |
25 | | -2. **Sending Receipts:** The sender sends receipts to the receiver through the state channel. |
26 | | -3. **Storing Receipts:** The receiver stores the receipts and tracks the aggregate payment. |
27 | | -4. **Creating a RAV Request:** A RAV request consists of a list of receipts and, optionally, the previous RAV. |
28 | | -5. **Signing the RAV:** The receiver sends the RAV request to the tap_aggregator, which signs it into a RAV. |
29 | | -6. **Tracking Aggregate Value:** The receiver tracks the aggregate value and new receipts since the last RAV. |
30 | | -7. **Requesting a New RAV:** The receiver sends new receipts and the last RAV to the tap_aggregator for a new RAV. |
31 | | -8. **Closing the State Channel:** When the allocation period ends, the receiver can send the last RAV to the blockchain and receive payment from the EscrowAccount. |
| 33 | +1. **Opening a State Channel:** A state channel is opened via a blockchain |
| 34 | +contract, creating an EscrowAccount for the sender-receiver pair. |
| 35 | +2. **Sending Receipts:** The sender sends receipts to the receiver through the |
| 36 | +state channel. |
| 37 | +3. **Storing Receipts:** The receiver stores the receipts and tracks the |
| 38 | +aggregate payment. |
| 39 | +4. **Creating a RAV Request:** A RAV request consists of a list of receipts and, |
| 40 | +optionally, the previous RAV. |
| 41 | +5. **Signing the RAV:** The receiver sends the RAV request to the tap_aggregator, |
| 42 | +which signs it into a new RAV. |
| 43 | +6. **Tracking Aggregate Value:** The receiver tracks the aggregate value and |
| 44 | +new receipts since the last RAV. |
| 45 | +7. **Requesting a New RAV:** The receiver sends new receipts and the last RAV |
| 46 | +to the tap_aggregator for a new RAV. |
| 47 | +8. **Closing the State Channel:** When the allocation period ends, the receiver |
| 48 | +can send the last RAV to the blockchain and receive payment from the EscrowAccount. |
32 | 49 |
|
33 | 50 | ## Performance Considerations |
34 | 51 |
|
35 | | -- The primary performance limitations are the time required to verify receipts and network limitations for sending requests to the tap_aggregator. |
| 52 | +- The primary performance limitations are the time required to verify receipts |
| 53 | +and network limitations for sending requests to the tap_aggregator. |
36 | 54 |
|
37 | 55 | ## Use Cases |
38 | 56 |
|
39 | | -- The TAP protocol is suitable for systems with sequential operations that are too expensive to redeem individually on-chain. By aggregating operations and redeeming them in one transaction, costs can be reduced. |
| 57 | +- The TAP protocol is suitable for systems with sequential operations that are |
| 58 | +too expensive to redeem individually on-chain. By aggregating operations |
| 59 | +off-chain and redeeming them in one transaction, costs are drastically reduced. |
40 | 60 |
|
41 | 61 | ## Compatibility |
42 | 62 |
|
43 | | -- The current implementation is for EVM-compatible blockchains, with most of the system being off-chain. |
| 63 | +- The current implementation is for EVM-compatible blockchains, with most of the |
| 64 | +system being off-chain. |
44 | 65 |
|
45 | 66 | ## Contributing |
46 | 67 |
|
47 | | -Contributions are welcome! Please submit a pull request or open an issue to discuss potential changes. |
| 68 | +Contributions are welcome! Please submit a pull request or open an issue to |
| 69 | +discuss potential changes. |
48 | 70 | Also, make sure to follow the [Contributing Guide](CONTRIBUTING.md). |
0 commit comments