<oembed><type>rich</type><version>1.0</version><author_name>npub1dpdfw74plzm03mzglkdegp3hqn6qs9yffqefa5kh98mru49nrg7szymz3t</author_name><author_url>https://nostr.ae/npub1dpdfw74plzm03mzglkdegp3hqn6qs9yffqefa5kh98mru49nrg7szymz3t</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2019-04-02&#xA;📝 Original message:Hi,&#xA;&#xA;I&#39;d like to discuss assumeutxo, which is an appealing and simple&#xA;optimization in the spirit of assumevalid[0].&#xA;&#xA;# Motivation&#xA;&#xA;To start a fully validating bitcoin client from scratch, that client&#xA;currently&#xA;needs to perform an initial block download. To the surprise of no one, IBD&#xA;takes a linear amount time based on the length of the chain&#39;s history. For&#xA;clients running on modest hardware under limited bandwidth constraints,&#xA;say a mobile device, completing IBD takes a considerable amount of time&#xA;and thus poses serious usability challenges.&#xA;&#xA;As a result, having fully validating clients run on such hardware is rare&#xA;and&#xA;basically unrealistic. Clients with even moderate resource constraints&#xA;are encouraged to rely on the SPV trust model. Though we have promising&#xA;improvements to existing SPV modes pending deployment[1], it&#39;s worth&#xA;thinking about a mechanism that would allow such clients to use trust&#xA;models closer to full validation.&#xA;&#xA;The subject of this mail is a proposal for a complementary alternative to&#xA;SPV&#xA;modes, and which is in the spirit of an existing default, `assumevalid`. It&#xA;may&#xA;help modest clients transact under a security model that closely resembles&#xA;full validation within minutes instead of hours or days.&#xA;&#xA;# assumeutxo&#xA;&#xA;The basic idea is to allow nodes to initialize using a serialized version&#xA;of the&#xA;UTXO set rendered by another node at some predetermined height. The&#xA;initializing node syncs the headers chain from the network, then obtains and&#xA;loads one of these UTXO snapshots (i.e. a serialized version of the UTXO set&#xA;bundled with the block header indicating its &#34;base&#34; and some other&#xA;metadata).&#xA;&#xA;Based upon the snapshot, the node is able to quickly reconstruct its&#xA;chainstate,&#xA;and compares a hash of the resulting UTXO set to a preordained hash&#xA;hard-coded&#xA;in the software a la assumevalid. This all takes ~23 minutes, not&#xA;accounting for&#xA;download of the 3.2GB snapshot[2].&#xA;&#xA;The node then syncs to the network tip and afterwards begins a simultaneous&#xA;background validation (i.e., a conventional IBD) up to the base height of&#xA;the&#xA;snapshot in order to achieve full validation. Crucially, even while the&#xA;background validation is happening the node can validate incoming blocks and&#xA;transact with the benefit of the full (assumed-valid) UTXO set.&#xA;&#xA;Snapshots could be obtained from multiple separate peers in the same manner&#xA;as&#xA;block download, but I haven&#39;t put much thought into this. In concept it&#xA;doesn&#39;t&#xA;matter too much where the snapshots come from since their validity is&#xA;determined via content hash.&#xA;&#xA;# Security&#xA;&#xA;Obviously there are some security implications due consideration. While this&#xA;proposal is in the spirit of assumevalid, practical attacks may become&#xA;easier.&#xA;Under assumevalid, a user can be tricked into transacting under a false&#xA;history&#xA;if an attacker convinces them to start bitcoind with a malicious&#xA;`-assumevalid`&#xA;parameter, sybils their node, and then feeds them a bogus chain encompassing&#xA;all of the hard-coded checkpoints[3].&#xA;&#xA;The same attack is made easier in assumeutxo because, unlike in assumevalid,&#xA;the attacker need not construct a valid PoW chain to get the victim&#39;s node&#xA;into&#xA;a false state; they simply need to get the user to accept a bad&#xA;`-assumeutxo`&#xA;parameter and then supply them an easily made UTXO snapshot containing,&#xA;say, a&#xA;false coin assignment.&#xA;&#xA;For this reason, I recommend that if we were to implement assumeutxo, we not&#xA;allow its specification via commandline argument[4].&#xA;&#xA;Beyond this risk, I can&#39;t think of material differences in security&#xA;relative to&#xA;assumevalid, though I appeal to the list for help with this.&#xA;&#xA;# More fully validating clients&#xA;&#xA;A particularly exciting use-case for assumeutxo is the possibility of mobile&#xA;devices functioning as fully validating nodes with access to the complete&#xA;UTXO&#xA;set (as an alternative to SPV models). The total resource burden needed to&#xA;start a node&#xA;from scratch based on a snapshot is, at time of writing, a ~(3.2GB&#xA;+ blocks_to_tip * 4MB) download and a few minutes of processing time, which&#xA;sounds&#xA;manageable for many mobile devices currently in use.&#xA;&#xA;A mobile user could initialize an assumed-valid bitcoin node within an hour,&#xA;transact immediately, and complete a pruned full validation of their&#xA;assumed-valid chain over the next few days, perhaps only doing the&#xA;background&#xA;IBD when their device has access to suitable high-bandwidth connections.&#xA;&#xA;If we end up implementing an accumulator-based UTXO scaling design[5][6]&#xA;down&#xA;the road, it&#39;s easy to imagine an analogous process that would allow very&#xA;fast&#xA;startup using an accumulator of a few kilobytes in lieu of a multi-GB&#xA;snapshot.&#xA;&#xA;---&#xA;&#xA;I&#39;ve created a related issue at our Github repository here:&#xA;  https://github.com/bitcoin/bitcoin/issues/15605&#xA;&#xA;and have submitted a draft implementation of snapshot usage via RPC here:&#xA;  https://github.com/bitcoin/bitcoin/pull/15606&#xA;&#xA;I&#39;d like to discuss here whether this is a good fit for Bitcoin&#xA;conceptually. Concrete&#xA;plans for deployment steps should be discussed in the Github issue, and&#xA;after all&#xA;that my implementation may be reviewed as a sketch of the specific software&#xA;changes necessary.&#xA;&#xA;Regards,&#xA;James&#xA;&#xA;&#xA;[0]:&#xA;https://bitcoincore.org/en/2017/03/08/release-0.14.0/#assumed-valid-blocks&#xA;[1]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki&#xA;[2]: as tested at height 569895, on a 12 core Intel Xeon Silver 4116 CPU @&#xA;2.10GHz&#xA;[3]:&#xA;https://github.com/bitcoin/bitcoin/blob/84d0fdc/src/chainparams.cpp#L145-L161&#xA;[4]: Marco Falke is due credit for this point&#xA;[5]: utreexo: https://www.youtube.com/watch?v=edRun-6ubCc&#xA;[6]: Boneh, Bunz, Fisch on accumulators: https://eprint.iacr.org/2018/1188&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20190402/46b25dd8/attachment-0001.html&gt;</html></oembed>