From d1f3c2b9b4a693f37d0fb707382a13f2a0662b81 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Wed, 2 Aug 2017 16:50:18 -0700 Subject: [PATCH 1/3] bcc: initial bcc implementation. --- lib/blockchain/chain.js | 136 +++-- lib/blockchain/chaindb.js | 2 +- lib/net/common.js | 2 +- lib/net/seeds/main.js | 1171 +------------------------------------ lib/primitives/block.js | 6 +- lib/primitives/mtx.js | 130 +--- lib/primitives/tx.js | 32 +- lib/protocol/consensus.js | 48 +- lib/protocol/networks.js | 18 +- lib/script/common.js | 15 +- lib/script/script.js | 83 +-- lib/wallet/walletdb.js | 2 +- 12 files changed, 200 insertions(+), 1445 deletions(-) diff --git a/lib/blockchain/chain.js b/lib/blockchain/chain.js index de26a44bb..d6525ece7 100644 --- a/lib/blockchain/chain.js +++ b/lib/blockchain/chain.js @@ -389,9 +389,9 @@ Chain.prototype.verify = async function verify(block, prev, flags) { } } - // Check block weight (different from block size + // Check block size (different from block size // check in non-contextual verification). - if (block.getWeight() > consensus.MAX_BLOCK_WEIGHT) { + if (block.getBaseSize() > state.maxBlockSize()) { throw new VerifyError(block, 'invalid', 'bad-blk-weight', @@ -437,6 +437,13 @@ Chain.prototype.getDeployments = async function getDeployments(time, prev) { if (height >= this.network.block.bip65height) state.flags |= Script.flags.VERIFY_CHECKLOCKTIMEVERIFY; + // UAHF is now enabled. + const mtp = await prev.getMedianTime(); + if (mtp >= consensus.UAHF_TIME) { + state.flags = Script.flags.VERIFY_STRICTENC; + state.flags = Script.flags.VERIFY_SIGHASH_FORKID; + } + // CHECKSEQUENCEVERIFY and median time // past locktimes are now usable (bip9 & bip113). if (await this.isActive(prev, deployments.csv)) { @@ -445,41 +452,6 @@ Chain.prototype.getDeployments = async function getDeployments(time, prev) { state.lockFlags |= common.lockFlags.MEDIAN_TIME_PAST; } - // Check the state of the segwit deployment. - const witness = await this.getState(prev, deployments.segwit); - - // Segregrated witness (bip141) is now usable - // along with SCRIPT_VERIFY_NULLDUMMY (bip147). - if (witness === thresholdStates.ACTIVE) { - state.flags |= Script.flags.VERIFY_WITNESS; - state.flags |= Script.flags.VERIFY_NULLDUMMY; - } - - // Segsignal is now enforced (bip91). - if (this.options.bip91) { - if (witness === thresholdStates.STARTED) { - if (await this.isActive(prev, deployments.segsignal)) - state.bip91 = true; - } - } - - // UASF is now enforced (bip148) (mainnet-only). - if (this.options.bip148 && this.network === Network.main) { - if (witness !== thresholdStates.LOCKED_IN - && witness !== thresholdStates.ACTIVE) { - // The BIP148 MTP check is nonsensical in - // that it includes the _current_ entry's - // timestamp. This requires some hackery, - // since bcoin only operates on the sane - // assumption that deployment checks should - // only ever examine the values of the - // previous block (necessary for mining). - const mtp = await prev.getMedianTime(time); - if (mtp >= 1501545600 && mtp <= 1510704000) - state.bip148 = true; - } - } - return state; }; @@ -518,6 +490,9 @@ Chain.prototype.setDeploymentState = function setDeploymentState(state) { if (!this.state.hasBIP148() && state.hasBIP148()) this.logger.warning('BIP148 has been activated.'); + if (!this.state.hasUAHF() && state.hasUAHF()) + this.logger.warning('UAHF has been activated.'); + this.state = state; }; @@ -1995,38 +1970,55 @@ Chain.prototype.getTarget = async function getTarget(time, prev) { return pow.bits; } - // Do not retarget - if ((prev.height + 1) % pow.retargetInterval !== 0) { - if (pow.targetReset) { - // Special behavior for testnet: - if (time > prev.time + pow.targetSpacing * 2) - return pow.bits; - - while (prev.height !== 0 - && prev.height % pow.retargetInterval !== 0 - && prev.bits === pow.bits) { - const cache = prev.getPrevCache(); - - if (cache) { - prev = cache; - continue; - } + if ((prev.height + 1) % pow.retargetInterval === 0) { + // Back 2 weeks + const height = prev.height - (pow.retargetInterval - 1); + assert(height >= 0); + + const first = await prev.getAncestor(height); + assert(first); - prev = await prev.getPrevious(); - assert(prev); + return this.retarget(prev, first); + } + + // Do not retarget + if (pow.targetReset) { + // Special behavior for testnet: + if (time > prev.time + pow.targetSpacing * 2) + return pow.bits; + + while (prev.height !== 0 + && prev.height % pow.retargetInterval !== 0 + && prev.bits === pow.bits) { + const cache = prev.getPrevCache(); + + if (cache) { + prev = cache; + continue; } + + prev = await prev.getPrevious(); + assert(prev); } - return prev.bits; } - // Back 2 weeks - const height = prev.height - (pow.retargetInterval - 1); - assert(height >= 0); + if (prev.bits === pow.bits) + return prev.bits; + + const prev6 = await prev.getAncestor((prev.height + 1) - 7); + assert(prev6); + const mtp6 = (await prev.getMedianTime()) - (await prev6.getMedianTime()); + + if (mtp6 < 12 * 3600) + return prev.bits; - const first = await prev.getAncestor(height); - assert(first); + const target = consensus.fromCompact(prev.bits); + target.iadd(target.ushrn(2)); - return this.retarget(prev, first); + if (target.cmp(pow.limit) > 0) + return pow.bits; + + return consensus.toCompact(target); }; /** @@ -2634,6 +2626,26 @@ DeploymentState.prototype.hasBIP148 = function hasBIP148() { return this.bip148; }; +/** + * Test whether UAHF is active. + * @returns {Boolean} + */ + +DeploymentState.prototype.hasUAHF = function hasUAHF() { + return (this.flags & Script.flags.VERIFY_SIGHASH_FORKID) !== 0; +}; + +/** + * Test whether UAHF is active. + * @returns {Boolean} + */ + +DeploymentState.prototype.maxBlockSize = function maxBlockSize() { + return this.hasUAHF() + ? consensus.MAX_FORK_BLOCK_SIZE + : consensus.MAX_BLOCK_SIZE; +}; + /** * Orphan * @constructor diff --git a/lib/blockchain/chaindb.js b/lib/blockchain/chaindb.js index 9ea75d13e..abb57d5ab 100644 --- a/lib/blockchain/chaindb.js +++ b/lib/blockchain/chaindb.js @@ -82,7 +82,7 @@ ChainDB.prototype.open = async function open() { this.logger.info('Opening ChainDB...'); await this.db.open(); - await this.db.checkVersion('V', 3); + await this.db.checkVersion('V', 0x80 | 3); const state = await this.getState(); diff --git a/lib/net/common.js b/lib/net/common.js index fda0005ea..6deceff0c 100644 --- a/lib/net/common.js +++ b/lib/net/common.js @@ -142,7 +142,7 @@ exports.USER_AGENT = `/bcoin:${pkg.version}/`; * @default */ -exports.MAX_MESSAGE = 4 * 1000 * 1000; +exports.MAX_MESSAGE = 8 * 1000 * 1000; /** * Amount of time to ban misbheaving peers. diff --git a/lib/net/seeds/main.js b/lib/net/seeds/main.js index 9cdf0cd1e..104c4ef24 100644 --- a/lib/net/seeds/main.js +++ b/lib/net/seeds/main.js @@ -1,1172 +1,3 @@ 'use strict'; -module.exports = [ - '2.7.8.12:8333', - '2.228.70.198:8333', - '5.39.64.7:8333', - '5.45.80.34:38333', - '5.51.160.38:8333', - '5.61.33.33:8333', - '5.61.37.12:8333', - '5.95.80.47:8333', - '5.102.164.173:8333', - '5.175.71.130:8333', - '5.189.165.22:8333', - '5.199.130.228:8333', - '5.228.100.222:8333', - '5.255.64.231:8333', - '13.93.6.133:8333', - '18.85.34.10:8333', - '18.241.0.63:8333', - '23.28.128.65:8333', - '23.248.113.52:8333', - '23.253.151.73:8333', - '24.4.96.121:8333', - '24.69.65.191:8333', - '24.87.8.43:8333', - '24.150.224.110:8333', - '24.227.69.146:8333', - '27.0.235.33:8333', - '31.170.106.203:8333', - '31.184.197.96:8333', - '31.214.240.56:8333', - '37.1.202.134:8333', - '37.18.74.232:8333', - '37.34.48.17:8333', - '37.48.64.140:8333', - '37.97.141.116:8333', - '37.120.164.16:8333', - '37.120.169.123:8333', - '37.143.9.128:8333', - '37.153.172.227:8333', - '37.193.227.16:8333', - '37.205.8.78:8333', - '37.220.0.114:8333', - '37.232.218.199:8333', - '38.140.161.53:8333', - '40.87.70.120:8333', - '41.162.163.93:8333', - '42.2.198.48:8333', - '45.20.67.1:8333', - '45.55.197.77:8333', - '45.56.97.63:8333', - '45.58.38.162:8333', - '45.63.1.33:8333', - '45.79.2.70:8333', - '46.16.240.98:8333', - '46.19.137.74:8333', - '46.28.206.146:8333', - '46.32.252.197:8333', - '46.59.13.59:8333', - '46.59.39.195:8333', - '46.148.16.210:8333', - '46.160.195.121:8333', - '46.166.142.21:8333', - '46.166.160.29:8330', - '46.188.44.20:8333', - '46.229.238.187:8333', - '46.231.16.149:8333', - '47.88.100.130:8333', - '47.89.192.134:8333', - '47.185.194.160:8333', - '47.189.129.218:8333', - '49.65.2.140:8333', - '50.3.72.129:8333', - '50.31.99.225:8333', - '51.175.33.95:8333', - '52.1.165.219:8333', - '52.10.170.186:8333', - '52.51.128.216:8333', - '54.197.130.244:8333', - '58.59.2.22:8333', - '58.84.6.81:8333', - '59.125.8.143:8333', - '59.167.130.139:8333', - '61.47.2.20:8333', - '62.43.130.178:8333', - '62.76.96.6:8333', - '62.107.200.30:8333', - '62.133.15.58:8333', - '62.133.194.2:8333', - '62.133.194.156:8333', - '62.138.1.95:8333', - '62.216.238.3:8333', - '62.238.34.125:8333', - '63.137.40.207:8333', - '63.231.96.109:8333', - '64.78.240.150:8333', - '64.83.225.146:8333', - '64.137.236.68:8833', - '64.156.193.120:8333', - '66.79.160.82:8333', - '66.91.230.231:8333', - '66.135.128.121:8333', - '66.172.10.4:8333', - '66.194.38.250:8333', - '66.194.38.253:8333', - '66.215.34.26:8333', - '66.240.237.155:8333', - '67.205.96.108:8333', - '67.205.128.5:8333', - '67.219.233.140:8333', - '67.221.193.55:8333', - '68.100.196.118:8333', - '68.132.193.222:8333', - '68.168.118.234:8333', - '69.11.97.43:8333', - '69.30.229.10:8333', - '69.50.171.205:8333', - '69.125.193.145:8333', - '69.162.139.125:8333', - '70.35.98.39:8333', - '70.112.32.29:8333', - '71.126.181.146:8333', - '72.180.32.105:8333', - '73.226.64.145:8333', - '74.83.140.242:8333', - '74.84.128.158:9333', - '74.122.237.124:8333', - '74.215.133.145:8333', - '75.76.101.169:8333', - '75.85.13.8:8333', - '75.86.168.13:8333', - '75.170.97.25:8333', - '75.177.137.134:8333', - '76.76.227.136:8333', - '77.53.136.6:8333', - '77.110.11.52:8333', - '78.25.32.206:8333', - '78.34.8.120:8333', - '78.46.32.99:8333', - '78.56.9.214:8333', - '78.56.229.177:8333', - '78.129.237.245:8333', - '78.196.172.45:8333', - '79.132.230.144:8333', - '79.169.35.235:8333', - '79.172.194.219:8333', - '80.64.65.87:8333', - '80.89.137.115:8333', - '80.93.36.173:8333', - '80.101.167.100:8333', - '80.114.34.158:8333', - '80.127.136.50:8333', - '80.188.139.82:8333', - '80.222.39.77:8333', - '80.223.105.69:8333', - '80.229.151.187:8333', - '80.240.129.221:8333', - '81.7.10.238:8333', - '81.7.13.84:8333', - '81.27.96.92:8333', - '81.35.143.98:8333', - '81.82.201.5:8333', - '81.83.96.5:8333', - '81.169.227.36:8333', - '81.171.2.119:8333', - '81.171.38.130:8333', - '81.175.255.118:8333', - '81.207.8.49:8333', - '81.228.194.187:8333', - '82.9.1.77:8333', - '82.11.33.229:8333', - '82.102.13.117:8333', - '82.116.203.240:8333', - '82.130.103.16:8333', - '82.136.65.227:8333', - '82.158.227.238:8333', - '82.197.212.25:8333', - '82.199.102.10:8333', - '82.200.204.41:8333', - '82.200.204.119:8333', - '82.221.105.223:8333', - '82.221.108.27:8333', - '82.221.111.136:8333', - '82.221.139.97:8333', - '83.137.41.10:8333', - '83.143.130.19:8333', - '83.150.9.196:8333', - '83.169.2.43:8333', - '83.217.203.130:8333', - '83.249.88.52:8333', - '84.26.162.92:8333', - '84.42.193.6:8333', - '84.134.194.115:8333', - '84.201.32.115:8333', - '84.212.232.71:8333', - '84.238.140.176:8333', - '85.10.104.34:8333', - '85.21.144.226:8333', - '85.25.194.12:8333', - '85.144.79.190:8333', - '85.145.228.192:8333', - '85.194.238.130:8333', - '85.228.201.80:8333', - '85.229.228.174:8333', - '85.236.233.87:8333', - '86.80.204.185:8333', - '86.105.227.190:8333', - '86.135.39.40:8333', - '87.106.139.127:8333', - '87.120.8.5:8333', - '87.120.37.230:8333', - '87.239.101.102:8333', - '87.243.197.82:8333', - '88.112.112.173:8333', - '88.150.192.17:8333', - '88.185.155.134:8333', - '88.202.202.221:8333', - '88.202.230.87:8333', - '88.208.39.182:8333', - '89.34.99.41:8333', - '89.163.224.187:8333', - '89.169.233.150:8333', - '89.184.65.85:8333', - '89.212.91.219:8333', - '89.249.178.36:8333', - '90.149.38.172:8333', - '91.65.97.157:8333', - '91.107.64.143:8333', - '91.114.35.107:8333', - '91.135.0.187:8333', - '91.145.110.95:8333', - '91.157.38.151:8333', - '91.197.44.133:8333', - '91.205.176.54:8333', - '91.206.203.10:8333', - '91.206.203.18:8333', - '91.215.35.130:8333', - '91.219.239.159:8333', - '91.223.133.2:8333', - '91.223.133.40:8333', - '91.226.10.90:8333', - '91.240.141.169:8333', - '92.27.7.209:8333', - '92.89.67.207:8333', - '92.221.201.138:8333', - '93.95.187.122:8333', - '93.103.73.187:8333', - '93.123.80.47:8333', - '93.188.224.253:8333', - '93.190.69.242:8333', - '94.19.12.244:8333', - '94.156.128.116:8333', - '94.177.171.73:8333', - '94.181.44.104:8333', - '94.237.26.173:8333', - '94.242.229.158:8333', - '94.255.128.98:8333', - '95.79.35.50:8333', - '95.91.41.39:8333', - '95.110.234.93:8333', - '95.128.48.209:8333', - '95.183.48.71:8333', - '96.23.67.85:8333', - '97.64.177.10:8333', - '97.104.201.95:8333', - '98.29.197.149:8333', - '98.169.2.107:8333', - '99.232.48.72:8333', - '101.100.141.55:8333', - '103.7.32.40:8333', - '103.53.225.69:8333', - '103.249.106.74:8333', - '104.128.224.13:8333', - '104.128.228.252:8333', - '104.155.1.158:8333', - '104.168.128.50:8333', - '104.199.160.228:8333', - '104.204.109.11:8333', - '104.219.251.118:8333', - '104.223.3.129:8333', - '104.223.3.219:8333', - '104.238.130.182:8333', - '104.245.99.227:8333', - '106.38.234.89:8333', - '106.104.134.218:8333', - '107.136.6.71:8333', - '107.150.45.210:8333', - '107.151.144.103:8333', - '107.170.44.99:8333', - '107.181.137.133:8333', - '107.191.102.13:8333', - '108.58.252.82:8333', - '108.59.9.167:8333', - '108.59.12.163:8333', - '108.162.106.215:8333', - '108.168.133.164:8333', - '108.173.202.101:8333', - '108.180.110.190:8333', - '109.29.75.40:8333', - '109.120.194.136:8333', - '109.230.230.88:8333', - '109.235.67.115:8333', - '109.235.69.120:8333', - '109.236.90.199:8333', - '109.255.0.107:8333', - '110.10.130.12:8333', - '110.10.176.94:8333', - '110.132.172.251:8333', - '111.90.158.17:8333', - '115.66.205.171:8333', - '116.31.123.139:8333', - '118.192.48.46:8333', - '118.193.164.98:8333', - '119.29.156.231:8333', - '119.63.44.133:19980', - '119.81.99.27:8333', - '119.106.12.169:8333', - '119.147.137.155:19980', - '119.185.1.182:8333', - '120.55.193.136:8333', - '121.254.173.23:8333', - '121.254.173.40:8333', - '123.56.129.45:8333', - '123.203.163.128:8333', - '123.206.32.198:8333', - '124.189.160.221:8333', - '124.189.192.232:8333', - '128.140.224.162:8333', - '128.199.68.205:8333', - '130.234.207.115:8333', - '131.113.41.123:8333', - '131.114.72.104:8333', - '132.204.108.155:8333', - '134.119.13.230:8333', - '134.213.133.206:8333', - '134.213.133.207:8333', - '135.23.5.3:8333', - '137.74.0.66:8333', - '138.68.1.45:8333', - '138.68.2.194:8333', - '138.68.64.19:8333', - '138.68.64.28:8333', - '139.59.42.248:8333', - '139.220.240.153:8333', - '140.112.107.118:8333', - '140.186.224.112:8333', - '141.52.64.141:8333', - '142.68.237.107:8333', - '142.217.12.106:8333', - '146.60.204.92:8333', - '146.185.161.209:8333', - '148.103.7.119:8333', - '149.210.133.244:8333', - '150.229.0.143:8333', - '151.231.238.25:8333', - '151.248.160.227:8333', - '153.230.228.15:8333', - '155.133.43.249:8333', - '158.58.238.145:8333', - '158.109.79.13:34821', - '159.203.70.208:8333', - '160.16.206.31:8333', - '162.209.1.233:8333', - '162.209.4.125:8333', - '162.216.192.231:8333', - '162.243.100.111:8333', - '162.246.11.194:8333', - '162.248.102.117:8333', - '162.252.46.83:8333', - '163.172.33.78:8333', - '163.172.194.30:8333', - '169.229.198.106:8333', - '170.75.195.168:8333', - '172.103.205.197:8333', - '172.245.225.126:8333', - '173.179.37.8:8333', - '173.208.203.74:8333', - '173.252.46.16:8333', - '174.117.141.124:8333', - '175.126.38.158:8333', - '175.126.38.177:8333', - '175.139.106.119:8333', - '175.140.232.66:8333', - '176.9.117.100:8333', - '176.36.33.121:8333', - '176.36.99.222:8333', - '176.56.227.36:8333', - '176.100.100.206:8333', - '176.106.144.183:8333', - '176.123.7.148:8333', - '176.126.167.10:8333', - '176.223.201.198:8333', - '178.62.68.62:8333', - '178.62.102.56:8333', - '178.62.203.185:8333', - '178.124.197.101:8333', - '178.170.138.202:8333', - '178.175.129.18:8333', - '178.188.47.62:8333', - '178.199.240.22:8333', - '178.218.209.162:8333', - '178.237.35.34:8333', - '178.238.224.242:8333', - '178.254.34.144:8333', - '178.254.34.161:8333', - '179.43.183.2:8333', - '180.200.128.58:8333', - '182.93.34.130:8333', - '185.8.238.197:8333', - '185.11.139.172:8333', - '185.24.97.11:8333', - '185.24.233.100:8333', - '185.25.48.71:8333', - '185.25.48.114:8333', - '185.28.76.179:8333', - '185.70.105.152:8339', - '185.77.128.69:8333', - '185.77.128.241:8333', - '185.86.79.87:8333', - '185.89.102.2:3333', - '185.89.102.53:3333', - '185.109.144.155:8333', - '185.117.75.50:8333', - '185.121.173.223:8333', - '185.128.41.157:8333', - '185.130.226.106:8333', - '185.145.130.76:8333', - '188.63.192.104:8333', - '188.113.164.231:8333', - '188.166.229.112:8333', - '188.214.128.77:8333', - '190.10.8.211:8333', - '190.81.160.184:8333', - '190.111.231.19:8333', - '192.131.44.93:8333', - '192.206.202.6:8333', - '192.227.245.133:8333', - '192.241.74.123:8333', - '192.241.74.126:8333', - '192.254.71.222:8333', - '193.10.64.85:8333', - '193.46.80.101:8333', - '193.49.43.219:8333', - '193.93.79.215:8333', - '193.183.99.46:8333', - '193.234.224.195:8333', - '193.239.80.155:8333', - '194.63.140.208:8333', - '194.87.1.232:8333', - '194.187.227.18:8333', - '194.247.12.136:8333', - '195.91.176.86:8333', - '196.28.98.20:8333', - '198.44.249.35:8333', - '198.84.172.252:8333', - '198.204.224.106:8333', - '198.211.97.46:8333', - '199.66.64.198:8333', - '199.101.100.58:8333', - '199.101.100.59:8333', - '199.127.224.50:8333', - '200.46.241.71:8333', - '200.116.98.185:8333', - '203.9.225.13:8333', - '203.177.142.37:8333', - '205.200.247.149:8333', - '205.209.131.150:13838', - '206.53.64.74:8333', - '206.72.192.69:8333', - '206.123.112.180:8333', - '208.66.208.153:8333', - '208.68.174.76:8333', - '208.107.97.242:8333', - '208.111.48.132:8333', - '208.118.235.190:8333', - '209.6.205.126:8333', - '209.40.96.121:8333', - '209.58.130.137:8333', - '209.73.142.226:8333', - '209.90.224.4:8333', - '209.126.69.243:8333', - '209.126.108.91:8333', - '209.195.4.18:8333', - '209.250.6.190:8333', - '210.54.37.225:8333', - '210.223.3.44:8333', - '211.149.234.109:8333', - '212.51.140.183:8333', - '212.90.179.206:8333', - '212.93.226.90:8333', - '212.110.171.118:8333', - '212.202.132.17:8333', - '213.91.205.134:8333', - '213.165.68.218:8333', - '213.196.200.213:8333', - '216.59.4.212:8333', - '216.74.32.109:8333', - '216.158.225.70:8333', - '216.164.138.13:8333', - '216.167.236.247:8333', - '216.197.79.74:8333', - '217.11.225.189:8333', - '217.12.199.207:8333', - '217.20.130.72:8333', - '217.23.6.148:8333', - '217.23.140.103:8333', - '217.28.96.180:8333', - '217.35.130.42:8333', - '217.111.66.79:8333', - '217.158.9.102:8333', - '217.168.143.169:8333', - '217.209.32.219:8333', - '218.161.33.165:8333', - '221.121.144.138:8333', - '[2001:0:4137:9e76:2048:3a84:bb91:e846]:8333', - '[2001:0:4137:9e76:2066:e9e:b489:f8b8]:8333', - '[2001:0:4137:9e76:3854:1211:b5ac:a96b]:8333', - '[2001:0:4137:9e76:4e3:1f66:cd4c:829f]:8333', - '[2001:0:4137:9e76:ad:1f4:9ea9:fa2e]:8333', - '[2001:0:4137:9e76:e5:baa:b66f:f418]:8333', - '[2001:0:53aa:64c:20a2:59c4:ad22:93ea]:8333', - '[2001:0:53aa:64c:59:617f:a10d:e0]:8333', - '[2001:0:5ef5:79fb:200f:3ae5:3cbc:74c9]:8333', - '[2001:0:5ef5:79fb:38f2:13b4:b208:5604]:8333', - '[2001:0:5ef5:79fd:200b:22a7:cc50:f52d]:8333', - '[2001:0:5ef5:79fd:24ef:1aef:a994:303d]:8333', - '[2001:0:5ef5:79fd:24fc:b5d:ad4f:4db2]:8333', - '[2001:0:5ef5:79fd:28bf:2d23:e02e:c3ef]:8333', - '[2001:0:5ef5:79fd:3cd0:3c2e:da44:a759]:8333', - '[2001:0:5ef5:79fd:87e:fd7:b1c2:1b4]:8333', - '[2001:0:9d38:6ab8:18db:3bda:ab90:e81e]:8333', - '[2001:0:9d38:6ab8:4e7:1660:862f:a6d7]:8333', - '[2001:0:9d38:6ab8:6:2b:5074:9588]:8333', - '[2001:0:9d38:6abd:10f8:a7d7:bb90:f524]:8333', - '[2001:13d8:1c01:1000::11]:8333', - '[2001:15c0:65ff:610::2]:8333', - '[2001:1608:10:156:ae::4adb]:8333', - '[2001:1620:b1b:8888:20d:b9ff:fe41:6710]:8333', - '[2001:1620:b1b:face:20d:b9ff:fe41:6710]:8333', - '[2001:1620:f00:282::2]:8333', - '[2001:1620:f00:8282::1]:8333', - '[2001:1680:101:1ae::1]:8333', - '[2001:16d8:ff00:85de:20c:29ff:fe52:9594]:8333', - '[2001:19f0:4400:434d:5400:ff:fe42:2678]:8333', - '[2001:19f0:5000:8c8b:5400:ff:fe1f:c023]:8333', - '[2001:19f0:5000:8ce6:5400:ff:fe1b:24a9]:8333', - '[2001:19f0:5:314:5400:ff:fe2c:42e8]:8333', - '[2001:19f0:5:51b:5400:ff:fe49:fe5b]:8333', - '[2001:19f0:5:bc:5400:ff:fe3b:9339]:8333', - '[2001:1af8:4020:a020:5::]:8333', - '[2001:1bc8:1a0:590e:2e0:f4ff:fe16:3a39]:8333', - '[2001:1c04:1401:8f00:f4fe:4fff:fe0c:df40]:8333', - '[2001:4128:6135:10:20c:29ff:fe69:9e81]:8333', - '[2001:4128:6135:2010:21e:bff:fee8:a3c0]:8333', - '[2001:4128:6135:e001:5054:ff:fe37:e9eb]:8333', - '[2001:41d0:1000:1024::]:8333', - '[2001:41d0:1000:1433::]:8333', - '[2001:41d0:1004:22ae::]:8333', - '[2001:41d0:1004:2996::]:8333', - '[2001:41d0:1008:11e0::1a5c:6d9d]:8333', - '[2001:41d0:1008:11e0::b74:baf7]:8333', - '[2001:41d0:1008:237a::]:8333', - '[2001:41d0:1008:2752::]:8333', - '[2001:41d0:1008:494::]:8333', - '[2001:41d0:1:45d8::1]:8333', - '[2001:41d0:1:5630::1]:8333', - '[2001:41d0:1:6f57::1]:8333', - '[2001:41d0:1:801e::1]:8333', - '[2001:41d0:1:8852::1]:8333', - '[2001:41d0:1:8b26::1]:8333', - '[2001:41d0:1:a5b8::1]:8333', - '[2001:41d0:1:b26b::1]:8333', - '[2001:41d0:1:c139::1]:8333', - '[2001:41d0:1:c8d7::1]:8333', - '[2001:41d0:1:d227::]:8333', - '[2001:41d0:1:dbc4::1]:8333', - '[2001:41d0:1:dc5d::1]:8333', - '[2001:41d0:1:e13b::1]:8333', - '[2001:41d0:1:ef5b::1]:8333', - '[2001:41d0:2:16be::1]:8333', - '[2001:41d0:2:203c::1]:8333', - '[2001:41d0:2:38c5::1]:8333', - '[2001:41d0:2:519::]:8333', - '[2001:41d0:2:9c94::1]:8333', - '[2001:41d0:2:b792::]:8333', - '[2001:41d0:2:bf2a::]:8333', - '[2001:41d0:2:c793::]:8333', - '[2001:41d0:2:c9bf::]:8333', - '[2001:41d0:303:4f0::]:8333', - '[2001:41d0:8:1a8a::1]:8333', - '[2001:41d0:8:3fa9::1]:8333', - '[2001:41d0:8:4670::1]:8333', - '[2001:41d0:8:4f48::1]:8333', - '[2001:41d0:8:6728::]:8333', - '[2001:41d0:8:72c2:d:242:ac11:2]:8333', - '[2001:41d0:8:8007::]:8333', - '[2001:41d0:8:a71c::]:8333', - '[2001:41d0:8:bccc::1]:8333', - '[2001:41d0:8:bd45::1]:8333', - '[2001:41d0:8:c67c::]:8333', - '[2001:41d0:8:de3d::1]:8333', - '[2001:41d0:8:e257::1]:8333', - '[2001:41d0:8:e3e4::1]:8333', - '[2001:41d0:a:14cc::1]:8333', - '[2001:41d0:a:15b2::1]:8333', - '[2001:41d0:a:1ac9::1]:8333', - '[2001:41d0:a:2496::1]:8333', - '[2001:41d0:a:308c::]:8333', - '[2001:41d0:a:5879::]:8333', - '[2001:41d0:a:6810::1]:8333', - '[2001:41d0:a:682d::1]:8333', - '[2001:41d0:a:6c29::1]:8333', - '[2001:41d0:a:f52a::1]:8333', - '[2001:41d0:d:111c::]:8333', - '[2001:41d0:e:1388::1]:8333', - '[2001:41d0:e:26b::1]:8333', - '[2001:41d0:e:f73::1]:8333', - '[2001:41d0:fc8c:a200:7a24:afff:fe9d:c69b]:8333', - '[2001:41f0:61:0:72f3:95ff:fe09:7521]:8333', - '[2001:41f0:61::7]:8333', - '[2001:4428:200:8171:db6:2ff4:9c0e:a2da]:8333', - '[2001:470:1f07:151c:baac:6fff:feb7:3ba9]:8333', - '[2001:470:1f0b:ad6:a60:6eff:fec6:2323]:8333', - '[2001:470:1f11:617::10f]:8333', - '[2001:470:1f14:73e::2]:8333', - '[2001:470:1f14:7d::2]:8333', - '[2001:470:1f15:11f8::10]:8333', - '[2001:470:1f15:1b95:2c3e:8a9a:24e1:7084]:8333', - '[2001:470:1f15:e9b::3ef]:8333', - '[2001:470:1f1d:3a9::10]:8333', - '[2001:470:25:482::2]:8333', - '[2001:470:27:19f::2]:8333', - '[2001:470:27:665::2]:8333', - '[2001:470:28:365::4]:8333', - '[2001:470:41:6::2]:8333', - '[2001:470:727b::11:14]:8333', - '[2001:470:7:2f0::2]:8333', - '[2001:470:7:65::2]:8333', - '[2001:470:7f85::2]:8333', - '[2001:470:8:2e1:5825:39df:3e4c:54a8]:8333', - '[2001:470:8:2e1::43]:8333', - '[2001:470:8:2e1:ae2a:e257:4470:6350]:8333', - '[2001:470:a:c13::2]:8333', - '[2001:4801:7819:74:b745:b9d5:ff10:a61a]:8333', - '[2001:4801:7819:74:b745:b9d5:ff10:aaec]:8333', - '[2001:4801:7828:104:be76:4eff:fe10:1325]:8333', - '[2001:4802:7800:2:30d7:1775:ff20:1858]:8333', - '[2001:4ba0:babe:832::]:8333', - '[2001:4ba0:cafe:379::1]:8333', - '[2001:4ba0:ffee:33::10]:8333', - '[2001:4dd0:ff00:9a67::9]:8333', - '[2001:610:1b19::3]:8333', - '[2001:610:600:a41::2]:8333', - '[2001:678:174:4021::2:8333]:8333', - '[2001:67c:16dc:1201:5054:ff:fe17:4dac]:8333', - '[2001:67c:2128:ffff:6062:36ff:fe30:6532]:8333', - '[2001:67c:2564:331:3547:6e28:85a4:fb27]:8333', - '[2001:6a0:200:368::2]:8333', - '[2001:718:801:311:5054:ff:fe19:c483]:8333', - '[2001:7b8:2ff:8f::2]:8333', - '[2001:8d8:8a6:4400::3f:86c]:8333', - '[2001:8d8:923:8400::87:ebd]:8333', - '[2001:960:66d::2]:8333', - '[2001:981:46:1:ba27:ebff:fe5b:edee]:8333', - '[2001:ba8:1f1:f069::2]:8333', - '[2001:bc8:225f:10e:505:6573:7573:d0a]:8333', - '[2001:bc8:2706::1]:8333', - '[2001:bc8:323c:100::53]:8333', - '[2001:bc8:323c:100::80:4]:8333', - '[2001:bc8:323c:100::cafe]:8333', - '[2001:bc8:3680:4242::1]:8333', - '[2001:bc8:399f:f000::1]:8333', - '[2001:bc8:3cbf::5]:8333', - '[2001:bc8:4700:2300::19:807]:8333', - '[2001:e42:102:1805:160:16:206:31]:8333', - '[2002:12f1:3f::12f1:3f]:8333', - '[2002:1e2:5349::1e2:5349]:8333', - '[2002:1e2:5588::1e2:5588]:8333', - '[2002:2501:cf62::2501:cf62]:8333', - '[2002:268c:a135::268c:a135]:8333', - '[2002:2a33:99db::2a33:99db]:8332', - '[2002:2ebc:2c14::7]:8333', - '[2002:2f59:2c9c::2f59:2c9c]:11885', - '[2002:2f5a:3619::2f5a:3619]:8333', - '[2002:2f5a:36a4::2f5a:36a4]:8333', - '[2002:2f5a:429::2f5a:429]:8333', - '[2002:2f5a:562a::2f5a:562a]:8333', - '[2002:3a3b:216::3a3b:216]:8333', - '[2002:3dfa:5d23::3dfa:5d23]:8333', - '[2002:424f:a052::424f:a052]:8333', - '[2002:451e:e922::451e:e922]:8333', - '[2002:4540:4b30::4540:4b30]:8333', - '[2002:51ab:7cc::51ab:7cc]:8333', - '[2002:527:de11::527:de11]:8333', - '[2002:5395:7d01::5395:7d01]:8333', - '[2002:5395:7d2a::5395:7d2a]:8333', - '[2002:5669:e3be::5669:e3be]:8333', - '[2002:566a:5d6d::566a:5d6d]:8333', - '[2002:59b9:f820::59b9:f820]:8333', - '[2002:59f8:ac69::59f8:ac69]:8333', - '[2002:5bd4:b65a::5bd4:b65a]:8333', - '[2002:5c3f:39db::5c3f:39db]:8333', - '[2002:5d33:8d03::5d33:8d03]:8333', - '[2002:5d67:49bb::5d67:49bb]:8333', - '[2002:5dae:5d5f::5dae:5d5f]:8333', - '[2002:5dbe:8cc6::5dbe:8cc6]:8333', - '[2002:5dbe:9503::5dbe:9503]:8333', - '[2002:5fd3:8944::5fd3:8944]:8333', - '[2002:5fd3:9467::5fd3:9467]:8333', - '[2002:67f9:6a48::67f9:6a48]:8333', - '[2002:67f9:6a4a::67f9:6a4a]:8333', - '[2002:67f9:6a95::67f9:6a95]:8333', - '[2002:6a0e:3ea8::6a0e:3ea8]:10011', - '[2002:6b96:375a::6b96:375a]:8333', - '[2002:6ca8:cffb::6ca8:cffb]:8333', - '[2002:6caf:234::6caf:234]:8333', - '[2002:6dec:58f5::6dec:58f5]:8333', - '[2002:6dec:5ac7::6dec:5ac7]:8333', - '[2002:7237:4a02::7237:4a02]:20033', - '[2002:7237:94fd::7237:94fd]:10011', - '[2002:7237:e428::7237:e428]:8333', - '[2002:7237:fcf6::7237:fcf6]:20188', - '[2002:76c0:96e6::76c0:96e6]:8333', - '[2002:7819:7e80::7819:7e80]:7743', - '[2002:781a:ea86::781a:ea86]:8333', - '[2002:781a:f3c2::781a:f3c2]:14475', - '[2002:784c:c2c0::784c:c2c0]:8333', - '[2002:784c:ec97::784c:ec97]:8333', - '[2002:792b:261a::792b:261a]:8333', - '[2002:88f3:8cca::88f3:8cca]:8333', - '[2002:88f3:a83c::88f3:a83c]:8333', - '[2002:8ac9:516f::8ac9:516f]:8333', - '[2002:8b81:6d78::8b81:6d78]:50344', - '[2002:8b81:6e5c::8b81:6e5c]:38176', - '[2002:8bc4:90a6::8bc4:90a6]:8333', - '[2002:ac52:b854::ac52:b854]:8333', - '[2002:add0:c14a::add0:c14a]:8333', - '[2002:b07e:a70a::b07e:a70a]:8333', - '[2002:b27c:c565:1::250]:8333', - '[2002:b27c:c565::1]:8333', - '[2002:b94d:80f1::b94d:80f1]:8333', - '[2002:b982:e26a::b982:e26a]:8333', - '[2002:bcd5:3145::bcd5:3145]:8333', - '[2002:c08a:d22b::c08a:d22b]:8333', - '[2002:c0c7:f8e3::c0c7:f8e3]:32771', - '[2002:c1a9:fc5a::c1a9:fc5a]:8333', - '[2002:c23f:8fc5::c23f:8fc5]:8333', - '[2002:d395:ea6d::d395:ea6d]:8333', - '[2002:d917:ca5::d917:ca5]:8333', - '[2002:d917:e91::d917:e91]:8333', - '[2002:db71:f434::db71:f434]:8333', - '[2400:2651:161:1000:6847:d40f:aaa3:4848]:8333', - '[2400:8901::f03c:91ff:fec8:4280]:8333', - '[2401:1800:7800:102:be76:4eff:fe1c:a7d]:8333', - '[2401:2500:203:10:153:120:156:83]:8333', - '[2401:a400:3200:5600:14ee:f361:4bdc:1f7c]:8333', - '[2403:4200:403:2::ff]:8333', - '[2405:aa00:2::40]:8333', - '[240b:10:ca20:f0:224:e8ff:fe1f:60d9]:8333', - '[240b:250:1e0:2400:b9ef:8fe3:a69a:7378]:8333', - '[240d:1a:302:8600:8876:a36d:12ee:f285]:8333', - '[2600:3c00::f03c:91ff:fe91:3e49]:8333', - '[2600:3c00::f03c:91ff:febb:981e]:8333', - '[2600:3c01::f03c:91ff:fe18:6adf]:8333', - '[2600:3c01::f03c:91ff:fe69:89e9]:8333', - '[2600:3c01::f03c:91ff:fe91:6a29]:8333', - '[2600:3c01::f03c:91ff:fef1:1eaa]:8333', - '[2600:3c03::f03c:91ff:fe18:da80]:8333', - '[2600:3c03::f03c:91ff:fe28:1445]:8333', - '[2600:3c03::f03c:91ff:fe67:d2e]:8333', - '[2600:3c03::f03c:91ff:fe89:116f]:8333', - '[2600:3c03::f03c:91ff:feb0:5fc4]:8333', - '[2600:3c03::f03c:91ff:fee0:233e]:8333', - '[2600:3c03::f03c:91ff:fee0:51]:8333', - '[2600:8805:2400:14e:226:4aff:fe02:2ba4]:8333', - '[2600:8807:5080:3301:1487:83b7:33d7:eb97]:8333', - '[2601:186:c100:6bcd:16bd:cea1:235d:1c19]:8333', - '[2601:18c:4200:28d0:e4d:e9ff:fec5:76d0]:8333', - '[2601:247:8201:6251:30e6:7b95:69bf:9248]:8333', - '[2601:602:9980:f78:211:11ff:fec5:1ae]:8333', - '[2602:ae:1993:de00:2c50:9a44:8f11:77a5]:8333', - '[2602:ff68:0:1:21e:bff:feca:db72]:8333', - '[2602:ff68:0:1:2bd:27ff:feb0:adf8]:8333', - '[2602:ff68:0:1::5]:8333', - '[2602:ff68:0:5:2bd:27ff:feb0:adf8]:8333', - '[2602:ffc5:1f::1f:2d61]:8333', - '[2602:ffc5:1f::1f:9211]:8333', - '[2602:ffc5::9e63:27a2]:8333', - '[2602:ffc5::c30:1c75]:8333', - '[2602:ffc5::ffc5:b844]:8333', - '[2602:ffe8:100:2::457:936b]:8333', - '[2604:180:2:eee::ca46]:8333', - '[2604:880:d:85::be37]:8333', - '[2604:9a00:2100:a009:2::]:8333', - '[2604:a880:2:d0::301:8001]:8333', - '[2604:a880:2:d0::4a9:1001]:8333', - '[2604:a880:2:d0::53a:c001]:8333', - '[2604:a880:400:d0::ad7:e001]:8333', - '[2604:a880:400:d0::dcf:f001]:8333', - '[2605:4d00::50]:8333', - '[2605:6000:edc8:300::ddfe]:8333', - '[2605:6000:ffc0:70:74d5:225c:f553:5bb8]:8333', - '[2606:6000:c148:7003:5054:ff:fe78:66ff]:8333', - '[2606:6000:e6d6:d701:d428:5e44:a2c9:3ff6]:8333', - '[2606:c680:1:4a:2016:d1ff:fe93:52a7]:8333', - '[2607:5300:203:118:3733::1414]:8333', - '[2607:5300:60:13bb::1]:8333', - '[2607:5300:60:1966::1]:8333', - '[2607:5300:60:2218::]:8333', - '[2607:5300:60:3775::]:8333', - '[2607:5300:60:3ddf::]:8333', - '[2607:5300:60:a654::]:8333', - '[2607:5300:60:a7a3::]:8333', - '[2607:5300:60:ac0::1]:8333', - '[2607:5300:60:cf97::]:8333', - '[2607:f0d0:1901:19::6]:8333', - '[2607:f128:40:1202:69:162:139:125]:8333', - '[2607:f128:40:1703::2]:8333', - '[2607:f178:0:8::106]:8333', - '[2607:f1c0:84d:8900::7e:cad]:8333', - '[2607:f948:0:1::1:40]:8333', - '[2607:fcd0:100:2302::6094:635a]:8333', - '[2607:fcd0:100:6a00::3a96:1]:8333', - '[2607:fcd0:100:6a02::7ff0:1]:8333', - '[2607:fcd0:100:8203::8c58:dbc]:8333', - '[2607:fea8:1360:9c2:221a:6ff:fe47:776d]:8333', - '[2607:fea8:4da0:9ce:5114:a8ec:20f5:a50b]:8333', - '[2607:fea8:5df:fda0:feaa:14ff:feda:c79a]:8333', - '[2607:fea8:84c0:163:f42c:baff:fecc:6bbf]:8333', - '[2607:ff10:c5:502:225:90ff:fe32:d446]:8333', - '[2607:ff48:aa81:800::96cf:1]:8333', - '[2620:11c:5001:1118:d267:e5ff:fee9:e673]:8333', - '[2620:b8:4000:1000::93:1]:8333', - '[2800:1a0::9]:8333', - '[2a00:1178:2:43:19fd:d43e:b77:edeb]:8333', - '[2a00:1178:2:43:b4e3:e562:f811:d761]:8333', - '[2a00:14f0:e000:80d2:cd1a::1]:8333', - '[2a00:1630:14::101]:8333', - '[2a00:1630:2:1802:188:122:91:11]:8333', - '[2a00:1630:2:500::4]:8333', - '[2a00:1768:2001:24::148:218]:8333', - '[2a00:1768:2001:27::142:21]:8333', - '[2a00:1a48:7810:101:be76:4eff:fe08:c774]:8333', - '[2a00:1ca8:37::a5fc:40d1]:8333', - '[2a00:1ca8:37::ab6d:ce2c]:8333', - '[2a00:1dc0:2255:10::2]:8333', - '[2a00:7c80:0:71::8]:8333', - '[2a00:7c80:0:97::7]:8333', - '[2a00:bbe0:0:42:222:64ff:fe9a:e206]:8333', - '[2a00:c98:2050:a020:3::110]:8333', - '[2a00:dcc0:eda:98:183:193:1d24:b53a]:8333', - '[2a00:dcc0:eda:98:183:193:c382:6bdb]:8333', - '[2a00:dcc0:eda:98:183:193:f72e:d943]:8333', - '[2a00:f90:ff0:c100:53c4:97a7:8b59:796a]:8333', - '[2a01:238:435c:de00:b110:38cf:192d:b2c]:28333', - '[2a01:348:6:7cf::2]:8333', - '[2a01:368:e012:8888:216:3eff:fe24:1162]:8333', - '[2a01:488:66:1000:53a9:22b:0:1]:8333', - '[2a01:488:67:1000:523:ffa7:0:1]:8333', - '[2a01:488:67:1000:b01c:3379:0:1]:8333', - '[2a01:4f8:100:34ce::2]:8333', - '[2a01:4f8:100:44e7::2]:8333', - '[2a01:4f8:10a:2e4::2]:8333', - '[2a01:4f8:10a:34e::2]:8333', - '[2a01:4f8:10a:51d::2]:8333', - '[2a01:4f8:10a:622::2]:8333', - '[2a01:4f8:10a:85f::2]:8333', - '[2a01:4f8:10a:864::2]:8333', - '[2a01:4f8:10a:d04::2]:8333', - '[2a01:4f8:110:334c::2]:8333', - '[2a01:4f8:110:536e::2]:8333', - '[2a01:4f8:120:43e4::2]:8333', - '[2a01:4f8:120:702e::2]:8333', - '[2a01:4f8:121:4346::2]:8333', - '[2a01:4f8:130:3332::2]:8333', - '[2a01:4f8:131:33ad::2]:8333', - '[2a01:4f8:131:33ad:fea1::666]:8333', - '[2a01:4f8:140:31b0::2]:8333', - '[2a01:4f8:140:4088::2]:8333', - '[2a01:4f8:140:931a::2]:8333', - '[2a01:4f8:140:93b0::2]:8333', - '[2a01:4f8:141:13ad::c451]:8333', - '[2a01:4f8:141:186::2]:8333', - '[2a01:4f8:141:22ae::2]:8333', - '[2a01:4f8:141:322c::2]:8333', - '[2a01:4f8:150:11d4::2]:8333', - '[2a01:4f8:150:440f::2]:8333', - '[2a01:4f8:150:61ee::2]:8333', - '[2a01:4f8:150:726b::2]:8333', - '[2a01:4f8:151:30c9::2]:15000', - '[2a01:4f8:151:41a2::2]:8333', - '[2a01:4f8:151:41cc::2]:8333', - '[2a01:4f8:151:52c6::154]:8333', - '[2a01:4f8:151:600b::1:1]:8333', - '[2a01:4f8:151:7175::2]:8333', - '[2a01:4f8:160:41f0::1:33]:8333', - '[2a01:4f8:160:5328::27f0:187a]:8333', - '[2a01:4f8:160:814f::2]:8333', - '[2a01:4f8:161:21ad::333:30]:8333', - '[2a01:4f8:161:7026::2]:8333', - '[2a01:4f8:162:4110::2]:8333', - '[2a01:4f8:162:4348::2]:8333', - '[2a01:4f8:171:1c1b::2]:8333', - '[2a01:4f8:171:1c3::2]:8333', - '[2a01:4f8:171:2258::2]:8333', - '[2a01:4f8:171:2a70::2]:8333', - '[2a01:4f8:171:2e1b::2]:8333', - '[2a01:4f8:171:2f28::2]:8333', - '[2a01:4f8:171:3248::2]:8333', - '[2a01:4f8:171:380c::2]:8333', - '[2a01:4f8:171:b93::2]:8333', - '[2a01:4f8:171:d0a::2]:8333', - '[2a01:4f8:172:116c::2]:8333', - '[2a01:4f8:172:1287::2]:8333', - '[2a01:4f8:172:17a9::2]:8333', - '[2a01:4f8:172:1ca7::2]:8333', - '[2a01:4f8:172:2159::2]:8333', - '[2a01:4f8:172:3a41::2]:8333', - '[2a01:4f8:172:3b42::2]:8333', - '[2a01:4f8:172:3ec1::2]:8333', - '[2a01:4f8:172:3ec2::2]:8333', - '[2a01:4f8:172:aeb::2]:8333', - '[2a01:4f8:172:aec::2]:8333', - '[2a01:4f8:173:10ab::2]:8333', - '[2a01:4f8:173:1551::2]:8333', - '[2a01:4f8:173:1bca::2]:8333', - '[2a01:4f8:173:1e2e::2]:8333', - '[2a01:4f8:173:2162::2]:8333', - '[2a01:4f8:173:21e6::2]:8333', - '[2a01:4f8:173:42::2]:8333', - '[2a01:4f8:173:cc1::2]:8333', - '[2a01:4f8:190:1253::2]:8333', - '[2a01:4f8:190:24eb::2]:8333', - '[2a01:4f8:190:34f0::2]:8333', - '[2a01:4f8:190:528d::2]:8333', - '[2a01:4f8:190:91ce::2]:8333', - '[2a01:4f8:191:2194::83]:8333', - '[2a01:4f8:191:40e8::2]:8333', - '[2a01:4f8:191:8165::2]:22556', - '[2a01:4f8:191:81b7::2]:8333', - '[2a01:4f8:191:8328::3]:8333', - '[2a01:4f8:192:11b2::2]:8343', - '[2a01:4f8:192:216c::2]:8333', - '[2a01:4f8:192:22af::2]:8333', - '[2a01:4f8:192:2422::2]:8333', - '[2a01:4f8:192:34d0::2]:8333', - '[2a01:4f8:192:440b::2]:8333', - '[2a01:4f8:192:5230::2]:8333', - '[2a01:4f8:192:db::2]:8333', - '[2a01:4f8:200:1012::2]:8333', - '[2a01:4f8:200:414e::2]:8333', - '[2a01:4f8:200:416a::2]:8333', - '[2a01:4f8:201:21a7::2]:8333', - '[2a01:4f8:201:4017::11]:8333', - '[2a01:4f8:201:6011::4]:8333', - '[2a01:4f8:201:60d5::2]:8333', - '[2a01:4f8:202:12d6::2]:8333', - '[2a01:4f8:202:31e3::2]:8333', - '[2a01:4f8:202:32c6::2]:8333', - '[2a01:4f8:202:53c3::2]:8333', - '[2a01:4f8:211:14cf::2]:8333', - '[2a01:4f8:211:1ec5::2]:8333', - '[2a01:4f8:211:483::2]:8333', - '[2a01:4f8:211:d99::8]:8333', - '[2a01:4f8:212:1826::2]:8333', - '[2a01:4f8:212:27a8::2]:8333', - '[2a01:4f8:221:801::2]:8333', - '[2a01:4f8:a0:12cc::2]:8333', - '[2a01:4f8:a0:746a:101:1:1:2]:8333', - '[2a01:4f8:a0:828a::2]:8333', - '[2a01:4f8:c17:2eef::2]:8333', - '[2a01:4f8:c17:2f3c::2]:3333', - '[2a01:4f8:c17:3b02::2]:8333', - '[2a01:4f8:c17:4245::2]:8333', - '[2a01:4f8:c17:464f::2]:8333', - '[2a01:4f8:c17:4a1c::2]:8333', - '[2a01:4f8:c17:4c5d::2]:8333', - '[2a01:4f8:c17:67f8::2]:8333', - '[2a01:4f8:c17:6dd0::2]:8333', - '[2a01:4f8:c17:710b::2]:8333', - '[2a01:4f8:c17:714::2]:8333', - '[2a01:4f8:c17:72c6::2]:8333', - '[2a01:608:ffff:a009:8bf5:879d:e51a:f837]:8333', - '[2a01:680:10:10::1]:8333', - '[2a01:6f0:ffff:120::8dcb]:8333', - '[2a01:79c:cebc:857c:98c1:88ff:fef5:90de]:8333', - '[2a01:79d:7377:2629:7e57:7e57:1:1]:8333', - '[2a01:7c8:aaac:43d:5054:ff:fe4e:3dd4]:8333', - '[2a01:7c8:aab5:3e6:5054:ff:fed7:4e54]:8333', - '[2a01:7c8:aabd:3d5:5054:ff:fe95:f586]:8333', - '[2a01:7c8:aac1:453:d0d2:af96:fa88:5d0e]:8333', - '[2a01:7c8:aac3:663:5054:ff:fe25:8c69]:8333', - '[2a01:7c8:aac3:97:5054:ff:fea7:3780]:8333', - '[2a01:7c8:aac4:567:5054:ff:fedc:518a]:8333', - '[2a01:7e00::f03c:91ff:fe26:8c87]:8333', - '[2a01:7e00::f03c:91ff:fe50:94b8]:8333', - '[2a01:7e00::f03c:91ff:fe55:2c]:8333', - '[2a01:7e00::f03c:91ff:fe89:1143]:8333', - '[2a01:7e00::f03c:91ff:fe89:53fd]:8333', - '[2a01:7e00::f03c:91ff:fedf:b70f]:8333', - '[2a01:b000::4166:515b:ef9e:b3]:8333', - '[2a01:b2e0:2::40]:8333', - '[2a01:e34:ec29:24c0:f3:ddaf:9f59:586f]:8333', - '[2a01:e34:eed7:6670:ec1b:bf7c:b012:6069]:8333', - '[2a01:e35:2ee5:610:21f:d0ff:fe4e:7460]:8333', - '[2a01:e35:8a3f:47c0:c617:feff:fe3c:9fbd]:8333', - '[2a01:e35:8bff:70b0:1e1b:dff:fe0b:236d]:8333', - '[2a02:1205:34c3:a4e0:d63d:7eff:fe98:10c8]:8333', - '[2a02:1205:34da:aa00:5882:249d:ddbf:bc43]:8333', - '[2a02:1205:5051:a640:d6ae:52ff:fea3:ac]:8333', - '[2a02:1205:c689:d980:baae:edff:feea:9445]:8333', - '[2a02:120b:2c2a:5ec0:10dd:31ff:fe42:5079]:8333', - '[2a02:120b:2c35:69d0:219:99ff:fe6b:4ec3]:8333', - '[2a02:120b:c3c2:ff60:21f:5bff:fec3:a7ad]:24312', - '[2a02:13b8:4000:1000:216:e6ff:fe92:8619]:8333', - '[2a02:13b8:4000:1000::27]:8333', - '[2a02:17d0:2a:4400:40f:3dd4:b053:47ad]:8333', - '[2a02:180:1:1::517:afb]:8333', - '[2a02:180:6:1::18]:8333', - '[2a02:1810:1d11:f900:6872:f28e:8126:f635]:8333', - '[2a02:27a8:0:1:52e5:49ff:fee3:3b49]:8333', - '[2a02:348:86:3011::1]:8333', - '[2a02:390:9000:0:218:7dff:fe10:be33]:8333', - '[2a02:582:78c1:7600:2d49:6212:29d3:abb]:8333', - '[2a02:6080::1:190b:69e3]:8333', - '[2a02:750:7:3305::575]:8333', - '[2a02:752:100:3::53]:8333', - '[2a02:7aa0:1201::7501:d950]:8333', - '[2a02:7aa0:1201::deb3:81a2]:8333', - '[2a02:7aa0:1619::a037:69a6]:8333', - '[2a02:810d:14c0:8694:d250:99ff:fe81:23d9]:8333', - '[2a02:a50::dacb:8aff:fe36:8d2d]:8333', - '[2a02:c200:0:10:3:0:2591:1]:8333', - '[2a02:c200:1:10:2:5:9982:1]:8333', - '[2a02:c200:1:10:3:0:9290:1]:8333', - '[2a02:c205:3000:7158::1]:8333', - '[2a02:c205:3001:4522::1]:8333', - '[2a02:c205:3001:6549::1]:8333', - '[2a02:c207:2008:3772::1]:8333', - '[2a02:c207:2008:6519::1]:8333', - '[2a02:c207:2009:213::1]:8333', - '[2a02:c207:2009:7858::1]:8333', - '[2a02:c207:2010:302::1]:8333', - '[2a02:c207:3001:5824::1]:8333', - '[2a02:ce80:0:20::1]:8333', - '[2a03:4000:2:496::8]:8333', - '[2a03:4000:6:416c::53]:8333', - '[2a03:4000:6:8009::1]:8333', - '[2a03:4000:9:8e::1]:8333', - '[2a03:7380:2140:17:51fe:3519:b571:4a13]:8333', - '[2a03:b0c0:0:1010::7a3:1001]:8333', - '[2a03:b0c0:0:1010::7aa:4001]:8333', - '[2a03:b0c0:3:d0::1b99:c001]:8333', - '[2a03:b0c0:3:d0::1b99:e001]:8333', - '[2a03:b0c0:3:d0::1b9a:3001]:8333', - '[2a03:b0c0:3:d0::2208:6001]:8333', - '[2a03:b0c0:3:d0::23f7:1001]:8333', - '[2a03:b0c0:3:d0::23f7:9001]:8333', - '[2a03:b0c0:3:d0::23fb:2001]:8333', - '[2a03:b0c0:3:d0::23fb:3001]:8333', - '[2a03:b0c0:3:d0::23fb:5001]:8333', - '[2a03:b0c0:3:d0::23fb:7001]:8333', - '[2a03:b0c0:3:d0::2400:1]:8333', - '[2a03:b0c0:3:d0::2400:3001]:8333', - '[2a03:b0c0:3:d0::2400:e001]:8333', - '[2a03:b0c0:3:d0::2401:e001]:8333', - '[2a03:b0c0:3:d0::2402:2001]:8333', - '[2a03:b0c0:3:d0::2402:8001]:8333', - '[2a03:b0c0:3:d0::2402:9001]:8333', - '[2a03:b0c0:3:d0::2402:b001]:8333', - '[2a03:b0c0:3:d0::2402:d001]:8333', - '[2a03:b0c0:3:d0::2403:1001]:8333', - '[2a03:b0c0:3:d0::2403:2001]:8333', - '[2a03:b0c0:3:d0::2403:4001]:8333', - '[2a03:b0c0:3:d0::2403:6001]:8333', - '[2a03:b0c0:3:d0::2403:a001]:8333', - '[2a03:b0c0:3:d0::2403:b001]:8333', - '[2a03:b0c0:3:d0::2403:f001]:8333', - '[2a03:b0c0:3:d0::2404:6001]:8333', - '[2a03:b0c0:3:d0::2404:b001]:8333', - '[2a03:f80:ed15:149:154:155:235:1]:8333', - '[2a04:1980:3100:1aac:e61d:2dff:fe29:f241]:8333', - '[2a04:1980:3100:1aac:e61d:2dff:fe29:f251]:8333', - '[2a04:2180:0:1::5a49:3c06]:8333', - '[2a04:2180:1:7::3]:8333', - '[2a04:2e00:5:2e:9a4b:e1ff:fe62:6dc0]:8333', - '[2a04:3542:1000:910:8492:b8ff:fe91:711d]:8333', - '[2a04:dbc3:fffe:0:e61f:13ff:fe95:8401]:8333', - '[2a06:9fc0:2a06:9fc0:2a06:9fc1:67c:e706]:8333', - '[2c0f:f738:2004:82::]:8333', - '2hryb3uh3tzwgnya.onion:8333', - '3nmbbakinewlgdln.onion:8333', - '3qeri3tmhzmpegyv.onion:8333', - '4wdknmecghcmclq5.onion:8333', - '53tsjt6zq3iasv5q.onion:8333', - '5cg7qeywvwo6vxpt.onion:8333', - '5gbcrgqxcbxj253s.onion:8333', - '6cn4ilbwkrkh7gwo.onion:8333', - '6e4jrnn7igeqxmlf.onion:8333', - '6ymgbvnn6d5nfmv4.onion:8333', - '6zsh3bfduhpo7ldl.onion:8333', - '72fq6phv4fg4rhvh.onion:8333', - '7gdqp6npusk4lfwk.onion:8333', - 'a7emxol55e623lqc.onion:8333', - 'assbiydziq77zaki.onion:8333', - 'bafk5ioatlgt7dgl.onion:8333', - 'bk7yp6epnmcllq72.onion:8333', - 'brwqezn6le54w2bb.onion:8333', - 'bs4bq6s6qkvt5hpi.onion:8333', - 'bup5n5e3kurvjzf3.onion:8333', - 'c2tpqkaz4ihjzwgb.onion:8333', - 'cernrmrk5zomzozn.onion:8333', - 'cfyegj64ht3jpodr.onion:8333', - 'cg5vg54cazzpvoug.onion:8333', - 'cgk4u2lxrvml4jvb.onion:8333', - 'cjygd7pu5lqkky5j.onion:8333', - 'd6wubsdtr46dd5ki.onion:8333', - 'dfq6yjc3aelplwr4.onion:8333', - 'dqpxwlpnv3z3hznl.onion:8333', - 'eamfospuveabaimd.onion:8333', - 'ep2mjzox3kvb6ax4.onion:8333', - 'fpbxb4wjudiw2w5a.onion:8333', - 'fu5hfsbbf5jwsvhv.onion:8333', - 'g4freoibsczujle3.onion:8333', - 'gb5ypqt63du3wfhn.onion:8333', - 'ggdy2pb2avlbtjwq.onion:8333', - 'gh2aiddzxmvyrnue.onion:8333', - 'gnxgylbgzvaazkq7.onion:8333', - 'hnizdxnejel64ubk.onion:8333', - 'htvdcmlc3abji2ab.onion:8443', - 'hwuboois4gslupgx.onion:8333', - 'hxz6gowludlj6d5a.onion:8333', - 'j6umo4bnsztpsonc.onion:8333', - 'jdunmaocwbbnw565.onion:8333', - 'ktv3qlxl7xvmdlf4.onion:8333', - 'kvd44sw7skb5folw.onion:8333', - 'kwimnzm6vd4zakvl.onion:8333', - 'la5xhk3lprxzxmz2.onion:8333', - 'lc7cx67end26uutp.onion:8352', - 'mwu5og2agcspmgkx.onion:8333', - 'mzxkipiyekaoh7my.onion:8333', - 'n6rwlrtwpqc7qwo7.onion:8333', - 'nj36424yccqph62z.onion:8333', - 'o256w7t3vcgktmxk.onion:8333', - 'o4sl5na6jeqgi3l6.onion:8333', - 'okdzjarwekbshnof.onion:8333', - 'oyebydl2pacx6v26.onion:8333', - 'p5mx2imj75dpmime.onion:8333', - 'psco6bxjewljrczx.onion:8333', - 'pxtgswet6tlgrbwj.onion:8333', - 'rb4v3fhgx2zr4rre.onion:8333', - 'rjlnp3hwvrsmap6e.onion:8333', - 'rlafimkctvz63llg.onion:8333', - 'rxjvy5eyttep5tts.onion:8333', - 'seoskudzk6vn6mqz.onion:8333', - 'tpgdufxxsw3jkrdf.onion:8333', - 'tuiyvqgi3o675pjb.onion:8333', - 'tx4zd7d5exonnblh.onion:8333', - 'uokg6avfgbhofls3.onion:8333', - 'v3gjphgqy5hygcml.onion:8333', - 'vhdoxqq63xr53ol7.onion:8333', - 'visevrizz3quyagj.onion:8333', - 'vqpye2k5rcqvj5mq.onion:8333', - 'wfsx2gi7djhy22hk.onion:8333', - 'wg6vwmbrzyyzapun.onion:8333', - 'xub4w3w4wwk56xiq.onion:8333', - 'ycivnom44dmxx4ob.onion:8333', - 'ywskufc62bf2fum4.onion:8333', - 'z4fax2vxg23t2ddf.onion:8333', - 'zo5dklwelmdrpo5n.onion:8333' -]; +module.exports = []; diff --git a/lib/primitives/block.js b/lib/primitives/block.js index 937aec2a6..e13fee237 100644 --- a/lib/primitives/block.js +++ b/lib/primitives/block.js @@ -429,7 +429,7 @@ Block.prototype.checkBody = function checkBody() { // Check base size. if (this.txs.length === 0 || this.txs.length > consensus.MAX_BLOCK_SIZE - || this.getBaseSize() > consensus.MAX_BLOCK_SIZE) { + || this.getBaseSize() > consensus.MAX_FORK_BLOCK_SIZE) { return [false, 'bad-blk-length', 100]; } @@ -438,7 +438,7 @@ Block.prototype.checkBody = function checkBody() { return [false, 'bad-cb-missing', 100]; // Test all transactions. - const scale = consensus.WITNESS_SCALE_FACTOR; + const size = this.getSize(); let sigops = 0; for (let i = 0; i < this.txs.length; i++) { @@ -456,7 +456,7 @@ Block.prototype.checkBody = function checkBody() { // Count legacy sigops (do not count scripthash or witness). sigops += tx.getLegacySigops(); - if (sigops * scale > consensus.MAX_BLOCK_SIGOPS_COST) + if (sigops > consensus.maxBlockSigops(size)) return [false, 'bad-blk-sigops', 100]; } diff --git a/lib/primitives/mtx.js b/lib/primitives/mtx.js index c145215e7..56448559c 100644 --- a/lib/primitives/mtx.js +++ b/lib/primitives/mtx.js @@ -461,38 +461,6 @@ MTX.prototype.scriptInput = function scriptInput(index, coin, ring) { // Witness program nested in regular P2SH. if (redeem.isProgram()) { - // P2WSH nested within pay-to-scripthash. - if (redeem.isWitnessScripthash()) { - prev = ring.getRedeem(redeem.get(1)); - - if (!prev) - return false; - - if (!this.scriptVector(prev, input.witness, ring)) - return false; - - input.witness.push(prev.toRaw()); - input.witness.compile(); - - input.script.push(redeem.toRaw()); - input.script.compile(); - - return true; - } - - // P2WPKH nested within pay-to-scripthash. - if (redeem.isWitnessPubkeyhash()) { - prev = Script.fromPubkeyhash(ring.getKeyHash()); - - if (!this.scriptVector(prev, input.witness, ring)) - return false; - - input.script.push(redeem.toRaw()); - input.script.compile(); - - return true; - } - // Unknown witness program. return false; } @@ -509,34 +477,6 @@ MTX.prototype.scriptInput = function scriptInput(index, coin, ring) { // Witness program. if (prev.isProgram()) { - // Bare P2WSH. - if (prev.isWitnessScripthash()) { - const redeem = ring.getRedeem(prev.get(1)); - - if (!redeem) - return false; - - if (!this.scriptVector(redeem, input.witness, ring)) - return false; - - input.witness.push(redeem.toRaw()); - input.witness.compile(); - - return true; - } - - // Bare P2WPKH. - if (prev.isWitnessPubkeyhash()) { - prev = Script.fromPubkeyhash(prev.get(1)); - - if (!this.scriptVector(prev, input.witness, ring)) - return false; - - input.witness.compile(); - - return true; - } - // Bare... who knows? return false; } @@ -637,7 +577,6 @@ MTX.prototype.signInput = function signInput(index, coin, ring, type) { const value = coin.value; let prev = coin.script; let vector = input.script; - let version = 0; let redeem = false; // Grab regular p2sh redeem script. @@ -648,28 +587,14 @@ MTX.prototype.signInput = function signInput(index, coin, ring, type) { redeem = true; } - // If the output script is a witness program, - // we have to switch the vector to the witness - // and potentially alter the length. Note that - // witnesses are stack items, so the `dummy` - // _has_ to be an empty buffer (what OP_0 - // pushes onto the stack). - if (prev.isWitnessScripthash()) { - prev = input.witness.getRedeem(); - if (!prev) - throw new Error('Input has not been templated.'); - vector = input.witness; - redeem = true; - version = 1; - } else if (prev.isWitnessPubkeyhash()) { - prev = Script.fromPubkeyhash(prev.get(1)); - vector = input.witness; - redeem = false; - version = 1; - } + if (type == null) + type = Script.hashType.ALL; + + type |= Script.hashType.SIGHASH_FORKID; + const flags = Script.flags.VERIFY_SIGHASH_FORKID; // Create our signature. - const sig = this.signature(index, prev, value, key, type, version); + const sig = this.signature(index, prev, value, key, type, flags); if (redeem) { const redeem = vector.pop(); @@ -869,21 +794,6 @@ MTX.prototype.isInputSigned = function isInputSigned(index, coin) { redeem = true; } - // If the output script is a witness program, - // we have to switch the vector to the witness - // and potentially alter the length. - if (prev.isWitnessScripthash()) { - prev = input.witness.getRedeem(); - if (!prev) - return false; - vector = input.witness; - redeem = true; - } else if (prev.isWitnessPubkeyhash()) { - prev = Script.fromPubkeyhash(prev.get(1)); - vector = input.witness; - redeem = false; - } - if (redeem) { const redeem = vector.pop(); const result = this.isVectorSigned(prev, vector); @@ -1101,21 +1011,6 @@ MTX.prototype.estimateSize = async function estimateSize(estimate) { continue; } - // P2WPKH - if (prev.isWitnessPubkeyhash()) { - let size = 0; - // varint-items-len - size += 1; - // varint-len [signature] - size += 1 + 73; - // varint-len [key] - size += 1 + 33; - // vsize - size = (size + scale - 1) / scale | 0; - total += size; - continue; - } - // Call out to the custom estimator. if (estimate) { const size = await estimate(prev); @@ -1134,19 +1029,6 @@ MTX.prototype.estimateSize = async function estimateSize(estimate) { continue; } - // P2WSH - if (prev.isWitnessScripthash()) { - let size = 0; - // varint-items-len - size += 1; - // 2-of-3 multisig input - size += 149; - // vsize - size = (size + scale - 1) / scale | 0; - total += size; - continue; - } - // Unknown. total += 110; } diff --git a/lib/primitives/tx.js b/lib/primitives/tx.js index 188899a05..a2a013be7 100644 --- a/lib/primitives/tx.js +++ b/lib/primitives/tx.js @@ -413,25 +413,25 @@ TX.prototype.hasWitness = function hasWitness() { * p2pkh script). * @param {Amount} value - Previous output value. * @param {SighashType} type - Sighash type. - * @param {Number} version - Sighash version (0=legacy, 1=segwit). + * @param {Number} flags - Script flags. * @returns {Buffer} Signature hash. */ -TX.prototype.signatureHash = function signatureHash(index, prev, value, type, version) { +TX.prototype.signatureHash = function signatureHash(index, prev, value, type, flags) { assert(index >= 0 && index < this.inputs.length); assert(prev instanceof Script); assert(typeof value === 'number'); assert(typeof type === 'number'); - // Traditional sighashing - if (version === 0) - return this.signatureHashV0(index, prev, type); + if (flags == null) + flags = Script.flags.STANDARD_VERIFY_FLAGS; - // Segwit sighashing - if (version === 1) + if ((type & Script.hashType.SIGHASH_FORKID) + && (flags & Script.flags.VERIFY_SIGHASH_FORKID)) { return this.signatureHashV1(index, prev, value, type); + } - throw new Error('Unknown sighash version.'); + return this.signatureHashV0(index, prev, type); }; /** @@ -700,16 +700,16 @@ TX.prototype.signatureHashV1 = function signatureHashV1(index, prev, value, type * @param {Amount} value * @param {Buffer} sig * @param {Buffer} key - * @param {Number} version + * @param {Number} flags * @returns {Boolean} */ -TX.prototype.checksig = function checksig(index, prev, value, sig, key, version) { +TX.prototype.checksig = function checksig(index, prev, value, sig, key, flags) { if (sig.length === 0) return false; const type = sig[sig.length - 1]; - const hash = this.signatureHash(index, prev, value, type, version); + const hash = this.signatureHash(index, prev, value, type, flags); return secp256k1.verify(hash, sig.slice(0, -1), key); }; @@ -723,18 +723,18 @@ TX.prototype.checksig = function checksig(index, prev, value, sig, key, version) * @param {Amount} value - Previous output value. * @param {Buffer} key * @param {SighashType} type - * @param {Number} version - Sighash version (0=legacy, 1=segwit). + * @param {Number} flags - Script flags. * @returns {Buffer} Signature in DER format. */ -TX.prototype.signature = function signature(index, prev, value, key, type, version) { +TX.prototype.signature = function signature(index, prev, value, key, type, flags) { if (type == null) type = hashType.ALL; - if (version == null) - version = 0; + if (flags == null) + flags = Script.flags.VERIFY_SIGHASH_FORKID; - const hash = this.signatureHash(index, prev, value, type, version); + const hash = this.signatureHash(index, prev, value, type, flags); const sig = secp256k1.sign(hash, key); const bw = new StaticWriter(sig.length + 1); diff --git a/lib/protocol/consensus.js b/lib/protocol/consensus.js index 1cf8bc346..15e3ef69c 100644 --- a/lib/protocol/consensus.js +++ b/lib/protocol/consensus.js @@ -61,13 +61,21 @@ exports.HALF_REWARD = Math.floor(exports.BASE_REWARD / 2); exports.MAX_BLOCK_SIZE = 1000000; +/** + * Maximum block base size (consensus). + * @const {Number} + * @default + */ + +exports.MAX_FORK_BLOCK_SIZE = 8000000; + /** * Maximum block serialization size (protocol). * @const {Number} * @default */ -exports.MAX_RAW_BLOCK_SIZE = 4000000; +exports.MAX_RAW_BLOCK_SIZE = 8000000; /** * Maximum block weight (consensus). @@ -75,7 +83,7 @@ exports.MAX_RAW_BLOCK_SIZE = 4000000; * @default */ -exports.MAX_BLOCK_WEIGHT = 4000000; +exports.MAX_BLOCK_WEIGHT = 4000000 * 8; /** * Maximum block sigops (consensus). @@ -85,6 +93,14 @@ exports.MAX_BLOCK_WEIGHT = 4000000; exports.MAX_BLOCK_SIGOPS = 1000000 / 50; +/** + * Maximum block sigops per mb (consensus). + * @const {Number} + * @default + */ + +exports.MAX_BLOCK_SIGOPS_PER_MB = 20000; + /** * Maximum block sigops cost (consensus). * @const {Number} @@ -218,6 +234,23 @@ exports.MAX_MULTISIG_PUBKEYS = 20; exports.BIP16_TIME = 1333238400; +/** + * Anti replay commitment. + * @const {String} + * @default + */ + +exports.ANTI_REPLAY_COMMITMENT = + 'Bitcoin: A Peer-to-Peer Electronic Cash System'; + +/** + * UAHF start time. + * @const {Number} + * @default + */ + +exports.UAHF_TIME = 1501590000; + /** * Convert a compact number to a big number. * Used for `block.bits` -> `target` conversion. @@ -346,3 +379,14 @@ exports.hasBit = function hasBit(version, bit) { const mask = 1 << bit; return (bits >>> 0) === topBits && (version & mask) !== 0; }; + +/** + * Calculate max block sigops. + * @param {Number} size + * @returns {Number} + */ + +exports.maxBlockSigops = function maxBlockSigops(size) { + const mb = 1 + ((size - 1) / 1e6 | 0); + return mb * exports.MAX_BLOCK_SIGOPS_PER_MB; +}; diff --git a/lib/protocol/networks.js b/lib/protocol/networks.js index e035baf27..2f4c17996 100644 --- a/lib/protocol/networks.js +++ b/lib/protocol/networks.js @@ -48,12 +48,12 @@ main.type = 'main'; */ main.seeds = [ - 'seed.bitcoin.sipa.be', // Pieter Wuille - 'dnsseed.bluematt.me', // Matt Corallo - 'dnsseed.bitcoin.dashjr.org', // Luke Dashjr - 'seed.bitcoinstats.com', // Christian Decker - 'seed.bitcoin.jonasschnelli.ch', // Jonas Schnelli - 'seed.btc.petertodd.org' // Peter Todd + 'seed.bitcoinabc.org', + 'seed-abc.bitcoinforks.org', + 'btccash-seeder.bitcoinunlimited.info', + 'seed.bitprim.org', + 'seed.deadalnix.me', + 'seeder.criptolayer.net' ]; /** @@ -101,7 +101,9 @@ main.checkpointMap = { 440000: '9bf296b8de5f834f7635d5e258a434ad51b4dbbcf7c08c030000000000000000', 450000: '0ba2070c62cd9da1f8cef88a0648c661a411d33e728340010000000000000000', 460000: '8c25fc7e414d3e868d6ce0ec473c30ad44e7e8bc1b75ef000000000000000000', - 470000: '89756d1ed75901437300af10d5ab69070a282e729c536c000000000000000000' + 470000: '89756d1ed75901437300af10d5ab69070a282e729c536c000000000000000000', + // UAHF fork block: + 478559: 'ec5e1a193601f25ff1d94b421ddead0dbefcb99cf91e65000000000000000000' }; /** @@ -110,7 +112,7 @@ main.checkpointMap = { * @default */ -main.lastCheckpoint = 470000; +main.lastCheckpoint = 478559; /** * @const {Number} diff --git a/lib/script/common.js b/lib/script/common.js index d6021113b..ccaef0567 100644 --- a/lib/script/common.js +++ b/lib/script/common.js @@ -187,7 +187,8 @@ exports.flags = { VERIFY_MINIMALIF: 1 << 13, VERIFY_NULLFAIL: 1 << 14, VERIFY_WITNESS_PUBKEYTYPE: 1 << 15, - VERIFY_MAST: 1 << 16 + VERIFY_MAST: 1 << 16, + VERIFY_SIGHASH_FORKID: 1 << 17 }; /** @@ -219,7 +220,8 @@ exports.flags.STANDARD_VERIFY_FLAGS = 0 | exports.flags.VERIFY_LOW_S | exports.flags.VERIFY_WITNESS | exports.flags.VERIFY_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM - | exports.flags.VERIFY_WITNESS_PUBKEYTYPE; + | exports.flags.VERIFY_WITNESS_PUBKEYTYPE + | exports.flags.VERIFY_SIGHASH_FORKID; /** * Standard flags without mandatory bits. @@ -255,6 +257,12 @@ exports.hashType = { SINGLE: 3, + /* + * Sighash fork ID. + */ + + SIGHASH_FORKID: 0x40, + /* * Sign only the current input (mask). */ @@ -327,7 +335,8 @@ exports.isHashType = function isHashType(sig) { if (sig.length === 0) return false; - const type = sig[sig.length - 1] & ~exports.hashType.ANYONECANPAY; + const type = sig[sig.length - 1] + & ~(exports.hashType.ANYONECANPAY | exports.hashType.SIGHASH_FORKID); if (!(type >= exports.hashType.ALL && type <= exports.hashType.SINGLE)) return false; diff --git a/lib/script/script.js b/lib/script/script.js index 3bdec8298..7e0e5434e 100644 --- a/lib/script/script.js +++ b/lib/script/script.js @@ -478,18 +478,14 @@ Script.prototype.removeSeparators = function removeSeparators() { * @param {TX?} tx - Transaction being verified. * @param {Number?} index - Index of input being verified. * @param {Amount?} value - Previous output value. - * @param {Number?} version - Signature hash version (0=legacy, 1=segwit). * @throws {ScriptError} Will be thrown on VERIFY failures, among other things. * @returns {Boolean} Whether the execution was successful. */ -Script.prototype.execute = function execute(stack, flags, tx, index, value, version) { +Script.prototype.execute = function execute(stack, flags, tx, index, value) { if (flags == null) flags = Script.flags.STANDARD_VERIFY_FLAGS; - if (version == null) - version = 0; - if (this.getSize() > consensus.MAX_SCRIPT_SIZE) throw new ScriptError('SCRIPT_SIZE'); @@ -640,7 +636,8 @@ Script.prototype.execute = function execute(stack, flags, tx, index, value, vers val = stack.top(-1); - if (version === 1 && (flags & Script.flags.VERIFY_MINIMALIF)) { + if ((flags & Script.flags.VERIFY_SIGHASH_FORKID) + && (flags & Script.flags.VERIFY_MINIMALIF)) { if (val.length > 1) throw new ScriptError('MINIMALIF'); @@ -1086,17 +1083,19 @@ Script.prototype.execute = function execute(stack, flags, tx, index, value, vers const subscript = this.getSubscript(lastSep); - if (version === 0) + if ((flags & Script.flags.SIGHASH_FORKID) + && (sig[sig.length - 1] & Script.hashType.SIGHASH_FORKID)) { subscript.removeData(sig); + } validateSignature(sig, flags); - validateKey(key, flags, version); + validateKey(key, flags); let res = false; if (sig.length > 0) { const type = sig[sig.length - 1]; - const hash = tx.signatureHash(index, subscript, value, type, version); + const hash = tx.signatureHash(index, subscript, value, type, flags); res = checksig(hash, sig, key); } @@ -1161,8 +1160,10 @@ Script.prototype.execute = function execute(stack, flags, tx, index, value, vers for (let j = 0; j < m; j++) { const sig = stack.top(-isig - j); - if (version === 0) + if ((flags & Script.flags.VERIFY_SIGHASH_FORKID) + && (sig[sig.length - 1] & Script.hashType.SIGHASH_FORKID)) { subscript.removeData(sig); + } } let res = true; @@ -1171,7 +1172,7 @@ Script.prototype.execute = function execute(stack, flags, tx, index, value, vers const key = stack.top(-ikey); validateSignature(sig, flags); - validateKey(key, flags, version); + validateKey(key, flags); if (sig.length > 0) { const type = sig[sig.length - 1]; @@ -1180,7 +1181,7 @@ Script.prototype.execute = function execute(stack, flags, tx, index, value, vers subscript, value, type, - version + flags ); if (checksig(hash, sig, key)) { @@ -2761,11 +2762,14 @@ Script.verify = function verify(input, witness, output, tx, i, value, flags) { throw new ScriptError('SIG_PUSHONLY'); } + if (flags & Script.flags.VERIFY_SIGHASH_FORKID) + flags |= Script.flags.VERIFY_STRICTENC; + // Setup a stack. let stack = new Stack(); // Execute the input script - input.execute(stack, flags, tx, i, value, 0); + input.execute(stack, flags, tx, i, value); // Copy the stack for P2SH let copy; @@ -2773,28 +2777,12 @@ Script.verify = function verify(input, witness, output, tx, i, value, flags) { copy = stack.clone(); // Execute the previous output script. - output.execute(stack, flags, tx, i, value, 0); + output.execute(stack, flags, tx, i, value); // Verify the stack values. if (stack.length === 0 || !Script.bool(stack.top(-1))) throw new ScriptError('EVAL_FALSE'); - let hadWitness = false; - - if ((flags & Script.flags.VERIFY_WITNESS) && output.isProgram()) { - hadWitness = true; - - // Input script must be empty. - if (input.raw.length !== 0) - throw new ScriptError('WITNESS_MALLEATED'); - - // Verify the program in the output script. - Script.verifyProgram(witness, output, flags, tx, i, value); - - // Force a cleanstack - stack.length = 1; - } - // If the script is P2SH, execute the real output script if ((flags & Script.flags.VERIFY_P2SH) && output.isScripthash()) { // P2SH can only have push ops in the scriptSig @@ -2818,20 +2806,6 @@ Script.verify = function verify(input, witness, output, tx, i, value, flags) { // Verify the the stack values. if (stack.length === 0 || !Script.bool(stack.top(-1))) throw new ScriptError('EVAL_FALSE'); - - if ((flags & Script.flags.VERIFY_WITNESS) && redeem.isProgram()) { - hadWitness = true; - - // Input script must be exactly one push of the redeem script. - if (!input.raw.equals(Opcode.fromPush(raw).toRaw())) - throw new ScriptError('WITNESS_MALLEATED_P2SH'); - - // Verify the program in the redeem script. - Script.verifyProgram(witness, redeem, flags, tx, i, value); - - // Force a cleanstack. - stack.length = 1; - } } // Ensure there is nothing left on the stack. @@ -2841,13 +2815,6 @@ Script.verify = function verify(input, witness, output, tx, i, value, flags) { throw new ScriptError('CLEANSTACK'); } - // If we had a witness but no witness program, fail. - if (flags & Script.flags.VERIFY_WITNESS) { - assert((flags & Script.flags.VERIFY_P2SH) !== 0); - if (!hadWitness && witness.items.length > 0) - throw new ScriptError('WITNESS_UNEXPECTED'); - } - return true; }; @@ -3141,17 +3108,16 @@ function sortKeys(keys) { * @throws {ScriptError} */ -function validateKey(key, flags, version) { +function validateKey(key, flags) { assert(Buffer.isBuffer(key)); assert(typeof flags === 'number'); - assert(typeof version === 'number'); if (flags & Script.flags.VERIFY_STRICTENC) { if (!common.isKeyEncoding(key)) throw new ScriptError('PUBKEYTYPE'); } - if (version === 1) { + if (flags & Script.flags.VERIFY_SIGHASH_FORKID) { if (flags & Script.flags.VERIFY_WITNESS_PUBKEYTYPE) { if (!common.isCompressedEncoding(key)) throw new ScriptError('WITNESS_PUBKEYTYPE'); @@ -3196,6 +3162,15 @@ function validateSignature(sig, flags) { if (flags & Script.flags.VERIFY_STRICTENC) { if (!common.isHashType(sig)) throw new ScriptError('SIG_HASHTYPE'); + + const usesFork = sig[sig.length - 1] & Script.hashType.SIGHASH_FORKID; + const forkEnabled = flags & Script.flags.VERIFY_SIGHASH_FORKID; + + if (!forkEnabled && usesFork) + throw new ScriptError('ILLEGAL_FORKID'); + + if (forkEnabled && !usesFork) + throw new ScriptError('MUST_USE_FORKID'); } return true; diff --git a/lib/wallet/walletdb.js b/lib/wallet/walletdb.js index 4b585ea73..869d809f1 100644 --- a/lib/wallet/walletdb.js +++ b/lib/wallet/walletdb.js @@ -143,7 +143,7 @@ WalletDB.prototype._open = async function _open() { await this.logger.open(); await this.db.open(); - await this.db.checkVersion('V', 6); + await this.db.checkVersion('V', 0x80 | 6); this.depth = await this.getDepth(); From 7127a82bc4e585d04745d2073fce6eb90d41de9d Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Wed, 2 Aug 2017 20:37:22 -0700 Subject: [PATCH 2/3] networks: remove segwit. --- lib/blockchain/chain.js | 6 --- lib/protocol/networks.js | 88 ---------------------------------------- 2 files changed, 94 deletions(-) diff --git a/lib/blockchain/chain.js b/lib/blockchain/chain.js index d6525ece7..73978473e 100644 --- a/lib/blockchain/chain.js +++ b/lib/blockchain/chain.js @@ -317,12 +317,6 @@ Chain.prototype.verify = async function verify(block, prev, flags) { // Get the new deployment state. const state = await this.getDeployments(block.time, prev); - // Enforce BIP91/BIP148. - if (state.hasBIP91() || state.hasBIP148()) { - if (!consensus.hasBit(block.version, deployments.segwit.bit)) - throw new VerifyError(block, 'invalid', 'bad-no-segwit', 0); - } - // Get timestamp for tx.isFinal(). const time = state.hasMTP() ? mtp : block.time; diff --git a/lib/protocol/networks.js b/lib/protocol/networks.js index 2f4c17996..fa4d45f8e 100644 --- a/lib/protocol/networks.js +++ b/lib/protocol/networks.js @@ -348,26 +348,6 @@ main.deployments = { required: false, force: true }, - segwit: { - name: 'segwit', - bit: 1, - startTime: 1479168000, // November 15th, 2016. - timeout: 1510704000, // November 15th, 2017. - threshold: -1, - window: -1, - required: true, - force: false - }, - segsignal: { - name: 'segsignal', - bit: 4, - startTime: 1496275200, // June 1st, 2017. - timeout: 1510704000, // November 15th, 2017. - threshold: 269, // 80% - window: 336, // ~2.33 days - required: false, - force: false - }, testdummy: { name: 'testdummy', bit: 28, @@ -388,8 +368,6 @@ main.deployments = { main.deploys = [ main.deployments.csv, - main.deployments.segwit, - main.deployments.segsignal, main.deployments.testdummy ]; @@ -588,26 +566,6 @@ testnet.deployments = { required: false, force: true }, - segwit: { - name: 'segwit', - bit: 1, - startTime: 1462060800, // May 1st 2016 - timeout: 1493596800, // May 1st 2017 - threshold: -1, - window: -1, - required: true, - force: false - }, - segsignal: { - name: 'segsignal', - bit: 4, - startTime: 0xffffffff, - timeout: 0xffffffff, - threshold: 269, - window: 336, - required: false, - force: false - }, testdummy: { name: 'testdummy', bit: 28, @@ -622,8 +580,6 @@ testnet.deployments = { testnet.deploys = [ testnet.deployments.csv, - testnet.deployments.segwit, - testnet.deployments.segsignal, testnet.deployments.testdummy ]; @@ -749,26 +705,6 @@ regtest.deployments = { required: false, force: true }, - segwit: { - name: 'segwit', - bit: 1, - startTime: 0, - timeout: 0xffffffff, - threshold: -1, - window: -1, - required: true, - force: false - }, - segsignal: { - name: 'segsignal', - bit: 4, - startTime: 0xffffffff, - timeout: 0xffffffff, - threshold: 269, - window: 336, - required: false, - force: false - }, testdummy: { name: 'testdummy', bit: 28, @@ -783,8 +719,6 @@ regtest.deployments = { regtest.deploys = [ regtest.deployments.csv, - regtest.deployments.segwit, - regtest.deployments.segsignal, regtest.deployments.testdummy ]; @@ -912,26 +846,6 @@ simnet.deployments = { required: false, force: true }, - segwit: { - name: 'segwit', - bit: 1, - startTime: 0, // May 1st 2016 - timeout: 0xffffffff, // May 1st 2017 - threshold: -1, - window: -1, - required: true, - force: false - }, - segsignal: { - name: 'segsignal', - bit: 4, - startTime: 0xffffffff, - timeout: 0xffffffff, - threshold: 269, - window: 336, - required: false, - force: false - }, testdummy: { name: 'testdummy', bit: 28, @@ -946,8 +860,6 @@ simnet.deployments = { simnet.deploys = [ simnet.deployments.csv, - simnet.deployments.segwit, - simnet.deployments.segsignal, simnet.deployments.testdummy ]; From afd34c46e4460ad13982069ef030c124fbbc4813 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Thu, 3 Aug 2017 16:15:03 -0700 Subject: [PATCH 3/3] primitives: show hex on json. --- lib/primitives/tx.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/primitives/tx.js b/lib/primitives/tx.js index a2a013be7..439bbd004 100644 --- a/lib/primitives/tx.js +++ b/lib/primitives/tx.js @@ -2168,7 +2168,8 @@ TX.prototype.getJSON = function getJSON(network, view, entry, index) { outputs: this.outputs.map((output) => { return output.getJSON(network); }), - locktime: this.locktime + locktime: this.locktime, + hex: this.toRaw().toString('hex') }; };