sipa changed the topic of #bitcoin-wizards to: This channel is for discussing theoretical ideas with regard to cryptocurrencies, not about short-term Bitcoin development | http://bitcoin.ninja/ | This channel is logged. | For logs and more information, visit http://bitcoin.ninja
TheoStorm has joined #bitcoin-wizards
joelklabo has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
proofofkeags has quit [Ping timeout: 240 seconds]
nkuttler has quit [Remote host closed the connection]
proofofkeags has quit [Remote host closed the connection]
TheoStorm has quit [Quit: Leaving]
CjS77 has quit [Read error: Connection reset by peer]
simian_za0 has quit [Read error: Connection reset by peer]
simian_za02 has joined #bitcoin-wizards
CjS77 has joined #bitcoin-wizards
joelklabo has joined #bitcoin-wizards
nick_fre_ has joined #bitcoin-wizards
nick_freeman has quit [Ping timeout: 265 seconds]
reallll has joined #bitcoin-wizards
belcher has quit [Ping timeout: 260 seconds]
<CubicEarth>
can the blockchain be validated in reverse, starting with the most recent blocks, and working backwards, hoping that converges on the genesis block?
<CubicEarth>
I'm thinking it could be
pinheadmz has quit [Quit: pinheadmz]
<shesek>
CubicEarth, it could, but you won't know that it properly connects to the genesis until you reach it
<CubicEarth>
shesek: Yes! And than you would have to start all over again
<shesek>
you also won't be able to tell if a transaction spends non-existing coins, so you'll have to keep around a list of all spent coins that haven't been funded yet and ensure that its empty at the end
<shesek>
which could be a DoS vector, because someone could send you a stream of blocks that spend invalid coins that will never get funded, which you'll have to keep around until you reach the genesis
<shesek>
something that could work is starting with a recent UTXO commitment (doesn't actually exists yet), doing SPV verification from the genesis onwards to the tip, then doing full validation from the tip backwards to the genesis
<CubicEarth>
but on the other hand, the blocks at the top have the most amount of work, so while your validation efforts might be wasted, you'd know someone someone spent a ton of work to waste you much smaller amount of work
<shesek>
you can't really tell the expected difficulty at the tip if you don't know the block before that
<shesek>
but doing forward SPV validation followed by backwards full validation solves that
<shesek>
* the block*s* before that (all of them up to the genesis, really)
<CubicEarth>
the total work in the chain can be ascertained just by examining the headers, right?
<shesek>
right, which is basically doing spv validation
<shesek>
you'll need to check that the blocks are hash-chained properly, that their declared target bits matches the actual block hash, that their declared target bits matches the expected difficulty for that block and the difficulty readjustments
<shesek>
the MTP rule too, and probably some others that I'm forgetting
<CubicEarth>
So there are three ways to break up the validation... first is downloading all the headers, making sure that they link properly, and also you can know how much total POW was expended on it
<CubicEarth>
next, if you have the block data, you could just hash each block and see if they link to the headers?
<CubicEarth>
third would be going through the all the txs to make sure everything adds up
<CubicEarth>
and I guess fourth would be validating all signatures?
rusty has quit [Quit: Leaving.]
joelklabo has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<CubicEarth>
#1 - fast and cheap, but linear #2 - parallel #3 - easiest to do linearly from he beginning... but this doesn't involve any cryptographic operations, right? #4 - parallel
rusty has joined #bitcoin-wizards
rusty has quit [Quit: Leaving.]
jesseposner has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
Kiminuo has joined #bitcoin-wizards
kabaum has joined #bitcoin-wizards
andyrtr1 has quit [Remote host closed the connection]
<Blackwolfsa4>
Thanks, please correct me if I am wrong, but the inputs are still technically malleable? Even after segwit. I know this would most likely mean a broken transaction and or block. But is still a large concern and is this something we should actively do something about? Or is this more like we dont care, or it would be nice to do something about this?
<Blackwolfsa4>
with inputs I mean the witness data.
jonatack has joined #bitcoin-wizards
jonatack has quit [Ping timeout: 246 seconds]
<darosior>
Blackwolfsa4: yea but that's witness data is not used anymore in the txid, ie for referencing previous outputs in second stage transactions.
jonatack has joined #bitcoin-wizards
sr_gi has quit [Read error: Connection reset by peer]
sr_gi has joined #bitcoin-wizards
laptop has quit [Quit: Leaving]
laptop has joined #bitcoin-wizards
TheoStorm has joined #bitcoin-wizards
satwo has joined #bitcoin-wizards
<andytoshi>
Blackwolfsa4: if we were recreating bitcoin from scratch, yes, absolutely i'd have rethought how everything is encoded and committed to
<andytoshi>
and the double-sha256s everywhere could've been replaced with something cheaper
<andytoshi>
and all the 160-bit hashes could've been dropped (though these aren't used outside of script)
<andytoshi>
the silliness where hashes are reversed; the multiple different varint encodings; the weird signed-magnitude numbers in Script
<andytoshi>
the problematic sighash computations (which segwit v0 mostly fixed, and v1 entirely fixed we think)
<andytoshi>
the way difficulty is encoded in a 4-byte floating point format that came from openssl
<andytoshi>
asicboost
<andytoshi>
requiring inputs and outputs within a tx be sorted
<andytoshi>
(this would break sighash_single but i think that was misguided to begin with, it was a low-level primitive that we never managed to sand the sharp edges off of)
<andytoshi>
the way locktimes are encoded (i'd have dropped timestamp-based locktimes entirely)
<andytoshi>
allowing uncompressed and hybrid EC keys everywhere
<waxwing>
andytoshi, oh interesting one about locktimes. why's that?
<andytoshi>
waxwing: (a) it's irritating to have to special-case the number 500_000_000 in all locktime-related code, and then in script to have 5-byte numbers when every other numeric opcode uses 4-byte numbers (although i'd have also changed this stuff to be 64-bit LE twos-complement everywhere)
<andytoshi>
(b) because of the issue where if you mix time-based and height-based locktimes in script, they're mutually exclusive
<andytoshi>
(c) because timestamps themselves are weird to work with, in principle miners can push them arbitrarily far into the future if they're incentivized to, though we have heuristics to prevent such blocks from propagating
<andytoshi>
(i guess another thing i'd add to my giant list above would be to fix the difficulty adjustment, at least to fix the timewarp bug if nothing else. though that's not really an "encoding" related issue)
<waxwing>
interesting. is there a case for the non-blockheight timestamp version? it seems if that didn't exist we'd be much better off.
<andytoshi>
they're just easier for humans to think about
<andytoshi>
and in practice you can assume block timestamps are roughly accurate, so they basically "just work"
<waxwing>
clock timestamps in general always looked icky
<andytoshi>
agreed
pinheadmz has joined #bitcoin-wizards
dleffler1 has quit []
Kiminuo has quit [Ping timeout: 272 seconds]
pinheadmz has quit [Quit: pinheadmz]
pinheadmz has joined #bitcoin-wizards
pinheadmz has quit [Client Quit]
jMCg has joined #bitcoin-wizards
davispuh has joined #bitcoin-wizards
CryptoDavid has joined #bitcoin-wizards
pinheadmz has joined #bitcoin-wizards
satwo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jesseposner has joined #bitcoin-wizards
TheoStorm has quit [Quit: Leaving]
vtnerd has quit [Ping timeout: 256 seconds]
joelklabo has joined #bitcoin-wizards
vtnerd has joined #bitcoin-wizards
Kiminuo has joined #bitcoin-wizards
sr_gi has quit [Read error: Connection reset by peer]
sr_gi has joined #bitcoin-wizards
jesseposner has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
vtnerd has quit [Ping timeout: 246 seconds]
vtnerd has joined #bitcoin-wizards
vtnerd has quit [Ping timeout: 240 seconds]
vtnerd has joined #bitcoin-wizards
vtnerd has quit [Ping timeout: 256 seconds]
satwo has joined #bitcoin-wizards
satwo has quit [Client Quit]
vtnerd has joined #bitcoin-wizards
shesek has quit [Remote host closed the connection]
bitdex has joined #bitcoin-wizards
justanotheruser has quit [Ping timeout: 272 seconds]
joelklabo has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
vtnerd has quit [Ping timeout: 260 seconds]
vtnerd has joined #bitcoin-wizards
CryptoDavid has quit [Quit: Connection closed for inactivity]
joelklabo has joined #bitcoin-wizards
davispuh has quit [Ping timeout: 246 seconds]
vtnerd has quit [Ping timeout: 264 seconds]
vtnerd has joined #bitcoin-wizards
davispuh has joined #bitcoin-wizards
Kiminuo has quit [Ping timeout: 240 seconds]
satwo has joined #bitcoin-wizards
satwo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]