From ccea59bbefd4df4dc0ecf86d43f74c0580f60730 Mon Sep 17 00:00:00 2001 From: Marcos Date: Thu, 21 Nov 2024 11:09:56 -0300 Subject: [PATCH] RSKIP455: PowPeg migration to multiple outputs --- IPs/RSKIP455.md | 72 +++++++++++++++++++++++++++++++++++++++++++------ README.md | 1 + 2 files changed, 65 insertions(+), 8 deletions(-) diff --git a/IPs/RSKIP455.md b/IPs/RSKIP455.md index 83d605bc..fe1723be 100644 --- a/IPs/RSKIP455.md +++ b/IPs/RSKIP455.md @@ -1,11 +1,67 @@ --- rskip: 455 -title: +title: PowPeg migration to multiple outputs +created: 20-NOV-24 +author: MI +purpose: Usa +layer: Core +complexity: 1 +status: Draft description: -status: -purpose: -author: -layer: -complexity: -created: 2024/10/28 ---- \ No newline at end of file +--- + +|RSKIP |455 | +| :------------ |:-------------| +|**Title** |PowPeg migration to multiple outputs | +|**Created** |20-NOV-24 | +|**Author** |MI | +|**Purpose** |Usa | +|**Layer** |Core | +|**Complexity** |1 | +|**Status** |Draft | + +## Abstract + +Ensure that after a PowPeg composition change the Bridge is still able to process peg-out requests without delays. To do so, update the PowPeg composition change process so that migration transactions include multiple outputs to the new PowPeg address. + +## Motivation + +When a PowPeg composition change process is executed, all funds are migrated to the new PowPeg address. This is done by creating a transaction that includes up to 50 UTXOs [1] as inputs and a single output to the new PowPeg address. This causes the Bridge to have a small number of UTXOs available after a migration, producing possible delays in processing peg-out requests. + +## Specification + +Update the process of creating the migration transaction to include multiple outputs to the new PowPeg address, ensuring that the Bridge has enough UTXOs available to operate normally. + +### How many outputs + +The Bridge contract creates a single peg-out transaction every 360 Rootstock blocks, this transaction includes all the peg-out requests sent during that period [2]. Under current network conditions, this is approximately every 3 hours. + +After a peg-out transaction is created it requires 4,000 Rootstock blocks to be confirmed and signed, approximately 33 hours. Once the transaction is broadcasted it requires 100 Bitcoin confirmations for the change UTXO to be registered in the Bridge, approximately 16 hours. Adding these values, we can estimate that after a UTXO is spent in a peg-out transaction it will take approximately 49 hours for the change UTXO to be available in the Bridge to be used for other peg-out transactions. + +Considering one peg-out transaction created every 3 hours, in a 49 hour period the Bridge creates approximately 17 peg-out transactions. Estimating 2 inputs per peg-out, the Bridge requires at least 34 UTXOs to function normally and prevent delays in peg-out processing times. + +The proposal is that migration transactions include **50 outputs** to new PowPeg address, to ensure availability for the Bridge to process peg-out requests in time. + +### Restrictions + +If at the time of the PowPeg composition change there are more than 50 UTXOs available in the Bridge, then multiple migration transactions will be created as specified in RSKIP294 [1]. In this case, the first migration transaction should include the 50 UTXOs with the highest value and 50 outputs to the new PowPeg address. Remaining migration transaction should include a single output. + +## Rationale + +### Additional cost + +Considering a typical transaction output for a P2SH address is 32 bytes, including 50 outputs in a migration transaction adds 1,600 bytes to the transaction size. The cost will vary depending on the network fees at the moment the transaction is created. + +## Backward Compatibility + +This change is a hard fork and therefore all full nodes must be updated. + +## References + +[1] [RSKIP294](https://github.com/rsksmart/RSKIPs/blob/master/IPs/RSKIP294.md): Limit the number of inputs to include in a migration transaction + +[2] [RSKIP271](https://github.com/rsksmart/RSKIPs/blob/master/IPs/RSKIP271.md): Bridge peg-out Batching + +### Copyright + +Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). diff --git a/README.md b/README.md index c7ce8b2b..a116755a 100644 --- a/README.md +++ b/README.md @@ -238,6 +238,7 @@ You can find an easily browseable version of this information [here](https://ips | 446 |[Transient storage opcodes](IPs/RSKIP446.md)| 12-AUG-24 | AE | Usa | Core | 2 | Draft| | 453 |[Prevent address creation on failed CREATE/CREATE2 operations](IPs/RSKIP453.md)| 09-OCT-24 | AS | Usa | Core | 1 | Draft| | 454 |[Support bitcoin blocks with chain work up to 32 unsigned bytes](IPs/RSKIP454.md)| 25-Oct-24 | NC | Sca | Core | 1 | Draft | +| 455 |[PowPeg migration to multiple outputs](IPs/RSKIP455.md)| 20-NOV-24 | MI | Usa | Core | 1 | Draft| (*) Under evaluation to be implemented in the next reference client release