/// <summary>
        /// Initializes a new instance of <see cref="SignatureScript"/> using given parameters of the <see cref="ICoin"/>.
        /// </summary>
        public SignatureScript()
        {
            IsWitness     = false;
            OperationList = new IOperation[0];
            ScriptType    = ScriptType.ScriptSig;

            redeemBuilder = new RedeemScript();
            maxLenOrCount = 10000; // TODO: set this to a real value and from ICoin
        }
        /// <summary>
        /// Initializes a new instance of <see cref="PubkeyScript"/> using given parameters of the <see cref="ICoin"/>.
        /// </summary>
        public PubkeyScript()
        {
            IsWitness     = false;
            OperationList = new IOperation[0];
            ScriptType    = ScriptType.ScriptPub;

            addrManager        = new Address();
            hashFunc           = new Ripemd160Sha256();
            witHashFunc        = new Sha256(false);
            redeemScrBuilder   = new RedeemScript();
            op_return_MaxSize  = 80;
            compPubKeyLength   = (/*coin.Curve.NSizeInBits*/ 256 / 8) + 1;
            uncompPubKeyLength = ((compPubKeyLength - 1) * 2) + 1;
            minMultiPubCount   = 0;
            maxMultiPubCount   = 20;
            maxLenOrCount      = 10000;
        }
        //public void SetToP2SH_P2WPKH(PublicKey pubKey)
        //{
        //    if (pubKey == null)
        //        throw new ArgumentNullException(nameof(pubKey), "Public key can not be null.");

        //    redeemBuilder.SetToP2SH_P2WPKH(pubKey);
        //    SetToP2SH_P2WPKH(redeemBuilder);
        //}


        public void SetToP2SH_P2WSH(RedeemScript redeem)
        {
            if (redeem == null)
            {
                throw new ArgumentNullException(nameof(redeem), "Redeem script can not be null.");
            }
            if (redeem.GetRedeemScriptType() != RedeemScriptType.P2SH_P2WSH)
            {
                throw new ArgumentException("Invalid redeem script type.");
            }


            OperationList = new IOperation[]
            {
                new PushDataOp(redeem.ToByteArray())
            };
        }