<p>This is a continuation from <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="774579111" data-permission-text="Title is private" data-url="https://github.com/bisq-network/bisq/issues/5000" data-hovercard-type="pull_request" data-hovercard-url="/bisq-network/bisq/pull/5000/hovercard" href="https://github.com/bisq-network/bisq/pull/5000">#5000</a>, which replaces Bisq's Json RPC client to allow Segwit data (<code>"txinwitness"</code> fields) to be retrieved by DAO full nodes, in order to fill in the pubkeys of BSQ tx Segwit inputs (as necessary to support fully Segwit compensation and proof-of-burn txs).</p>
<p>This PR makes the necessary changes to the user's wallet and address formatting + validation to support Segwit BSQ, migrating the wallet upon startup in an analogous way to the Segwit BTC wallet upgrade (<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="710660237" data-permission-text="Title is private" data-url="https://github.com/bisq-network/bisq/issues/4568" data-hovercard-type="pull_request" data-hovercard-url="/bisq-network/bisq/pull/4568/hovercard" href="https://github.com/bisq-network/bisq/pull/4568">#4568</a>). With these changes, newly generated BSQ addresses are native Segwit (p2wpkh) and take the form <em>'B' + <bech32-address></em>, e.g.</p>
<blockquote>
<p>Bbc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq <strong>(mainnet)</strong><br>
Bbcrt1qj4t04q4mpssfv9uzpm6w2n8rlhs7es47ktqx8x <strong>(regtest)</strong></p>
</blockquote>
<p>They should be valid everywhere the old base58 (p2pkh) BSQ addresses are, which continue to be supported (just never selected as new change or recipient addresses).</p>
<p>--</p>
<p>Note that this PR probably shouldn't be merged into master until the technical hard fork introduced by <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="774579111" data-permission-text="Title is private" data-url="https://github.com/bisq-network/bisq/issues/5000" data-hovercard-type="pull_request" data-hovercard-url="/bisq-network/bisq/pull/5000/hovercard" href="https://github.com/bisq-network/bisq/pull/5000">#5000</a> activates on mainnet, as otherwise upgraded users will have difficultly generating valid compensation requests or proof-of-burn txs. This is because native Segwit BSQ coins from their wallet may be arbitrarily selected as tx inputs.</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/bisq-network/bisq/pull/5109'>https://github.com/bisq-network/bisq/pull/5109</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>Code cleanup: Simplify Optional stream processing</li>
  <li>Allow use of bech32 BSQ addresses</li>
  <li>Perform segwit BSQ wallet migration upon startup</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5109/files#diff-6c369bf146b35b7c634ad739e48b95ec315679f63e9e557821c83419002758cc">apitest/src/test/java/bisq/apitest/method/wallet/BsqWalletTest.java</a>
    (4)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5109/files#diff-8e3e031c1ab615657b5d7d6eff81934c42bb56b34b9bcb1f810ea2867c993831">assets/src/main/java/bisq/asset/coins/BSQ.java</a>
    (6)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5109/files#diff-f1df4fd99db45d9b91ec2a59f443619324e243cb5738a597ef8008b67cc97d9a">core/src/main/java/bisq/core/api/CoreWalletsService.java</a>
    (15)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5109/files#diff-0acc7d00f8368b0f79485d84162b2beb9487b061fd2d31aeb529e06d7c10d299">core/src/main/java/bisq/core/app/BisqSetup.java</a>
    (4)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5109/files#diff-7e8dfadb3a06f282f4e9f3f5d778fe45e7717e5007f2d72f50f58742b9e13349">core/src/main/java/bisq/core/btc/model/BsqTransferModel.java</a>
    (6)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5109/files#diff-346d26dcf388a3ca332c7c31e1d4612e7b97cc9d171fbe2b4008f2a95c9005b8">core/src/main/java/bisq/core/btc/setup/BisqKeyChainGroupStructure.java</a>
    (16)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5109/files#diff-3b2440cf0088e50ee4befa9b6ea071cc40c003764e3368f0adb141b9aea3073e">core/src/main/java/bisq/core/btc/setup/WalletConfig.java</a>
    (39)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5109/files#diff-7653fe88b27c966f6dd2f862c436fee5e5581ab2648c08888ac95afd7cd5c471">core/src/main/java/bisq/core/btc/setup/WalletsSetup.java</a>
    (17)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5109/files#diff-51ad8d296d65d6b3ce8dc9791aa5a912f3ed622796fcd9853692711086c48972">core/src/main/java/bisq/core/btc/wallet/BsqTransferService.java</a>
    (4)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5109/files#diff-ad1ae5fe768f7b1b85d73655e580b4799d29c71eaa7fed3363c43c5418fd116a">core/src/main/java/bisq/core/btc/wallet/BsqWalletService.java</a>
    (22)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5109/files#diff-75820b5165905d1e3a47d5fe31e4b5dba017c6b25a322aad955ffa592a67b362">core/src/main/java/bisq/core/btc/wallet/BtcWalletService.java</a>
    (16)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5109/files#diff-7a1aaa940926ec321522b46a6bbf947799c506f8f8aadbd7b0476f3eaf523754">core/src/main/java/bisq/core/dao/governance/period/CycleService.java</a>
    (3)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5109/files#diff-51f5be79942ea2011d11044547ab42ceb48461b0a876062e77a05555442590e8">core/src/main/java/bisq/core/dao/governance/proposal/IssuanceProposal.java</a>
    (12)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5109/files#diff-2c67ec9d7b7f8b71990478bf5c51266f8c6556f12a5d6aa71f21a9d27b8d784b">core/src/main/java/bisq/core/dao/state/model/blockchain/OpReturnType.java</a>
    (4)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5109/files#diff-5136dee3346fc07e6457578648abe309843351d37bc59985dbed539ffb781dd7">core/src/main/java/bisq/core/dao/state/model/governance/CompensationProposal.java</a>
    (11)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5109/files#diff-95bb9c97e4725f47689a3837dfaa17b0bfce65008b428817d31dbe76f2386aa4">core/src/main/java/bisq/core/dao/state/model/governance/ReimbursementProposal.java</a>
    (11)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5109/files#diff-80ff3d931ad11e74bacd7cc62c938dfe18787d571cacc0195ca80f96582f1269">core/src/main/java/bisq/core/util/coin/BsqFormatter.java</a>
    (10)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5109/files#diff-0ed3fa0968518a1628795b660aa5dd2dbb1357c80125204a3eafb72c7653a0aa">desktop/src/main/java/bisq/desktop/main/dao/wallet/tx/BsqTxListItem.java</a>
    (11)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5109/files#diff-807ea8ca542229e2835fa3ff2f36efc719c2f4a7d0284c06a65d8aab9df7dfc4">desktop/src/main/java/bisq/desktop/util/validation/BsqAddressValidator.java</a>
    (2)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/bisq-network/bisq/pull/5109.patch'>https://github.com/bisq-network/bisq/pull/5109.patch</a></li>
  <li><a href='https://github.com/bisq-network/bisq/pull/5109.diff'>https://github.com/bisq-network/bisq/pull/5109.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/bisq-network/bisq/pull/5109">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJFFTNUA3LR7T23EJRV3NB3S3MMTNANCNFSM4WP4XQZQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AJFFTNQLOYQVXIWKSBKGATLS3MMTNA5CNFSM4WP4XQZ2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4LZ6R37A.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/bisq-network/bisq/pull/5109",
"url": "https://github.com/bisq-network/bisq/pull/5109",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>