Hello,
Together with Nicolas Vescovo and Ramses Fernandez-Valencia, we have created a new draft RSKIP Peg-out efficiency improvement (Segwit).
The purpose of the proposal is the introduction of Segwit V0 for use in peg-ins and peg-outs to improve performance, cost reductions, and security.
You can find the text of the RSKIP for details here:
2 Likes
An implementation of this RSKIP has been completed and proposed to be included in the upcoming Reed network upgrade of rskj.
Code changes are open for review
master ← segwit_compatible_powpeg_integration
opened 07:24PM - 04 Jun 25 UTC
Implementation of [RSKIP305](https://github.com/rsksmart/RSKIPs/blob/master/IPs/… RSKIP305.md)
## Description
Create a new federation type that is segwit-compatible according to [BIP141](https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki) specification. Signatures are now inserted in the witness script instead of the scriptSig.
## Motivation and Context
This allows for the PowPeg to have up to 20 members max, and a significant reduction in pegout transactions fees (> 60%)
## How Has This Been Tested?
Unit tests have been included in the PR. Functional testing will be executed before merging to master
## Types of changes
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
## Checklist:
- [x] My code follows the code style of this project.
- [x] My change requires a change to the documentation.
- [x] I have updated the documentation accordingly.
- [x] Tests for the changes have been added (for bug fixes / features)
- [x] Requires Activation Code (Hard Fork)
* **Other information**:
`fed:segwit_compatible_powpeg_integration`
`rit:disable-tbd-800`
master ← segwit_compatible_powpeg_integration
opened 02:36PM - 09 May 25 UTC
Related to https://github.com/rsksmart/rskj/pull/3165. Changes required to imple… ment [RSKIP305](https://github.com/rsksmart/RSKIPs/blob/master/IPs/RSKIP305.md)
## Description
- Consider new segwit-compatible Federation type in FederationProviderFromFederatorSupport class
- No need to remove signatures from segwit-compatible pegout transactions before getting the unsigned transaction hash, signatures are no longer part of the transaction so they don't affect the hash calculation
## Motivation and Context
Be compatible with rskj changes to support segwit-compatible federations
## How Has This Been Tested?
Unit tests have been included in the PR. Functional testing will be executed before merging to master
## Types of changes
- [ ] Bug fix (non-breaking change which fixes an issue)
- [X] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
## Checklist:
- [X] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [X] Tests for the changes have been added (for bug fixes / features)
- [X] Requires Activation Code (Hard Fork)
* **Other information**:
`rskj:segwit_compatible_powpeg_integration`
`rit:disable-tbd-800`
1 Like
I would also like to share the result of some tests executed with the code shared above.
We can see that with this new proposal, even after increasing the amount of members in the PowPeg to 20, peg-out transactions are still at least 40% cheaper.
1 Like
Wow, this are great news! Achieving a 62 % improvement over the 66 % projection, is an outstanding result. Huge kudos to everyone who made it happen!
Thanks for sharing, @mirisarri !