I was not aware that XDR permitted multiply-tagged cases like that. If so, then sure, that is equivalent and smaller so I'm happy to use it.
I think this is beyond scope for this change, but (very roughly) I can speculate/discuss this a bit:
- Stellar strongly differentiates accounts from transactions, so this analogy depends on what your putative SPV wallet is trying to verify.
- Verification of either transactions or accounts is going to work off the ledger chain, which already has an embedded skip-list structure to find (in a logarithmic-in-time number of downloads) a trusted historical ledger header from a given present consensus ledger.
- If you want to verify the presence of a transaction in the chain, these can be fetched from history for any given ledger and compared against the TransactionResultSet (that includes txn hashes) in that ledger header.
- If you want to verify the state of a given account at some point in time, these can be fetched by downloading progressively older buckets in the bucket list of a given ledger until you find one with an entry for that account. If you're investigating an account that was changed recently, this should happen in one of the newer (small) buckets.
The only verification that's potentially slow in this model is verifying the state of an account at-present that was last changed a long time ago; depending on how long-ago the account was changed, this could involve as much as downloading the oldest (biggest) level of the present bucket list. We could theoretically restructure buckets to have some sort of maximum size and trie-like substructure to permit directly fetching & investigating partial buckets, but this would be a fairly involved project (note: bucket entries are sorted presently, without concern to whether a bit-string prefix of their keys is uniformly distributed as a trie would want; these are similar but different situations requiring somewhat careful rearrangement) and it's not clear to me that this particular type of verification is a pressing need relative to other performance issues.
(I should also say here: I'm not totally opposed to working through such a change eventually; it could potentially support a variety of improvements to the bucketlist, such as parallel downloads, parallel merges, and/or checkpoint/restart of big merges. As with the SPV case though, these are all quantitative motives, which are not going to be very amenable to quantitative analysis until after we've fixed the current issue and flushed the obsolete tombstones that comprise 99% of current bucket volume out of the existing buckets.)
-Graydon