Add NTumbleBit output wallet support
MODIFY
HiddenWallet/HiddenWallet.API/HiddenWallet.API.csproj
HiddenWallet/HiddenWallet.API/HiddenWallet.API.csproj
<RuntimeIdentifiers>win7-x64;win8-x64;win81-x64;win10-x64;osx.10.10-x64;osx.10.11-x64;osx.10.12-x64;ubuntu.14.04-x64;ubuntu.14.10-x64;ubuntu.15.04-x64;ubuntu.15.10-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;debian.8-x64;linuxmint.17-x64;linuxmint.17.1-x64;linuxmint.17.2-x64;linuxmint.17.3-x64;linuxmint.18-x64;win7-x86;win8-x86;win81-x86;win10-x86</RuntimeIdentifiers>
</PropertyGroup>
<ItemGroup>
- <PackageReference Include="HBitcoin" Version="0.1.7.6" />
+ <PackageReference Include="HBitcoin" Version="0.1.7.7" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.3" />
<PackageReference Include="Microsoft.AspNetCore.Routing" Version="1.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.1.2" />

MODIFY
HiddenWallet/HiddenWallet.API/Models/ReceiveResponse.cs
HiddenWallet/HiddenWallet.API/Models/ReceiveResponse.cs
@@ -9,5 +9,6 @@ namespace HiddenWallet.API.Models
{
public ReceiveResponse() => Success = true;
public string[] Addresses { get; set; }
+ public string ExtPubKey { get; set; }
}
}

MODIFY
HiddenWallet/HiddenWallet.API/Wrappers/WalletWrapper.cs
HiddenWallet/HiddenWallet.API/Wrappers/WalletWrapper.cs
@@ -44,9 +44,9 @@ namespace HiddenWallet.API.Wrappers
public Money GetAvailable(SafeAccount account) => account == AliceAccount ? _availableAlice : _availableBob;
public Money GetIncoming(SafeAccount account) => account == AliceAccount ? _incomingAlice : _incomingBob;
- private ReceiveResponse _receiveAddressesAlice = new ReceiveResponse();
- private ReceiveResponse _receiveAddressesBob = new ReceiveResponse();
- public ReceiveResponse GetReceiveResponse(SafeAccount account) => account == AliceAccount ? _receiveAddressesAlice : _receiveAddressesBob;
+ private ReceiveResponse _receiveResponseAlice = new ReceiveResponse();
+ private ReceiveResponse _receiveResponseBob = new ReceiveResponse();
+ public ReceiveResponse GetReceiveResponse(SafeAccount account) => account == AliceAccount ? _receiveResponseAlice : _receiveResponseBob;
private HistoryResponse _historyResponseAlice = new HistoryResponse();
private HistoryResponse _historyResponseBob = new HistoryResponse();
@@ -94,6 +94,9 @@ namespace HiddenWallet.API.Wrappers
_walletJob.StateChanged += _walletJob_StateChanged;
_walletJob.Tracker.TrackedTransactions.CollectionChanged += TrackedTransactions_CollectionChanged;
+ _receiveResponseAlice.ExtPubKey = _walletJob.Safe.GetBitcoinExtPubKey(index: null, hdPathType: HdPathType.NonHardened, account: AliceAccount).ToWif();
+ _receiveResponseBob.ExtPubKey = _walletJob.Safe.GetBitcoinExtPubKey(index: null, hdPathType: HdPathType.NonHardened, account: BobAccount).ToWif();
+
_walletJobTask = _walletJob.StartAsync(_cts.Token);
UpdateHistoryRelatedMembers();
@@ -184,15 +187,15 @@ namespace HiddenWallet.API.Wrappers
// receive
var ua = _walletJob.GetUnusedScriptPubKeys(AliceAccount, HdPathType.Receive).ToArray();
var ub = _walletJob.GetUnusedScriptPubKeys(BobAccount, HdPathType.Receive).ToArray();
- _receiveAddressesAlice.Addresses = new string[7];
- _receiveAddressesBob.Addresses = new string[7];
+ _receiveResponseAlice.Addresses = new string[7];
+ _receiveResponseBob.Addresses = new string[7];
var network = _walletJob.Safe.Network;
for (int i = 0; i < 7; i++)
{
- if (ua[i] != null) _receiveAddressesAlice.Addresses[i] = ua[i].GetDestinationAddress(network).ToWif();
- else _receiveAddressesAlice.Addresses[i] = "";
- if (ub[i] != null) _receiveAddressesBob.Addresses[i] = ub[i].GetDestinationAddress(network).ToWif();
- else _receiveAddressesBob.Addresses[i] = "";
+ if (ua[i] != null) _receiveResponseAlice.Addresses[i] = ua[i].GetDestinationAddress(network).ToWif();
+ else _receiveResponseAlice.Addresses[i] = "";
+ if (ub[i] != null) _receiveResponseBob.Addresses[i] = ub[i].GetDestinationAddress(network).ToWif();
+ else _receiveResponseBob.Addresses[i] = "";
}
}
private void _walletJob_StateChanged(object sender, EventArgs e)

MODIFY
HiddenWallet/HiddenWallet.GUI/app/html/wallet-content.html
HiddenWallet/HiddenWallet.GUI/app/html/wallet-content.html
<div id="receive-content">
- <label>Unused receive addresses:</label>
+ <label>Unused Receive Addresses:</label>
<ul id="receive-addresses" class="list-group">
</ul>
+ <label>[Advanced] Extended Public Key:</label>
+ <ul class="list-group">
+ <li id="extpubkey" class="list-group-item" style="word-wrap:break-word"></li>
+ </ul>
</div>
<div id="history-content">

MODIFY
HiddenWallet/HiddenWallet.GUI/app/js/wallet-phase.js
HiddenWallet/HiddenWallet.GUI/app/js/wallet-phase.js
@@ -72,6 +72,7 @@ function updateWalletContent() {
node.appendChild(textNode);
document.getElementById("receive-addresses").appendChild(node);
}
+ document.getElementById("extpubkey").innerText = resp.ExtPubKey;
}
else if (menuId === "history-active") {
document.getElementById("content").innerHTML = document.getElementById("wallet-content-frame").contentWindow.document.getElementById("history-content").outerHTML;
@@ -111,6 +112,7 @@ function updateWalletContent() {
node.appendChild(textNode);
document.getElementById("receive-addresses").appendChild(node);
}
+ document.getElementById("extpubkey").innerText = resp.ExtPubKey;
}
else if (menuId === "history-active") {
document.getElementById("content").innerHTML = document.getElementById("wallet-content-frame").contentWindow.document.getElementById("history-content").outerHTML;

Add NTumbleBit output wallet support