4

I'm trying to fill a few gaps in my understanding how this transaction happened!

It all started with this article

In short, some vigilante/miner was able to scoop up all of the BCH sitting in segwit addresses (namely, the ones for which the public keys were revealed by the owners spending BTC from the same addresses.

See this Transaction that was created, miner Bitcoin Cash Block Explorer

Step by Step Breakdown

  1. Miner scoops public key of this address 3P9dyU9ga3aJorHAUqKBFCX2NdyuHEVgx1 (this is a P2SH P2WPKH address see this bitcoin block explorer )

    Question: what is that public key? Do you see any keys? ("3" is a multisig address & requires 3 addresses, so there must be 3 public keys, right?)

  2. The article didn't explain how and what raw transaction he created using only public keys.

  3. This is the most frustrating part. The article claims that miner created a segwit node and mined on top of that.

    How is that even possible? (Bcash doesnt have segwit activated. However even if he mined using his segwit node, his node will not allow him to create a valid transaction because segwit requires a witness or sign with private key of public key of address 3P9dyU9ga3aJorHAUqKBFCX2NdyuHEVgx1.)


However, this article claims

  1. The miner just created a scriptsig (the article didn't explain what "apply a particular hash" means).

  2. Now it's easy, the miner just has to assign a BCH output (address starting with 1)

  3. it gets even more stupid. The article says after making that raw transaction he mined it ..... without broadcasting it. How does that work?

    3.1 If you are not broadcasting it then whats the point? How will that transaction go through to the new address/wallet created by miner (in this case 1C4TafndKYFoGkeoHfQAWkZzEYLum31txf)?

    3.2 If the miner is mining his own block and then not broadcasting it, wouldn't it get orphaned? So what is going on here?

  • 1
    It's a good question (though it would be easier to read with capitalized sentences, correct spelling, and fewer ? marks). However the last paragraph is off topic - this site isn't the place to recruit people for your projects. – Nate Eldredge Dec 13 '17 at 15:59
  • i agree however i want to learn ... segwit is so confusing trying to search for 25 days .. already had 46 tabs and 4 windows open in my browser – user380208 Dec 13 '17 at 16:32
2

Question: what is that public key? do you see any keys? ("3" is a multisig address & requires 3 address? so there must be 3 public keys right?)

No. An address beginning with a 3 is a P2SH address. This does not mean it is a multisig address or requires any number of keys to sign the transaction. Rather it just means that there is some script (it can be any script, not necessarily a multisig script) that needs to be included in the input that spends the P2SH output. That script will dictate the other items in the input.

For a P2SH nested Segwit output (P2SH-P2WPKH and P2SH-P2WSH), the script that the address refers to (known as the redeem script) is of the form OP_0 <20 byte hash> or OP_0 <32 byte hash>. When a segwit node sees this script in an output or as a redeem script, it knows that it should look in the newly defined witness are of a transaction to get the rest of the data it needs to verify the transaction.

However for a non-segwit node, they will mark the transaction as valid (but not standard) because for a non-segwit node, those redeem scripts don't specify that a signature is needed. This makes these outputs anyone-can-spend to non-segwit nodes.

Since Bitcoin Cash does not implement segwit, all of their nodes are non-segwit nodes. Thus in order to spend from the P2SH nested segwit outputs, you only need to provide the redeem script. However the redeem scripts are protected by a hash; given only a P2SH output, you cannot figure out the redeem script unless you already know it. Redeem scripts are revealed when the output is spent from.

What the miner did here was that they found as many redeem scripts as they could. The redeem scripts of the P2SH outputs used were all redeem scripts that had been revealed on the Bitcoin network because they had been used as an input in a transaction. So the miner took all of those revealed redeem scripts and checked to see which ones had corresponding outputs on the Bitcoin Cash network. Those that did could then be spent by the miner as the miner then knew the redeem script.

it gets even more stupid ????????????????????? Article says after making that raw transaction he mined it ..... without broadcasting it ?????? what

A transaction does not need to be broadcast before it is mined. A miner can include whatever transactions he wants, and that includes transactions not broadcast to the public. Once the block is mined, the transaction will then be broadcast with the block.

  • "Once the block is mined, the transaction will then be broadcast with the block." 1. a miner can include tx that haven't being broadcasted before! isn't that against consensus rules? 2. what will happen if a miner didn't broadcast that tx after the block has been mined? is that block going to get rejected by other peers? – user380208 Dec 13 '17 at 18:38
  • No, it is not against the consensus rules to include a transaction that was not broadcast. It is impossible for a node to know whether a transaction was actually broadcast to the network because they may have not received it if it were broadcast. The transaction itself does not need to be broadcast; it will be included in a block and that block will be broadcast. If the block that is transmitted does not include the transaction but when it was mined it did, then the transmitted block will be invalid. – Andrew Chow Dec 13 '17 at 18:53
  • it will be lot easier if bitcoin.org would have explained how mining works with segwit... If the block includes that tx and removes it after being mined it will then change the nonce + hash making is automatically invalid ... thats what you're trying to say right? – user380208 Dec 13 '17 at 19:05
  • Yes. It has nothing to do with segwit though. That is a consensus rule that has always existed. – Andrew Chow Dec 13 '17 at 19:15
  • so why didn't he just broadcasted it like a regular person ...instead of mining it ? maybe cuz he was afraid other miners will take that transaction & replace with there address in the output section, i guess .... lol :) just like the game of thrones – user380208 Dec 13 '17 at 19:43
1

SegWit outputs look like AnyoneCanSpend outputs to legacy nodes (to keep it as a softfork). Since Bitcoin Cash doesn't have (and strictly opposes) SegWit, all the miners see them as AnyoneCanSpend outputs, and they can redeem it.

This cannot happen on the Bitcoin network, because the other miners would reject that block.

Maybe he's this guy: https://www.reddit.com/r/btc/comments/7g6s9l/an_update_on_bch_segwit_recoveries/ ?

[Removed nonsense part]

  • yeah that's the miner.. however these outputs where ignored by other miners (miners didnt took it- look the date on bch block explorer) and it is actually after than it was kindof hacked by that bcnsegwit-miner – user380208 Dec 13 '17 at 16:29
  • No, it is not a hack. Other miners could redeem these outputs too, but they didn't for some reason. (Ethics?) – MCCCS Dec 13 '17 at 16:33
  • i know its not a hack ... other miners didnt do it cuz its complicated as hell... even the miner admits himself- "Because of the significant effort that was required to both claim these BCH and to verify that each person is the person who should be receiving the BCH, I will be taking 30% " – user380208 Dec 13 '17 at 16:35
  • 1
    That article on SegWit is nonsensical FUD, as it completely ignores full nodes. Since nearly every node on the network now enforces SegWit consensus rules, reverting it to steal its outputs would require full nodes to stop enforcing first. That's a hardfork. – Pieter Wuille Dec 13 '17 at 17:54
  • @PieterWuille Thanks for reviewing this page ... 1. Which article are you referencing to? 2. quote "Since nearly every node on the network now enforces SegWit" which network ? bcash or bitcoin – user380208 Dec 13 '17 at 18:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.