Finish 'inputs' post request
MODIFY
HiddenWallet.ChaumianTumbler/Controllers/TumblerController.cs
HiddenWallet.ChaumianTumbler/Controllers/TumblerController.cs
@@ -137,10 +137,11 @@ namespace HiddenWallet.ChaumianTumbler.Controllers
throw new ArgumentException("Total provided inputs must be > denomination + fee");
}
+ byte[] signature = Global.RsaKey.SignBlindedData(blindedOutput);
return new ObjectResult(new InputsResponse()
{
UniqueId = Guid.NewGuid().ToString(),
- SignedBlindedOutput = ""
+ SignedBlindedOutput = HexHelpers.ToString(signature)
});
}
catch (Exception ex)

MODIFY
HiddenWallet.ChaumianTumbler/Program.cs
HiddenWallet.ChaumianTumbler/Program.cs
@@ -13,6 +13,8 @@ using HiddenWallet.ChaumianTumbler.Configuration;
using NBitcoin.RPC;
using System.Net;
using HiddenWallet.ChaumianTumbler.Store;
+using System.Text;
+using HiddenWallet.Crypto;
namespace HiddenWallet.ChaumianTumbler
{
@@ -28,6 +30,19 @@ namespace HiddenWallet.ChaumianTumbler
Global.Config = new Config();
await Global.Config.LoadOrCreateDefaultFileAsync(configFilePath, CancellationToken.None);
+ string rsaPath = Path.Combine(Global.DataDir, "RsaKey.json");
+ if (File.Exists(rsaPath))
+ {
+ string rsaKeyJson = await File.ReadAllTextAsync(rsaPath, Encoding.UTF8);
+ Global.RsaKey = BlindingRsaKey.CreateFromJson(rsaKeyJson);
+ }
+ else
+ {
+ Global.RsaKey = new BlindingRsaKey();
+ await File.WriteAllTextAsync(rsaPath, Global.RsaKey.ToJson(), Encoding.UTF8);
+ Console.WriteLine($"Created RSA key at: {rsaPath}");
+ }
+
Global.RpcClient = new RPCClient(
credentials: new RPCCredentialString
{

Finish 'inputs' post request