Calculate AliceId without using backend class
MODIFY
WalletWasabi/WabiSabi/Backend/Models/Alice.cs
WalletWasabi/WabiSabi/Backend/Models/Alice.cs
@@ -35,11 +35,13 @@ namespace WalletWasabi.WabiSabi.Backend.Models
Deadline = DateTimeOffset.UtcNow + (connectionConfirmationTimeout * 0.9);
}
- private uint256 CalculateHash()
+ private uint256 CalculateHash() => CalculateHash(Coin, OwnershipProof);
+
+ public static uint256 CalculateHash(Coin coin, OwnershipProof ownershipProof)
=> StrobeHasher.Create(ProtocolConstants.AliceStrobeDomain)
- .Append(ProtocolConstants.AliceCoinTxOutStrobeLabel, Coin.TxOut)
- .Append(ProtocolConstants.AliceCoinOutpointStrobeLabel, Coin.Outpoint)
- .Append(ProtocolConstants.AliceOwnershipProofStrobeLabel, OwnershipProof)
+ .Append(ProtocolConstants.AliceCoinTxOutStrobeLabel, coin.TxOut)
+ .Append(ProtocolConstants.AliceCoinOutpointStrobeLabel, coin.Outpoint)
+ .Append(ProtocolConstants.AliceOwnershipProofStrobeLabel, ownershipProof)
.GetHash();
}
}

MODIFY
WalletWasabi/WabiSabi/Client/AliceClient.cs
WalletWasabi/WabiSabi/Client/AliceClient.cs
using NBitcoin;
using System;
using System.Collections.Generic;
-using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using WalletWasabi.Crypto;
+using WalletWasabi.Crypto.StrobeProtocol;
using WalletWasabi.Crypto.ZeroKnowledge;
-using WalletWasabi.Helpers;
using WalletWasabi.Logging;
using WalletWasabi.WabiSabi.Backend.Models;
@@ -111,7 +110,8 @@ namespace WalletWasabi.WabiSabi.Client
var ownershipProof = OwnershipProof.GenerateCoinJoinInputProof(
bitcoinSecret.PrivateKey,
new CoinJoinInputCommitmentData("CoinJoinCoordinatorIdentifier", roundId));
- return new Alice(coin, ownershipProof).Id;
+
+ return Alice.CalculateHash(coin, ownershipProof);
}
}
}

Calculate AliceId without using backend class