Possible bug: The instructions BOOLAND and BOOLOR don't interpret the stack values the same way IF, VERIFY etc do. They decode the top stack values as integers and compare against zero, thus they have to fail when the top stack item size is greater than 4 bytes. Edit: littleEndian.decode also doesn't seem to respect the size limits Edit2: .. or signed integers for that matter. So while this is a very cool basic conce…
Yes, you're right, numbers treatment is not exactly the same as in Bitcoin Core. The script interpreter supports only basics and it was implemented to show how Bitcoin Script works in general for another article [0]. But it was not clear from this text whether it's a complete implementation or not so it looks like a bug. I've added the annotation [1] and will update the interpreter in the future. Of course if one wan…
Low-level Bitcoin
21–28 of 28 posts
Re: Low-level Bitcoin
#22Earlier quoted context omitted.
An unregulated/unregulatable space. Might as well try to regulate math - "PI is 3"
How is that related? If someone puts CP intentionally into the block chain that has nothing to do with math. The spread of child pornography is a criminal offense and they could just force every miner to split the chain or charge them for spread of CP.
I'm not a lawyer but from a technical point of view it's almost impossible to remove any kind of data from a truly distributed network. Be it Bitcoin's Blockchain, BitTorrent or the internet itself. That's just a fact, no judge order will change it, sorry.
And as M4v3R said it'd be very expensive to add a big file like a picture to Blockchain anyway.
Re: Low-level Bitcoin
#23A little note about the "make a privkey" section of the signature example; it can sometimes* make invalid privkeys that are off the end of the EC curve. Only integers between 0x1 and 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 are valid in our particular case. Super unlikely to ever get a sha256 hash that matches the invalid portion, but it's worthwhile to point out. * probably never, but worth…
Re: Low-level Bitcoin
#24Earlier quoted context omitted.
Yes, you're right, numbers treatment is not exactly the same as in Bitcoin Core. The script interpreter supports only basics and it was implemented to show how Bitcoin Script works in general for another article [0]. But it was not clear from this text whether it's a complete implementation or not so it looks like a bug. I've added the annotation [1] and will update the interpreter in the future. Of course if one wan…
No problem - I wasn't sure if this is something you're currently working on or just a demonstration. The script interpreter is a tricky beast that looks easy but has a lot of edge cases. If one client behaves slightly different, a blockchain fork could happen: https://bitcoin.org/en/alert/2013-03-11-chain-fork
The article is just a demonstration but it won't hurt if it was as accurate as possible (while still being readable) :)
[0] https://en.bitcoin.it/wiki/OP_CHECKSIG#Procedure_for_Hashtyp...
[1] http://bitcoinmagazine.com/3668/bitcoin-network-shaken-by-bl...
Re: Low-level Bitcoin
#25Earlier quoted context omitted.
An unregulated/unregulatable space. Might as well try to regulate math - "PI is 3"
How is that related? If someone puts CP intentionally into the block chain that has nothing to do with math. The spread of child pornography is a criminal offense and they could just force every miner to split the chain or charge them for spread of CP.
Re: Low-level Bitcoin
#26Earlier quoted context omitted.
An unregulated/unregulatable space. Might as well try to regulate math - "PI is 3"
How is that related? If someone puts CP intentionally into the block chain that has nothing to do with math. The spread of child pornography is a criminal offense and they could just force every miner to split the chain or charge them for spread of CP.
Re: Low-level Bitcoin
#27Earlier quoted context omitted.
So what happens if someone puts CP into the block chain and publishes the instructions to retrieve after two months?
Nothing. The way arbitrary data is stored in the blockchain is encoding it in the financial transactional data. For example, you could use a similar method to "store" data using Paypal: use the amount of cents in each transaction to encode a byte of data (e.g. $1.17 means 0x75 etc.) and make transfers to random people until enough bytes have been transferred. That's it, your copyrighted data or CP is now forever "sto…
Re: Low-level Bitcoin
#28Earlier quoted context omitted.
Nothing. The way arbitrary data is stored in the blockchain is encoding it in the financial transactional data. For example, you could use a similar method to "store" data using Paypal: use the amount of cents in each transaction to encode a byte of data (e.g. $1.17 means 0x75 etc.) and make transfers to random people until enough bytes have been transferred. That's it, your copyrighted data or CP is now forever "sto…
There is no minimum output size. Outputs can be zero-valued.
You are correct that the protocol itself doesn't have a minimum output size, so if you mine a block yourself you can include dust reliably.