Accept SegWit deposits to the RSK Powpeg

I found this old issue on GitHub:

https://github.com/rsksmart/rskj/issues/148

I’m wondering if there is still a plan to integrate support for segwit deposits on the Powpeg federation address?

Currently if a user has their BTC in a segwit address (or any other non-P2PKH address) then to transfer to RSK they first have to move their BTC to a P2PKH address then make the deposit. And the same in reverse, if when they transfer from RSK back to the mainchain, and they want to ultimately store their BTC in a non-P2PKH address, they must first transfer from RSK to a P2PKH address and then send on to the final non-P2PKH address. This means non-P2PKH users pay twice as much fees and put twice the amount of load on the blockchain as a P2PKH user.

I would like to see support added for deposits and withdrawals using non-P2PKH addresses to lighten the user’s fee burden and the load that they are putting on the bitcoin blockchain.

While segwit support is of course a benefit, the next release (Iris) already provides two ways for users to use segwit addresses for peg-ins:

The first feature allows you to send BTC from any bitcoin address to any RSK address by adding an additional output containing OP_RETURN and the destination address (plus some other data).
The second is a trustless system where you negotiate with a third party a powpeg-derived address, you send the bitcoins to that address in few confirmations, and the third party advances you the bitcoins on RSK to an off-chain negotiated address.
I designed the fast BTC bridge, and we’re implementing a PoC. The consensus changes have already been approved by the community, coded, and the feature is waiting to be activated in Iris.

2 Likes

Thank you for pointing out those RSKIPs! I think those will both be useful features on top of the benefit of being able to deposit from non-P2PKH addresses. I saw mention of P2SH address support, do you know if they will also allow depositing from bech32 P2WPKH addresses?

I just noticed on the BTC to R-BTC Conversion page of the RSK Developer Portal that it says:

Compatibility

The types of addresses that are accepted for the Federation are :

  • Legacy (P2PKH)
  • Segwit Compatible (P2SH-P2WPKH)

However on the mainnet instructions page it says:

Note: The Bitcoin wallet needs to be legacy (not Segwit) whose public key starts with either m or n , and private key starting with p2pkh.

Can you please confirm whether or not the federation is compatible with segwit addresses today?

Here’s an answer from our team:

  • legacy → p2sh-p2wpkh (addresses that start with 3)
  • native → p2wpkh (bech32 address, start with bc)

If one uses native addresses → lose funds

If one use legacy they can peg-in, BUT, if they peg-out from their derived RSK address, the BTC will be transferred to a p2pkh address (those that start with 1)

In summary, I would not recommend using segwit with the existing 2wp.

This will change with Iris, peg-in v1 and the 2wp app.

1 Like