# Questions about P2SH encoding

**URL:** <https://forums.counterparty.io/t/questions-about-p2sh-encoding/6118>\
**Category:** Counterparty\
**Created:** [May 4, 2021, 1:17pm UTC](https://forums.counterparty.io/t/questions-about-p2sh-encoding/6118 "2021-05-04T13:17:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![JPJA](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/jpja/32/1324_2.png) [@JPJA](https://forums.counterparty.io/u/JPJA)\
**Post date:** [May 4, 2021, 1:17pm UTC](https://forums.counterparty.io/t/questions-about-p2sh-encoding/6118/1 "2021-05-04T13:17:20Z")

</div>

Counterparty now [supports P2SH encoding](https://counterparty.io/news/counterparty-lib-9-58-0/).

I used [JDog’s MPMA Tool](https://jdogresorg.github.io/counterparty-mpma-send-tool/) and created [these transactions](https://blockstream.info/testnet/address/2NC9VRfNesim49GYqjXRLwjL3p7jkk5NCfA) (one P2SH encoded counterparty tx = 2 bitcoin txs).

The block explorer informs that: _This transaction could **save 62% on fees** by upgrading to native SegWit-Bech32 or 54% by upgrading to SegWit-P2SH_ on the 2nd and largest transaction. For the first tx the saving could be 36/26%.

1. Is it technically possible to get this saving with Counterparty data?
2. I tested a large broadcast with CW. It still uses multisig encoding. Any plan to upgrade CW to use P2SH?
3. FreeWallet uses P2SH only for MPMA sends. Will it be updated to use P2SH for broadcasts too?

---

<div class="post-metadata">

**Author:** ![jdogresorg](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/jdogresorg/32/1349_2.png) [@jdogresorg](https://forums.counterparty.io/u/jdogresorg)\
**Post date:** [May 10, 2021, 5:33pm UTC](https://forums.counterparty.io/t/questions-about-p2sh-encoding/6118/2 "2021-05-10T17:33:45Z")

</div>

1.) Yes, if you use a segwit (bech32) address, you can save on fees… this is working NOW on counterparty… only issue with bech32 addresses right now is with MPMA sends (change is sent to bad address, resulting in loss of funds, which is why I have disabled MPMA sends for segwit addresses in [freewallet.io](http://freewallet.io) until we get a chance to get the MPMA send issue fixed… MPMA sends from normal addresses works fine)

> <https://github.com/CounterpartyXCP/counterparty-lib/issues/1116>
>
> We have an issue with MPMA Sends from segwit addresses where the BTC change is n…ot returned to the source address in the pre-send transaction, resulting in loss of BTC. I will disable MPMA Sends from segwit addresses on mainnet in Freewallet until this issue is fixed.
> 
> \# Testing Data (Testnet)
> Test MPMA Send from tb1q67lsygzt4udupksq5y57j2wfmgy0fjusm40l83
> 
> Send List :
> mvThcDEbeqog2aJ7JNj1FefUPaNdYYGqHt, XCP, 1.00000000
> mvThcDEbeqog2aJ7JNj1FefUPaNdYYGqHt, NONDIVISIBLE, 1
> mvThcDEbeqog2aJ7JNj1FefUPaNdYYGqHt, RUMPSHAKER.IN.YA.FACE, 1.00000000
> 
> Freewallet MPMA Send
> !\[image\](https://i.gyazo.com/0effe711b918479832ee52909ae2703b.png)
> 
> API call to Counterparty API
> !\[image\](https://i.gyazo.com/c358c7edafd712abfa5951d11080acfc.png)
> 
> Resulting Pending MPMA transaction
> !\[image\](https://i.gyazo.com/863810047744347c947b21557ece577a.png)
> 
> MPMA Pre-Send Transaction
> https://chain.so/tx/BTCTEST/b3f6de91d788fe6f39b53deb3d0db3fcb19c179e1a9064f807b2f8ccb4bc2c82
> 
> MPMA Send Transaction
> https://testnet.xchain.io/tx/5f3e25aecf666a3856d03d7ab3aea70c361fae2fd6f1f017ede7f164220d1fec
> 
> \# Issues
> \- Change in MPMA Pre-Send tx is not returned to tb1q67lsygzt4udupksq5y57j2wfmgy0fjusm40l83 and end result is loss of BTC funds.
> 
> \- Counterparty Parses Transaction as valid... but source is wrong 
> !\[image\](https://i.gyazo.com/75d1bd57f54e58e17168c3baa9cde0ac.png)
> !\[image\](https://i.gyazo.com/1730eac7a029ead94675473c704d6ccf.png)

2.) You should be able to specify “P2SH” for the “encodings” param on most “create\_” requests…

> **[Counterparty API | Counterparty](https://counterparty.io/docs/api/#transaction-encodings)**
>
> Developers/API.md

3.) Yes, at some point in the future I will update [freewallet.io](http://freewallet.io) desktop wallet to allow users to choose their preferred encoding type, but for now, I just allow Counterparty to use the default encoding method, except in the case of MPMA sends, where I force the encoding to be “P2SH” 🙂
