Add anonymity set
MODIFY
WalletWasabi.Backend/CcjRoundConfig.cs
WalletWasabi.Backend/CcjRoundConfig.cs
@@ -26,16 +26,20 @@ namespace WalletWasabi.Backend
[JsonProperty(PropertyName = "CoordinatorFeePercent")]
public decimal? CoordinatorFeePercent { get; private set; }
+ [JsonProperty(PropertyName = "AnonymitySet")]
+ public int? AnonymitySet { get; private set; }
+
public CcjRoundConfig()
{
}
- public CcjRoundConfig(Money denomination, int? confirmationTarget, decimal? coordinatorFeePercent)
+ public CcjRoundConfig(Money denomination, int? confirmationTarget, decimal? coordinatorFeePercent, int? anonymitySet)
{
Denomination = Guard.NotNull(nameof(denomination), denomination);
ConfirmationTarget = Guard.NotNull(nameof(confirmationTarget), confirmationTarget);
CoordinatorFeePercent = Guard.NotNull(nameof(coordinatorFeePercent), coordinatorFeePercent);
+ AnonymitySet = Guard.NotNull(nameof(anonymitySet), anonymitySet);
}
public async Task ToFileAsync(string path)
@@ -55,6 +59,7 @@ namespace WalletWasabi.Backend
Denomination = new Money(0.1m, MoneyUnit.BTC);
ConfirmationTarget = 144; // 1 day
CoordinatorFeePercent = 0.1m;
+ AnonymitySet = 100;
if (!File.Exists(path))
{
@@ -68,6 +73,7 @@ namespace WalletWasabi.Backend
Denomination = config.Denomination ?? Denomination;
ConfirmationTarget = config.ConfirmationTarget ?? ConfirmationTarget;
CoordinatorFeePercent = config.CoordinatorFeePercent ?? CoordinatorFeePercent;
+ AnonymitySet = config.AnonymitySet ?? AnonymitySet;
}
await ToFileAsync(path);
@@ -95,6 +101,10 @@ namespace WalletWasabi.Backend
{
return true;
}
+ if (AnonymitySet != config.AnonymitySet)
+ {
+ return true;
+ }
return false;
}

MODIFY
WalletWasabi.Backend/CcjRoundConfigWatcher.cs
WalletWasabi.Backend/CcjRoundConfigWatcher.cs
@@ -57,7 +57,7 @@ namespace WalletWasabi.Backend
await RoundConfig.LoadOrCreateDefaultFileAsync(RoundConfigFilePath);
- await Coordinator.StartNewRoundAsync(Global.RpcClient, RoundConfig.Denomination, (int)RoundConfig.ConfirmationTarget, (decimal) RoundConfig.CoordinatorFeePercent);
+ await Coordinator.StartNewRoundAsync(Global.RpcClient, RoundConfig.Denomination, (int)RoundConfig.ConfirmationTarget, (decimal) RoundConfig.CoordinatorFeePercent, (int)RoundConfig.AnonymitySet);
}
}
catch (TaskCanceledException ex)

MODIFY
WalletWasabi.Backend/Global.cs
WalletWasabi.Backend/Global.cs
@@ -99,7 +99,7 @@ namespace WalletWasabi.Backend
IndexBuilderService.Synchronize();
Coordinator = new CcjCoordinator();
- await Coordinator.StartNewRoundAsync(RpcClient, RoundConfig.Denomination, (int)RoundConfig.ConfirmationTarget, (decimal)RoundConfig.CoordinatorFeePercent);
+ await Coordinator.StartNewRoundAsync(RpcClient, RoundConfig.Denomination, (int)RoundConfig.ConfirmationTarget, (decimal)RoundConfig.CoordinatorFeePercent, (int)RoundConfig.AnonymitySet);
RoundConfigWatcher = new CcjRoundConfigWatcher(RoundConfig, RoundConfigFilePath, Coordinator);
RoundConfigWatcher.Start(TimeSpan.FromSeconds(10)); // Every 10 seconds check the config

MODIFY
WalletWasabi/ChaumianCoinJoin/CcjRound.cs
WalletWasabi/ChaumianCoinJoin/CcjRound.cs
@@ -17,6 +17,7 @@ namespace WalletWasabi.ChaumianCoinJoin
public Money Denomination { get; }
public int ConfirmationTarget { get; }
public Money CoordinatorFee { get; }
+ public int AnonymitySet { get; private set; }
public Money FeePerInputs { get; private set; }
public Money FeePerOutputs { get; private set; }
@@ -26,12 +27,13 @@ namespace WalletWasabi.ChaumianCoinJoin
public CcjRoundStatus Status { get; private set; }
- public CcjRound(RPCClient rpc, Money denomination, int confirmationTarget, decimal coordinatorFeePercent)
+ public CcjRound(RPCClient rpc, Money denomination, int confirmationTarget, decimal coordinatorFeePercent, int anonymitySet)
{
RpcClient = Guard.NotNull(nameof(rpc), rpc);
Denomination = Guard.NotNull(nameof(denomination), denomination);
ConfirmationTarget = confirmationTarget;
CoordinatorFee = new Money((coordinatorFeePercent * 0.01m) * decimal.Parse(Denomination.ToString(false, true)), MoneyUnit.BTC);
+ AnonymitySet = anonymitySet;
Phase = CcjRoundPhase.InputRegistration;
Status = CcjRoundStatus.NotStarted;

MODIFY
WalletWasabi/Services/CcjCoordinator.cs
WalletWasabi/Services/CcjCoordinator.cs
@@ -23,7 +23,7 @@ namespace WalletWasabi.Services
RoundsListLock = new AsyncLock();
}
- public async Task StartNewRoundAsync(RPCClient rpc, Money denomination, int confirmationTarget, decimal coordinatorFeePercent)
+ public async Task StartNewRoundAsync(RPCClient rpc, Money denomination, int confirmationTarget, decimal coordinatorFeePercent, int anonymitySet)
{
using (await RoundsListLock.LockAsync())
{
@@ -32,7 +32,7 @@ namespace WalletWasabi.Services
throw new InvalidOperationException("Maximum two concurrently running round is allowed the same time.");
}
- var round = new CcjRound(rpc, denomination, confirmationTarget, coordinatorFeePercent);
+ var round = new CcjRound(rpc, denomination, confirmationTarget, coordinatorFeePercent, anonymitySet);
await round.ExecuteNextPhaseAsync();
Rounds.Add(round);
}

Add anonymity set