Example #1
0
 public BlameRound(RoundParameters roundParameters, Round blameOf, ISet <OutPoint> blameWhitelist)
     : base(roundParameters)
 {
     BlameOf                    = blameOf;
     BlameWhitelist             = blameWhitelist;
     InputRegistrationTimeFrame = TimeFrame.Create(RoundParameters.BlameInputRegistrationTimeout).StartNow();
 }
Example #2
0
        public Round(RoundParameters roundParameters)
        {
            RoundParameters = roundParameters;

            AmountCredentialIssuer           = new(new(Random), 2, Random, MaxRegistrableAmount);
            WeightCredentialIssuer           = new(new(Random), 2, Random, RegistrableWeightCredentials);
            AmountCredentialIssuerParameters = AmountCredentialIssuer.CredentialIssuerSecretKey.ComputeCredentialIssuerParameters();
            WeightCredentialIssuerParameters = WeightCredentialIssuer.CredentialIssuerSecretKey.ComputeCredentialIssuerParameters();

            Coinjoin = Transaction.Create(Network);

            Hash = new(HashHelpers.GenerateSha256Hash($"{Id}{MaxInputCountByAlice}{MinRegistrableAmount}{MaxRegistrableAmount}{RegistrableWeightCredentials}{AmountCredentialIssuerParameters}{WeightCredentialIssuerParameters}{FeeRate.SatoshiPerByte}"));
        }
Example #3
0
        public Round(RoundParameters roundParameters)
        {
            RoundParameters = roundParameters;

            var allowedAmounts = new MoneyRange(roundParameters.MinRegistrableAmount, RoundParameters.MaxRegistrableAmount);
            var txParams       = new MultipartyTransactionParameters(roundParameters.FeeRate, allowedAmounts, allowedAmounts, roundParameters.Network);

            CoinjoinState = new ConstructionState(txParams);

            InitialInputVsizeAllocation = CoinjoinState.Parameters.MaxTransactionSize - MultipartyTransactionParameters.SharedOverhead;
            MaxRegistrableVsize         = Math.Min(InitialInputVsizeAllocation / RoundParameters.MaxInputCountByRound, (int)ProtocolConstants.MaxVsizeCredentialValue);
            MaxVsizeAllocationPerAlice  = MaxRegistrableVsize;

            AmountCredentialIssuer           = new(new(RoundParameters.Random), RoundParameters.Random, MaxRegistrableAmount);
            VsizeCredentialIssuer            = new(new(RoundParameters.Random), RoundParameters.Random, MaxRegistrableVsize);
            AmountCredentialIssuerParameters = AmountCredentialIssuer.CredentialIssuerSecretKey.ComputeCredentialIssuerParameters();
            VsizeCredentialIssuerParameters  = VsizeCredentialIssuer.CredentialIssuerSecretKey.ComputeCredentialIssuerParameters();

            Id = CalculateHash();
        }
Example #4
0
        public Round(RoundParameters roundParameters)
        {
            RoundParameters = roundParameters;

            var allowedAmounts = new MoneyRange(roundParameters.MinRegistrableAmount, RoundParameters.MaxRegistrableAmount);
            var txParams       = new MultipartyTransactionParameters(roundParameters.FeeRate, allowedAmounts, allowedAmounts, roundParameters.Network);

            CoinjoinState = new ConstructionState(txParams);

            InitialInputVsizeAllocation = CoinjoinState.Parameters.MaxTransactionSize - MultipartyTransactionParameters.SharedOverhead;
            MaxVsizeCredentialValue     = Math.Min(InitialInputVsizeAllocation / RoundParameters.MaxInputCountByRound, (int)ProtocolConstants.MaxVsizeCredentialValue);
            MaxVsizeAllocationPerAlice  = MaxVsizeCredentialValue;

            AmountCredentialIssuer           = new(new(RoundParameters.Random), RoundParameters.Random, MaxAmountCredentialValue);
            VsizeCredentialIssuer            = new(new(RoundParameters.Random), RoundParameters.Random, MaxVsizeCredentialValue);
            AmountCredentialIssuerParameters = AmountCredentialIssuer.CredentialIssuerSecretKey.ComputeCredentialIssuerParameters();
            VsizeCredentialIssuerParameters  = VsizeCredentialIssuer.CredentialIssuerSecretKey.ComputeCredentialIssuerParameters();

            InputRegistrationTimeFrame      = TimeFrame.Create(RoundParameters.StandardInputRegistrationTimeout).StartNow();
            ConnectionConfirmationTimeFrame = TimeFrame.Create(RoundParameters.ConnectionConfirmationTimeout);
            OutputRegistrationTimeFrame     = TimeFrame.Create(RoundParameters.OutputRegistrationTimeout);
            TransactionSigningTimeFrame     = TimeFrame.Create(RoundParameters.TransactionSigningTimeout);
        }