daily pastebin goal
17%
SHARE
TWEET

Email 4

a guest Aug 11th, 2017 6,055 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. From: Mike Hearn <mike@plan99.net>
  2. Date: Mon, Mar 7, 2011 at 2:13 PM
  3. To: Satoshi Nakamoto <satoshin@gmx.com>
  4.  
  5.  
  6. Hi Satoshi,
  7.  
  8. I hope you are doing well. I finally got all the lawyers happy enough
  9. to release BitCoinJ under the Google name using the Apache 2 license:
  10.  
  11. http://www.bitcoin.org/smf/index.php?topic=4236.0
  12.  
  13. It's incomplete - notably it doesn't properly handle block chain
  14. splits yet - but the rest is coming. I put a lot of work into
  15. documentation and comments so hopefully it'll open up BitCoin to a new
  16. audience who weren't able to understand/build the current code. Over
  17. the next month or two I'll be finishing off some of the bigger missing
  18. pieces for a full client-mode implementation.
  19.  
  20. I know you are busy right now but I'm hoping you can find time to
  21. answer a few questions I had.
  22.  
  23. As part of doing full SPV I'm thinking of adding a getmerklebranch
  24. message to the protocol. This would return a set of {blockhash,
  25. branch} pairs given tx hashes, so allowing verification of a broadcast
  26. transaction before it was incorporated into a block without storing
  27. the full chain. Does that approach sound good to you?
  28.  
  29. Also, I've been thinking of exploring different transaction types
  30. lately, eg by removing the IsStandard() checks for the testnet. It's
  31. clear you put a lot of thought into transactions beyond simply moving
  32. coins around up front, but unfortunately none of it was in the paper
  33. or documented in the code. Escrow, multi-pay and so on are all
  34. interesting but I was wondering if you could compile a list of ideas
  35. for things we can do with the scripting language at some point.
  36.  
  37. Finally, the code that allows for transaction replacement has been
  38. disabled but the comment doesn't say why. Is this just to reduce the
  39. attack surface/complexity or is there a deeper reason? I haven't fully
  40. understood why sequence numbers are a property of the tx inputs rather
  41. than the tx itself.
  42.  
  43. Hope you can find the time/energy to rejoin us soon! I don't know if
  44. you've seen this:
  45.  
  46. http://bitcoin.sipa.be/speed-lin.png
  47.  
  48. but it's exciting times for the network!
  49.  
  50. thanks!
  51. /mike
  52.  
  53. ----------
  54. From: Satoshi Nakamoto <satoshin@gmx.com>
  55. Date: Wed, Mar 9, 2011 at 5:15 PM
  56. To: Mike Hearn <mike@plan99.net>
  57.  
  58.  
  59.     I hope you are doing well. I finally got all the lawyers happy enough
  60.     to release BitCoinJ under the Google name using the Apache 2 license:
  61.  
  62.     It's incomplete - notably it doesn't properly handle block chain
  63.     splits yet - but the rest is coming. I put a lot of work into
  64.     documentation and comments so hopefully it'll open up BitCoin to a new
  65.     audience who weren't able to understand/build the current code. Over
  66.     the next month or two I'll be finishing off some of the bigger missing
  67.     pieces for a full client-mode implementation.
  68.  
  69.  
  70. That's great news!  Much complexity can be left behind in a clean rewrite with only client requirements, and it opens it to Java developers too.
  71.  
  72.     I know you are busy right now but I'm hoping you can find time to
  73.     answer a few questions I had.
  74.  
  75.  
  76. I'm happy to answer any questions.
  77.  
  78.     As part of doing full SPV I'm thinking of adding a getmerklebranch
  79.     message to the protocol. This would return a set of {blockhash,
  80.     branch} pairs
  81.  
  82.  
  83. That's a CMerkleTx
  84.  
  85.     given tx hashes, so allowing verification of a broadcast
  86.     transaction before it was incorporated into a block without storing
  87.     the full chain. Does that approach sound good to you?
  88.  
  89.  
  90. I don't understand.  A merkle branch links a tx back to a block, which only has significance if the block exhibits proof-of-work.  Linking back to an as-yet unsolved block proves nothing.
  91.  
  92. Network nodes are able to verify 0-conf txes because they have the complete tx index, so they can:
  93. 1) verify signatures against dependencies.
  94. 2) say that they haven't seen another spend yet, because they know about every tx in existence.
  95.  
  96. Are you talking about CMerkleTxes for the tx's dependencies?  That would get part 1), but not part 2).
  97.  
  98. If you don't know about all txes in existence, I don't know how to do 2).  You could only rely on trusting other nodes for that.  That trust can be distributed over multiple nodes.  Nodes only relay transactions they accept as valid.  If you receive inv messages for a tx from all the nodes you're connected to, they're attesting that it's valid and the first spend they saw.
  99.  
  100.     Also, I've been thinking of exploring different transaction types
  101.     lately, eg by removing the IsStandard() checks for the testnet.
  102.  
  103.  
  104. Very good idea.  That should definitely be allowed on -testnet.
  105.  
  106.     It's
  107.     clear you put a lot of thought into transactions beyond simply moving
  108.     coins around up front, but unfortunately none of it was in the paper
  109.     or documented in the code. Escrow, multi-pay and so on are all
  110.     interesting but I was wondering if you could compile a list of ideas
  111.     for things we can do with the scripting language at some point.
  112.  
  113.     Finally, the code that allows for transaction replacement has been
  114.     disabled but the comment doesn't say why. Is this just to reduce the
  115.     attack surface/complexity or is there a deeper reason?
  116.  
  117.  
  118. Just to reduce surface area.  It wouldn't help with increasing tx fee. A tx starts being valid at nLockTime.  It wouldn't work to have a tx that stops being valid at a certain time; once a tx ever becomes valid, it must stay valid permanently.
  119.  
  120. See these threads:
  121. http://www.bitcoin.org/smf/index.php?topic=1786.msg22119#msg22119
  122. http://www.bitcoin.org/smf/index.php?topic=2181.msg28729#msg28729
  123.  
  124.     I haven't fully
  125.     understood why sequence numbers are a property of the tx inputs rather
  126.     than the tx itself.
  127.  
  128.  
  129. It's for contracts.  An unrecorded open transaction can keep being replaced until nLockTime.  It may contain payments by multiple parties.  Each input owner signs their input.  For a new version to be written, each must sign a higher sequence number (see IsNewerThan).  By signing, an input owner says "I agree to put my money in, if everyone puts their money in and the outputs are this."  There are other options in SignatureHash such as SIGHASH_SINGLE which means "I agree, as long as this one output (i.e. mine) is what I want, I don't care what you do with the other outputs.".  If that's written with a high nSequenceNumber, the party can bow out of the negotiation except for that one stipulation, or sign SIGHASH_NONE and bow out completely.
  130.  
  131. The parties could create a pre-agreed default option by creating a higher nSequenceNumber tx using OP_CHECKMULTISIG that requires a subset of parties to sign to complete the signature.  The parties hold this tx in reserve and if need be, pass it around until it has enough signatures.
  132.  
  133. One use of nLockTime is high frequency trades between a set of parties.  They can keep updating a tx by unanimous agreement.  The party giving money would be the first to sign the next version.  If one party stops agreeing to changes, then the last state will be recorded at nLockTime.  If desired, a default transaction can be prepared after each version so n-1 parties can push an unresponsive party out.  Intermediate transactions do not need to be broadcast.  Only the final outcome gets recorded by the network.  Just before nLockTime, the parties and a few witness nodes broadcast the highest sequence tx they saw.
  134.  
  135. ----------
  136. From: Mike Hearn <mike@plan99.net>
  137. Date: Wed, Mar 9, 2011 at 5:39 PM
  138. To: Satoshi Nakamoto <satoshin@gmx.com>
  139.  
  140.  
  141.     If you don't know about all txes in existence, I don't know how to do 2).  You could only rely on trusting other nodes for that.  That trust can be distributed over multiple nodes.  Nodes only relay transactions they accept as valid.  If you receive inv messages for a tx from all the nodes you're connected to, they're attesting that it's valid and the first spend they saw.
  142.  
  143.  
  144. Good point. I was talking about verifying the inputs yes, but it is indeed pointless unless you hear about all open transactions as well. So being able to fetch a CMerkleTx is not important.
  145.  
  146.  
  147.     Just to reduce surface area.  It wouldn't help with increasing tx fee. A tx starts being valid at nLockTime.  It wouldn't work to have a tx that stops being valid at a certain time; once a tx ever becomes valid, it must stay valid permanently.
  148.  
  149.     See these threads:
  150.     http://www.bitcoin.org/smf/index.php?topic=1786.msg22119#msg22119
  151.     http://www.bitcoin.org/smf/index.php?topic=2181.msg28729#msg28729
  152.  
  153.  
  154. I see. So right now fees are tricky because you have to decide up front what the fee should be, and if you guess too low, there's no way to correct the transaction and though the network will eventually forget it, your wallet still records that you spent the coins. This has already started happening.
  155.  
  156.  
  157.     It's for contracts.
  158.  
  159.  
  160. Ah ha. A whole unexplored area of the system opens up before my eyes :-) The concept of forming distributed contracts and escrow transactions without needing to trust an intermediary is a concept nearly as novel as BitCoin itself, I think.
  161.  
  162. I have more questions!
  163.  
  164. There's an unfinished part of the protocol that deals with setting up publisher/subscriber channels for distributed routing via the network. What was the purpose of this? Was the idea to have a p2p market or did it have some kind of lower level function, like perhaps broadcasting expected tx fees?
  165.  
  166. There was an interesting discussion of generalizing BitCoin some months ago, but we struggled to fully understand how you planned to achieve it. I think I understood the concept of placing another merkle tree on top of multiple separate chains:
  167.  
  168.    http://www.bitcoin.org/smf/index.php?topic=3414.msg48171#msg48171
  169.  
  170. But I didn't understand your comment about having 200 bytes for backwards compatibility. Also, I guess this is obvious, but to be super clear - in your idea the alternative chains would share exactly the same format and sets of verification rules as BitCoin (the same script language etc), so all miners can verify all blocks even if they are non-financial in nature? And then the point of having separate block chains is simply to manage storage costs and bandwidth for client-mode implementations?
  171.  
  172. Thanks!
  173.  
  174. ----------
  175. From: Satoshi Nakamoto <satoshin@gmx.com>
  176. Date: Wed, Mar 9, 2011 at 7:39 PM
  177. To: Mike Hearn <mike@plan99.net>
  178.  
  179.  
  180.         See these threads:
  181.         http://www.bitcoin.org/smf/index.php?topic=1786.msg22119#msg22119
  182.         http://www.bitcoin.org/smf/index.php?topic=2181.msg28729#msg28729
  183.  
  184.     I see. So right now fees are tricky because you have to decide up front what the fee should be, and if you guess too low, there's no way to correct the transaction and though the network will eventually forget it, your wallet still records that you spent the coins. This has already started happening.
  185.  
  186.  
  187. The network won't forget, and the owner's client will keep rebroadcasting it.  The overflow transaction was remembered by the network for several months even as the remaining 0.3.8 nodes diminished.
  188.  
  189. Priority includes age, so as a transaction waits it ages and will eventually have enough priority.
  190.  
  191. See one of the links above where I contemplate sending an honest double-spend to increase the fee.  It's a lot of work but could be done.  I don't think it's worth it right now.
  192.  
  193. The current system, where nodes make sure to include enough fee for current conditions and the network makes sure all transactions get processed eventually, works well enough.  Gavin is fixing the oversight where nodes didn't check the priority of their own transactions when writing them.
  194.  
  195. Users still worried about processing speed uncertainty should think of it as encouragement to include a fee.
  196.  
  197.     There's an unfinished part of the protocol that deals with setting up publisher/subscriber channels for distributed routing via the network. What was the purpose of this? Was the idea to have a p2p market or did it have some kind of lower level function, like perhaps broadcasting expected tx fees?
  198.  
  199.  
  200. I was trying to implement an eBay style marketplace built in to the client.  Publish/subscribe would be used for broadcasting product offers and ratings/reviews.  Your reviews would be weighted by the blocks you've generated.  I rightly abandoned it in favour of JSON-RPC, so other authors could implement it externally.  The publish/subscribe "meet in the middle" mechanism was an interesting concept, but nothing remains that uses it.
  201.  
  202. It was part of writing code to explore the most technically demanding use cases and make sure Bitcoin could support everything that might be needed in the future, given the locked-in nature of the rules once the block chain started.
  203.  
  204.     There was an interesting discussion of generalizing BitCoin some months ago, but we struggled to fully understand how you planned to achieve it. I think I understood the concept of placing another merkle tree on top of multiple separate chains:
  205.  
  206.        http://www.bitcoin.org/smf/index.php?topic=3414.msg48171#msg48171
  207.  
  208.     But I didn't understand your comment about having 200 bytes for backwards compatibility. Also, I guess this is obvious, but to be super clear - in your idea the alternative chains would share exactly the same format and sets of verification rules as BitCoin (the same script language etc), so all miners can verify all blocks even if they are non-financial in nature? And then the point of having separate block chains is simply to manage storage costs and bandwidth for client-mode implementations?
  209.  
  210.  
  211. No, other chains do not follow Bitcoin's rules.  They are completely independent chains.  They share nothing except the miners.  The other network's definition of proof-of-work is to make a solved (according to their own chain's difficulty) Bitcoin-format block that has a hash of their own block in it.  They don't care if the Bitcoin block is valid or used by Bitcoin, but it allows miners to work both chains at once.
  212.  
  213. Procedure to hash a BitDNS block:
  214.  - hash the BitDNS block
  215.  - construct a Bitcoin block
  216.  - insert the BitDNS hash into the scriptSig of tx 0 in the Bitcoin block
  217.  - hash the Bitcoin block
  218.  
  219. The BitDNS block is valid if that hash is below BitDNS's target.
  220.  
  221. The BitDNS block needs to have with it about 200 bytes of data needed to reconstruct the Bitcoin block used in the hash:
  222.  - the Bitcoin block header
  223.  - the merkle branch to tx 0
  224.  - tx 0  (btw, tx 0's prev hash is always 0 so leaving that out saves 32 bytes)
  225.  
  226. Note that it doesn't matter if the fodder "Bitcoin block" was actually valid in the Bitcoin chain, though it could have been.  To BitDNS, it's just a bunch of salt necessary to do its convoluted hash calculation. If a miner is only mining for BitDNS and doesn't care about Bitcoin, it would use a blank Bitcoin block of all zeroes (except the nonce).
  227.  
  228. To further expand the idea for extensibility, consider instead of putting the BitDNS block hash in tx 0, you put the root of a merkle tree that includes BitDNS.  This is the merkle tree that is conceptually at the top.
  229.  
  230.  
  231. ----------
  232. From: Mike Hearn <mike@plan99.net>
  233. Date: Wed, Mar 9, 2011 at 7:52 PM
  234. To: Satoshi Nakamoto <satoshin@gmx.com>
  235.  
  236.  
  237. Thanks again.
  238.  
  239. Hal speculated that you intended to stash the new merkle root in the tx0 scriptSig. Good to know at least he had the right idea :-)
RAW Paste Data
Top