# MidnightBech32m parser fails on preview and undeployed networks PK

**URL:** <https://forum.midnight.network/t/midnightbech32m-parser-fails-on-preview-and-undeployed-networks-pk/992>\
**Category:** Technical Questions\
**Created:** [January 27, 2026, 4:32pm UTC](https://forum.midnight.network/t/midnightbech32m-parser-fails-on-preview-and-undeployed-networks-pk/992 "2026-01-27T16:32:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bochaco](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.midnight.network/bochaco/32/112_2.png) [@bochaco](https://forum.midnight.network/u/bochaco)\
**Post date:** [January 27, 2026, 4:32pm UTC](https://forum.midnight.network/t/midnightbech32m-parser-fails-on-preview-and-undeployed-networks-pk/992/1 "2026-01-27T16:32:22Z")

</div>

I have been using `@midnight-ntwrk/wallet-sdk-address-format` (v2.0.0 published 8 months ago) with `testnet-2` to decode/parse coin public keys retrieved from the wallet provider, e.g.:

```auto
const pk = providers.walletProvider.getCoinPublicKey();
const zswapPk = MidnightBech32m.parse(pk);

```

But I’ve just tried the same with both `preview` and `undeployed` networks and it seems those type of formats are not supported by this library.

Does anybody know of any other of the js libs which supports such a decoding/parsing API which works on `preview` and `undeployed` networks?

---

<div class="post-metadata">

**Author:** ![bochaco](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.midnight.network/bochaco/32/112_2.png) [@bochaco](https://forum.midnight.network/u/bochaco)\
**Post date:** [January 27, 2026, 4:43pm UTC](https://forum.midnight.network/t/midnightbech32m-parser-fails-on-preview-and-undeployed-networks-pk/992/2 "2026-01-27T16:43:30Z")

</div>

…ah…I think I just figured it out, `providers.walletProvider.getCoinPublicKey()` now returns the address in a hex-encoded format rather than Bech32m, so I don’t seem to need that library anymore, just hex-decoding it seems to work.
