public OpenChannelRequest GetOpenChannelRequest()
        {
            AssertState(TumblerClientSessionStates.WaitingGenerateTumblerTransactionKey);
            var escrow = new Key();

            InternalState.TumblerEscrowKey = escrow;
            InternalState.Status           = TumblerClientSessionStates.WaitingTumblerEscrow;
            var result = new OpenChannelRequest
            {
                EscrowKey  = escrow.PubKey,
                Signature  = InternalState.SignedVoucher,
                CycleStart = InternalState.UnsignedVoucher.CycleStart,
                Nonce      = InternalState.UnsignedVoucher.Nonce,
            };

            InternalState.SignedVoucher   = null;
            InternalState.UnsignedVoucher = null;
            return(result);
        }
        public void ReceiveBobEscrowInformation(OpenChannelRequest openChannelRequest)
        {
            if (openChannelRequest == null)
            {
                throw new ArgumentNullException($"{nameof(openChannelRequest)}");
            }
            AssertState(BobServerChannelNegotiationStates.WaitingBobEscrowInformation);

            if (!VoucherKey.PubKey.Verify(openChannelRequest.Signature, NBitcoin.Utils.ToBytes((uint)openChannelRequest.CycleStart, true), openChannelRequest.Nonce))
            {
                throw new PuzzleException("Invalid voucher");
            }

            var escrow = new Key();
            var redeem = new Key();

            InternalState.EscrowKey      = escrow;
            InternalState.OtherEscrowKey = openChannelRequest.EscrowKey;
            InternalState.RedeemKey      = redeem;
            InternalState.Status         = BobServerChannelNegotiationStates.WaitingSignedTransaction;
        }