From 9868f5056412748c80eb2764fa19605f78b13d72 Mon Sep 17 00:00:00 2001 From: DJStern Date: Fri, 19 Jan 2024 09:42:04 +0100 Subject: [PATCH 1/4] Reduce the number of words and iq and energy required to read this --- applications/Liberland_judiciary.md | 118 ++++++++++++++++------------ 1 file changed, 68 insertions(+), 50 deletions(-) diff --git a/applications/Liberland_judiciary.md b/applications/Liberland_judiciary.md index db447acd56a..751bde9a73f 100644 --- a/applications/Liberland_judiciary.md +++ b/applications/Liberland_judiciary.md @@ -10,13 +10,15 @@ Follow-up on Liberland Grant Application [pull request: Create liberland #831; a ### Liberland Blockchain -We are Liberland, the world's freest country. Currently, we are settling the physical land, but we also remain focused on our blockchain. The next milestone in our blockchain suite's development is to conceive a blockchain-agnostic solution that translates traditional dispute resolution and judiciary and contract functionalities into the digital realm. Our vision includes a system that synergizes the virtues of centralized and decentralized models. +We are Liberland, the world's freest country. Currently, we are settling the physical land and developing our blockchain. -Liberland Blockchain is a layer one public blockchain owned by coin and token holders. The blockchain is funded and supported by Liberland, providing the first set of use cases. The codebase is a fork of Substrate/Polkadot, and the license is MIT, the same as Bitcoin. Liberland does not claim ownership of the blockchain or related materials. +Liberland Blockchain is a sovereign blockchain owned by token holders, founded and supported by Liberland which provides the first set of use cases. The codebase is a fork of Substrate/Polkadot, with MIT license. Liberland does not claim ownership of the blockchain or related materials. -The blockchain allows permissionless usage of tokens and coins as a store of value or medium of exchange. Advanced functionalities critical to the project's future are permissioned. DeFi projects on the Liberland chain are not permissioned unless designed by third-party developers on a per-project basis. +Functionalities such as trading and DeFi projects are permissionless by default while some critical functionalities such as country politics are permissioned and require KYC. -This milestone now sets the stage for implementing the quintessential element of all governance systems - the judiciary. We seek to enable dispute resolution and advisory opinions, traditionally offline activities, to take place within this blockchain ecosystem. +The next blockchain milestone is translating traditional contract, dispute resolution and judiciary functionalities into the Web3 realm, synergizing the virtues of centralized and decentralized models. + +This milestone implements the quintessential element of all governance systems - the judiciary. We seek to enable dispute resolution and advisory opinions to take place within this blockchain ecosystem. ### Overview @@ -25,51 +27,51 @@ This milestone now sets the stage for implementing the quintessential element of The Liberland Judiciary is designed to develop an on-chain system capable of acting on behalf of a party without their explicit permission in pre-approved ways with mutual consent given in advance. - Facilitate the integration of a 'court as a smart contract oracle', thereby enabling the execution of traditional, verbose contracts on-chain. This system allows for the imposition of sanctions as dictated by the applicable law and the contract itself in the event of a dispute. -- Implement a body of norms or laws to regulate the system's operations, thereby eliminating arbitrary decisions and enhancing trust. + +- Implement norms or laws to regulate the system's operations, thereby eliminating arbitrary decisions and enhancing trust. - Guarantee decentralization and security while ensuring that the system is operated by professionals who uphold the quality of decisions. - Retain recognizability by resembling a traditional courtroom rather than a streamlined IT service app. The solution we propose introduces a hybrid entity, central yet decentralized, capable of interpreting intent behind actions within the blockchain. Empowered to regulate transactions by reversing or counteracting them, this entity exercises authority particularly in situations where malicious or bad faith intentions are identified. By introducing a virtual judiciary, any questionable actions can be evaluated and, if necessary, nullified. This architecture enhances the breadth of on-chain business activity, facilitating enforcement of traditional contract agreements and enabling partial algorithmic execution. In effect, this approach instills confidence that transactions, whether off-chain or on-chain, offline or online, will be enforced. Additionally, it offers an authoritative entity to resolve any disputes arising from the obligations agreed upon by the parties involved. - + #### Project Ecosystem Fit -The Liberland Blockchain solution will be a significant addition to the Polkadot ecosystem. By translating traditional dispute resolution and judiciary functionalities into the digital realm, it will introduce a new layer of trust and security to blockchain transactions. The integration of a 'court as a smart contract oracle' will enable the execution of traditional, worded contracts on-chain, thereby expanding the scope of on-chain business activity. - -Furthermore, the solution will provide a hybrid entity that is both central and decentralized, capable of interpreting the intent behind actions within the blockchain. This will enhance the Polkadot ecosystem's ability to regulate transactions, especially in situations where malicious or bad faith intentions are identified. - -The Liberland Blockchain, a layer one public blockchain, is a fork of Substrate/Polkadot, further strengthening the ties between the two ecosystems. By offering a virtual judiciary, the solution will instil confidence in transactions and provide an authoritative entity to resolve any arising disputes. This will significantly contribute to the robustness and reliability of the Polkadot ecosystem. +The integration of a 'court as a smart contract oracle' will enable the execution of traditional, worded contracts on-chain, thereby expanding the scope of on-chain business activity. +By translating traditional dispute resolution and judiciary functionalities into Web3, it will introduce a new layer of trust and security to blockchain transactions. +The Liberland Blockchain will be a significant addition to the Polkadot ecosystem as our pallets and practices can be used directly or in other parachains. ### Project Details #### Simple Process ##### Outline -The Simple process is employed when all parties involved reach a consensus on selecting a judge or panel of judges to preside over their case. The selection can be explicit (naming a specific judge) or implicit ("we agree to let the system decide"). The system provides parameters (such as cost, experience level, etc.) for judge selection, stipulating that parties are bound by their agreement to accept the system's random selection within the agreed-upon parameters. +The Simple process is employed when all involved parties reach a consensus on selecting judges to preside over their case. The selection can be explicit (naming a specific judge) or implicit ("letting the system decide"). within given parameters (such as cost, experience level, etc.) for judge selection. -The Simple process is designed to be: -- Quick, -- More economical than the contested process, and -- the intent is to ensure expedient and cost-effective resolution, contrasting with contemporary systems where years can elapse before disputes are resolved. In Liberland, minor disputes could potentially be adjudicated within a day or a few days through the Simple process, and at a significantly reduced cost. +The Simple process is designed to be quick and cost-effective. ##### Mediation -The appointed judge endeavours to segment the case into manageable portions, drafting a mediation solution for each. This proposed solution is then presented to the involved parties. If an agreement is reached, the process concludes without litigation, and the judge is remunerated a flat fee, which is lower than the litigation tariff. +The appointed judge segments the case into portions, drafting a mediation solution for each. This proposed solution is presented to the involved parties. +If an agreement is reached, the process concludes without litigation, and the judge is paid. ##### Litigation -In instances where a mutual agreement is not achieved, the judge drafts a mediation solution and presents it to the involved parties. If an agreement is reached, -> the litigation process is averted, -> with the judge remunerated a flat fee that is lower than the tariff payable when Complex Process is used. - + +When mutual agreement is not achieved, the judge drafts a mediation solution and presents it to the involved parties. +If an agreement is reached, -> the litigation process is averted, -> with the judge remunerated a flat fee that is lower than the tariff payable when Complex Process is used. + #### Complex Process ##### Outline -The Complex Process acts as a fallback mechanism when the parties cannot concur on the choice of a judge or other terms. A mutual agreement on jurisdiction must be established for any process to occur, but there may exist a level of distrust that prevents a jointly accepted judge. In such circumstances, the system adapts to assign three judges: +The Complex Process is used when the parties cannot agree on the choice of a judge or other terms. An agreement on jurisdiction must be pre-established for any process to occur. In such circumstances, the system adapts to assign three judges: - The attorney representing the applicant, - The attorney representing the respondent, and - An arbitrator jointly selected by the two attorneys. -This system, although more involved, remains streamlined for efficiency and cost-effectiveness, maintaining the balance between swiftness and the demands of judicature. The Complex Process is designed to handle intricate issues requiring detailed attention and processual protections for the parties involved. Ultimately, the criminal process of Liberland will adopt the framework of the Complex Process. +The Complex Process is designed to handle intricate issues requiring detailed attention and processual protections for the parties involved while maintaining balance between swiftness and the demands of judicature. +Ultimately, the criminal process of Liberland will adopt the framework of the Complex Process. ##### Mediation -1. A user (Party A) alleges that another user (Party B) has violated the standing body of rules (Liberland Law). In the case of a smart contract, this is done by triggering a function on the contract itself, which enters into 'litigation mode' until the process is resolved -2. Party A selects a judge (Attorney A) from the available roster, agrees to their terms, and pays collateral plus a transaction fee. -3. Party B is notified and selects a judge (Attorney B). +1. Party A alleges that Party B has violated the rules (Contract or law). In a smart contract, this is done by triggering a function on the contract which activates 'litigation mode' until the process is resolved +2. Party A selects Attorney A from the available roster, agrees to their terms, and pays collateral plus a transaction fee. +3. Party B is notified and selects Attorney B. 4. Party A and Attorney A compile and submit a Case. 5. Party B and Attorney B compile and submit a Response. 6. The Attorneys meet to create a Compromise, dividing the Case into parts and seeking resolution without litigation where possible. @@ -83,46 +85,57 @@ This system, although more involved, remains streamlined for efficiency and cost #### Appeal ##### Outline -An appeal can ensue after either the Simple Process or the Complex Process. It is initiated upon the request of a party, presenting costs to the petitioner and imposing time constraints, namely the period until adjudication, upon the other party. Additionally, the assurance of the first instance's final verdict is jeopardized. Parties may agree in advance to forgo the appeal process, rendering the first instance judgment as the final verdict, anticipated to be prevalent primarily with the Simple Process. +An appeal can ensue after the litigation process, unless the parties agreed in advance to forego the possibility of appeal, which is anticipated to be common in the Simple process. +Appeal is initiated on request, which questions the litigation verdict. +Appeal must be paid for by the party initiating it. ##### Steps of an Appeal 1. An Appeal Judge is appointed by the algorithm. 2. The Appeal Judge examines the appeal points and formulates an Appeal Verdict. -3. The final Verdict is executed on the Collateral and the Pooled LLM. +3. The final Verdict is executed on the Collateral. #### Functionality: Advisory Opinion -If a party wishes to obtain the Court's opinion on a particular legal, technical or factual matter, even in the absence of a dispute, the system will offer two types of Advisory Opinions: +If a party wishes to obtain the Court's opinion on a particular matter in the absence of a dispute, the system offers two types of Advisory Opinions: -**Simple Advisory Opinion:** This is a yes/no binary question. The party formulates the question, provides reasoning, pays a fee, and presents the question to the Judge. They then wait for the Judge's decision and can either accept or reject it. If they reject it, they can pay an additional fee to re-run the game up to three times to view the opinions of three different Juries. -**Complex Advisory Opinion:** The party pays a higher fee, formulates a complex question, and chooses a Judge. The Judge then formulates the Opinion on the points of the question. The party waits for the Judge's decision and, similar to a Simple Advisory Opinion, they can accept or reject it, paying an additional fee to re-run the game up to three times if they choose to reject it. +**Simple Advisory Opinion:** A yes/no binary question. The party formulates the question, provides reasoning, pays a fee, and presents the question to the Judge. They then wait for the Judge's decision and can either accept or reject it. If they reject it, they can pay an additional fee to re-run the game up to three times to view the opinions of three different Juries. +**Complex Advisory Opinion:** The party pays a higher fee, formulates a complex question, and chooses a Judge. The Judge then formulates the Opinion on the points of the question. The party waits for the Judge's decision and either accepts or rejects it, paying an additional fee to re-run the game up to three times if they choose to reject it. #### Enactment of Awards ##### The Optimal Circumstance -A contract or a case is collateralized such that the collateral is sufficient to cover any additional payments prescribed in the final verdict beyond the awarded sum and the Court Costs. In this scenario, the collateral serves as a mechanism for the execution of the judgement. A third party, such as an insurance company may handle collateral. +A contract or a case has suffiient collateral to cover any additional payments in the final verdict and the court costs. In this scenario, the collateral is used for the execution of the judgement. A third party, like an insurance company may handle collateral. ##### Case with Insufficient Collateral ###### Seizing politipooled LLM -The judge is imbued with the authority to designate an individual's politipooled (staked) LLM as collateral. Upon such a declaration, an involuntary unpooling of the owing party's pooled LLM stash will ensue, optionally carrying typical ramifications like the forfeit of voting rights associated with that stash. If the full amount is subsequently paid, this directive is withdrawn. However, under circumstances where +The judge has the authority to designate an individual's politipooled (staked) LLM as collateral, triggering involuntary unpooling of the owing party's pooled LLM. -- there is a violation of the Non-Aggression Principle, implicating aggressive conduct against another individual's person or property, or +However, under circumstances where + +- there is a violation of the Non-Aggression Principle, implicating aggressive conduct against persons or property, or - the damage incurred exceeds one's LLM stash, -- the offender's LLM balance could turn negative, resulting in their listing on Liberland's 'wanted' roster, rendering them a 'persona non grata'. Consequently, they lose their voting rights and potentially access to other Liberland services until the owed amount is fully settled. + +the offender's LLM balance could turn negative, resulting in their listing on Liberland's 'wanted' roster, rendering them a 'persona non grata'. Consequently, they lose their voting rights and potentially access to other Liberland services until the owed amount is fully settled. ###### Enforcement Beyond the Chain -In instances where either of the aforementioned methods cannot enforce the judgement, the awarded sum will be incorporated into a conventional contract or appended as a supplement if the dispute is contract-related. This contract, endorsed by both parties, holds legitimacy outside of Liberland, akin to any other contract. It can be presented to an enforcement agency for execution, even against the unwilling party's resistance. Note that this is just an explanation of the process and doesn't represent a deliverable for the grant. +In instances where aforementioned methods cannot enforce the judgement, the awarded sum will be incorporated into a conventional contract or appended as a supplement if the dispute is contract-related. +This contract, endorsed by both parties, holds legitimacy outside of Liberland, akin to any other contract. It can be presented to an enforcement agency for execution, even against the unwilling party's resistance. +Note that this is just an explanation of the process and doesn't represent a deliverable for the grant. #### Functionality: Traditional Contracts ##### Overview -Most contractual relationships in the world aren't currently simple and predictable enough to be run on smart contracts. This is likely to remain so even in the age of AI, at least for a decade or so. In the meantime, dumb contracts, that is, traditional contracts, are what runs the world of business and your everyday life. What is a dumb contract? It is an agreement you make with another human being. It is also a smart contract, in a way, but it runs on the hardware and the OS of your brain. +Most contractual relationships in the world aren't simple and predictable enough to be run on smart contracts. +Dumb/traditional contracts, are what runs the world of business and everyday life made in an agreement with another humans under juridistictions of nation states. -How will it work? Alice and Bob enter into a traditional contract for the sale of goods. They agree to use the Liberland Blockchain Judiciary system for any potential disputes. They choose a judge from the roster and agree on the collateral and fees. The contract is then recorded on the blockchain. Why should someone want to do this? +We aim to translate these traditional contracts into Web3. + +How will it work? Alice and Bob enter into a traditional contract for the sale of goods. They agree to use the Liberland Blockchain Judiciary system for any potential disputes. +They choose a judge from the roster and agree on the collateral and fees. The contract is recorded on the blockchain. ##### Benefits: -- **Efficiency and Speed:** The Liberland Blockchain Judiciary system offers a Simple Process for dispute resolution. If a dispute arises, Alice or Bob can trigger the judge to give a binding opinion. This process is designed to be quick and more economical than traditional legal systems, potentially resolving disputes within a few days. -- **Cost-Effectiveness:** The system is designed to be more economical than traditional legal systems. The costs are defined upfront and include the judge's fees and any potential award to the victorious party. This transparency and predictability of costs can make the system more attractive to parties entering into a contract. -- **Security and Trust:** The system is built on the blockchain, providing a secure and immutable record of the contract and any subsequent dispute resolution proceedings. This can increase trust between the parties and reduce the risk of fraudulent claims. -- **Payment Processing:** The blockchain can also be used to process payments related to the contract. This can be particularly useful in cases where the contract involves regular payments or where the amount of payment is dependent on certain conditions being met. The blockchain can automatically process these payments when the conditions are met, reducing the need for manual intervention and the risk of non-payment. -- **Smartification of Traditional Contracts:** While the contract itself may be a traditional contract, the use of the blockchain allows for certain aspects of the contract to be automated. For example, payments can be automatically triggered when certain conditions are met. This can make the contract more efficient and reduce the potential for disputes. +- **Efficiency and Speed:** The Liberland Blockchain Judiciary system offers a Simple Process for dispute resolution. If a dispute arises, Alice or Bob can trigger the judge to give a binding opinion. This process is quicker and cheaper than traditional legal systems, potentially resolving disputes within a few days. +- **Cost-Effectiveness:** The system is designed to be cheaper than traditional legal systems. The costs are defined upfront and include the judge's fees and any potential award to the victorious party, offering transparency and predictability of costs. +- **Security and Trust:** Blockchain provides a secure and immutable record of the contract and dispute resolution proceedings. This increases trust and reduces the risk of fraudulent claims. +- **Payment Processing:** The blockchain can be used to process payments related to the contract. This is useful in cases where the contract involves regular payments or where the amount depends on certain conditions being met. The blockchain can automatically process these payments when the conditions are met, removing manual intervention and the risk of non-payment. +- **Smartification of Traditional Contracts:** While the contract itself may be a traditional contract, the use of the blockchain allows for parts of the contract to be automated. For example, payments can be automatically triggered when certain conditions are met. This makes the contract more efficient and reduces the potential for disputes. - **Functionality:** Advisory Option in State Administration Beyond dispute resolution and advisory opinions, we plan to extend the use of this system to other areas, such as Administrative Decisions on-chain. @@ -133,18 +146,23 @@ Afterward, they would create a brief report on the results and a more detailed r This is not an exhaustive list of potential applications for our system. We encourage other builders to explore further expansions. #### Functionality: Decentralized Registers -Along with the previous system, we can also decentralize our property register operations. The relevant Ministry would create an entry and add background information, which is generally straightforward or automated. +This system enables decentralization of property registers. + +The relevant Ministry would create an entry, whichcan be confirmed or rejected by a judge. These decisions will mostly be affirmations and are considered low-stakes/low gains games. -The Judge then makes a final Confirmation or Rejection. These decisions will mostly be affirmations. Hence they are considered low-stakes/low gains games. +Alternatively, a group of private on-chain registrars can provide concensus or different opinions on inscriptions of registered entities. -To make these games more engaging, we could utilize the Complex Advisory Opinion and establish a group of on-chain Registrars who operate the Registry instead of the Ministry. These Registrars could even propose different opinions on what to inscribe, making the games about these matters more interesting. ### Ecosystem Fit - **Where and how does your project fit into the ecosystem?** -The Liberland Blockchain project fits into the Polkadot/Substrate/Kusama ecosystem as a layer 1 public blockchain that is a fork of Substrate/Polkadot. The project aims to translate traditional dispute resolution and judiciary functionalities into the digital realm, thereby introducing a new layer of trust and security to blockchain transactions. The integration of a 'court as a smart contract oracle' will enable the execution of traditional contracts on-chain, thereby expanding the scope of on-chain business activity. +The project aims to translate traditional dispute resolution and judiciary functionalities into Web3, introducing a new layer of trust and security to blockchain transactions. +The integration of a 'court as a smart contract oracle' will enable the execution of traditional contracts on-chain, expanding the scope of on-chain business activity. +The Liberland Blockchain project fits into the Polkadot/Substrate/Kusama ecosystem as a layer 1 public blockchain that is a fork of Substrate/Polkadot, that can be used directly or in parachains. -Although we deploy the system on our blockchain, it is fully open source and, ultimately, chain agnostic in the sense that you can deploy and use it yourself, under your own unique circumstances. Or just bridge to us and use it as part of Liberland's system. Additionally, the judiciary and registries pallets could be deployed as Liberland recognized, but separate private courts to provide traditional contract execution as a paracain on Polkadot and Kusama. +Although we deploy the system on our blockchain, it is fully open source and, available for anyone to use and adapt. +Or just bridge to us and use it as part of Liberland's system. +Additionally, the judiciary and registries pallets could be deployed as Liberland recognized, but separate private courts to provide traditional contract execution as a parachain on Polkadot and Kusama. - **Who is your target audience (parachain/dapp/wallet/UI developers, designers, your own user base, some dapp's userbase, yourself)?** @@ -152,9 +170,9 @@ The target audience for the Liberland Blockchain project includes developers, de - **What need(s) does your project meet?** -The Liberland Blockchain project meets the need for a blockchain-compatible solution that translates traditional dispute resolution and judiciary functionalities into the digital realm. It provides a system that synergizes the virtues of centralized and decentralized models, allowing for the execution of traditional contracts on-chain and facilitating enforcement of traditional contract agreements. It also introduces a hybrid entity that is both central and decentralized, capable of interpreting intent behind actions within the blockchain and regulating transactions, especially in situations where malicious or bad faith intentions are identified. +The Liberland Blockchain project meets the need for a blockchain-compatible solution that translates traditional dispute resolution and judiciary functionalities into Web3. It provides a system that synergizes the virtues of centralized and decentralized models, allowing for the execution of traditional contracts on-chain and facilitating enforcement of traditional contract agreements. It also introduces a entity capable of interpreting intent behind actions within the blockchain and regulating transactions, especially in situations where malicious or bad faith intentions are identified. -In addition, but no less in importance, it is the judiciary of the country of Liberland, fulfiling one part of the liberlander ambition to attain statehood, namely, to be able to appoint judges and to resolve cases of those who wish to live under Liberland's jurisdiction. +In addition, it is the judiciary of the country of Liberland, fulfiling one part of the liberlander ambition to attain statehood, namely, to be able to appoint judges and to resolve cases of those who wish to live under Liberland' jurisdiction. - **Are there any other projects similar to yours in the Substrate / Polkadot / Kusama ecosystem?** - **If so, how is your project different?** @@ -168,7 +186,7 @@ Upon a comprehensive review of the solutions currently available within the Polk In light of these observations, we believe that our solution does not compete with either the SaaS3 Court or the DOT Marketplace. Instead, we see potential opportunities for collaboration with these initiatives. Our unique approach to providing a comprehensive legal framework on the blockchain sets us apart and positions us to address a distinct set of challenges and needs within the Polkadot Ecosystem. -As of the time of writing, there are no known projects within the Substrate/Polkadot/Kusama ecosystem that offer the same combination of features as the Liberland Blockchain project. First, we are the first country to run its government (and judiciary) on the blockchain. But besides that, the unique aspect of this project is the integration of a 'court as a smart contract oracle' that enables the execution of traditional contracts on-chain and the introduction of a hybrid entity that is both central and decentralized, capable of interpreting intent behind actions within the blockchain. The entire world of traditional contracts is currently barred entry into the blockchain world, and we are attempting to forge a key allowing that huge, majority part of the world economy to come into the Polkadot ecosystem. +As of the time of writing, there are no known projects within the Substrate/Polkadot/Kusama ecosystem that offer the same combination of features as the Liberland Blockchain project. We are the first country to run its government (and judiciary) on the blockchain. But besides that, the unique aspect of this project is the integration of a 'court as a smart contract oracle' that enables the execution of traditional contracts on-chain and the introduction of a entity capable of interpreting intent behind actions within the blockchain. The entire world of traditional contracts is currently barred entry into the blockchain world, and we are attempting to forge a key allowing that huge, majority part of the world economy to come into the Polkadot ecosystem. ## Team :busts_in_silhouette: @@ -190,7 +208,7 @@ As of the time of writing, there are no known projects within the Substrate/Polk ### Team's experience -Our team has extensive experience in developing blockchain solutions. We have been working on the Liberland Blockchain, a layer 1 public blockchain owned by coin and token holders. All team members individually have 7+ years of software engineering experience with 1+ years experience with blockchain technologies, primarily Substrate, Rust and Solidity. The codebase is a fork of Substrate/Polkadot, and the license is MIT, the same as Bitcoin. Liberland does not claim ownership of the blockchain or related materials. +Our team has extensive experience in developing blockchain solutions. We have been working on the Liberland Blockchain, a layer 1 public blockchain owned by coin and token holders. All team members individually have 7+ years of software engineering experience with 1+ years experience with blockchain technologies, primarily Substrate, Rust and Solidity. ### Team Code Repos From af673bab2c27b389706c2ca8457c4168b71a6a95 Mon Sep 17 00:00:00 2001 From: DJStern Date: Tue, 12 Mar 2024 16:43:06 +0100 Subject: [PATCH 2/4] Update grant --- applications/Liberland_judiciary.md | 312 ++++++++++++++++------------ 1 file changed, 182 insertions(+), 130 deletions(-) diff --git a/applications/Liberland_judiciary.md b/applications/Liberland_judiciary.md index 751bde9a73f..427e0986be1 100644 --- a/applications/Liberland_judiciary.md +++ b/applications/Liberland_judiciary.md @@ -12,165 +12,215 @@ Follow-up on Liberland Grant Application [pull request: Create liberland #831; a We are Liberland, the world's freest country. Currently, we are settling the physical land and developing our blockchain. -Liberland Blockchain is a sovereign blockchain owned by token holders, founded and supported by Liberland which provides the first set of use cases. The codebase is a fork of Substrate/Polkadot, with MIT license. Liberland does not claim ownership of the blockchain or related materials. +Liberland Blockchain is a sovereign blockchain founded and supported by Liberland which provides the first set of use cases. The codebase is a fork of Substrate/Polkadot, with MIT license. Liberland does not claim ownership of the blockchain or related materials. Functionalities such as trading and DeFi projects are permissionless by default while some critical functionalities such as country politics are permissioned and require KYC. The next blockchain milestone is translating traditional contract, dispute resolution and judiciary functionalities into the Web3 realm, synergizing the virtues of centralized and decentralized models. -This milestone implements the quintessential element of all governance systems - the judiciary. We seek to enable dispute resolution and advisory opinions to take place within this blockchain ecosystem. +This milestone implements the quintessential element of all governance systems - the judiciary. We seek to enable dispute resolution within this blockchain ecosystem. ### Overview #### Project Overview -The Liberland Judiciary is designed to develop an on-chain system capable of acting on behalf of a party without their explicit permission in pre-approved ways with mutual consent given in advance. +The Liberland Judiciary is developing an on-chain system capable of acting on behalf of a party without their explicit permission in pre-determined ways with mutual consent given in advance. -- Facilitate the integration of a 'court as a smart contract oracle', thereby enabling the execution of traditional, verbose contracts on-chain. This system allows for the imposition of sanctions as dictated by the applicable law and the contract itself in the event of a dispute. - -- Implement norms or laws to regulate the system's operations, thereby eliminating arbitrary decisions and enhancing trust. -- Guarantee decentralization and security while ensuring that the system is operated by professionals who uphold the quality of decisions. -- Retain recognizability by resembling a traditional courtroom rather than a streamlined IT service app. +While cryptocurrencies have successfully managed to build a parallel financial system, other uses of the technology remain rare +because its hard to represent the real world or enforce contracts onchain. +This anarchic decentralization is at the same time a great benefit but also a big limitation of blockchain technology. + +This limitation needs to be solved in order to run a country on the blockchain. + +Liberland solves this through courts acting as on-chain oracles providing data and judgements to contracts. + +Everything in Liberland is done through contracts. While 'a social contract' is forced and implied in other countries, +it is explicit and voluntary in Liberland. + + - A citizen is a person who signed and fulfills the criteria for a 'citizenship contract', +which gives voting rights to the citizen but also allows courts to punish the citizen for breaking the law. + + - A Liberland company is an entity that has signed and fulfills the criteria for a 'company contract' which gives it +the rights and protections of the Liberland ecosystem, which can be taken away and company closed for breaking the law. + + - Any custom contract with conditions that cannot be tokenized, for example onchain health insurance contracts. + +Judiciary is capable of interpreting intent behind actions within the blockchain. +Empowered to enforce contracts, this entity exercises authority particularly in situations where malicious or bad faith intentions are identified. +By introducing a virtual judiciary, questionable actions can be evaluated and, if necessary, nullified. + +This architecture enhances the breadth of on-chain business activity, +facilitating enforcement of traditional contract agreements and enabling partial algorithmic execution. +In effect, this approach instills confidence that transactions, whether off-chain or on-chain, offline or online, will be enforced. +It offers an authoritative entity to resolve any disputes arising from the obligations agreed upon by the parties involved. + +- Develop a 'court as a smart contract oracle' system to enable execution of traditional verbose contracts on-chain. This allows the imposition of sanctions as dictated by law or the contract itself in the event of a dispute. +- Implement norms, laws and contract templates to regulate the system's operations and promote good practices. +- Retain recognizable courtroom processes. +- Develop a market for judges and attorneys, and seed it with professionals ready to be hired. +- Enable traditional businesses to operate on-chain. +- Use the system for criminal cases in Liberland. -The solution we propose introduces a hybrid entity, central yet decentralized, capable of interpreting intent behind actions within the blockchain. Empowered to regulate transactions by reversing or counteracting them, this entity exercises authority particularly in situations where malicious or bad faith intentions are identified. By introducing a virtual judiciary, any questionable actions can be evaluated and, if necessary, nullified. -This architecture enhances the breadth of on-chain business activity, facilitating enforcement of traditional contract agreements and enabling partial algorithmic execution. In effect, this approach instills confidence that transactions, whether off-chain or on-chain, offline or online, will be enforced. Additionally, it offers an authoritative entity to resolve any disputes arising from the obligations agreed upon by the parties involved. - -#### Project Ecosystem Fit -The integration of a 'court as a smart contract oracle' will enable the execution of traditional, worded contracts on-chain, thereby expanding the scope of on-chain business activity. -By translating traditional dispute resolution and judiciary functionalities into Web3, it will introduce a new layer of trust and security to blockchain transactions. -The Liberland Blockchain will be a significant addition to the Polkadot ecosystem as our pallets and practices can be used directly or in other parachains. ### Project Details -#### Simple Process -##### Outline -The Simple process is employed when all involved parties reach a consensus on selecting judges to preside over their case. The selection can be explicit (naming a specific judge) or implicit ("letting the system decide"). within given parameters (such as cost, experience level, etc.) for judge selection. - -The Simple process is designed to be quick and cost-effective. - -##### Mediation -The appointed judge segments the case into portions, drafting a mediation solution for each. This proposed solution is presented to the involved parties. -If an agreement is reached, the process concludes without litigation, and the judge is paid. - -##### Litigation - -When mutual agreement is not achieved, the judge drafts a mediation solution and presents it to the involved parties. -If an agreement is reached, -> the litigation process is averted, -> with the judge remunerated a flat fee that is lower than the tariff payable when Complex Process is used. - -#### Complex Process -##### Outline -The Complex Process is used when the parties cannot agree on the choice of a judge or other terms. An agreement on jurisdiction must be pre-established for any process to occur. In such circumstances, the system adapts to assign three judges: -- The attorney representing the applicant, -- The attorney representing the respondent, and -- An arbitrator jointly selected by the two attorneys. - -The Complex Process is designed to handle intricate issues requiring detailed attention and processual protections for the parties involved while maintaining balance between swiftness and the demands of judicature. -Ultimately, the criminal process of Liberland will adopt the framework of the Complex Process. - -##### Mediation -1. Party A alleges that Party B has violated the rules (Contract or law). In a smart contract, this is done by triggering a function on the contract which activates 'litigation mode' until the process is resolved -2. Party A selects Attorney A from the available roster, agrees to their terms, and pays collateral plus a transaction fee. -3. Party B is notified and selects Attorney B. -4. Party A and Attorney A compile and submit a Case. -5. Party B and Attorney B compile and submit a Response. -6. The Attorneys meet to create a Compromise, dividing the Case into parts and seeking resolution without litigation where possible. -7. Resolved parts of the Case are executed. -8. The unresolved parts proceed to Litigation. - -##### Litigation -1. Attorneys mutually select a third Judge (the Arbitrator). -2. The Arbitrator delivers a Judgement, analyzing the Application and Response according to Liberland law and relevant contract, resulting in statements of "Party X pays to Party Y," backed by a rationale. -3. If the Parties accept, the judgment is executed. If a Party rejects, the Party pays the appeals fee, and an appeal process commences. - -#### Appeal -##### Outline -An appeal can ensue after the litigation process, unless the parties agreed in advance to forego the possibility of appeal, which is anticipated to be common in the Simple process. -Appeal is initiated on request, which questions the litigation verdict. -Appeal must be paid for by the party initiating it. - -##### Steps of an Appeal -1. An Appeal Judge is appointed by the algorithm. -2. The Appeal Judge examines the appeal points and formulates an Appeal Verdict. -3. The final Verdict is executed on the Collateral. - -#### Functionality: Advisory Opinion -If a party wishes to obtain the Court's opinion on a particular matter in the absence of a dispute, the system offers two types of Advisory Opinions: - -**Simple Advisory Opinion:** A yes/no binary question. The party formulates the question, provides reasoning, pays a fee, and presents the question to the Judge. They then wait for the Judge's decision and can either accept or reject it. If they reject it, they can pay an additional fee to re-run the game up to three times to view the opinions of three different Juries. -**Complex Advisory Opinion:** The party pays a higher fee, formulates a complex question, and chooses a Judge. The Judge then formulates the Opinion on the points of the question. The party waits for the Judge's decision and either accepts or rejects it, paying an additional fee to re-run the game up to three times if they choose to reject it. +#### Hybrid Contracts + +Major part of the project is refactoring current functionality into contracts that can be opted in and out of. + +These are hybrid contracts, part code where code is law and part traditional text contract where law is law. + +Hybrid Contracts need to + - Keep smart contract functionalities + - Handle real-world data + - Handle traditional contract clauses (text) + - Choose jurisdiction + - Handle disputes + - Enforce code and text 'clauses' + + +Components of a hybrid contract + - Self executing (smart) clauses + - Traditional text clauses + - jurisdiction when in dispute mode + - Parties that signed the contract + - Change in behaviour when in dispute mode + - Execution when in dispute mode + - Cancellation clause + - Collateral (can be another contract) + +Note that these contracts can basically be anything, we just outline the most common ones used in Liberland. + +##### Example - citizenship contract + +A citizen in Liberland is a person who signed and fulfills the criteria of the 'Citizenship contract' + +To qualify, one needs to stake at least 5000LLM (which can act as collateral), be approved (KYCd) by the Ministry of Interior and follow the laws of Liberland. + +If the conditions are met and contract is signed, the citizen gains the right to + - run a validator + - participate in politics + - veto legislation + - obtain a Liberland passport + - Account recovery (optional) + +Some of these rights are conditional while some are permanent. + +For example. if the citizen falls under 5000 staked LLM, the right to apply for congress is lost, but the right to use the passport is not affected. + +The condition for 5000 LLM and the corresponding political rights are handled programmatically. + +Other conditions however are handled by humans. + +Since the citizenship contract is under the jurisdiction of Liberland, courts are given pre-defined execution power when in dispute mode. + +If the citizen is accused of breaking the law, the contract enters 'dispute mode'. +If the court finds the citizen guilty, they may decide to order the citizen to pay for the damages. If the citizen cannot pay, the contract allows the court to unstake the citizens LLM to cover the costs. + +If for example the citizen was proven to be hacking the validator, the right to run a validator might be taken away. + +##### TODO Example - Managed staking company +##### TODO Example - Other company example + +#### Default 'dispute mode' + +In general, if all the parties of the contract agree to execute some contract clause, the contract will allow it. + +However, dispute mode can be triggered by a party. In a dispute mode, the contract can change behaviour and gives execution power to the judge. + +For example, if the contract was normally making payments every month, dispute mode may stop this until the judge or the parties resolve the dispute. + +A judge needs to be defined, either pre-defined in the contract or appointed with agreement by both parties. + +After the off-chain judicial process, the judge then executes the decisions on the contract. + +In most cases, the services of the judge will need to be paid for. + +##### Default Dispute Process + +When all parties reach a consensus on selecting a judge the dispute can continue. The judge is ideally pre-defined in the contract itself. + +The judge selection can be explicit (specific judge) or implicit ("letting the system decide"). +For example, a contract can say that any judge in Liberland(or German, or US etc...) jurisdiction or a specific private court can take the case. +In that case the legal organization selects the judge to handle the dispute. + +The process is designed to be quick and cost-effective, happens off chain, and only the final decision is recorded on-chain. + +Depending on the judge and jurisdiction, the details of the judicial process may vary and are irrelevant for this grant. + + +##### Appeal + +The default contract waits a period of time until the judges decision about a dispute are executed. +This allows to trigger the appeal process which happens in the backup jurisdiction at the expense of the appealer. + #### Enactment of Awards + +As part of dispute resolution, one party might have to pay the other. In addition, the judges have to be paid for their services. + ##### The Optimal Circumstance -A contract or a case has suffiient collateral to cover any additional payments in the final verdict and the court costs. In this scenario, the collateral is used for the execution of the judgement. A third party, like an insurance company may handle collateral. +A contract or a case has sufficient collateral to cover any additional payments in the final verdict and the court costs. +In this scenario, the collateral is used for the execution of the judgement. +A third party, like an insurance company may handle collateral in which case the collateral provider might be a different contract in itself with its own rules. ##### Case with Insufficient Collateral ###### Seizing politipooled LLM -The judge has the authority to designate an individual's politipooled (staked) LLM as collateral, triggering involuntary unpooling of the owing party's pooled LLM. - -However, under circumstances where - -- there is a violation of the Non-Aggression Principle, implicating aggressive conduct against persons or property, or -- the damage incurred exceeds one's LLM stash, - -the offender's LLM balance could turn negative, resulting in their listing on Liberland's 'wanted' roster, rendering them a 'persona non grata'. Consequently, they lose their voting rights and potentially access to other Liberland services until the owed amount is fully settled. +If an individual's staked LLM is collateral, involuntary unstaking of the owing party's staked LLM will be triggered as defined in the citizenship contract. ###### Enforcement Beyond the Chain In instances where aforementioned methods cannot enforce the judgement, the awarded sum will be incorporated into a conventional contract or appended as a supplement if the dispute is contract-related. This contract, endorsed by both parties, holds legitimacy outside of Liberland, akin to any other contract. It can be presented to an enforcement agency for execution, even against the unwilling party's resistance. Note that this is just an explanation of the process and doesn't represent a deliverable for the grant. -#### Functionality: Traditional Contracts -##### Overview -Most contractual relationships in the world aren't simple and predictable enough to be run on smart contracts. -Dumb/traditional contracts, are what runs the world of business and everyday life made in an agreement with another humans under juridistictions of nation states. +#### Edge Cases + +##### Unresponsive judge +If the judge is unresponsive for a long period of time, the backup jurisdiction is activated. +If there is no backup, the dispute can only be resolved by both parties agreeing (signing the same transaction) on the contract -We aim to translate these traditional contracts into Web3. +#### Marketplace of judges and jurisdictions -How will it work? Alice and Bob enter into a traditional contract for the sale of goods. They agree to use the Liberland Blockchain Judiciary system for any potential disputes. -They choose a judge from the roster and agree on the collateral and fees. The contract is recorded on the blockchain. +We will build a registry system for jurisdictions and judges so that contracts can easily search for the right one +based on parameters such as location, reputation, experience, cost etc. -##### Benefits: -- **Efficiency and Speed:** The Liberland Blockchain Judiciary system offers a Simple Process for dispute resolution. If a dispute arises, Alice or Bob can trigger the judge to give a binding opinion. This process is quicker and cheaper than traditional legal systems, potentially resolving disputes within a few days. -- **Cost-Effectiveness:** The system is designed to be cheaper than traditional legal systems. The costs are defined upfront and include the judge's fees and any potential award to the victorious party, offering transparency and predictability of costs. -- **Security and Trust:** Blockchain provides a secure and immutable record of the contract and dispute resolution proceedings. This increases trust and reduces the risk of fraudulent claims. -- **Payment Processing:** The blockchain can be used to process payments related to the contract. This is useful in cases where the contract involves regular payments or where the amount depends on certain conditions being met. The blockchain can automatically process these payments when the conditions are met, removing manual intervention and the risk of non-payment. -- **Smartification of Traditional Contracts:** While the contract itself may be a traditional contract, the use of the blockchain allows for parts of the contract to be automated. For example, payments can be automatically triggered when certain conditions are met. This makes the contract more efficient and reduces the potential for disputes. -- **Functionality:** Advisory Option in State Administration -Beyond dispute resolution and advisory opinions, we plan to extend the use of this system to other areas, such as Administrative Decisions on-chain. +While Liberland will maintain its own registry, the system is decentralized so anyone can start their own. -For example, the process of granting or denying citizenship could be complemented with our decentralized system. The Ministry of Internal Affairs, Citizenship Agency would work with the Citizen applicant through steps such as proof of commitment (locked stake), KYC, and Citizenship Interview. -Afterward, they would create a brief report on the results and a more detailed report on the applicant's background. The Judge would then Confirm or Reject the applicant. A Confirmed applicant becomes a Citizen, while a Rejected one must wait one year before re-applying. +#### Contract builder -This is not an exhaustive list of potential applications for our system. We encourage other builders to explore further expansions. +To expand the usage we will build an easy to use contract builder that suggests best practices and allows adding pre-built clauses. -#### Functionality: Decentralized Registers -This system enables decentralization of property registers. +For example, jurisdiction clause, monthly payment if no dispute clause, cancellation clause, insurance provider clause and so on. -The relevant Ministry would create an entry, whichcan be confirmed or rejected by a judge. These decisions will mostly be affirmations and are considered low-stakes/low gains games. +There are 90+ businesses in Liberland and the exact implementation details of the contract builder will be discovered in the process of migrating them on-chain. -Alternatively, a group of private on-chain registrars can provide concensus or different opinions on inscriptions of registered entities. ### Ecosystem Fit -- **Where and how does your project fit into the ecosystem?** +#### Project Ecosystem Fit + -The project aims to translate traditional dispute resolution and judiciary functionalities into Web3, introducing a new layer of trust and security to blockchain transactions. -The integration of a 'court as a smart contract oracle' will enable the execution of traditional contracts on-chain, expanding the scope of on-chain business activity. -The Liberland Blockchain project fits into the Polkadot/Substrate/Kusama ecosystem as a layer 1 public blockchain that is a fork of Substrate/Polkadot, that can be used directly or in parachains. +- **Where and how does your project fit into the ecosystem?** -Although we deploy the system on our blockchain, it is fully open source and, available for anyone to use and adapt. -Or just bridge to us and use it as part of Liberland's system. -Additionally, the judiciary and registries pallets could be deployed as Liberland recognized, but separate private courts to provide traditional contract execution as a parachain on Polkadot and Kusama. +The integration of a 'court as a smart contract oracle' will enable the execution of traditional, worded contracts on-chain, +thereby expanding the scope of on-chain business activity. +By translating traditional dispute resolution and judiciary functionalities into Web3, it will introduce a new layer of trust and security to blockchain transactions. +The Liberland Blockchain will be a significant addition to the Polkadot ecosystem as our pallets and practices can be used directly or in other parachains, +allowing more organizations to operate and do business using the polkadot ecosystem. We are connected to the dotsama ecosystem through SORA. - **Who is your target audience (parachain/dapp/wallet/UI developers, designers, your own user base, some dapp's userbase, yourself)?** -The target audience for the Liberland Blockchain project includes developers, designers, and users of the Liberland Blockchain, as well as developers and users of other parachains, dapps, wallets, and UIs within the Polkadot/Substrate/Kusama ecosystem. The project also targets individuals and organizations interested in utilizing blockchain technology for dispute resolution, judiciary, traditional contract and company/asset management functionalities. +Liberland justice system, Liberland entrepreneurs, anyone else who wants to run complex contracts and dispute resolution on chain + - **What need(s) does your project meet?** -The Liberland Blockchain project meets the need for a blockchain-compatible solution that translates traditional dispute resolution and judiciary functionalities into Web3. It provides a system that synergizes the virtues of centralized and decentralized models, allowing for the execution of traditional contracts on-chain and facilitating enforcement of traditional contract agreements. It also introduces a entity capable of interpreting intent behind actions within the blockchain and regulating transactions, especially in situations where malicious or bad faith intentions are identified. +Traditional dispute resolution, judiciary and traditional business functionalities in Web3. +It allows the execution of traditional contracts on-chain and facilitating enforcement of traditional contract agreements. +It introduces a entity capable of interpreting intent behind actions within the blockchain and regulating transactions, +especially in situations where malicious or bad faith intentions are identified. In addition, it is the judiciary of the country of Liberland, fulfiling one part of the liberlander ambition to attain statehood, namely, to be able to appoint judges and to resolve cases of those who wish to live under Liberland' jurisdiction. @@ -188,6 +238,7 @@ In light of these observations, we believe that our solution does not compete wi As of the time of writing, there are no known projects within the Substrate/Polkadot/Kusama ecosystem that offer the same combination of features as the Liberland Blockchain project. We are the first country to run its government (and judiciary) on the blockchain. But besides that, the unique aspect of this project is the integration of a 'court as a smart contract oracle' that enables the execution of traditional contracts on-chain and the introduction of a entity capable of interpreting intent behind actions within the blockchain. The entire world of traditional contracts is currently barred entry into the blockchain world, and we are attempting to forge a key allowing that huge, majority part of the world economy to come into the Polkadot ecosystem. + ## Team :busts_in_silhouette: ### Team members @@ -264,15 +315,14 @@ This article discusses how cryptocurrency is being dealt with in family court ca | Number | Deliverable | Specification | | -----: | ----------- | ------------- | | **0a.** | License | MIT | -| **0b.** | Documentation | We will provide both **inline documentation** of the code and a basic **tutorial** that explains how a user can (for example) spin up one of our Substrate nodes and send test transactions, which will show how the new functionality works. | -| **0c.** | Testing and Testing Guide | Core functions will be fully covered by comprehensive unit tests to ensure functionality and robustness. In the guide, we will describe how to run these tests. | -| **0d.** | Docker | We will provide a Dockerfile(s) that can be used to test all the functionality delivered with this milestone. | -| 0e. | Article | We will publish an **article**/workshop that explains the functioning of the judiciary and its impact on the Polkadot environment | -| 1. | Substrate module: Judiciary | We will create a Substrate module that will facilitate the adjudication of cases under the Simple Process, e.g. when the parties agree on the Judge or the Judge selection method| -| 2. | Substrate module: Escrow/Collateral | We will create an Escrow solution which will also be useable in the judiciary, as explained above | -| 3. | Substrate module: Traditional Contracts | The Traditional Contracts Substrate module will enable users to turn traditional contracts into smart contracts by attaching collateral to them and the algorithmic power of each party to click on "dispute" and activate the Judiciary module | -| 4. | Substrate chain | Module Traditional Contracts will enable parties to agree to be adjudicated using the Judiciary Module, covering the court costs and the contract using the Escrow/Collateral module) | -| 5. | Frontend| We will deliver a basic frontend to operate the new substrate modules | +| **0b.** | Documentation | **Inline documentation** of the code and a **tutorial** to spin up a Liberland nodes and test how the new functionality works. | +| **0c.** | Testing and Testing Guide | Unit tests and testing guide. | +| **0d.** | Docker | Dockerfile(s) that can be used to test the functionality in this milestone. | +| 0e. | Article | Publish an **article**/workshop that explains the functioning of the judiciary and its impact on the Polkadot environment | +| 1. | Substrate: Simple judiciary | Traditional plaintext contracts on chain that can be signed by parties and registered judges | +| 2. | Substrate: Hybrid contracts | Expanding smart contract solutions to support plaintext clauses, courts as oracles, work with other pallets such as LLM | +| 3. | Substrate: Default contracts | Develop default contracts for common business, rental and insurance uses | +| 4. | Frontend| We will deliver a basic frontend to operate the new substrate modules | ### Milestone 2 Example — Additional features @@ -284,15 +334,14 @@ This article discusses how cryptocurrency is being dealt with in family court ca | Number | Deliverable | Specification | | -----: | ----------- | ------------- | | **0a.** | License | MIT | -| **0b.** | Documentation | We will provide both **inline documentation** of the code and a basic **tutorial** that explains how a user can (for example) spin up one of our Substrate nodes and send test transactions, which will show how the new functionality works. | -| **0c.** | Testing and Testing Guide | Core functions will be fully covered by comprehensive unit tests to ensure functionality and robustness. In the guide, we will describe how to run these tests. | -| **0d.** | Docker | We will provide a Dockerfile(s) that can be used to test all the functionality delivered with this milestone. | -| 1. | Substrate module: Advanced Judiciary | We will create a Substrate module that will facilitate the adjudication of cases where the parties can't agree on anything more than having their case adjudicated in Liberland| -| 2. | Substrate module: Judiciary Market | We will create a module that gathers on-chain data to facilitate the operation of the marketplace of judges | -| 3. | Substrate module: Insurance | The Insurance Substrate module will enable users registered as insurers to pay collateral for others and to receive compensation based on a smart contract | -| 4. | Substrate chain | Modules X, Y & Z of our custom chain will interact in such a way... (Please describe the deliverable here as detailed as possible) | -| 5. | Frontend| Judiciary Marketplace and Insurance frontend | -| 6. | Smart contracts: ... | We will setup smart contract templates for judiciary and insurance contracts. +| **0b.** | Documentation | **Inline documentation** of the code and a **tutorial** to spin up a Liberland nodes and test how the new functionality works. | +| **0c.** | Testing and Testing Guide | Unit tests and testing guide. | +| **0d.** | Docker | Dockerfile(s) that can be used to test the functionality in this milestone. +| 1. | Contract insurace | Develop default insurance contracts that can be used as collateral provider in other contracts | +| 2. | Substrate module: Judiciary Market | Module that gathers on-chain data to facilitate the operation of the marketplace of judges to be used as judges and jurisdictions in contracts| +| 3. | Contract builder | Easy to use frontend interface to build hybrid contracts by adding pre-built smart and traditional clauses, define jurisdictions, handle collateral, handle dispute mode etc. | +| 4. | Contract dispute appeals and edge cases| Develop default contract clauses that handle appeals and edge cases when in dispute mode | +| 5. | Frontend| Judiciary Marketplace, Insurance and contract builder frontend | ## Future Plans @@ -305,12 +354,15 @@ This article discusses how cryptocurrency is being dealt with in family court ca - After the success of our first Liberland Blockchain/ Polkadot conference, we will keep organizing more. ### Judiciary development future plans -- Easy to use contract builder frondend that deploys a hybrid smart/traditional contract with defined juridistictions +- Upgrade contract builder frondend that deploys a hybrid smart/traditional contract with defined juridistictions - Upgrade escrow functionality to adapt for use with insurance companies, allowing partial escrow etc - Integration with the company, land and asset registry pallets to allow full legal support for on chain assets - Setup default company hybrid contracts to support shareholders in preparation for the Liberland stock market - Bridge more tokens so that contracts can support BTC, USDT, ETH, DOT etc... - Instantiate a new chain with these functionalities as a parachain on Polkadot/Kusama +- Citizenship and e-resident contracts +- Delict law support + ## Additional Information :heavy_plus_sign: From b8ef93cb85a1c7f22f74814475c988ad4600f84f Mon Sep 17 00:00:00 2001 From: DJStern Date: Thu, 21 Mar 2024 13:17:57 +0100 Subject: [PATCH 3/4] Add example clauses --- applications/Liberland_judiciary.md | 71 +++++++++++++++++++++++++++-- 1 file changed, 68 insertions(+), 3 deletions(-) diff --git a/applications/Liberland_judiciary.md b/applications/Liberland_judiciary.md index 427e0986be1..1714221b39e 100644 --- a/applications/Liberland_judiciary.md +++ b/applications/Liberland_judiciary.md @@ -71,6 +71,10 @@ Major part of the project is refactoring current functionality into contracts th These are hybrid contracts, part code where code is law and part traditional text contract where law is law. +The intention is to handle the pyhsical world in addition to web3 tokens, for example with hybrid contracts to build a house +where payments and disputes are handled on chain, and the judge can be the oracle deciding if the house has been built +properly in case of dispute. + Hybrid Contracts need to - Keep smart contract functionalities - Handle real-world data @@ -92,6 +96,9 @@ Components of a hybrid contract Note that these contracts can basically be anything, we just outline the most common ones used in Liberland. +##### TODO Example - Managed staking company +##### TODO Example - Other company example + ##### Example - citizenship contract A citizen in Liberland is a person who signed and fulfills the criteria of the 'Citizenship contract' @@ -120,9 +127,6 @@ If the court finds the citizen guilty, they may decide to order the citizen to p If for example the citizen was proven to be hacking the validator, the right to run a validator might be taken away. -##### TODO Example - Managed staking company -##### TODO Example - Other company example - #### Default 'dispute mode' In general, if all the parties of the contract agree to execute some contract clause, the contract will allow it. @@ -196,6 +200,67 @@ For example, jurisdiction clause, monthly payment if no dispute clause, cancella There are 90+ businesses in Liberland and the exact implementation details of the contract builder will be discovered in the process of migrating them on-chain. +##### Example clauses +###### Periodic payment clause +Intended for contracts handling employment, renting, ongoing services, memberships etc... + +Tokens from party A will go to party B every time period (week, month, X number of blocks...) +as long as the contract is not in dispute mode. +The tokens that are paid can come directly from the 'main' account of the person, which in Liberland is usually KYCd. + +###### Delict liability clause +Intended to ensure payment in case of delict/crime as part of citizenship contract. + +Staked LLM from party A can be unstaked for the benefit of party B, triggerable only by Liberland judges/courts. + +###### Insurance provider clause +Intended to handle third party insurance providers and guarantors. + +In case a payment needs to be made from party A to party B, and the party A is unable to pay, insurance wallet C will +automatically pay. + +Insurance wallet C can be insurance provider to many contracts and be liable for much more than its wallet balance. +Choosing reliable insurance providers is important. + +###### Traditional plaintext clause +Intended to handle real world conditions. + +Traditional plaintext clause contains text representing traditional human contract clauses relating to the real world such as + - The house will be built + - The rented car must be returned undamaged + - Employee must come to work every day + - Murder is illegal + +###### Variables tracking clause +Some clauses rely on data that needs to be inputted and behave differently based on that data/variables. + +For example, some project has milestones and some clause is triggered on each milestone, or + +employee can skip coming to work 10 days in a year without penalty, so every time this happens it can be recorded on the contract or + +as part of apartment rental contract, the utility costs vary so exact payment amount changes every month. + +Parties can change this data, but a dispute mode can be triggered if the parties disagree about the change. + +###### Pallet and assets integration +Contracts may interact with other assets and pallets. + +Payment can be made in assets from the assets pallet. + +Companies can trigger payout of profits that goes to wallets proportionally based on held stock. + +###### Jurisdiction clause +Intended to handle jurisdiction/judge selection. + +In case of dispute, the defined judge/court gets execution power over certain clauses instead of the parties themselves. + +###### Trigger dispute clause +Intended to handle triggering dispute mode and start the judicial process. + +Disputes can be triggered either manually or when some algorithmic clause fails (for example payment isnt made). +It is possible to dispute only specific clauses and not the entire contract. +When in dispute mode, some clauses behave differently. Dispute can be resolved either by both parties agreeing to resolve it +or by the defined judge. ### Ecosystem Fit From 59f45c94488673f29fc340f80d928ad2f8c62713 Mon Sep 17 00:00:00 2001 From: DJStern Date: Wed, 27 Mar 2024 22:58:22 +0100 Subject: [PATCH 4/4] add contract integration --- applications/Liberland_judiciary.md | 58 +++++++++++++++++++++++++++-- 1 file changed, 54 insertions(+), 4 deletions(-) diff --git a/applications/Liberland_judiciary.md b/applications/Liberland_judiciary.md index 1714221b39e..a7549ef9601 100644 --- a/applications/Liberland_judiciary.md +++ b/applications/Liberland_judiciary.md @@ -96,9 +96,6 @@ Components of a hybrid contract Note that these contracts can basically be anything, we just outline the most common ones used in Liberland. -##### TODO Example - Managed staking company -##### TODO Example - Other company example - ##### Example - citizenship contract A citizen in Liberland is a person who signed and fulfills the criteria of the 'Citizenship contract' @@ -262,6 +259,58 @@ It is possible to dispute only specific clauses and not the entire contract. When in dispute mode, some clauses behave differently. Dispute can be resolved either by both parties agreeing to resolve it or by the defined judge. +### Technical Integration with other pallets + +#### Option 1: runtime asks contract what to do +Quick but intermediary solution +Instead of originating actions from the contract, we can originate from the runtime. Pallet then asks contract what should happen and executes. + +For example. We define a set of methods: + +```rust +enum RuntimeAction { + Transfer(NativeOrAssetId, AccountId, AccountId, Balance), + TransferWithInsuranceFallback(NativeOrAssetId, AccountId, AccountId, AccountId, Balance), + SlashStakedLLM(AccountId, AccountId, Balance) +} +``` + +Then instead of calling the smart-contract directly, judge calls pallet-contracts-registry. +Contracts registry asks the smart-contract what to do, does some checks (whether the action is for contract signer) and executes it. + +Upsides: +* No chain extensions +* Info about judges, parties and signatures already present in the contracts-registry, so access control is easy +* Smart contracts will be easy to write - just import one enum and return specific variant from a function. + +Downsides: +* Smart contracts still won't be able to access any citizenship/llm/assets info, nor truly own assets, +so it's not possible for other people to innovate with stuff like DAOs or DeFi. + + +#### Option 2: chain extension(s) + +The alleged security problem with current assets chain extensions is that smart-contracts can do anything in the assets pallet on behalf of whoever called the smart contract. +But it doesn't have to be that way - we can simply restrict the chain extension to be only able to act on behalf of the contract. +So we'd develop 2 Chain Extensions: +1. Safe Assets Chain extension, which allows contracts to receive and transfer arbitrary pallet-assets, +but only those owned by them (or explicitly preapproved in assets pallet) +2. Liberland extension, which: + * provides current info about staked LLM (& maybe identity & registries in the future) + * allows slashing staked LLM + * allows taking LLD & assets directly from someone elses account + + +Upsides: +* Flexible - allows arbitrary smart contracts to actually hold and manage assets. Opens lots of possibilities. + +Downsides: +* Encoding/decoding all data passed between contracts and runtime must be done manually, there're 3 layers in between, it's much harder to get security right, +* Smart contracts that use Chain Extensions are PITA to implement, +* Will take much longer to implement. +* The Liberland Chain Extension will need some additional layer of integration with contracts-registry, +to make sure that whatever contract is trying to do is done to someone that actually signed the contract. + ### Ecosystem Fit #### Project Ecosystem Fit @@ -392,7 +441,7 @@ This article discusses how cryptocurrency is being dealt with in family court ca ### Milestone 2 Example — Additional features -- **Estimated Duration:** 1 month +- **Estimated Duration:** 1-3 month - **FTE:** 1,5 - **Costs:** 15,000 USD @@ -407,6 +456,7 @@ This article discusses how cryptocurrency is being dealt with in family court ca | 3. | Contract builder | Easy to use frontend interface to build hybrid contracts by adding pre-built smart and traditional clauses, define jurisdictions, handle collateral, handle dispute mode etc. | | 4. | Contract dispute appeals and edge cases| Develop default contract clauses that handle appeals and edge cases when in dispute mode | | 5. | Frontend| Judiciary Marketplace, Insurance and contract builder frontend | +| 6. | Integration with other pallets| We will choose either a simple (new pallet) or proper (chain extension) integration of contracts with other pallets and implement it | ## Future Plans