# RSKIP-305 Peg-out efficiency improvement (Segwit)

**URL:** <https://research.rsk.dev/t/rskip-305-peg-out-efficiency-improvement-segwit/368>\
**Category:** RSKIP\
**Created:** [July 15, 2022, 9:07pm UTC](https://research.rsk.dev/t/rskip-305-peg-out-efficiency-improvement-segwit/368 "2022-07-15T21:07:26Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![mirisarri](https://avatars.discourse-cdn.com/v4/letter/m/46a35a/32.png) [@mirisarri](https://research.rsk.dev/u/mirisarri)\
**Post date:** [August 7, 2025, 7:25pm UTC](https://research.rsk.dev/t/rskip-305-peg-out-efficiency-improvement-segwit/368/2 "2025-08-07T19:25:01Z")

</div>

An implementation of this RSKIP has been completed and proposed to be included in the upcoming [Reed network upgrade](https://research.rsk.dev/t/rskip-518-network-upgrade-reed/495) of rskj.

Code changes are open for review

> <https://github.com/rsksmart/rskj/pull/3165>
>
> 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\`

> <https://github.com/rsksmart/powpeg-node/pull/425>
>
> 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\`

---

_[View the full topic](https://research.rsk.dev/t/rskip-305-peg-out-efficiency-improvement-segwit/368)._
