All I'm really doing is taking a very roundabout route to coding up a Python block/tx reader based on
the full specification, (making allowances for the fact that it describes the structure of a
contemporary Bitcoin block, not a vintage one from back in the days of v.0.7) the task is mostly matching up the size of C/C++ structures with reading in the required number of bytes in Python. As far as I can tell, the script is working now. I also made use of the undocumented command-line option
-printblocktree to, well, print the block tree, including the orphan blocks. Quite instructive and useful in that it poinpoints each block's location in the blk0001.dat file.
Thanks. I looked into my wiki article draft again and I found some errors which I corrected (in particular, I incorrectly assigned 8-byte-lengths for items that are only 4 bytes "wide"; this is due to that when processing the raw hex transaction in Python obviously every byte requires two hexadecimal characters
- the good part about that error is that in the Inscriber tool I did everything correctly). I added your additions about coinbase transactions now and the format now matches the one of the "Anatomy" article.
Edit: I spotted one difference still: The tx_output item ...
tx_output = ds.read_bytes(2)[::-1].hex()
should be only 1 byte wide (I re-checked it with some recent transactions, if it's 2 bytes wide, the value (BTC_num) in hex doesn't match the value of the decoded json).
It's an irrelevant remnant of the advertising feature which I took from fusioncoin, with main part of their advertisement stuff removed (
https://github.com/fusioncoin/fusioncoin/blob/master/src/smalldata.cpp#L75). I think the convention they use in the fusionoin code is that OP_RETURN data is assumed to be rich text by default (to support the advertising) or set PLAINTEXT to use plaintext and the BROADCAST flag indicates whether the OP_RETURN_DATA content appears in the advertisement listing on the fusioncoin overview page.
Aha, thanks for the explanation. I did briefly look at fusioncoin but not so much in detail to understand their "advertising" feature. I don't remember the reason why you added it, can you help me remember? (I googled the thread but didn't find it, we really need something like a text mining tool - or an
AI, to use a current buzzword - recompiling old Slimcoin Bitcointalk posts and tagging them with metadata ...)
Obviously it would be ideal that the inscription dialog could use the raw transaction format allowing control over the used addresses, like my Inscriber tool does, but I think we need a couple of rounds of testing to ensure everything is working right.
Maybe it could also be possible to change the
createrawtransaction command so it allows a "data" field like newer Bitcoin versions do. Would this be a difficult change?
By the way, interesting discussion in the Peercoin community:
https://talk.peercoin.net/t/modifying-the-economics-of-peercoin-in-anticipation-of-increased-blockchain-usage/They plan to modify the fixed transaction fee structure a bit, keeping the 0.01 PPC/kB fee but not "rounding" it up anymore - so a ~200 byte transaction would only cost 0.002 PPC instead of 0.01 PPC. I think that would be a nice change in the future that wouldn't change the incentive model too much. If we decided to follow that path, I would also propose to remove the 0.01 minimum transaction output value - this would only become relevant if Slimcoin ever should cost more than 1$, but I think it's an unnecessary restriction as Slimcoin's granularity is already lower than Bitcoin's afaik (1 "Slimtoshi" = 10 BTC Satoshis).