I've been digging into the history of Bitcoin's creation, especially the encoding techniques used in those early .dat files by Satoshi Nakamoto. I'm trying to get a grip on the specific patterns and encoding methods from those initial days, particularly the use of uppercase hex letters for representing blockchain data and two interesting patterns: "FD FE FF" and "F%F%F%".
"FD FE FF" Encoding: From what I gather, these sequences are tied to varint encoding, where each prefix tells us the byte length of the following integer (like "FD" for 2 bytes, "FE" for 4 bytes, and "FF" for 8 bytes). This compact encoding method is really intriguing, and I want to learn more about how it works and its role within the Bitcoin blockchain's data structure.
"F%F%F%" Pattern: This one is a bit of a mystery for me. It doesn't seem to fit with standard hexadecimal notation or the principles of Bitcoin's varint encoding. Can anyone clarify the meaning and usage of "F%" in the early Bitcoin code or data formatting? Is it a unique encoding method, or does it serve a specific purpose that isn’t well-known?
I'm on the lookout for any documents, discussions, or literature that might explain these patterns, especially the tricky "F%F%F%". Any insights into Satoshi's encoding decisions or references to early forum discussions or code comments would really help me out.
Thanks for your time and knowledge. I'm excited to dive deeper into Bitcoin's technical history.
Exploring Satoshi's ASCII Patterns
6 replies 460 views
There is https://en.bitcoin.it/wiki/Protocol_documentation#Variable_length_integer regarding documentation for compact size integers inside Bitcoin protocol. You may also find it interesting that in Bitcoin signatures we use DER encoding and if you read into the X.690 standard specifying ASN.1 encoding formats, you can see some similarities between the Tag Length Value (TLV) form and what we do in Bitcoin (the LV part) and the way Lengths are encoded in DER is a similar concept to compact ints in Bitcoin.
l have to delve deeper into the Bitcoin protocol documentation and the X.690 standard to understand the intricacies of Bitcoin's encoding schemes further. I did know about DER encoding but even with this I haven't yet been able to understand the use of F% yet.
thx
Bitcoin Protocol Documentation:
In the context of the Bitcoin protocol, the hexadecimal notation is extensively used for representing binary data, particularly for transaction ids, block hashes, and script values. The symbol "%", however, does not have a standard or documented use within the Bitcoin protocol's official documentation. The protocol primarily focuses on binary data representation, cryptographic operations, and network message formats, where data is typically encoded in hexadecimal for readability and compactness. There's no inherent function or recognized encoding pattern that directly involves the "%" symbol as part of the core protocol documentation.
X.690 Standard (ASN.1 and DER Encoding):
The X.690 standard, which details the rules for DER (Distinguished Encoding Rules) as part of ASN.1 (Abstract Syntax Notation One), is concerned with the encoding of data structures for secure and efficient transmission. This standard specifies a binary format for encoding data structures that include various data types. While it uses a comprehensive approach to data representation, including the specification of types, lengths, and values (TLV), the "%" symbol does not play a role in the syntax or encoding schemes described by the X.690 standard. The standard focuses on binary and hexadecimal representations for encoding and does not utilize the "%" symbol as part of its specified encoding formats.
The "%" symbol is commonly used in programming and data formats for purposes such as URL encoding (percent-encoding) or as a placeholder in string formatting operations across various programming languages. However, it is not a standard symbol within the hexadecimal notation system nor is it a recognized part of the encoding schemes in the Bitcoin protocol or the DER encoding rules specified by the X.690 standard.
so basically "%" is not used in Bitcoin, but I know it once was, so the question remains open.
RogueDegenFull Member
Posts: 74 · Reputation: 309
#4Apr 23, 2023, 03:18 AM
Can you provide an example? Perhaps link to the code in Github? I'm not sure what % use you're referring to.
Are you referring to output formatting by any chance?
Thx so very much , sorry not to read your comment three months ago.
Will come back with an update.
I think the basic problem here is that you are interpreting binary data as text in cases where that is not intended.
If you want to understand the encoding methods used, then your best approach is to look at the source code.