Esempio n. 1
0
        public static InputRoundSignaturePair CreateInputRoundSignaturePair(Key?key = null, uint256?roundHash = null)
        {
            var rh       = roundHash ?? BitcoinFactory.CreateUint256();
            var outpoint = BitcoinFactory.CreateOutPoint();
            var coinJoinInputCommitmentData = new CoinJoinInputCommitmentData("CoinJoinCoordinatorIdentifier", rh);

            var signingKey = key ?? new();

            return(new InputRoundSignaturePair(
                       outpoint,
                       OwnershipProof.GenerateCoinJoinInputProof(signingKey, coinJoinInputCommitmentData).ToBytes()));
        }
Esempio n. 2
0
        public static InputRoundSignaturePair CreateInputRoundSignaturePair(Key?key = null, uint256?roundHash = null)
        {
            var rh = roundHash ?? BitcoinFactory.CreateUint256();

            if (key is null)
            {
                using Key k = new();
                return(new InputRoundSignaturePair(
                           BitcoinFactory.CreateOutPoint(),
                           k.SignCompact(rh)));
            }
            else
            {
                return(new InputRoundSignaturePair(
                           BitcoinFactory.CreateOutPoint(),
                           key.SignCompact(rh)));
            }
        }