Advertisement
Guest User

Untitled

a guest
Jun 8th, 2017
2,845
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.10 KB | None | 0 0
  1. movrcx [8:31 PM]
  2. joined tx-replay-prevention, and invited @smrtz, @finpunk, @blockops, @jane.hk, @lpsun, @iohk_carlo, @anarch3
  3.  
  4. smrtz [8:33 PM]
  5. The current idea is to push an 'emergency' commit that implements OP_CHECKBLOCKATHEIGHT to prevent replay attacks by verifying that TXs are on the ZEN chain by confirming the block height. Then get Bittrex and pool operators to update, and then try to get as many node operators to update too.
  6.  
  7. [8:33]
  8. Correct?
  9.  
  10. movrcx [8:34 PM]
  11. No. OP_CHECKBLOCKATHEIGHT was activated for 2 BIP9 periods (~4096 blocks). That's coming to an end soon and I'm not sure if Bittrex is mitigated sufficiently for when the period ends.
  12.  
  13. [8:35]
  14. They can't even move their funds without assistance and I have to baby sit.
  15.  
  16. [8:35]
  17. It's possible an attacker has already conducted the transactions already required on the zcl network and is waiting for the replay prevention to shutdown.
  18.  
  19. [8:36]
  20. As of the current codebase nodes will reject non OP_CHECKBLOCKATHEIGHT transactions as non-standard but a miner can still forceably insert replayed transactions into the block.
  21.  
  22. smrtz [8:36 PM]
  23. So we have to check blocks before adding them to the chain?
  24.  
  25. movrcx [8:37 PM]
  26. No that's going to wreck consensus
  27.  
  28. [8:39]
  29. 1. Bittrex should put their ZCL wallet into maintenance mode soon.
  30. 2. Bittrex should move their ZEN before the transaction replay window ends.
  31. 3. Possibly create a custom daemon for Bittrex that applies OP_CHECKBLOCKATHEIGHT on the ZCL network (It hasn't been activated by softfork yet)
  32. 4. Get Supernova to run a custom daemon that accepts to mempool the non-standard OP_CHECKBLOCKATHEIGHT transactions until the softfork activates.
  33.  
  34. [8:39]
  35. It would probably be useful if someone audited the ZCL blockchain for any suspicious activity that could be used for a replay attack on Zen.
  36.  
  37. [8:41]
  38. I've updated the codebase earlier to enforce OP_CHECKBLOCKATHEIGHT indefinitely but that's just for mempool acceptance and doesn't include transactions inserted into blocks.
  39.  
  40. [8:42]
  41. anyway i have to drive to ny in an hour
  42.  
  43. lukas
  44. [8:42 PM]
  45. joined tx-replay-prevention by invitation from @movrcx
  46.  
  47. smrtz [8:44 PM]
  48. Does bittrex already know to put the ZCL wallets into maintenance mode?
  49.  
  50. movrcx [8:44 PM]
  51. Huh?
  52.  
  53. [8:45]
  54. They put wallets into maint mode all the time
  55.  
  56. [8:45]
  57. Bittrex already sent us a list of their unspents so it might be worthwhile to parse the ZCL network against that to determine any suspicious activity.
  58.  
  59. [8:46]
  60. All someone needs to do to execute the attack is withdraw ZCL into a wallet somewhere and then forceably insert that transaction into a Zen block.
  61.  
  62. [8:46]
  63. OP_CHECKBLOCKATHEIGHT needs to be implemented soon on ZCL.
  64.  
  65. smrtz [8:47 PM]
  66. But are they planning on putting them into maint mode soon? Have we reached out to them yet?
  67.  
  68. movrcx [8:47 PM]
  69. No
  70.  
  71. [8:48]
  72. anyway i gotta get ready ttyl
  73.  
  74. smrtz [8:48 PM]
  75. Have a safe drive.
  76.  
  77. blockops [8:49 PM]
  78. sounds like this is something we have thought about, there is not a problem yet, but we can prevent a problem by pushing a ZCL softfork. Does that sound about right?
  79.  
  80. smrtz [8:50 PM]
  81. That's my current understanding.
  82.  
  83. blockops [8:50 PM]
  84. ok, so informing bittrex and taking action wait until after movrcx vacation? He's been pushing hard and can probably use a break.
  85.  
  86. movrcx [8:50 PM]
  87. We'll need to a hardfork I think
  88.  
  89. [8:51]
  90. Ah I'm just heading to NY for BitDevs and doing some business
  91.  
  92. blockops [8:51 PM]
  93. hardfork zen, zclassic, or both?
  94.  
  95. movrcx [8:51 PM]
  96. hardfork on zcl
  97.  
  98. smrtz [8:51 PM]
  99. ZCL.
  100.  
  101. movrcx [8:51 PM]
  102. which i think people would support
  103.  
  104. blockops [8:51 PM]
  105. sure - I agree. Thanks for the heads up
  106.  
  107. [8:51]
  108. :smile:
  109.  
  110. movrcx [8:52 PM]
  111. :slightly_smiling_face: I need to double check the alert system and make sure it's still implemented but it would be worthwhile to send a network alert out about the hardfork
  112.  
  113. [8:52]
  114. I'm really worried about Bittrex because they have 80% of coins in circulation and getting Gox'd would kill the project
  115.  
  116. blockops [8:53 PM]
  117. I'm sure if you present a problem and solution together they will be cool with it.
  118.  
  119. [8:53]
  120. I think thye don't like surprises where they lose money without the devs telling them about it first
  121.  
  122. movrcx [8:53 PM]
  123. agreed
  124.  
  125. blockops [8:53 PM]
  126. ok, ttyl. Travel safe
  127.  
  128. movrcx [8:54 PM]
  129. ok take care!
  130.  
  131. [8:55]
  132. @smrtz i'm going push a commit in about 10 mins on the ZCL wallet and then i need to head out
  133.  
  134. smrtz [8:55 PM]
  135. We have 500 blocks before this happens, so 20.833 hours.
  136.  
  137. [8:55]
  138. @movrcx Ok.
  139.  
  140. movrcx [8:55 PM]
  141. @smrtz the attack is executable now if the transactions are inserted into blocks
  142.  
  143. [8:56]
  144. The 500 block period just prevents transcations from being relayed by nodes.
  145.  
  146. [8:56]
  147. Putting it into a block circumvents that
  148.  
  149. smrtz [8:56 PM]
  150. Ahh, great.
  151.  
  152. movrcx [8:57 PM]
  153. What do you think you'd be able to help with btw @smrtz ?
  154.  
  155. smrtz [8:58 PM]
  156. Not sure ATM. I'm reading up on this now.
  157.  
  158. anarch3
  159. [9:04 PM]
  160. Im ok with a hard fork
  161.  
  162. movrcx [9:04 PM]
  163. cool @anarch3 i think what i can do is just set the BIP9 period to something small like 50 blocks
  164.  
  165. [9:06]
  166. As long as Bittrex is secured then everything should be good imo
  167.  
  168. anarch3
  169. [9:06 PM]
  170. The thing is I don't know if major pools like suprnova and @miningpoolhub support bip9
  171.  
  172. movrcx [9:06 PM]
  173. hmm
  174.  
  175. [9:06]
  176. the code was pushed but i dont think they updated
  177.  
  178. [9:07]
  179. BIP9 might not be needed at all
  180.  
  181. anarch3
  182. [9:08 PM]
  183. Suprnova has 0x2000000 in it's version headers
  184.  
  185. movrcx [9:08 PM]
  186. cool so they should be good then
  187.  
  188. anarch3
  189. [9:08 PM]
  190. http://node1.zenchain.info:8886
  191.  
  192. [9:08]
  193. There's a few leagcy blocks though
  194.  
  195. movrcx [9:08 PM]
  196. oh i mean hardfork on the zcl chain.. i didnt see any signaled blocks when i did `getblockchaininfo`
  197.  
  198. anarch3
  199. [9:10 PM]
  200. Well, it seems all blocks on zcl are 0x4
  201.  
  202. movrcx [9:10 PM]
  203. nobody upgraded :confused: although testnet has `OP_CHECKBLOCKATHEIGHT` active
  204.  
  205. [9:11]
  206. i'll just remove it from BIP9 and add it as part of 0x4 blocks then?
  207.  
  208.  
  209. anarch3
  210. [9:11 PM]
  211. That may work
  212.  
  213. movrcx [9:23 PM]
  214. ok pushing the code now as a PR
  215.  
  216. [9:23]
  217. seems to work fine
  218.  
  219. [9:27]
  220. Ok it's almost done @anarch3.... I'll let Bittrex know once you ACK it that they should update their wallet and put it into maintenance mode for 24 hours. If somebody could tell all the pools to upgrade that would be great too. Anyway I'm behind on time and I'm heading out soon. Message me if you need anything! (edited)
  221.  
  222. movrcx [9:37 PM]
  223. Hmm it turns out disabling BIP9 is a bit more work than I anticipated... Since Supernova is already signaling BIP9 on Zen I'm hoping it's not an issue
  224.  
  225. [9:42]
  226. Ready for review: https://github.com/z-classic/zclassic/pull/90
  227. GitHub
  228. Enable mandatory transaction replay countermeasures by joshuayabut · Pull Request #90 · z-classic/zclassic
  229. zclassic - Zclassic is financial freedom.
  230.  
  231.  
  232. anarch3
  233. [9:54 PM]
  234. @movrcx merged
  235.  
  236.  
  237. movrcx [9:57 PM]
  238. That's weird I think some people have `OP_CHECKBLOCKATHEIGHT` implemented but they aren't signaling for it... My anti-replay txs were successfully added into blocks...
  239.  
  240. [9:57]
  241. ``` {
  242. "value": 0.00080000,
  243. "n": 1,
  244. "scriptPubKey": {
  245. "asm": "OP_DUP OP_HASH160 4177acddaf9c3e1b3599c32648ac11f2e53adb38 OP_EQUALVERIFY OP_CHECKSIG f20d9de3f5cd43b6384f337d43e550c933736bc42428e08f2e44f00f03000000 120416 OP_CHECKBLOCKATHEIGHT",
  246. "hex": "76a9144177acddaf9c3e1b3599c32648ac11f2e53adb3888ac20f20d9de3f5cd43b6384f337d43e550c933736bc42428e08f2e44f00f030000000360d601b4",
  247. "reqSigs": 1,
  248. "type": "pubkeyhashreplay",
  249. "addresses": [
  250. "t1PqmHzDJZpwPh6dA3P2qN36QG9DYpzpjEP"
  251. ]
  252. }
  253. }
  254. ],
  255. ```
  256.  
  257. [9:57]
  258. Either way that's a good thing :slightly_smiling_face: (edited)
  259.  
  260. blockops [10:00 PM]
  261. I know I'm just catching up to you all but I want to make sure that if we need to @finpunk and I can explain this to people.
  262.  
  263. Would the potential form of the replay attack be that someone withdraw a large amount of Zen from bittrex or suprnova and then replay that attack on zclassic and successfully withdraw the same amount of zclassic as they did zen?
  264.  
  265. Or is there more to it?
  266.  
  267. smrtz [10:02 PM]
  268. I believe they would inject a TX from ZCL into a ZEN block, and it would hit ZEN rather then ZCL.
  269.  
  270. movrcx [10:02 PM]
  271. That's right^......they would just buy a ton of zclassic from Bittrex and then withdraw it somewhere and then the attacker would forceably insert those transactions into some blocks. They'd get free Zen that way.
  272.  
  273. [10:03]
  274. The mitigation signs each transaction with the hash of a unique block from its original blockchain so if that hash doesn't match up the daemon knows the transaction is being replayed. (edited)
  275.  
  276. smrtz [10:03 PM]
  277. effectively draining Bittrex (or whomever) of their ZEN supply.
  278.  
  279. blockops [10:05 PM]
  280. So by mitigating zclassic it prevents it. No mitigation necessary for Zen code?
  281.  
  282. And did you make a determination if it needs to be a hard fork or soft fork for zclassic?
  283.  
  284. smrtz [10:05 PM]
  285. I'm confused about why we should wait to inform bittrex if this attack is currently performable?
  286.  
  287. blockops [10:05 PM]
  288. I'm sure bittrex and suprnova would hard fork. I think they're making a lot of money on Zen right now.
  289.  
  290. movrcx [10:06 PM]
  291. It was originally implemented as a temporary protection in Zen for 4096 blocks. That's coming to an end in about 20 hours.
  292.  
  293. [10:06]
  294. But the Zen code has been updated to make it mandatory forever as of today.
  295.  
  296. smrtz [10:07 PM]
  297. I vote hard fork. If I'm understanding correctly then a single node could perform the attack and steal the ZEN. Regardless of whether or not they'd be able to propagate it to the ZCL blockchain, the ZEN would still be moved.
  298.  
  299. movrcx [10:07 PM]
  300. @smrtz bro.... no hardfork is necessary for ZCL
  301.  
  302. [10:07]
  303. I just tested it on the live network.. people are running my implementation but aren't signaling it for some reason
  304.  
  305. [10:07]
  306. Either way it's good to go
  307.  
  308. [10:08]
  309. Bittrex just needs to protect their transactions w/ the new ZCL daemon and then everyone should be good to go
  310.  
  311. blockops [10:10 PM]
  312. Can Bittrex update their ZCL Damon at their convenience or should it be done as soon as possible?
  313.  
  314. If it can be done during one of their scheduled maintenance periods That would probably be better.
  315.  
  316. movrcx [10:11 PM]
  317. Yup they can update at any time. I just sent them a message to update it within 20 hours.
  318.  
  319. blockops [10:11 PM]
  320. Ok, sounds good. You've got my support with Bittrex if you need it.
  321.  
  322. movrcx [10:11 PM]
  323. It should be done asap though
  324.  
  325. [10:11]
  326. :+1:
  327.  
  328. smrtz [10:14 PM]
  329. I thought you originally suggested a hard fork?
  330. movrcx
  331. We'll need to a hardfork I think
  332. Posted in #tx-replay-preventionJune 6th at 8:50 PM
  333.  
  334. movrcx [10:14 PM]
  335. There are miners that are accepting the transactions so it's not required.
  336.  
  337. [10:14]
  338. It's not changing their consensus model.
  339.  
  340. [10:14]
  341. They just aren't signaling that's all.
  342.  
  343. smrtz [10:15 PM]
  344. Ok, I'm getting it now. Thank's for spelling it out for me again. :smile:
  345.  
  346. finpunk [11:18 PM]
  347. Just to recap, after chatting with Josh, this is just a prudent precautionary mod to reduce replay risk post expiration of this next BIP9 cycle. There's no known attack, latest PR extends protection indefinitely on ZEN, and we've also advised Bittrex to both recompile and move ZEN from old ZCL addresses. These recommendations should permanently eliminate replay risk. There's no further action for us at this point.
  348.  
  349. movrcx [11:20 PM]
  350. That's pretty accurate except that an attack is possible now if an adversary inserts the transactions within their own mined blocks. That would require custom code to execute though (the difficulty to execute this attack is low-moderate).
  351.  
  352. [11:22]
  353. This all pretty much stems from `OP_CHECKBLOCKATHEIGHT` mitigations not being initiated on the ZCL network. I think some of the miners forced the block version to be 4 instead of signaling for the `OP_CHECKBLOCKATHEIGHT` soft fork.
  354.  
  355. [11:23]
  356. So the ZCL network hasn't signaled for replay prevention to activate but most of the miners are running compliant code. There was an issue with Claymore's miner that prevented mining any blocks that weren't version 4. (edited)
  357.  
  358. [11:25]
  359. Bittrex really needs to move their funds over to new addresses soon imo. It's such a liability to keep funds from a chainsplit in the same address.
  360.  
  361.  
  362. ----- Yesterday June 7th, 2017 -----
  363. movrcx [9:30 AM]
  364. Btw so far it looks like this issue applies to Bitcoin as well and an adversary could execute this during a 148/149 chainsplit.
  365.  
  366.  
  367. [9:30]
  368. Those guys are nuts if they think a chainsplit will end well.
  369.  
  370. finpunk [10:46 AM]
  371. Anything else we can do to help with this @movrcx? Bittrex is informed, but hasn't responded yet; PR out there, need miners to update. Anything else? Great job identifying this and figuring out a quick path forward to mitigate :slightly_smiling_face:
  372.  
  373. lukas
  374. [11:16 AM]
  375. :+1:
  376.  
  377. smrtz [11:18 AM]
  378. @finpunk The PR to zClassic has already been merged into master: https://github.com/z-classic/zclassic/commit/867ad6cd05d2fb5c2950377eaf41aba7ae224fa9
  379. GitHub
  380. Merge pull request #90 from z-classic/transaction-replay · z-classic/zclassic@867ad6c
  381. Enable mandatory transaction replay countermeasures
  382.  
  383.  
  384.  
  385. finpunk [11:43 AM]
  386. Booyah, awesome @smrtz :slightly_smiling_face:
  387.  
  388. movrcx [11:44 AM]
  389. That was merged last night...
  390.  
  391.  
  392. lukas
  393. [12:59 PM]
  394. Hello, I would like to say thank you to all who participate to fix this issue. It looks like really huge threat.
  395.  
  396.  
  397. blockops [3:13 PM]
  398. @movrcx Bittrex Richie has responded on the bittrex slack and I'm trying to nicely tell him to do the upgrade today. So they at least know about it now.
  399.  
  400. smrtz [5:56 PM]
  401. @blockops He seems active now. Has he said anything back?
  402.  
  403. blockops [6:01 PM]
  404. I just messaged him again
  405.  
  406.  
  407. smrtz [6:02 PM]
  408. There are a few other bittrex-* people active in #customer-support. Should I message one of them too?
  409.  
  410. blockops [6:04 PM]
  411. Well, Richie responded. I think he gets to make the call on it. I would recommend not alerting others about it. I had also messaged two others about it this morning, Bill and Julian
  412.  
  413. smrtz [6:06 PM]
  414. Ok, I was going to message Julian since he seems the most active right now.
  415.  
  416. [6:06]
  417. Cool.
  418.  
  419. blockops [6:19 PM]
  420. @smrtz I don't know if you should message Julian. I don't know their organization. @finpunk is more familiar
  421.  
  422. smrtz [6:19 PM]
  423. Yeah, I haven't messaged anyone about it. I agree about keeping quiet until the threat is resolved.
  424.  
  425. [6:20]
  426. I'm just anxious to get it resolved.
  427.  
  428. finpunk [6:45 PM]
  429. I agree, they clearly know already, so pinging them again won't add anything
  430.  
  431. [6:46]
  432. Plus we want to keep this issue as narrowly known as possible until prevention measures implemented
  433.  
  434.  
  435. ----- Today June 8th, 2017 -----
  436. movrcx [3:53 PM]
  437. left tx-replay-prevention
  438.  
  439. blockops [3:53 PM]
  440. @iohk_carlo this is the one. I think you were already part of it
  441.  
  442. iohk_carlo [3:55 PM]
  443. Yes, thanks
  444.  
  445. smrtz [3:59 PM]
  446. OP_CHECKBLOCKATHEIGHT was a custom implementation written by Josh based on BIP115: https://github.com/bitcoin/bips/blob/master/bip-0115.mediawiki
  447. GitHub
  448. bitcoin/bips
  449. bips - Bitcoin Improvement Proposals
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement