Re: [Bitcoin-development] Enforcing inflation rules for SPV clients

2012-06-25 Thread Mike Hearn
 Link?

It was a private conversation for some reason.

 I also proposed this on this list (see the response in the tree
 datastructures thread) along with more elaboration on IRC.

Ah OK. I wasn't paying much attention to those threads.

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Bitcoin-development mailing list
Bitcoin-development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bitcoin-development


Re: [Bitcoin-development] LevelDB benchmarking

2012-06-25 Thread Mike Hearn
I've added some more commits:

https://github.com/mikehearn/bitcoin/commits/leveldb

It's still not ready for a pull req but is a lot closer:

1) Auto-migration is there but not well tested enough (I only tested
with empty wallets).
2) Migration progress UI is there so you have something to watch for
the few minutes it takes. Script execution is disabled during
migration
3) LevelDB source is checked in to the main tree, bitcoin-qt.pro
updated to use it
4) LevelDB is conditionally compiled so if there's some unexpected
issue or regression on some platform it can be switched back to BDB

Still to go:

1) More testing, eg, with actual wallets :-)
2) Update the non-Qt makefiles
3) On Windows it's currently de-activated due to some missing files
from leveldb + I didn't test it

If you want to help out, some testing and makefile work would be
useful. I may not get a chance to work on this again until next week.

On Wed, Jun 20, 2012 at 2:41 PM, Mike Hearn m...@plan99.net wrote:
 Two days ago on #bitcoin-dev:
 21:01:19 sipa what was CTxDB::ReadOwnerTxes ever used for?
 21:01:31 sipa maybe it predates the wallet logic

 (read: it's not used anywhere in the code, and apparently wasn't ever, even 
 in 0.1.5)

 Great, in that case Stefan is right and I'll delete that code when I
 next work on the patch.

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Bitcoin-development mailing list
Bitcoin-development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bitcoin-development


Re: [Bitcoin-development] Enforcing inflation rules for SPV clients

2012-06-25 Thread Daniel Lidstrom

  
  
Here's the conversation I had with Mike that Gregory requested a
link to:


Thanks!
  
  
  Bad or hacked client devs is indeed a huge, worrying problem.
The official client is addressing this with a system called
gitian, where multiple developers all compile the same source to
the same binary and then sign the results. Multi-signatures
raise the bar for releasing hacked clients a lot. We're starting
to investigate this with bitcoinj too, but it's a lot of work.
  
  
  Generally, the more people you have to involve in a
conspiracy, the less likely it is to succeed. If a few miners
started to dominate the system they have strong financial
incentives to cheat, alternatively, they may be subjected to
government pressure. Having to get the client developers
involved too makes it much harder, especially as users have to
actually upgrade.
  
  
  I started a thread on the development mailing list with your
suggestion, by the way.

On Mon, Jun 25, 2012 at 1:00 AM, Daniel
  Lidstrom lidstro...@gmail.com
  wrote:
  
 Hey Mike,
  
  I put our conversation in the email for easy reference.
  
  In the unlikely event of a miner conspiracy to print
  money, is it really so much of a further stretch to think
  the developers of a widely used client could also be
  involved? (Well, maybe, since miners are unaccountable
  and developers are not. OTOH if most users are
  apathetic...) Also, isn't the advantage for lightweight
  clients of SPV over the server-client model that you don't
  have to trust any operator? Maybe I'm being too much of a
  purist here...
  
  Regarding errors being cheap to send and expensive to
  verify, compartmentalizing them the way I suggested before
  would make them individually cheaper to verify. Just
  throwing around ideas: requiring the error message be
  received by a quorum of peers before checking, and
  dropping misbehaving or unreliable peers could help.
  Also, not verifying error messages unless the peers
  relaying them are willing to send all the data necessary
  to do so would help. Hashcash could also be used to
  balance the costs to send and to verify a given type of
  error message. I like your idea to only check errors in
  blocks that are split points, and the length of the split
  could also be a consideration.
  
  Can we move further conversations
to email please? SMF kind of sucks as an inbox.

Anyway, yes, your proposal makes a lot of sense,
although I think in practice this is unlikely to be an
issue. If a majority of miners did start mining on a
chain with new rules, even if SPV clients couldn't
detect the switch automatically it's very likely the
developers of those clients would notify the users out
of band in some way. For example, by pushing an update
to users that explains the new rules to them and tells
them how they can cash out of the Bitcoin economy if
they disagree with the new consensus.

If users are on the losing side of a rule change and
want to stay there (eg, maybe most non-miners want to
stay on the slower chain), then the client can just
checkpoint the first block after the rule change
occurred. Now even though there's a harder chain with
the new rules, the client will stay with the old rules
despite being blind to them. There's nothing that says
checkpoints have to be hard coded - clients could poll
the client developers every day to get new ones. So as
long as the SPV devs are on the ball, most users would
stay on the old rules even if the software can't do it
by itself.

All that said, broadcasting messages proving a block
broke the rules is a nice backstop if it can be done
without excessive complexity. There are some details to
think about. These messages would be cheap to create and
expensive to verify. There has to be something that
stops me claiming to SPV clients that every single block
is invalid and forcing them to do tons of useless work.
Perhaps only blocks that