Bitcoin Forum
January 23, 2019, 08:24:21 AM *
News: Latest Bitcoin Core release: 0.17.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [Idea] Replay protection by adding a new variable to transactions  (Read 278 times)
Coding Enthusiast
Hero Member
*****
Offline Offline

Activity: 564
Merit: 682


Novice C♯ Coder


View Profile WWW
October 27, 2017, 09:08:26 AM
 #1

I've been reading more about "Replay Protection" and how these forks are having trouble with it, some claiming the Sighash_forkID is hard to implement and is complicated to implement, so I was thinking there can be a much simpler way of implementing such protection.

Idea:
Add a new variable to transaction to indicate this is a transaction belonging to chain_x (bitcoin whatever chain).
For example it can be a 1 byte variable before version. Let's call it Fork_Flag

Example:
bitcoin transaction:
Code:
01000000017b1eabe0209b1fe794124575ef807057.... [Version][tx_in count][tx_in]....
bitcoin fork transaction:
Code:
0101000000017b1eabe0209b1fe794124575ef807057.... [Fork_flag][Version][tx_in count][tx_in]....

Since when a transaction is being signed, everything is signed, the signature of said transaction will be different. So an attacker can't just remove the first byte and "replay" that tx on bitcoin network, the signature will be invalid then.

Benefit:
- Easy to implement
- Also if a bitcoin node receives this transaction it does not have to verify the signature to know it is invalid which means not wasting CPU power. A quick look tells the node that this transaction is invalid.


So, will this work, or am I missing something here? Is there any downside to it?

Projects List+Suggestion box
Donation link using BIP21
Bech32 Donation link!
BitcoinTransactionTool (0.9.2):  Ann - Source Code
Watch Only Bitcoin Wallet (supporting SegWit) (3.1.0):  Ann - Source Code
SharpPusher (broadcast transactions) (0.10.0): Ann - Source Code

1548231861
Hero Member
*
Offline Offline

Posts: 1548231861

View Profile Personal Message (Offline)

Ignore
1548231861
Reply with quote  #2

1548231861
Report to moderator
1548231861
Hero Member
*
Offline Offline

Posts: 1548231861

View Profile Personal Message (Offline)

Ignore
1548231861
Reply with quote  #2

1548231861
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1548231861
Hero Member
*
Offline Offline

Posts: 1548231861

View Profile Personal Message (Offline)

Ignore
1548231861
Reply with quote  #2

1548231861
Report to moderator
amaclin1
Full Member
***
Offline Offline

Activity: 532
Merit: 226


View Profile
October 27, 2017, 02:14:21 PM
 #2

So, will this work, or am I missing something here? Is there any downside to it?

This is not "work", this is "fork".
Nobody wants to call his improvements as "fork".

Quote
[Fork_flag][Version][tx_in count][tx_in]
The client should know what the first 4 bytes mean: is it old good version or new fork_flag?
Do you know how segwit transactions are serialized?  Grin
Coding Enthusiast
Hero Member
*****
Offline Offline

Activity: 564
Merit: 682


Novice C♯ Coder


View Profile WWW
October 27, 2017, 02:33:36 PM
 #3

So, will this work, or am I missing something here? Is there any downside to it?

This is not "work", this is "fork".
Nobody wants to call his improvements as "fork".

Quote
[Fork_flag][Version][tx_in count][tx_in]
The client should know what the first 4 bytes mean: is it old good version or new fork_flag?
Do you know how segwit transactions are serialized?  Grin

In case you missed it, I am talking about these new forks that are coming out these days like bitcoin gold for example. And as they are creating a new fork, a new coin with a new client and new way of transactions, that client knows this.

As for that "flag", you can change the place of it. Put it at the end, after Sequence if you think it can cause any issues (not yet 100% familiar with SegWit Tongue)

Projects List+Suggestion box
Donation link using BIP21
Bech32 Donation link!
BitcoinTransactionTool (0.9.2):  Ann - Source Code
Watch Only Bitcoin Wallet (supporting SegWit) (3.1.0):  Ann - Source Code
SharpPusher (broadcast transactions) (0.10.0): Ann - Source Code

amaclin1
Full Member
***
Offline Offline

Activity: 532
Merit: 226


View Profile
October 27, 2017, 02:49:27 PM
 #4

As for that "flag", you can change the place of it. Put it at the end, after Sequence if you think it can cause any issues (not yet 100% familiar with SegWit Tongue)
between [version] and [tx_in count]  Grin
Taras
Legendary
*
Offline Offline

Activity: 1330
Merit: 1017


Please do not PM me loan requests!


View Profile WWW
October 28, 2017, 05:31:04 AM
 #5

I kind of like the idea of putting it right at the beginning of the transaction, before the version. You could tell what fork a raw transaction is made for at a glance, just looking at the hex. That would be harder if it were at the end or between the version and inputs.
Pages: [1]
  Print  
 
Jump to:  

Bitcointalk.org is not available or authorized for sale. Do not believe any fake listings.
Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!