Viewing a response to: @jl777/bitcoin-spinoff-fork-how-to-make-a-clean-fork-without-any-replay-attack-and-no-blockchain-visible-changes
Where in the Core code does the SIGHASH `int` get truncated to 1 byte before signing?
author | pinhead26 |
---|---|
permlink | re-jl777-bitcoin-spinoff-fork-how-to-make-a-clean-fork-without-any-replay-attack-and-no-blockchain-visible-changes-20160818t221710952z |
category | bitcoin |
json_metadata | {"tags":["bitcoin"]} |
created | 2016-08-18 22:17:09 |
last_update | 2016-08-18 22:17:09 |
depth | 1 |
children | 5 |
last_payout | 2016-09-18 08:42:33 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 85 |
author_reputation | 3,707,077 |
root_title | "bitcoin spinoff fork - how to make a clean fork without any replay attack and no blockchain visible changes" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 878,832 |
net_rshares | 0 |
HASH(the modified tx with the 4 byte sighash int) -> 256 bits that is signed then the SIGHASH byte (not int) is concatenated to the signature and that is what goes in the blockchain. it is explained in the http://bitcoinfactswiki.github.io/OP_CHECKSIG/
author | jl777 |
---|---|
permlink | re-pinhead26-re-jl777-bitcoin-spinoff-fork-how-to-make-a-clean-fork-without-any-replay-attack-and-no-blockchain-visible-changes-20160818t231059861z |
category | bitcoin |
json_metadata | {"tags":["bitcoin"],"links":["http://bitcoinfactswiki.github.io/OP_CHECKSIG/"]} |
created | 2016-08-18 23:10:57 |
last_update | 2016-08-18 23:10:57 |
depth | 2 |
children | 4 |
last_payout | 2016-09-18 08:42:33 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 252 |
author_reputation | 14,988,697,980,664 |
root_title | "bitcoin spinoff fork - how to make a clean fork without any replay attack and no blockchain visible changes" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 879,623 |
net_rshares | 0 |
Right that's what I meant sorry, 4 bytes are signed but only 1 byte goes into the serialized transaction for broadcast. So what I'm asking is, where in the Tx serialization process is the 4 bytes reduced to 1? Like literally where in the code or protocol spec?
author | pinhead26 |
---|---|
permlink | re-jl777-re-pinhead26-re-jl777-bitcoin-spinoff-fork-how-to-make-a-clean-fork-without-any-replay-attack-and-no-blockchain-visible-changes-20160818t232451363z |
category | bitcoin |
json_metadata | {"tags":["bitcoin"]} |
created | 2016-08-18 23:24:51 |
last_update | 2016-08-18 23:24:51 |
depth | 3 |
children | 3 |
last_payout | 2016-09-18 08:42:33 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 260 |
author_reputation | 3,707,077 |
root_title | "bitcoin spinoff fork - how to make a clean fork without any replay attack and no blockchain visible changes" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 879,806 |
net_rshares | 0 |
the signature is generated, 70 to 72 bytes (maybe I am off by 1 here), and the sighash byte is just added to the end. It is in the protocol spec, so that is what I did and it works. not familiar with bitcoind code as I wrote iguanacore from scratch
author | jl777 |
---|---|
permlink | re-pinhead26-re-jl777-re-pinhead26-re-jl777-bitcoin-spinoff-fork-how-to-make-a-clean-fork-without-any-replay-attack-and-no-blockchain-visible-changes-20160818t234635928z |
category | bitcoin |
json_metadata | {"tags":["bitcoin"]} |
created | 2016-08-18 23:46:36 |
last_update | 2016-08-18 23:46:36 |
depth | 4 |
children | 1 |
last_payout | 2016-09-18 08:42:33 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 248 |
author_reputation | 14,988,697,980,664 |
root_title | "bitcoin spinoff fork - how to make a clean fork without any replay attack and no blockchain visible changes" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 880,057 |
net_rshares | 0 |
yes, you found it. casting an int to char will truncate it
author | jl777 |
---|---|
permlink | re-pinhead26-re-jl777-re-pinhead26-re-jl777-bitcoin-spinoff-fork-how-to-make-a-clean-fork-without-any-replay-attack-and-no-blockchain-visible-changes-20160819t005941796z |
category | bitcoin |
json_metadata | {"tags":["bitcoin"]} |
created | 2016-08-19 00:59:42 |
last_update | 2016-08-19 00:59:42 |
depth | 4 |
children | 0 |
last_payout | 2016-09-18 08:42:33 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 58 |
author_reputation | 14,988,697,980,664 |
root_title | "bitcoin spinoff fork - how to make a clean fork without any replay attack and no blockchain visible changes" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 881,023 |
net_rshares | 0 |