public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
From: Johnson Lau <jl2012@xbt•hk>
To: Sergio Demian Lerner <sergio.d.lerner@gmail•com>
Cc: Bitcoin Protocol Discussion <bitcoin-dev@lists•linuxfoundation.org>
Subject: Re: [bitcoin-dev] Attack by modifying non-segwit transactions after segwit is accepted ?
Date: Thu, 1 Sep 2016 07:29:29 -0400 (EDT)	[thread overview]
Message-ID: <1348417205.55392.1472729369522@privateemail.com> (raw)
In-Reply-To: <CAKzdR-oMEe6rcusn5kajZHvWXEkneywsNEJpooss76o9WuhDxg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1839 bytes --]

Thank you so much for taking time to actually review the codes. I hope you will keep raising questions when you feel something might be wrong. This is how things supposed to work and we should not be affected by some forum discussions.

> On August 26, 2016 at 9:16 AM Sergio Demian Lerner <sergio.d.lerner@gmail•com> wrote:
> 
>     Because there was a discussion on reddit about this topic, I want to clarify that Johnson Lau explained how a check in the code prevents this attack.
>     So there is no real attack.
> 
>     Also note that the subject of this thread has a question mark, which means that I'm asking the community for clarification, not asserting the existence of a vulnerability.
> 
>     The segwit code is complex, and some key parts of the consensus code are spread over the source files (such as state.CorruptionPossible() relation to DoS banning, IsNull() check in witness program serialization, etc.).
> 
>     Thanks again Johnson for your clarifications.
> 
> 
>     On Wed, Aug 24, 2016 at 10:49 PM, Johnson Lau <jl2012@xbt•hk mailto:jl2012@xbt•hk > wrote:
> 
>         > > 
> >         Adding witness data to a non-segwit script is invalid by consensus:
> > 
> >         https://github.com/bitcoin/bitcoin/blob/d612837814020ae832499d18e6ee5eb919a87907/src/script/interpreter.cpp#L1467 https://github.com/bitcoin/bitcoin/blob/d612837814020ae832499d18e6ee5eb919a87907/src/script/interpreter.cpp#L1467
> > 
> > 
> >         This PR will detect such violation early and ban the peer:
> > 
> >         https://github.com/bitcoin/bitcoin/pull/8499 https://github.com/bitcoin/bitcoin/pull/8499
> > 
> >          
> > 
> > 
> >         Another approach is to run the scripts of all incoming transactions. That's not too bad as you have already fetched the utxos which is a major part of validation.
> > 
> >     > 
> 

[-- Attachment #2: Type: text/html, Size: 2276 bytes --]

      reply	other threads:[~2016-09-01 11:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-24 20:51 Sergio Demian Lerner
2016-08-25  1:49 ` Johnson Lau
2016-08-26 13:16   ` Sergio Demian Lerner
2016-09-01 11:29     ` Johnson Lau [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1348417205.55392.1472729369522@privateemail.com \
    --to=jl2012@xbt$(echo .)hk \
    --cc=bitcoin-dev@lists$(echo .)linuxfoundation.org \
    --cc=sergio.d.lerner@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox