diff --git a/README.md b/README.md new file mode 100644 index 0000000..054ecc4 --- /dev/null +++ b/README.md @@ -0,0 +1,16 @@ +People wishing to submit QIPs, first should propose their idea to the [Quai forum](https://forum.qu.ai) (do *not* assign a number - read [QIP 1](qip-0001.md) for the full process). After discussion, please open a PR. After copy-editing and acceptance, it will be published here. + +We are fairly liberal with approving QIPs, and try not to be too involved in decision making on behalf of the community. The exception is in very rare cases of dispute resolution when a decision is contentious and cannot be agreed upon. In those cases, the conservative option will always be preferred. + +Having a QIP here does not make it a formally accepted standard until its status becomes Final or Active. + +Those proposing changes should consider that ultimately consent may rest with the consensus of the Quai users. + +| Number | Layer | Title | Owner | Type | Status | +|--------|----------------------|---------------------------------|----------|---------|--------| +| [1](qip-0001.md) | | QIP process | wizeguyy | Process | Active | +| [2](qip-0002.md) | Consensus (hard fork) | Sharded ledger | wizeguyy | Standard| Draft | +| [3](qip-0003.md) | Applications | Shard Specific Address Discovery | wizeguyy | Standard| Draft | +| [4](qip-0004.md) | Applications | 9 Shard Address Mapping | wizeguyy | Standard| Draft | + + diff --git a/README.mediawiki b/README.mediawiki deleted file mode 100644 index 645db0c..0000000 --- a/README.mediawiki +++ /dev/null @@ -1,46 +0,0 @@ -People wishing to submit QIPs, first should propose their idea to the [https://forum.qu.ai Quai forum] (do not assign a number - read QIP 1 for the full process). After discussion, please open a PR. After copy-editing and acceptance, it will be published here. - -We are fairly liberal with approving QIPs, and try not to be too involved in decision making on behalf of the community. The exception is in very rare cases of dispute resolution when a decision is contentious and cannot be agreed upon. In those cases, the conservative option will always be preferred. - -Having a QIP here does not make it a formally accepted standard until its status becomes Final or Active. - -Those proposing changes should consider that ultimately consent may rest with the consensus of the Quai users. - -{| class="wikitable sortable" style="width: auto; text-align: center; font-size: smaller; table-layout: fixed;" -!Number -!Layer -!Title -!Owner -!Type -!Status -|- style="background-color: #cfffcf" -| [[qip-0001.mediawiki|1]] -| -| QIP process -| wizeguyy -| Process -| Active -|- -| [[qip-0002.mediawiki|2]] -| Consensus (hard fork) -| Sharded ledger -| wizeguyy -| Standard -| Draft -|- -| [[qip-0003.mediawiki|3]] -| Applications -| Shard Specific Address Discovery -| wizeguyy -| Standard -| Draft -|- -| [[qip-0004.mediawiki|4]] -| Applications -| 9 Shard Address Mapping -| wizeguyy -| Standard -| Draft -|} - - diff --git a/qip-0001.mediawiki b/qip-0001.md similarity index 72% rename from qip-0001.mediawiki rename to qip-0001.md index d984818..b2cd412 100644 --- a/qip-0001.mediawiki +++ b/qip-0001.md @@ -1,4 +1,4 @@ -
+```
   QIP: 1
   Title: QIP process
   Author: wizeguyy 
@@ -9,9 +9,9 @@
   Created: 2023-09-06
   License: BSD-2-Clause
            OPL
-
+``` -==Abstract== +## Abstract A Quai Improvement Proposal (QIP) is a design document providing information to the Quai community, or describing a new feature for Quai or its processes or environment. The QIP should provide a concise technical specification of the feature and a rationale for the feature. @@ -19,57 +19,41 @@ We intend QIPs to be the primary mechanisms for proposing new features, for coll Because the QIPs are maintained as text files in a versioned repository, their revision history is the historical record of the feature proposal. -This particular QIP is derived heavily from Bitcoin's [https://github.com/bitcoin/bips/blob/master/bip-0002.mediawiki BIP2] +This particular QIP is derived heavily from Bitcoin's [BIP2](https://github.com/bitcoin/bips/blob/master/bip-0002.md) -==Copyright== +## Copyright This QIP is dual-licensed under the Open Publication License and BSD 2-clause license. -==QIP workflow== +## QIP workflow -The QIP process begins with a new idea for Quai. Each potential QIP must have a champion -- someone who writes the QIP using the style and format described below, shepherds the discussions in the appropriate forums, and attempts to build community consensus around the idea. The QIP champion (a.k.a. Author) should first attempt to ascertain whether the idea is QIP-able. -Small enhancements or patches to a particular piece of software often don't require standardisation between multiple projects; these don't need a QIP and should be injected into the relevant project-specific development workflow with a patch submission to the applicable issue tracker. -Additionally, many ideas have been brought forward for changing Quai that have been rejected for various reasons. -The first step should be to search past discussions to see if an idea has been considered before, and if so, what issues arose in its progression. -After investigating past work, the best way to proceed is by posting about the new idea to the [https://forum.qu.ai Quai forum]. +The QIP process begins with a new idea for Quai. Each potential QIP must have a champion -- someone who writes the QIP using the style and format described below, shepherds the discussions in the appropriate forums, and attempts to build community consensus around the idea. The QIP champion (a.k.a. Author) should first attempt to ascertain whether the idea is QIP-able. Small enhancements or patches to a particular piece of software often don't require standardization between multiple projects; these don't need a QIP and should be injected into the relevant project-specific development workflow with a patch submission to the applicable issue tracker. Additionally, many ideas have been brought forward for changing Quai that have been rejected for various reasons. The first step should be to search past discussions to see if an idea has been considered before, and if so, what issues arose in its progression. After investigating past work, the best way to proceed is by posting about the new idea to the [Quai forum](https://forum.qu.ai). -Vetting an idea publicly before going as far as writing a QIP is meant to save both the potential author and the wider community time. -Asking the Quai community first if an idea is original helps prevent too much time being spent on something that is guaranteed to be rejected based on prior discussions (searching the internet does not always do the trick). -It also helps to make sure the idea is applicable to the entire community and not just the author. Just because an idea sounds good to the author does not mean it will work for most people in most areas where Quai is used. +Vetting an idea publicly before going as far as writing a QIP is meant to save both the potential author and the wider community time. Asking the Quai community first if an idea is original helps prevent too much time being spent on something that is guaranteed to be rejected based on prior discussions (searching the internet does not always do the trick). It also helps to make sure the idea is applicable to the entire community and not just the author. Just because an idea sounds good to the author does not mean it will work for most people in most areas where Quai is used. -Once the champion has asked the Quai community as to whether an idea has any chance of acceptance, a draft QIP should be presented on the [https://forum.qu.ai Quai forum]. -This gives the author a chance to flesh out the draft QIP to make it properly formatted, of high quality, and to address additional concerns about the proposal. -Following a discussion, the proposal should be submitted to the [https://github.com/quai/qips QIPs git repository] as a pull request. -This draft must be written in QIP style as described below, and named with an alias such as "qip-johndoe-infinitequais" until an editor has assigned it a QIP number (authors MUST NOT self-assign QIP numbers). +Once the champion has asked the Quai community as to whether an idea has any chance of acceptance, a draft QIP should be presented on the [Quai forum](https://forum.qu.ai). This gives the author a chance to flesh out the draft QIP to make it properly formatted, of high quality, and to address additional concerns about the proposal. Following a discussion, the proposal should be submitted to the [QIPs git repository](https://github.com/quai/qips) as a pull request. This draft must be written in QIP style as described below, and named with an alias such as "qip-johndoe-infinitequais" until an editor has assigned it a QIP number (authors MUST NOT self-assign QIP numbers). It is highly recommended that a single QIP contain a single key proposal or new idea. The more focused the QIP, the more successful it tends to be. If in doubt, split your QIP into several well-focused ones. -When the QIP draft is complete, a QIP editor will assign the QIP a number, label it as Standards Track, Informational, or Process, and merge the pull request to the QIPs git repository. -The QIP editors will not unreasonably reject a QIP. -Reasons for rejecting QIPs include duplication of effort, disregard for formatting rules, being too unfocused or too broad, being technically unsound, not providing proper motivation or addressing backwards compatibility, or not in keeping with the Quai philosophy. -For a QIP to be accepted it must meet certain minimum criteria. -It must be a clear and complete description of the proposed enhancement. -The enhancement must represent a net improvement. -The proposed implementation, if applicable, must be solid and must not complicate the protocol unduly. +When the QIP draft is complete, a QIP editor will assign the QIP a number, label it as Standards Track, Informational, or Process, and merge the pull request to the QIPs git repository. The QIP editors will not unreasonably reject a QIP. Reasons for rejecting QIPs include duplication of effort, disregard for formatting rules, being too unfocused or too broad, being technically unsound, not providing proper motivation or addressing backwards compatibility, or not in keeping with the Quai philosophy. For a QIP to be accepted it must meet certain minimum criteria. It must be a clear and complete description of the proposed enhancement. The enhancement must represent a net improvement. The proposed implementation, if applicable, must be solid and must not complicate the protocol unduly. The QIP author may update the draft as necessary in the git repository. Updates to drafts should also be submitted by the author as pull requests. -===Transferring QIP Ownership=== +### Transferring QIP Ownership It occasionally becomes necessary to transfer ownership of QIPs to a new champion. In general, we'd like to retain the original author as a co-author of the transferred QIP, but that's really up to the original author. A good reason to transfer ownership is because the original author no longer has the time or interest in updating it or following through with the QIP process, or has fallen off the face of the 'net (i.e. is unreachable or not responding to email). A bad reason to transfer ownership is because you don't agree with the direction of the QIP. We try to build consensus around a QIP, but if that's not possible, you can always submit a competing QIP. If you are interested in assuming ownership of a QIP, send a message asking to take over, addressed to both the original author and the QIP editors. If the original author doesn't respond to email in a timely manner, the QIP editors will make a unilateral decision (it's not like such decisions can't be reversed :). -===QIP Editors=== +### QIP Editors The current QIP editors are: -* wizeguyy ([[mailto:wizeguyy+qip@quai.org|wizeguyy+qip@quai.org]]) +* wizeguyy ([wizeguyy+qip@quai.org](mailto:wizeguyy+qip@quai.org)) -===QIP Editor Responsibilities & Workflow=== +### QIP Editor Responsibilities & Workflow -The QIP editors subscribe to the Quai forum. -Off-list QIP-related correspondence should be sent (or CC'd) to the QIP editors. +The QIP editors subscribe to the Quai forum. Off-list QIP-related correspondence should be sent (or CC'd) to the QIP editors. For each new QIP that comes in an editor does the following: @@ -82,47 +66,38 @@ For each new QIP that comes in an editor does the following: If the QIP isn't ready, the editor will send it back to the author for revision, with specific instructions. -Once the QIP is ready for the repository it should be submitted as a "pull request" to the [https://github.com/quai/qips QIPs git repository] where it may get further feedback. +Once the QIP is ready for the repository it should be submitted as a "pull request" to the [QIPs git repository](https://github.com/quai/qips) where it may get further feedback. The QIP editor will: * Assign a QIP number in the pull request. - * Merge the pull request when it is ready. - -* List the QIP in [[README.mediawiki]] +* List the QIP in [README.md](README.md) The QIP editors are intended to fulfill administrative and editorial responsibilities. The QIP editors monitor QIP changes, and update QIP headers as appropriate. -==QIP format and structure== +## QIP format and structure -===Specification=== +### Specification -QIPs should be written in mediawiki format. +QIPs should be written in markdown format. Each QIP should have the following parts: -* Preamble -- Headers containing metadata about the QIP ([[#QIP header preamble|see below]]). - +* Preamble -- Headers containing metadata about the QIP ([see below](#QIP-header-preamble)). * Abstract -- A short (~200 word) description of the technical issue being addressed. - -* Copyright -- The QIP must be explicitly licensed under acceptable copyright terms ([[#QIP licensing|see below]]). - +* Copyright -- The QIP must be explicitly licensed under acceptable copyright terms ([see below](#QIP-licensing)). * Specification -- The technical specification should describe the syntax and semantics of any new feature. The specification should be detailed enough to allow competing, interoperable implementations for any of the current Quai platforms. - * Motivation -- The motivation is critical for QIPs that want to change the Quai protocol. It should clearly explain why the existing protocol is inadequate to address the problem that the QIP solves. - * Rationale -- The rationale fleshes out the specification by describing what motivated the design and why particular design decisions were made. It should describe alternate designs that were considered and related work. The rationale should provide evidence of consensus within the community and discuss important objections or concerns raised during discussion. - * Backwards compatibility -- All QIPs that introduce backwards incompatibilities must include a section describing these incompatibilities and their severity. The QIP must explain how the author proposes to deal with these incompatibilities. - * Reference implementation -- The reference implementation must be completed before any QIP is given status "Final", but it need not be completed before the QIP is accepted. It is better to finish the specification and rationale first and reach consensus on it before writing code. The final implementation must include test code and documentation appropriate for the Quai protocol. -====QIP header preamble==== +### QIP header preamble Each QIP must begin with an RFC 822 style header preamble. The headers must appear in the following order. Headers marked with "*" are optional and are described below. All other headers are required. -
+```plaintext
   QIP: 
 * Layer: 
   Title: 
@@ -140,10 +115,11 @@ Each QIP must begin with an RFC 822 style header preamble. The headers must appe
 * Requires: 
 * Replaces: 
 * Superseded-By: 
-
+``` The Layer header (only for Standards Track QIPs) documents which layer of Quai the QIP applies to. -See [[qip-0123.mediawiki|QIP 123]] for definitions of the various QIP layers. Activation of this QIP implies activation of QIP 123. +See [QIP 123](qip-0123.mediawiki) for definitions of the various QIP layers. Activation of this QIP implies activation of QIP 123. + The Author header lists the names and email addresses of all the authors/owners of the QIP. The format of the Author header value must be @@ -158,31 +134,31 @@ The Type header specifies the type of QIP: Standards Track, Informational, or Pr The Created header records the date that the QIP was assigned a number, while Post-History is used to record when new versions of the QIP are posted to quai forums. Dates should be in yyyy-mm-dd format, e.g. 2001-08-14. -Post-History is permitted to be a link to a specific thread on the [https://forum.qu.ai Quai forum]. +Post-History is permitted to be a link to a specific thread on the [Quai forum](https://forum.qu.ai). QIPs may have a Requires header, indicating the QIP numbers that this QIP depends on. QIPs may also have a Superseded-By header indicating that a QIP has been rendered obsolete by a later document; the value is the number of the QIP that replaces the current document. The newer QIP must have a Replaces header containing the number of the QIP that it rendered obsolete. -====Auxiliary Files==== +#### Auxiliary Files -QIPs may include auxiliary files such as diagrams. Auxiliary files should be included in a subdirectory for that QIP, or must be named QIP-XXXX-Y.ext, where "XXXX" is the QIP number, "Y" is a serial number (starting at 1), and "ext" is replaced by the actual file extension (e.g. "png"). +QIPs may include auxiliary files such as diagrams. Auxiliary files should be included in a subdirectory for that QIP, or must be named QIP-XXXX-Y.ext, where "XXXX" is the QIP number, "Y" is a serial number (starting at 1), and "ext" is replaced by the actual file extension (e.g., "png"). -==QIP types== +## QIP Types There are three kinds of QIP: -* A Standards Track QIP describes any change that affects most or all Quai implementations, such as a change to the network protocol, a change in block or transaction validity rules, or any change or addition that affects the interoperability of applications using Quai. Standards Track QIPs consist of two parts, a design document and a reference implementation. -* An Informational QIP describes a Quai design issue, or provides general guidelines or information to the Quai community, but does not propose a new feature. Informational QIPs do not necessarily represent a Quai community consensus or recommendation, so users and implementors are free to ignore Informational QIPs or follow their advice. -* A Process QIP describes a process surrounding Quai, or proposes a change to (or an event in) a process. Process QIPs are like Standards Track QIPs but apply to areas other than the Quai protocol itself. They may propose an implementation, but not to Quai's codebase; they often require community consensus; unlike Informational QIPs, they are more than recommendations, and users are typically not free to ignore them. Examples include procedures, guidelines, changes to the decision-making process, and changes to the tools or environment used in Quai development. Any meta-QIP is also considered a Process QIP. +- A Standards Track QIP describes any change that affects most or all Quai implementations, such as a change to the network protocol, a change in block or transaction validity rules, or any change or addition that affects the interoperability of applications using Quai. Standards Track QIPs consist of two parts, a design document and a reference implementation. +- An Informational QIP describes a Quai design issue, or provides general guidelines or information to the Quai community, but does not propose a new feature. Informational QIPs do not necessarily represent a Quai community consensus or recommendation, so users and implementors are free to ignore Informational QIPs or follow their advice. +- A Process QIP describes a process surrounding Quai, or proposes a change to (or an event in) a process. Process QIPs are like Standards Track QIPs but apply to areas other than the Quai protocol itself. They may propose an implementation, but not to Quai's codebase; they often require community consensus; unlike Informational QIPs, they are more than recommendations, and users are typically not free to ignore them. Examples include procedures, guidelines, changes to the decision-making process, and changes to the tools or environment used in Quai development. Any meta-QIP is also considered a Process QIP. -==QIP status field== +### QIP Status Field -===Specification=== +## Specification The typical paths of the status of QIPs are as follows: - +![QIP Process](qip-0001/process.png) Champions of a QIP may decide on their own to change the status between Draft, Deferred, or Withdrawn. A QIP editor may also change the status to Deferred when no progress is being made on the QIP. @@ -197,33 +173,33 @@ When a Final QIP is no longer relevant, its status may be changed to Replaced or A process QIP may change status from Draft to Active when it achieves rough consensus on the forum. Such a proposal is said to have rough consensus if it has been open to discussion on the forum for at least one month, and no person maintains any unaddressed substantiated objections to it. Addressed or obstructive objections may be ignored/overruled by general agreement that they have been sufficiently addressed, but clear reasoning must be given in such circumstances. -====Progression to Final status==== +#### Progression to Final Status -A hard-fork QIP requires adoption from the entire Quai economy, particularly including those selling desirable goods and services in exchange for quai payments, as well as Quai holders who wish to spend or would spend their quais (including selling for other currencies) differently in the event of such a hard-fork. Adoption must be expressed by de facto usage of the hard-fork in practice (ie, not merely expressing public support, although that is a good step to establish agreement before adoption of the QIP). This economic adoption cannot be established merely by a super-majority, except by literally forcing the minority to accept the hard-fork (whether this is viable or not is outside the scope of this document). +A hard-fork QIP requires adoption from the entire Quai economy, particularly including those selling desirable goods and services in exchange for quai payments, as well as Quai holders who wish to spend or would spend their quais (including selling for other currencies) differently in the event of such a hard-fork. Adoption must be expressed by de facto usage of the hard-fork in practice (i.e., not merely expressing public support, although that is a good step to establish agreement before adoption of the QIP). This economic adoption cannot be established merely by a super-majority, except by literally forcing the minority to accept the hard-fork (whether this is viable or not is outside the scope of this document). Peer services QIPs should be observed to be adopted by at least 1% of public listening nodes for one month. API/RPC and application layer QIPs must be implemented by at least two independent and compatible software applications. -Software authors are encouraged to publish summaries of what QIPs their software supports to aid in verification of status changes. Good examples of this at the time of writing this QIP, can be observed in [https://github.com/quai/quai/blob/master/doc/qips.md Quai Core's doc/qips.md file] as well as [https://github.com/quai-wallet/quai-wallet/blob/master/wallet/README.specs.md Quai Wallet for Android's wallet/README.specs.md file]. +Software authors are encouraged to publish summaries of what QIPs their software supports to aid in verification of status changes. Good examples of this at the time of writing this QIP, can be observed in [Quai Core's doc/qips.md file](https://github.com/quai/quai/blob/master/doc/qips.md) as well as [Quai Wallet for Android's wallet/README.specs.md file](https://github.com/quai-wallet/quai-wallet/blob/master/wallet/README.specs.md). These criteria are considered objective ways to observe the de facto adoption of the QIP, and are not to be used as reasons to oppose or reject a QIP. Should a QIP become actually and unambiguously adopted despite not meeting the criteria outlined here, it should still be updated to Final status. -===Rationale=== +### Rationale -==QIP comments== +## QIP Comments -===Specification=== +### Specification Each QIP should, in its preamble, link to a public wiki page with a summary tone of the comments on that page. Reviewers of the QIP who consider themselves qualified, should post their own comments on this wiki page. The comments page should generally only be used to post final comments for a completed QIP. If a QIP is not yet completed, reviewers should instead post on the applicable forum thread to allow the QIP author(s) to address any concerns or problems pointed out by the review. -Some QIPs receive exposure outside the development community prior to completion, and other QIPs might not be completed at all. To avoid a situation where critical QIP reviews may go unnoticed during this period, reviewers may, at their option, still post their review on the comments page, provided they first post it to the forum and plan to later remove or revise it as applicable based on the completed version. Such revisions should be made by editing the previous review and updating the timestamp. Reviews made prior to the complete version may be removed if they are no longer applicable and have not been updated in a timely manner (eg, within one month). +Some QIPs receive exposure outside the development community prior to completion, and other QIPs might not be completed at all. To avoid a situation where critical QIP reviews may go unnoticed during this period, reviewers may, at their option, still post their review on the comments page, provided they first post it to the forum and plan to later remove or revise it as applicable based on the completed version. Such revisions should be made by editing the previous review and updating the timestamp. Reviews made prior to the complete version may be removed if they are no longer applicable and have not been updated in a timely manner (e.g., within one month). -Pages must be named after the full QIP number (eg, "QIP 0001") and placed in the "Comments" namespace. -For example, the link for QIP 1 will be https://github.com/quai/qips/wiki/Comments:QIP-0001 . +Pages must be named after the full QIP number (e.g., "QIP 0001") and placed in the "Comments" namespace. +For example, the link for QIP 1 will be [https://github.com/quai/qips/wiki/Comments:QIP-0001](https://github.com/quai/qips/wiki/Comments:QIP-0001). Comments posted to this wiki should use the following format: @@ -251,7 +227,7 @@ These fields must follow the "Discussions-To" header defined in QIP 1 (if that h To avoid doubt: comments and status are unrelated metrics to judge a QIP, and neither should be directly influencing the other. -===Rationale=== +### Rationale What is the purpose of QIP comments? @@ -261,9 +237,9 @@ Will QIP comments be censored or limited to particular participants/"experts"? * Participants should freely refrain from commenting outside of their area of knowledge or expertise. However, comments should not be censored, and participation should be open to the public. -==QIP licensing== +## QIP licensing -===Specification=== +### Specification New QIPs may be accepted with the following licenses. Each new QIP must identify at least one acceptable license in its preamble. The License header in the preamble must be placed after the Created header. Each license must be referenced by their respective abbreviation given below. @@ -296,64 +272,64 @@ In the event that the licensing for the text or code is too complicated to expre QIPs are not required to be *exclusively* licensed under approved terms, and may also be licensed under unacceptable licenses *in addition to* at least one acceptable license. In this case, only the acceptable license(s) should be listed in the License and License-Code headers. -====Recommended licenses==== +#### Recommended licenses -* BSD-2-Clause: [https://opensource.org/licenses/BSD-2-Clause OSI-approved BSD 2-clause license] -* BSD-3-Clause: [https://opensource.org/licenses/BSD-3-Clause OSI-approved BSD 3-clause license] -* CC0-1.0: [https://creativecommons.org/publicdomain/zero/1.0/ Creative Commons CC0 1.0 Universal] -* GNU-All-Permissive: [http://www.gnu.org/prep/maintain/html_node/License-Notices-for-Other-Files.html GNU All-Permissive License] +- BSD-2-Clause: [OSI-approved BSD 2-clause license](https://opensource.org/licenses/BSD-2-Clause) +- BSD-3-Clause: [OSI-approved BSD 3-clause license](https://opensource.org/licenses/BSD-3-Clause) +- CC0-1.0: [Creative Commons CC0 1.0 Universal](https://creativecommons.org/publicdomain/zero/1.0/) +- GNU-All-Permissive: [GNU All-Permissive License](http://www.gnu.org/prep/maintain/html_node/License-Notices-for-Other-Files.html) In addition, it is recommended that literal code included in the QIP be dual-licensed under the same license terms as the project it modifies. For example, literal code intended for Quai Core would ideally be dual-licensed under the MIT license terms as well as one of the above with the rest of the QIP text. -====Not recommended, but acceptable licenses==== +#### Not recommended, but acceptable licenses -* Apache-2.0: [http://www.apache.org/licenses/LICENSE-2.0 Apache License, version 2.0] -* BSL-1.0: [http://www.boost.org/LICENSE_1_0.txt Boost Software License, version 1.0] -* CC-BY-4.0: [https://creativecommons.org/licenses/by/4.0/ Creative Commons Attribution 4.0 International] -* CC-BY-SA-4.0: [https://creativecommons.org/licenses/by-sa/4.0/ Creative Commons Attribution-ShareAlike 4.0 International] -* MIT: [https://opensource.org/licenses/MIT Expat/MIT/X11 license] -* AGPL-3.0+: [http://www.gnu.org/licenses/agpl-3.0.en.html GNU Affero General Public License (AGPL), version 3 or newer] -* FDL-1.3: [http://www.gnu.org/licenses/fdl-1.3.en.html GNU Free Documentation License, version 1.3] -* GPL-2.0+: [http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html GNU General Public License (GPL), version 2 or newer] -* LGPL-2.1+: [http://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html GNU Lesser General Public License (LGPL), version 2.1 or newer] +- Apache-2.0: [Apache License, version 2.0](http://www.apache.org/licenses/LICENSE-2.0) +- BSL-1.0: [Boost Software License, version 1.0](http://www.boost.org/LICENSE_1_0.txt) +- CC-BY-4.0: [Creative Commons Attribution 4.0 International](https://creativecommons.org/licenses/by/4.0/) +- CC-BY-SA-4.0: [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/) +- MIT: [Expat/MIT/X11 license](https://opensource.org/licenses/MIT) +- AGPL-3.0+: [GNU Affero General Public License (AGPL), version 3 or newer](http://www.gnu.org/licenses/agpl-3.0.en.html) +- FDL-1.3: [GNU Free Documentation License, version 1.3](http://www.gnu.org/licenses/fdl-1.3.en.html) +- GPL-2.0+: [GNU General Public License (GPL), version 2 or newer](http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html) +- LGPL-2.1+: [GNU Lesser General Public License (LGPL), version 2.1 or newer](http://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html) -====Not acceptable licenses==== +#### Not acceptable licenses All licenses not explicitly included in the above lists are not acceptable terms for a Quai Improvement Proposal unless a later QIP extends this one to add them. -===Rationale=== +### Rationale QIP 1 allowed the Open Publication License or releasing into the public domain; was this insufficient? -* The OPL is generally regarded as obsolete, and not a license suitable for new publications. -* Many are unfamiliar with the OPL terms, and may just prefer to use the public domain rather than license under uncertain terms. -* The OPL license terms allowed for the author to prevent publication and derived works, which was widely considered inappropriate for Quai standards. -* Public domain is not universally recognised as a legitimate action, thus it is inadvisable. +- The OPL is generally regarded as obsolete, and not a license suitable for new publications. +- Many are unfamiliar with the OPL terms, and may just prefer to use the public domain rather than license under uncertain terms. +- The OPL license terms allowed for the author to prevent publication and derived works, which was widely considered inappropriate for Quai standards. +- Public domain is not universally recognised as a legitimate action, thus it is inadvisable. Why are there software licenses included? -* Some QIPs, especially consensus layer, may include literal code in the QIP itself which may not be available under the exact license terms of the QIP. -* Despite this, not all software licenses would be acceptable for content included in QIPs. +- Some QIPs, especially consensus layer, may include literal code in the QIP itself which may not be available under the exact license terms of the QIP. +- Despite this, not all software licenses would be acceptable for content included in QIPs. Why is Public Domain no longer acceptable for new QIPs? -* In some jurisdictions, public domain is not recognised as a legitimate legal action, leaving the QIP simply copyrighted with no redistribution or modification allowed at all. +- In some jurisdictions, public domain is not recognised as a legitimate legal action, leaving the QIP simply copyrighted with no redistribution or modification allowed at all. -==Changes from QIP 1== +## Changes from QIP 1 -* Acceptable licenses are entirely rechosen, allowing a wide variety of open licenses, while prohibiting the problematic older choices. -* Accepted Status has been renamed to Proposed. -* An implementation is now required (when applicable) before QIPs can proceed to Proposed Status. -* QIP Comments are newly introduced. -* The License preamble headers have been added. -* The Layer header is included from QIP 123. -* Non-image auxiliary files are permitted in the qip-XXXX subdirectory. -* Email addresses are now required for authors. -* The Post-History header may be provided as a link instead of a simple date. -* Markdown format is no longer permitted for QIPs. -* The Resolution header has been dropped, as it is not applicable to a decentralised system where no authority exists to make final decisions. +- Acceptable licenses are entirely rechosen, allowing a wide variety of open licenses, while prohibiting the problematic older choices. +- Accepted Status has been renamed to Proposed. +- An implementation is now required (when applicable) before QIPs can proceed to Proposed Status. +- QIP Comments are newly introduced. +- The License preamble headers have been added. +- The Layer header is included from QIP 123. +- Non-image auxiliary files are permitted in the qip-XXXX subdirectory. +- Email addresses are now required for authors. +- The Post-History header may be provided as a link instead of a simple date. +- Markdown format is no longer permitted for QIPs. +- The Resolution header has been dropped, as it is not applicable to a decentralised system where no authority exists to make final decisions. -==See Also== +## See Also -* [[https://github.com/bitcoin/bips/blob/master/bip-0002.mediawiki|Bitcoin BIP-0002: BIP Process, revised]] -* [https://tools.ietf.org/html/rfc7282 RFC 7282: On Consensus and Humming in the IETF] +- [Bitcoin BIP-0002: BIP Process, revised](https://github.com/bitcoin/bips/blob/master/bip-0002.mediawiki) +- [RFC 7282: On Consensus and Humming in the IETF](https://tools.ietf.org/html/rfc7282) \ No newline at end of file diff --git a/qip-0002.mediawiki b/qip-0002.md similarity index 58% rename from qip-0002.mediawiki rename to qip-0002.md index 4a9d184..3f9595d 100644 --- a/qip-0002.mediawiki +++ b/qip-0002.md @@ -1,4 +1,4 @@ -
+```
   QIP: 2
   Layer: Consensus (hard fork)
   Title: Sharded ledger
@@ -9,114 +9,68 @@
   Type: Standards Track
   Created: 2023-09-07
   License: BSD-2-Clause
-
+``` -==Abstract== +## Abstract -The Quai protocol accommodates high transactional throughput by splitting ledger state into independent shards. Each shard is updated via block chain and merge mined with the other shard chains. This QIP describes a mechanism of splitting the state trie according to account prefix, in order to guarantee no two shards posess conflicting state transitions. +The Quai protocol accommodates high transactional throughput by splitting ledger state into independent shards. Each shard is updated via blockchain and merge mined with the other shard chains. This QIP describes a mechanism of splitting the state trie according to account prefix, in order to guarantee no two shards possess conflicting state transitions. -==Motivation== +## Motivation -Sharding makes it possible to asynchronously progress multiple chains simultaneously. Concretely, sharding the ledger provides a simple guarantee that no two zone chains will have conflicting state transitions. Without this guarantee, zone chains would not be able progress asynchronously. Put differently, if zone chains could have conflicting transactions, then no chain would reach finality until it found a merge mined block that the entire network accepts as canonical. This would completely negate the scaling benefits of Quai's merge mined architecture, reducing the network throughput to that of a single chain of merged blocks. +Sharding makes it possible to asynchronously progress multiple chains simultaneously. Concretely, sharding the ledger provides a simple guarantee that no two zone chains will have conflicting state transitions. Without this guarantee, zone chains would not be able to progress asynchronously. Put differently, if zone chains could have conflicting transactions, then no chain would reach finality until it found a merge mined block that the entire network accepts as canonical. This would completely negate the scaling benefits of Quai's merge mined architecture, reducing the network throughput to that of a single chain of merged blocks. -==Specification== +## Specification -===Overview=== +### Overview The address space is divided into subsets according to address prefix. The account state for each subset of addresses will be maintained wholly by one and only one shard. Intra-shard transactions may only be processed by the blockchain which maintains that shard. Inter-shard transactions are possible, but the specification for those will be left to another QIP. -===Shard Organization=== +### Shard Organization The Quai protocol defines a hierarchy of merge mined blockchains. This hierarchy takes the form of a tree with two levels under the root. The root chain (aka prime chain) is merge mined by several "region chains" of lower difficulty. Each region chain is merge mined by "zone chains" of lower difficulty. Since this architecture is symmetric, the total number of shards which can exist in a region is `sqrt(N)`, where `N` is the total number of shards in the network. -===Shard Identifiers=== +### Shard Identifiers -Each shard is given a binary identifier. Any address which has a matching binary prefix will exist in that shard. The shard identifier is a single byte. The first 4 MSb of the identifier indicates which region this shard belongs to. The remaining 4 LSb of the indentifier, indicates which zone within the region, this shard belongs to. +Each shard is given a binary identifier. Any address which has a matching binary prefix will exist in that shard. The shard identifier is a single byte. The first 4 MSb of the identifier indicates which region this shard belongs to. The remaining 4 LSb of the identifier, indicates which zone within the region, this shard belongs to. -====Format==== -{| +#### Format -!bits 0..4 -!bits 4..8 -|- -| region number -| zone number -|} +| bits 0..4 | bits 4..8 | +| ------------- | ------------- | +| region number | zone number | + +#### Examples -====Examples==== The following table gives a few example shard identifiers, and which zone chain they belong to. -{| -!Shard ID -!Hex Value -!Region -!Zone -|- -| shard-0 -| 0x00 -| region-0 -| zone-0-0 -|- -| shard-1 -| 0x01 -| region-0 -| zone-0-1 -|- -| shard-10 -| 0x0A -| region-0 -| zone-0-10 -|- -| shard-42 -| 0x2A -| region-2 -| zone-2-10 -|- -| shard-255 -| 0xFF -| region-15 -| zone-15-15 -|} - - -===Shard Activation=== +| Shard ID | Hex Value | Region | Zone | +| --------- | --------- | -------- | -------- | +| shard-0 | 0x00 | region-0 | zone-0-0 | +| shard-1 | 0x01 | region-0 | zone-0-1 | +| shard-10 | 0x0A | region-0 | zone-0-10| +| shard-42 | 0x2A | region-2 | zone-2-10| +| shard-255 | 0xFF | region-15| zone-15-15| + +### Shard Activation There is no requirement for shards to be active. It is likely that only a fraction of the shards will be active initially, and the network will expand to activate more shards as network demand increases. The exact process for deciding how/when to activate more shards will be left for a future QIP. The Quai protocol defines the initial topology to be a 3x3 tree, so there will be 9 shards active in this minimum topology. Those shards are given below. -====Initially Active Shards==== -{| -!Shard ID -!Hex Value -|- -| shard-0 -| 0x00 -|- -| shard-1 -| 0x01 -|- -| shard-2 -| 0x02 -|- -| shard-3 -| 0x10 -|- -| shard-4 -| 0x11 -|- -| shard-5 -| 0x12 -|- -| shard-6 -| 0x20 -|- -| shard-7 -| 0x21 -|- -| shard-8 -| 0x22 -|} - -==Copyright== - -This QIP licensed under the BSD 2-clause license. + +#### Initially Active Shards + +| Shard ID | Hex Value | +| --------- | --------- | +| shard-0 | 0x00 | +| shard-1 | 0x01 | +| shard-2 | 0x02 | +| shard-3 | 0x10 | +| shard-4 | 0x11 | +| shard-5 | 0x12 | +| shard-6 | 0x20 | +| shard-7 | 0x21 | +| shard-8 | 0x22 | + +## Copyright + +This QIP licensed under the BSD 2-clause license. \ No newline at end of file diff --git a/qip-0003.mediawiki b/qip-0003.md similarity index 72% rename from qip-0003.mediawiki rename to qip-0003.md index aae012a..a055059 100644 --- a/qip-0003.mediawiki +++ b/qip-0003.md @@ -1,41 +1,42 @@ -
-  QIP: 3
-  Layer: Applications
-  Title: Shard Specific Address Discovery
-  Author: wizeguyy 
-  Comments-Summary: No comments yet.
-  Comments-URI: https://github.com/quainetwork/qips/wiki/Comments:QIP-0003
-  Status: Draft
-  Type: Standards Track
-  Created: 2023-09-12
-  License: BSD-2-Clause
-
+``` + QIP: 3 + Layer: Applications + Title: Shard Specific Address Discovery + Author: wizeguyy + Comments-Summary: No comments yet. + Comments-URI: https://github.com/quainetwork/qips/wiki/Comments:QIP-0003 + Status: Draft + Type: Standards Track + Created: 2023-09-12 + License: BSD-2-Clause +``` -==Abstract== +## Abstract -This QIP defines an address discovery algorithm for deterministic [https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki BIP44] wallets, which is compatible with Quai's QIP2 sharded address space. +This QIP defines an address discovery algorithm for deterministic [BIP44](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki) wallets, which is compatible with Quai's [QIP2](qip-0002.mediawiki) sharded address space. -==Motivation== +## Motivation -The hierarchy proposed in BIP44 is well defined, but the gap limit technique for address discovery is insufficient for wallets operating in Quai's sharded address space, described in QIP2. This specification discribes an algorithm to discover addresses mapped to each shard, within the BIP44 hierarchy. +The hierarchy proposed in BIP44 is well defined, but the gap limit technique for address discovery is insufficient for wallets operating in Quai's sharded address space, described in [QIP2](qip-0002.mediawiki). This specification describes an algorithm to discover addresses mapped to each shard, within the BIP44 hierarchy. -==Specification== +## Specification -===Relationship to BIP44=== +### Relationship to BIP44 BIP44 defines the following 5 levels in the BIP32 path: -
+```
 m / purpose' / coin_type' / account' / change / address_index
-
+``` Additionally BIP44 describes an account discovery and address gap limit techniques to standardize how wallet software can identify keys for use on a given blockchain. This QIP adheres to BIP44 in all ways except for the gap limit technique. Since each address is valid in one and only one chain, and that validity cannot be known by path alone (validity is determined by address prefix), the wallet must grind addresses until it finds addresses which are valid in each shard. In place of BIP44's gap limit, we define the shard discovery technique below. -===Shard Address Discovery=== +### Shard Address Discovery -To perform address discovery, a wallet software should search through the BIP44 address_index level of the BIP32 path and record which shard each address belongs to. This creates a secondary mapping on the address_index, which we denote shard_address_index. Precisely, the ith shard_address_index in shard-k is the ith address from the subset of addresses which are valid in shard-k. +To perform address discovery, a wallet software should search through the BIP44 `address_index` level of the BIP32 path and record which shard each address belongs to. This creates a secondary mapping on the `address_index`, which we denote `shard_address_index`. Precisely, the ith `shard_address_index` in `shard-k` is the ith address from the subset of addresses which are valid in `shard-k`. We give the following search algorithm in pseudo code for reference: -
+
+```plaintext
 // A BIP32 type to represent a full BIP32 path for address derivation
 struct bip32 {
   uint64 purpose;
@@ -83,9 +84,8 @@ vec> generateShardAddresses(n int, path bip32) {
   // Return the full list of addresses we've discovered
   return address_lists;
 }
-
- -===Gap Limit=== +``` +### Gap Limit For an account ledger there is no need to search for additional addresses beyond the first 256 (QIP2 defined maximum number of shards). For a UTXO ledger, we follow BIP44's gap limit definition applied to each shard, instead of applied to the raw address_index. @@ -93,14 +93,14 @@ Precisely, BIP44 has defined a gap limit of 20. In keeping with that, a UTXO wal Software should warn when the user is trying to exceed the gap limit on any given shard chain, by generating a new address. -====Examples==== +#### Examples TBD... -==Copyright== +## Copyright This QIP licensed under the BSD 2-clause license. -==References== +## References * https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki * https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki diff --git a/qip-0004.md b/qip-0004.md new file mode 100644 index 0000000..538fdd8 --- /dev/null +++ b/qip-0004.md @@ -0,0 +1,46 @@ +``` + QIP: 4 + Layer: Applications + Title: 9 Shard Address Mapping + Author: wizeguyy + Comments-Summary: No comments yet. + Comments-URI: [https://github.com/quainetwork/qips/wiki/Comments:QIP-0004](https://github.com/quainetwork/qips/wiki/Comments:QIP-0004) + Status: Draft + Type: Standards Track + Created: 2023-09-15 + License: BSD-2-Clause +``` + +## Abstract + +This QIP defines an address mapping to be used in a 9 shard hierarchy of the Quai protocol. + +## Motivation + +This defines the address mapping used in early testnets of the Quai protocol. Early testnets use a lighter 9-shard hierarchy. It has already been concluded that the mainnet should accommodate more than 9 shards, so this mapping is no longer recommended. We documented it here for wallet compatibility with early testnets. + +## Specification + +### Overview + +The address space is divided into subsets according to address prefix. The account state for each subset of addresses will be maintained wholly by one and only one shard. Intra-shard transactions may only be processed by the blockchain which maintains that shard. Inter-shard transactions are possible, but the specification for those will be left to another QIP. + +### Address Mapping + +All addresses are mapped to exist in one of nine shards according to the MSB of the address. The Address groupings are given below: + +| Name | Region | Zone | Min Address | Max Address | +|---------|---------|---------|-----------------------------------------|-----------------------------------------| +| cyprus1 | region-0| zone-0-0| 0x0000000000000000000000000000000000000000| 0x1DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF| +| cyprus2 | region-0| zone-0-1| 0x1E00000000000000000000000000000000000000| 0x3AFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF| +| cyprus3 | region-0| zone-0-2| 0x3B00000000000000000000000000000000000000| 0x57FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF| +| paxos1 | region-1| zone-1-0| 0x5800000000000000000000000000000000000000| 0x73FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF| +| paxos2 | region-1| zone-1-1| 0x7400000000000000000000000000000000000000| 0x8FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF| +| paxos3 | region-1| zone-1-2| 0x9000000000000000000000000000000000000000| 0xABFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF| +| hydra1 | region-2| zone-2-0| 0xAC00000000000000000000000000000000000000| 0xC7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF| +| hydra2 | region-2| zone-2-1| 0xC800000000000000000000000000000000000000| 0xE3FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF| +| hydra3 | region-2| zone-2-2| 0xE400000000000000000000000000000000000000| 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF| + +## Copyright + +This QIP is licensed under the BSD 2-clause license. \ No newline at end of file diff --git a/qip-0004.mediawiki b/qip-0004.mediawiki deleted file mode 100644 index 40f05ff..0000000 --- a/qip-0004.mediawiki +++ /dev/null @@ -1,96 +0,0 @@ -
-  QIP: 4
-  Layer: Applications
-  Title: 9 Shard Address Mapping
-  Author: wizeguyy 
-  Comments-Summary: No comments yet.
-  Comments-URI: https://github.com/quainetwork/qips/wiki/Comments:QIP-0004
-  Status: Draft
-  Type: Standards Track
-  Created: 2023-09-15
-  License: BSD-2-Clause
-
- -==Abstract== - -This QIP defines a address mapping to be used in an 9 shard hierarchy of the Quai protocol. - -==Motivation== - -This defines the address mapping used in early testnets of the Quai protocol. Early testnets use a lighter 9-shard hierarchy. It has already been concluded that mainnet should accommodate more than 9-shards,so this mapping is no longer recommended. We documented it here for wallet compatibility with early testnets. - -==Specification== - -===Overview=== - -The address space is divided into subsets according to address prefix. The account state for each subset of addresses will be maintained wholly by one and only one shard. Intra-shard transactions may only be processed by the blockchain which maintains that shard. Inter-shard transactions are possible, but the specification for those will be left to another QIP. - -===Address Mapping=== - -All addresses are mapped to exist in one of nine shards according to the MSB of the address. The Address groupings are given below: - -{| -!Name -!Region -!Zone -!Min Address -!Max Address -|- -| cyprus1 -| region-0 -| zone-0-0 -| 0x0000000000000000000000000000000000000000 -| 0x1DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -|- -| cyprus2 -| region-0 -| zone-0-1 -| 0x1E00000000000000000000000000000000000000 -| 0x3AFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -|- -| cyprus3 -| region-0 -| zone-0-2 -| 0x3B00000000000000000000000000000000000000 -| 0x57FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -|- -| paxos1 -| region-1 -| zone-1-0 -| 0x5800000000000000000000000000000000000000 -| 0x73FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -|- -| paxos2 -| region-1 -| zone-1-1 -| 0x7400000000000000000000000000000000000000 -| 0x8FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -|- -| paxos3 -| region-1 -| zone-1-2 -| 0x9000000000000000000000000000000000000000 -| 0xABFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -|- -| hydra1 -| region-2 -| zone-2-0 -| 0xAC00000000000000000000000000000000000000 -| 0xC7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -|- -| hydra2 -| region-2 -| zone-2-1 -| 0xC800000000000000000000000000000000000000 -| 0xE3FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -|- -| hydra3 -| region-2 -| zone-2-2 -| 0xE400000000000000000000000000000000000000 -| 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -|} - -==Copyright== - -This QIP licensed under the BSD 2-clause license.