<p>There isn't a formal specification. The nearest thing to that is probably one of</p>
<ul>
<li><a href="https://developer.bitcoin.org/devguide/p2p_network.html" rel="nofollow noreferrer">https://developer.bitcoin.org/devguide/p2p_network.html</a></li>
<li><a href="https://en.bitcoin.it/wiki/Protocol_documentation" rel="nofollow noreferrer">https://en.bitcoin.it/wiki/Protocol_documentation</a></li>
<li>Bitcoin core source code</li>
</ul>
<p>I believe none of these would have the properties you seem to be seeking. They do not have canonical forms that are insensitive to, for example, minor punctuation changes that are either meaningless or within non-functional commentary etc.</p>

CC BY-SA 4.0
2024-04-02T15:27:43.227Z
Thanks, I'm not asking for that insensitivity though; I see it as inevitable (yet tolerable). Concatenating and hashing the sources you suggest seems like a valid answer. The measure of usefulness for me, however, is "how easy is it to tell if (&where) there is a critical deviation between different schemas." Perhaps there's a way to improve by that measure so I'll leave the answer unaccepted for now.
Lee
CC BY-SA 4.0
2024-04-02T10:24:28.790Z
2024-04-02T13:15:15.290Z
2024-04-02T13:15:15.290Z
RedGrittyBrick
<p>In an application, I'd like users to be able to declare, through a signed 32 byte number, the bitcoin protocol rules and data formats they will adhere to.</p>
<p>Presently, I'm envisaging this being the hash value of an annotated schema description document (e.g. JSON Schema). The schema will describe the construction of block header, coinbase tx and other transactions together with annotations to describe the nature of each component. It does not need to include the peer to peer message passing conventions.</p>
<p>I'm expecting the schema document to have many &quot;synonyms&quot;. For example, changing a full-stop in the schema annotations will likely result in a wholly compatible schema, but with a different hash-value.</p>
<p>Does anything like this already exist?</p>
<p>Or, is there something else I could hash to achieve the same thing (the bitcoin core source code, compilers, and white paper for example)?</p>

<protocol><documentation><specification>
What schema descriptions exist for the bitcoin protocol?
Lee
# What schema descriptions exist for the bitcoin protocol?

(Asked by: username_0 on 2024-04-02)

In an application, I'd like users to be able to declare, through a signed 32 byte number, the bitcoin protocol rules and data formats they will adhere to.

Presently, I'm envisaging this being the hash value of an annotated schema description document (e.g. JSON Schema). The schema will describe the construction of block header, coinbase tx and other transactions together with annotations to describe the nature of each component. It does not need to include the peer to peer message passing conventions.

I'm expecting the schema document to have many "synonyms". For example, changing a full-stop in the schema annotations will likely result in a wholly compatible schema, but with a different hash-value.

Does anything like this already exist?

Or, is there something else I could hash to achieve the same thing (the bitcoin core source code, compilers, and white paper for example)?

**Tags:** protocol, documentation, specification


---

## 1 answers

### Answer by username_1 on 2024-04-02. Score: 1

There isn't a formal specification. The nearest thing to that is probably one of

* <https://developer.bitcoin.org/devguide/p2p_network.html>
* <https://en.bitcoin.it/wiki/Protocol_documentation>
* Bitcoin core source code

I believe none of these would have the properties you seem to be seeking. They do not have canonical forms that are insensitive to, for example, minor punctuation changes that are either meaningless or within non-functional commentary etc.

> **Comments:**
> **username_0**: Thanks, I'm not asking for that insensitivity though; I see it as inevitable (yet tolerable). Concatenating and hashing the sources you suggest seems like a valid answer. The measure of usefulness for me, however, is "how easy is it to tell if (&where) there is a critical deviation between different schemas." Perhaps there's a way to improve by that measure so I'll leave the answer unaccepted for now.  

---

