Add verify message extension method
MODIFY
HiddenWallet.ChaumianTumbler/Controllers/TumblerController.cs
HiddenWallet.ChaumianTumbler/Controllers/TumblerController.cs
@@ -101,6 +101,7 @@ namespace HiddenWallet.ChaumianTumbler.Controllers
}
var value = txOutResponse.Result.Value<decimal>("value");
var scriptPubKey = new Script(txOutResponse.Result["scriptPubKey"].Value<string>("asm"));
+
var txout = new TxOut(new Money(value, MoneyUnit.BTC), scriptPubKey);
inputs.Add(txout);
}

MODIFY
HiddenWallet/Extensions/NBitcoinExtensions.cs
HiddenWallet/Extensions/NBitcoinExtensions.cs
@@ -20,5 +20,11 @@ namespace NBitcoin
if (me == null) throw new ArgumentNullException(nameof(me));
me.FromBytes(HexHelpers.GetBytes(hex));
}
+
+ public static bool VerifyMessage(this BitcoinWitPubKeyAddress me, string message, string signature)
+ {
+ var key = PubKey.RecoverFromMessage(message, signature);
+ return key.Hash == me.Hash;
+ }
}
}

Add verify message extension method