Re: [Bitcoin-development] Time

2014-07-25 Thread Aaron Voisine
Yes, if the wallet isn't up to date yet, it uses the highest estimated
block height from connected peers, but that could be gamed by
controlling the network. The app has blockchain checkpoints in it
though, so you couldn't truncate the chain starting point below that.
The worst case is that you get a 4-5 extra guesses, but as I
mentioned, it'd be easier to just jailbreak the phone if the phone
itself isn't using a system wide pin lock. I just though it was a fun
and convenient way to prevent the system time hack. The system pin is
what protects your wallet in the event of physical theft, and the app
pin is just for when you lend your phone to a friend for a few
minutes.

Aaron Voisine
breadwallet.com


On Fri, Jul 25, 2014 at 9:22 AM, Natanael  wrote:
> Probably because the network isn't designed for interactive proofs. Most
> interactive algoritms AFAICT requires that some machine holds a secret state
> (or at least continuous and untampered state, but you still need to verify
> you're falling to the right machine), otherwise the machine can be mimicked
> and "rewound" to earlier states. Without a challenge-response that can't be
> faked, you've got problems.
>
> There's no trusted machines here that you can rely on. The certainty of
> having the right blockchain is a statistical one over longer periods of
> time, not enough for a PIN you want verified right now. So you can always be
> shown an old copy, and if your node isn't up to date yet then it can also be
> shown fake chains further into the future.
>
> Maybe you could throw in some kind of Secure Multiparty Computation among
> the miners to enable challenge-response, with state saved in the blockchain
> (so it can't be rolled back), but that would be fragile. How do you select
> what nodes may participate? How do you prevent the secret state from
> leaking? And performance would be absolutely horrible, and reliability is a
> huge problem.
>
> Den 25 jul 2014 18:03 skrev "Mike Hearn" :
>
>> Sorry, you're right. I'd have hoped a delay that doubles on failure each
>> time up to some max would be good enough, relying on the p2p network to
>> unlock a PIN feels weird, but I can't really quantify why or what's wrong
>> with it so I guess it's just me :-)
>>
>>
>> On Fri, Jul 25, 2014 at 4:45 PM, Aaron Voisine  wrote:
>>>
>>> The problem is if someone moves system time forward between app launches.
>>> The lockout period doesn't have to be all that precise, it just makes you
>>> wait for the next block, then 5, then 25, and so on. Using a well known time
>>> server over https would also be a good option, but the wallet app already
>>> has the chain height anyway.
>>>
>>>
>>> On Friday, July 25, 2014, Mike Hearn  wrote:

 Given that the speed at which the block chain advances is kind of
 unpredictable, I'd think it might be better to just record the time to disk
 when a PIN attempt is made and if you observe time going backwards, refuse
 to allow more attempts until it's advanced past the previous attempt.


 On Fri, Jul 25, 2014 at 7:56 AM, Aaron Voisine 
 wrote:
>
> It's based on the block height, not the block's timestamp. If you have
> access to the device and the phone itself is not pin locked, then you
> can jailbreak it and get access to the wallet seed that way. A pin
> locked device however is reasonably secure as the filesystem is
> hardware aes encrypted to a combination of pin+uuid. This was just an
> easy way to prevent multiple pin guesses by changing system time in
> settings, so that isn't the weakest part of the security model.
>
> Aaron Voisine
> breadwallet.com
>
>
> On Thu, Jul 24, 2014 at 8:21 PM, William Yager 
> wrote:
> > On Thu, Jul 24, 2014 at 10:39 PM, Gregory Maxwell
> > 
> > wrote:
> >>
> >>
> >> Is breadwallet tamper resistant & zero on tamper hardware? otherwise
> >> this sounds like security theater I attach a debugger to the
> >> process (or modify the program) and ignore the block sourced time.
> >>
> >
> > It's an iOS application. I would imagine it is substantially more
> > difficult
> > to attach to a process (which, at the very least, requires root, and
> > perhaps
> > other things on iOS) than to convince the device to change its system
> > time.
> >
> > That said, the security benefits might not be too substantial.
> >
> >
> > --
> > Want fast and easy access to all the code in your enterprise? Index
> > and
> > search up to 200,000 lines of code with a free copy of Black Duck
> > Code Sight - the same software that powers the world's largest code
> > search on Ohloh, the Black Duck Open Hub! Try it now.
> > http://p.sf.net/sfu/bds
> > ___
> > Bitcoin-development mailing list
> > Bit

Re: [Bitcoin-development] Time

2014-07-25 Thread Natanael
Probably because the network isn't designed for interactive proofs. Most
interactive algoritms AFAICT requires that some machine holds a secret
state (or at least continuous and untampered state, but you still need to
verify you're falling to the right machine), otherwise the machine can be
mimicked and "rewound" to earlier states. Without a challenge-response that
can't be faked, you've got problems.

There's no trusted machines here that you can rely on. The certainty of
having the right blockchain is a statistical one over longer periods of
time, not enough for a PIN you want verified right now. So you can always
be shown an old copy, and if your node isn't up to date yet then it can
also be shown fake chains further into the future.

Maybe you could throw in some kind of Secure Multiparty Computation among
the miners to enable challenge-response, with state saved in the blockchain
(so it can't be rolled back), but that would be fragile. How do you select
what nodes may participate? How do you prevent the secret state from
leaking? And performance would be absolutely horrible, and reliability is a
huge problem.
Den 25 jul 2014 18:03 skrev "Mike Hearn" :

> Sorry, you're right. I'd have hoped a delay that doubles on failure each
> time up to some max would be good enough, relying on the p2p network to
> unlock a PIN feels weird, but I can't really quantify why or what's wrong
> with it so I guess it's just me :-)
>
>
> On Fri, Jul 25, 2014 at 4:45 PM, Aaron Voisine  wrote:
>
>> The problem is if someone moves system time forward between app launches.
>> The lockout period doesn't have to be all that precise, it just makes you
>> wait for the next block, then 5, then 25, and so on. Using a well
>> known time server over https would also be a good option, but the wallet
>> app already has the chain height anyway.
>>
>>
>> On Friday, July 25, 2014, Mike Hearn  wrote:
>>
>>>  Given that the speed at which the block chain advances is kind of
>>> unpredictable, I'd think it might be better to just record the time to disk
>>> when a PIN attempt is made and if you observe time going backwards, refuse
>>> to allow more attempts until it's advanced past the previous attempt.
>>>
>>>
>>> On Fri, Jul 25, 2014 at 7:56 AM, Aaron Voisine 
>>> wrote:
>>>
 It's based on the block height, not the block's timestamp. If you have
 access to the device and the phone itself is not pin locked, then you
 can jailbreak it and get access to the wallet seed that way. A pin
 locked device however is reasonably secure as the filesystem is
 hardware aes encrypted to a combination of pin+uuid. This was just an
 easy way to prevent multiple pin guesses by changing system time in
 settings, so that isn't the weakest part of the security model.

 Aaron Voisine
 breadwallet.com


 On Thu, Jul 24, 2014 at 8:21 PM, William Yager 
 wrote:
 > On Thu, Jul 24, 2014 at 10:39 PM, Gregory Maxwell >>> >
 > wrote:
 >>
 >>
 >> Is breadwallet tamper resistant & zero on tamper hardware? otherwise
 >> this sounds like security theater I attach a debugger to the
 >> process (or modify the program) and ignore the block sourced time.
 >>
 >
 > It's an iOS application. I would imagine it is substantially more
 difficult
 > to attach to a process (which, at the very least, requires root, and
 perhaps
 > other things on iOS) than to convince the device to change its system
 time.
 >
 > That said, the security benefits might not be too substantial.
 >
 >
 --
 > Want fast and easy access to all the code in your enterprise? Index
 and
 > search up to 200,000 lines of code with a free copy of Black Duck
 > Code Sight - the same software that powers the world's largest code
 > search on Ohloh, the Black Duck Open Hub! Try it now.
 > http://p.sf.net/sfu/bds
 > ___
 > Bitcoin-development mailing list
 > Bitcoin-development@lists.sourceforge.net
 > https://lists.sourceforge.net/lists/listinfo/bitcoin-development
 >


 --
 Want fast and easy access to all the code in your enterprise? Index and
 search up to 200,000 lines of code with a free copy of Black Duck
 Code Sight - the same software that powers the world's largest code
 search on Ohloh, the Black Duck Open Hub! Try it now.
 http://p.sf.net/sfu/bds
 ___
 Bitcoin-development mailing list
 Bitcoin-development@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/bitcoin-development

>>>
>>>
>>
>> --
>>
>> Aaron Voisine
>> breadwallet.com
>>
>
>
>
> --
> Want 

Re: [Bitcoin-development] Time

2014-07-25 Thread Mike Hearn
Sorry, you're right. I'd have hoped a delay that doubles on failure each
time up to some max would be good enough, relying on the p2p network to
unlock a PIN feels weird, but I can't really quantify why or what's wrong
with it so I guess it's just me :-)


On Fri, Jul 25, 2014 at 4:45 PM, Aaron Voisine  wrote:

> The problem is if someone moves system time forward between app launches.
> The lockout period doesn't have to be all that precise, it just makes you
> wait for the next block, then 5, then 25, and so on. Using a well
> known time server over https would also be a good option, but the wallet
> app already has the chain height anyway.
>
>
> On Friday, July 25, 2014, Mike Hearn  wrote:
>
>> Given that the speed at which the block chain advances is kind of
>> unpredictable, I'd think it might be better to just record the time to disk
>> when a PIN attempt is made and if you observe time going backwards, refuse
>> to allow more attempts until it's advanced past the previous attempt.
>>
>>
>> On Fri, Jul 25, 2014 at 7:56 AM, Aaron Voisine  wrote:
>>
>>> It's based on the block height, not the block's timestamp. If you have
>>> access to the device and the phone itself is not pin locked, then you
>>> can jailbreak it and get access to the wallet seed that way. A pin
>>> locked device however is reasonably secure as the filesystem is
>>> hardware aes encrypted to a combination of pin+uuid. This was just an
>>> easy way to prevent multiple pin guesses by changing system time in
>>> settings, so that isn't the weakest part of the security model.
>>>
>>> Aaron Voisine
>>> breadwallet.com
>>>
>>>
>>> On Thu, Jul 24, 2014 at 8:21 PM, William Yager 
>>> wrote:
>>> > On Thu, Jul 24, 2014 at 10:39 PM, Gregory Maxwell 
>>> > wrote:
>>> >>
>>> >>
>>> >> Is breadwallet tamper resistant & zero on tamper hardware? otherwise
>>> >> this sounds like security theater I attach a debugger to the
>>> >> process (or modify the program) and ignore the block sourced time.
>>> >>
>>> >
>>> > It's an iOS application. I would imagine it is substantially more
>>> difficult
>>> > to attach to a process (which, at the very least, requires root, and
>>> perhaps
>>> > other things on iOS) than to convince the device to change its system
>>> time.
>>> >
>>> > That said, the security benefits might not be too substantial.
>>> >
>>> >
>>> --
>>> > Want fast and easy access to all the code in your enterprise? Index and
>>> > search up to 200,000 lines of code with a free copy of Black Duck
>>> > Code Sight - the same software that powers the world's largest code
>>> > search on Ohloh, the Black Duck Open Hub! Try it now.
>>> > http://p.sf.net/sfu/bds
>>> > ___
>>> > Bitcoin-development mailing list
>>> > Bitcoin-development@lists.sourceforge.net
>>> > https://lists.sourceforge.net/lists/listinfo/bitcoin-development
>>> >
>>>
>>>
>>> --
>>> Want fast and easy access to all the code in your enterprise? Index and
>>> search up to 200,000 lines of code with a free copy of Black Duck
>>> Code Sight - the same software that powers the world's largest code
>>> search on Ohloh, the Black Duck Open Hub! Try it now.
>>> http://p.sf.net/sfu/bds
>>> ___
>>> Bitcoin-development mailing list
>>> Bitcoin-development@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/bitcoin-development
>>>
>>
>>
>
> --
>
> Aaron Voisine
> breadwallet.com
>
--
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds___
Bitcoin-development mailing list
Bitcoin-development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bitcoin-development


Re: [Bitcoin-development] Time

2014-07-25 Thread Aaron Voisine
The problem is if someone moves system time forward between app launches.
The lockout period doesn't have to be all that precise, it just makes you
wait for the next block, then 5, then 25, and so on. Using a well
known time server over https would also be a good option, but the wallet
app already has the chain height anyway.

On Friday, July 25, 2014, Mike Hearn  wrote:

> Given that the speed at which the block chain advances is kind of
> unpredictable, I'd think it might be better to just record the time to disk
> when a PIN attempt is made and if you observe time going backwards, refuse
> to allow more attempts until it's advanced past the previous attempt.
>
>
> On Fri, Jul 25, 2014 at 7:56 AM, Aaron Voisine  > wrote:
>
>> It's based on the block height, not the block's timestamp. If you have
>> access to the device and the phone itself is not pin locked, then you
>> can jailbreak it and get access to the wallet seed that way. A pin
>> locked device however is reasonably secure as the filesystem is
>> hardware aes encrypted to a combination of pin+uuid. This was just an
>> easy way to prevent multiple pin guesses by changing system time in
>> settings, so that isn't the weakest part of the security model.
>>
>> Aaron Voisine
>> breadwallet.com
>>
>>
>> On Thu, Jul 24, 2014 at 8:21 PM, William Yager > > wrote:
>> > On Thu, Jul 24, 2014 at 10:39 PM, Gregory Maxwell > >
>> > wrote:
>> >>
>> >>
>> >> Is breadwallet tamper resistant & zero on tamper hardware? otherwise
>> >> this sounds like security theater I attach a debugger to the
>> >> process (or modify the program) and ignore the block sourced time.
>> >>
>> >
>> > It's an iOS application. I would imagine it is substantially more
>> difficult
>> > to attach to a process (which, at the very least, requires root, and
>> perhaps
>> > other things on iOS) than to convince the device to change its system
>> time.
>> >
>> > That said, the security benefits might not be too substantial.
>> >
>> >
>> --
>> > Want fast and easy access to all the code in your enterprise? Index and
>> > search up to 200,000 lines of code with a free copy of Black Duck
>> > Code Sight - the same software that powers the world's largest code
>> > search on Ohloh, the Black Duck Open Hub! Try it now.
>> > http://p.sf.net/sfu/bds
>> > ___
>> > Bitcoin-development mailing list
>> > Bitcoin-development@lists.sourceforge.net
>> 
>> > https://lists.sourceforge.net/lists/listinfo/bitcoin-development
>> >
>>
>>
>> --
>> Want fast and easy access to all the code in your enterprise? Index and
>> search up to 200,000 lines of code with a free copy of Black Duck
>> Code Sight - the same software that powers the world's largest code
>> search on Ohloh, the Black Duck Open Hub! Try it now.
>> http://p.sf.net/sfu/bds
>> ___
>> Bitcoin-development mailing list
>> Bitcoin-development@lists.sourceforge.net
>> 
>> https://lists.sourceforge.net/lists/listinfo/bitcoin-development
>>
>
>

-- 

Aaron Voisine
breadwallet.com
--
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds___
Bitcoin-development mailing list
Bitcoin-development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bitcoin-development


Re: [Bitcoin-development] Time

2014-07-25 Thread Mike Hearn
Given that the speed at which the block chain advances is kind of
unpredictable, I'd think it might be better to just record the time to disk
when a PIN attempt is made and if you observe time going backwards, refuse
to allow more attempts until it's advanced past the previous attempt.


On Fri, Jul 25, 2014 at 7:56 AM, Aaron Voisine  wrote:

> It's based on the block height, not the block's timestamp. If you have
> access to the device and the phone itself is not pin locked, then you
> can jailbreak it and get access to the wallet seed that way. A pin
> locked device however is reasonably secure as the filesystem is
> hardware aes encrypted to a combination of pin+uuid. This was just an
> easy way to prevent multiple pin guesses by changing system time in
> settings, so that isn't the weakest part of the security model.
>
> Aaron Voisine
> breadwallet.com
>
>
> On Thu, Jul 24, 2014 at 8:21 PM, William Yager 
> wrote:
> > On Thu, Jul 24, 2014 at 10:39 PM, Gregory Maxwell 
> > wrote:
> >>
> >>
> >> Is breadwallet tamper resistant & zero on tamper hardware? otherwise
> >> this sounds like security theater I attach a debugger to the
> >> process (or modify the program) and ignore the block sourced time.
> >>
> >
> > It's an iOS application. I would imagine it is substantially more
> difficult
> > to attach to a process (which, at the very least, requires root, and
> perhaps
> > other things on iOS) than to convince the device to change its system
> time.
> >
> > That said, the security benefits might not be too substantial.
> >
> >
> --
> > Want fast and easy access to all the code in your enterprise? Index and
> > search up to 200,000 lines of code with a free copy of Black Duck
> > Code Sight - the same software that powers the world's largest code
> > search on Ohloh, the Black Duck Open Hub! Try it now.
> > http://p.sf.net/sfu/bds
> > ___
> > Bitcoin-development mailing list
> > Bitcoin-development@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/bitcoin-development
> >
>
>
> --
> Want fast and easy access to all the code in your enterprise? Index and
> search up to 200,000 lines of code with a free copy of Black Duck
> Code Sight - the same software that powers the world's largest code
> search on Ohloh, the Black Duck Open Hub! Try it now.
> http://p.sf.net/sfu/bds
> ___
> Bitcoin-development mailing list
> Bitcoin-development@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bitcoin-development
>
--
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds___
Bitcoin-development mailing list
Bitcoin-development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bitcoin-development


Re: [Bitcoin-development] Time

2014-07-25 Thread Mike Hearn
>
> Ok... 'time' on the blockchain could be 'gamed' ... but with great
> difficulty.


Unfortunately not: miners have in the past routinely gamed the timestamp in
order to use it as an extra nonce and squeeze some more gigahashes out of
their hardware/pool.

Also remember that currently the chain could be dominated by a coalition of
just two pools.


> An application presented with a fake blockchain can use
> quite a few heuristics to test the 'validity' of the block chain.
>

The app cannot tell if it was given a truncated chain. You could keep such
an app stuck in the past forever. This is often a problem.


> Reliable 'time' has been impossible up until now - because you need to
> trust the time source, and that can always be faked.  Using the
> blockchain as an approximate time source gives you a world wide
> consensus without direct trust of any player.
>

Much though I hate to be a party pooper, you could currently get
Bitcoin-level trusted time by just polling at least two or three
independent servers e.g. google.com, baidu.cn, yandex.ru(they all serve
time via HTTPS headers).

If we crack the mining decentralisation problem then this argument becomes
a lot stronger, but for now ..


> So if this presumption is correct, then we can now build time capsule
> applications that can not be tricked into exposing their contents too
> early by running them in a virtual environment with the wrong system time.


If you have a tamper resistant execution environment (TXT, SGX, Flicker
etc) then yes. However trusted execution environments sometimes have tamper
resistant clocks as well for exactly this reason. So whether this technique
makes sense depends a lot on the details of your configuration, I think.
--
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds___
Bitcoin-development mailing list
Bitcoin-development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bitcoin-development