├── .github └── workflows │ └── deploy-pages.yml ├── .gitignore ├── .prettierrc ├── .vscode └── settings.json ├── .yarnrc.yml ├── CNAME ├── LICENSE ├── README.md ├── babel.config.js ├── docusaurus.config.js ├── guides ├── cat │ └── cat-creation-tutorial.md ├── chialisp-concepts │ ├── condition-morphing.md │ ├── currying.md │ └── inner-puzzles.md ├── chialisp-primer │ ├── bls-signatures.md │ ├── first-smart-coin.md │ ├── intro.md │ ├── testnet-setup.md │ └── using-modules.md ├── crash-course │ ├── cats-offers-nfts.md │ ├── chialisp-and-typescript.md │ ├── chialisp.md │ ├── inner-puzzles.md │ ├── intro-to-chialisp.md │ ├── introduction.md │ ├── notes.md │ ├── signatures.md │ ├── smart-coins.md │ └── state.md ├── custody │ ├── custody_tool.mdx │ └── custody_tool_description.md ├── datalayer │ └── datalayer-user-guide.mdx ├── nft │ ├── nft-bulk-mint.mdx │ ├── nft-cli.mdx │ ├── nft-intro.mdx │ └── nft-rpc.mdx ├── simulator │ └── simulator-user-guide.mdx └── tutorials │ ├── application-structure.md │ ├── coin-spend-rpc.md │ ├── custom-puzzle-lock.md │ ├── offers-cli.md │ ├── offers-gui.md │ └── video-series │ ├── announcements-oracles.md │ ├── coin-lifecycle-and-testing.md │ ├── developing-applications.md │ ├── multiple-issuance-cat.md │ ├── programming-chialisp.md │ ├── security-arguments-signing.md │ ├── single-issuance-cat.md │ ├── singleton-contracts.md │ ├── state-coins-announcements.md │ ├── tools-and-setup.md │ └── why-chia-is-great.md ├── package.json ├── sidebars.js ├── src ├── components │ └── HomepageFeatures │ │ ├── index.js │ │ └── styles.module.css ├── css │ └── custom.css ├── pages │ ├── index.js │ └── index.module.css └── theme │ ├── prism-chialisp.js │ ├── prism-dark-theme-chialisp.js │ ├── prism-include-languages.js │ └── prism-light-theme-chialisp.js ├── static ├── .nojekyll ├── CNAME ├── files │ ├── Piggybank_Example.zip │ └── tutorials │ │ ├── 4-Securing_a_Smart_Coin_Slides-Chialisp.pdf │ │ └── Piggybank_Example.zip └── img │ ├── chia-logo-white.svg │ ├── chia-logo.svg │ ├── chia_NFT.svg │ ├── chia_leaf_green.svg │ ├── chiadevs-icon.svg │ ├── chialisp_logo.svg │ ├── coin_lifecycle_testing.png │ ├── data_layer │ ├── 01_downloads_windows.png │ ├── 02_downloads_mac.png │ ├── 03_start_chia_mac.png │ ├── 04_wallet_farming_mode.png │ ├── 05_create_private_key.png │ ├── 06_seed_phrase.png │ ├── 07_choose_key.png │ ├── 08_not_synced.png │ ├── 09_start_data.png │ ├── 10_synced.png │ ├── 11_copy_address.png │ ├── 12_send_money.png │ ├── 13_send_pending.png │ └── 14_cant_send.png │ ├── dev-guides-logo.svg │ ├── docusaurus.png │ ├── favicon.ico │ ├── logo.svg │ ├── offers_img │ ├── gui_tutorial │ │ ├── cancel │ │ │ ├── 1_actions.png │ │ │ ├── 2_cancel.png │ │ │ ├── 3_cancel_on_chain.png │ │ │ ├── 4_cancel_off_chain.png │ │ │ ├── 5_pending_cancel.png │ │ │ └── 6_cancelled.png │ │ ├── issues │ │ │ ├── 01_xch_wallet.png │ │ │ ├── 02_ckc_wallet.png │ │ │ ├── 03_100xch_for_1mckc.png │ │ │ ├── 04_100xch_for_1mckc_fail.png │ │ │ ├── 05_accept_offer.png │ │ │ ├── 06_insufficient_funds.png │ │ │ ├── 07_0.1xch_wallet.png │ │ │ ├── 08_0.25_shibe_for_0.1_xch.png │ │ │ ├── 09_accept_unknown_warning.png │ │ │ ├── 10_unknown_success.png │ │ │ ├── 11_invalid_offer.png │ │ │ ├── 12_0.1xch_wallet.png │ │ │ ├── 13_1usds_wallet.png │ │ │ ├── 14_view_offer_0.1xch_10usds.png │ │ │ ├── 15_cancel_off_chain.png │ │ │ ├── 16_canceled_off_chain.png │ │ │ ├── 17_accept_a_canceled_offer.png │ │ │ ├── 18_confirmed_canceled_offer.png │ │ │ ├── 19_0xch_wallet.png │ │ │ ├── 20_11usds_wallet.png │ │ │ ├── 21_1xch_wallet.png │ │ │ ├── 22_0usds_wallet.png │ │ │ ├── 23_pending_accept.png │ │ │ ├── 24_show_details.png │ │ │ ├── 25_one_coin.png │ │ │ ├── 26_cant_send_offer_pending.png │ │ │ ├── 27_send_0.1xch_to_self.png │ │ │ ├── 28_0.1_coin_in_offer.png │ │ │ ├── 29_0.1xch_available.png │ │ │ └── 30_send_while_offer_pending.png │ │ ├── offer_multiple_accept │ │ │ ├── 1_multiple_accept_dialog.png │ │ │ ├── 2_confirmed.png │ │ │ ├── 3_ckc_wallet.png │ │ │ └── 4_usds_wallet.png │ │ ├── offer_multiple_create │ │ │ ├── 1_plus_buttons.png │ │ │ ├── 2_save_multiple_offer.png │ │ │ └── 3_manage_multiple.png │ │ ├── offer_single_accept │ │ │ ├── 10_wallet_post_trade.png │ │ │ ├── 1_chia_wallet.png │ │ │ ├── 2_view_an_offer.png │ │ │ ├── 3_select_offer_file.png │ │ │ ├── 4_open.png │ │ │ ├── 5_accept_offer.png │ │ │ ├── 6_accept_offer.png │ │ │ ├── 7_success.png │ │ │ ├── 8_pending_confirm.png │ │ │ └── 9_confirmed.png │ │ ├── offer_single_create │ │ │ ├── 1_usds_wallet.png │ │ │ ├── 2_create_offer.png │ │ │ ├── 3_save_offer.png │ │ │ ├── 4_save_dialog.png │ │ │ ├── 5_share_offer.png │ │ │ ├── 6_share_on_offer_bin.png │ │ │ ├── 7_view_on_offer_bin.png │ │ │ └── 8_pending_accept.png │ │ ├── unknown_cat │ │ │ └── 1_unknown_cat.png │ │ └── wallet_add │ │ │ ├── 1_xch_balance.png │ │ │ ├── 2_add_usds.png │ │ │ ├── 3_adding_usds_token.png │ │ │ └── 4_two_wallets.png │ └── offers │ │ ├── 1_alice_1_xch.png │ │ ├── 2_offer_1_xch_251_ckc.png │ │ ├── 3_bob_view_xch_ckc_offer.png │ │ ├── 4_alice_251_ckc.png │ │ └── 5_bob_1_xch.png │ ├── tools_and_setup_graphic.png │ ├── undraw_docusaurus_mountain.svg │ ├── undraw_docusaurus_react.svg │ └── undraw_docusaurus_tree.svg └── yarn.lock /.github/workflows/deploy-pages.yml: -------------------------------------------------------------------------------- 1 | name: Deploy to Pages on trunk 2 | 3 | on: 4 | push: 5 | branches: 6 | - 'main' 7 | 8 | jobs: 9 | deploy: 10 | runs-on: ubuntu-latest 11 | container: node:18-alpine 12 | steps: 13 | - name: "Install deps" 14 | run: | 15 | apk add python3 make g++ git 16 | 17 | - name: Checkout Code 18 | uses: actions/checkout@v3 19 | 20 | - name: "yarn deps" 21 | run: | 22 | yarn 23 | 24 | - name: "yarn deploy" 25 | run: | 26 | git config --global user.name 'ChiaAutomation' 27 | git config --global user.email 'automation@chia.net' 28 | GIT_USER=ChiaAutomation GIT_PASS=${{ github.token }} yarn deploy 29 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Dependencies 2 | /node_modules 3 | 4 | # Production 5 | /build 6 | 7 | # Generated files 8 | .docusaurus 9 | .cache-loader 10 | 11 | # Misc 12 | .DS_Store 13 | .env.local 14 | .env.development.local 15 | .env.test.local 16 | .env.production.local 17 | .idea/* 18 | 19 | # Package managers 20 | npm-debug.log* 21 | yarn-debug.log* 22 | yarn-error.log* 23 | .yarn/* 24 | package-lock.json 25 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "useTabs": false, 3 | "tabWidth": 2, 4 | "singleQuote": true 5 | } 6 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "spellright.language": ["en"], 3 | "spellright.documentTypes": ["latex", "plaintext"] 4 | } 5 | -------------------------------------------------------------------------------- /.yarnrc.yml: -------------------------------------------------------------------------------- 1 | nodeLinker: node-modules 2 | -------------------------------------------------------------------------------- /CNAME: -------------------------------------------------------------------------------- 1 | devs.chia.net -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright 2023 Chia Network 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Website 2 | 3 | This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator. 4 | 5 | ### Installation 6 | 7 | ``` 8 | $ yarn 9 | ``` 10 | 11 | ### Local Development 12 | 13 | ``` 14 | $ yarn start 15 | ``` 16 | 17 | This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. 18 | 19 | ### Build 20 | 21 | ``` 22 | $ yarn build 23 | ``` 24 | 25 | This command generates static content into the `build` directory and can be served using any static contents hosting service. 26 | 27 | ### Deployment 28 | 29 | Using SSH: 30 | 31 | ``` 32 | $ USE_SSH=true yarn deploy 33 | ``` 34 | 35 | Not using SSH: 36 | 37 | ``` 38 | $ GIT_USER= yarn deploy 39 | ``` 40 | 41 | If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch. 42 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [require.resolve("@docusaurus/core/lib/babel/preset")], 3 | }; 4 | -------------------------------------------------------------------------------- /docusaurus.config.js: -------------------------------------------------------------------------------- 1 | const lightTheme = require('./src/theme/prism-light-theme-chialisp'); 2 | const darkTheme = require('./src/theme/prism-dark-theme-chialisp'); 3 | 4 | // @ts-check 5 | // Note: type annotations allow type checking and IDEs autocompletion 6 | 7 | /** @type {import('@docusaurus/types').Config} */ 8 | const config = { 9 | title: 'Chia Dev Guides', 10 | tagline: 'Resources for developers onboarding to Chia.', 11 | url: 'https://devs.chia.net', 12 | baseUrl: '/', 13 | onBrokenLinks: 'throw', 14 | onBrokenMarkdownLinks: 'throw', 15 | favicon: 'img/chia_leaf_green.svg', 16 | 17 | // GitHub pages deployment config. 18 | // If you aren't using GitHub pages, you don't need these. 19 | organizationName: 'Chia-Network', // Usually your GitHub org/user name. 20 | projectName: 'chia-dev-guides', // Usually your repo name. 21 | themes: [ 22 | [ 23 | '@easyops-cn/docusaurus-search-local', 24 | { 25 | hashed: true, 26 | language: ['en'], 27 | highlightSearchTermsOnTargetPage: true, 28 | docsRouteBasePath: '/', 29 | }, 30 | ], 31 | ], 32 | 33 | // Even if you don't use internalization, you can use this field to set useful 34 | // metadata like html lang. For example, if your site is Chinese, you may want 35 | // to replace "en" with "zh-Hans". 36 | i18n: { 37 | defaultLocale: 'en', 38 | locales: ['en'], 39 | }, 40 | 41 | presets: [ 42 | [ 43 | 'classic', 44 | /** @type {import('@docusaurus/preset-classic').Options} */ 45 | ({ 46 | docs: { 47 | sidebarPath: require.resolve('./sidebars.js'), 48 | // Please change this to your repo. 49 | // Remove this to remove the "edit this page" links. 50 | editUrl: 'https://github.com/Chia-Network/chia-dev-guides/edit/main/', 51 | path: 'guides', 52 | routeBasePath: 'guides', 53 | }, 54 | theme: { 55 | customCss: require.resolve('./src/css/custom.css'), 56 | }, 57 | }), 58 | ], 59 | ], 60 | 61 | themeConfig: 62 | /** @type {import('@docusaurus/preset-classic').ThemeConfig} */ 63 | ({ 64 | navbar: { 65 | title: 'Dev Guides', 66 | logo: { 67 | alt: 'Chialisp Logo', 68 | src: 'img/chia_leaf_green.svg', 69 | href: '/guides', 70 | width: 45, 71 | }, 72 | items: [ 73 | { 74 | href: 'https://docs.chia.net', 75 | label: 'Chia Docs', 76 | }, 77 | { 78 | href: 'https://chialisp.com/', 79 | label: 'Chialisp', 80 | }, 81 | { 82 | href: 'https://github.com/Chia-Network/chia-dev-guides', 83 | label: 'GitHub', 84 | position: 'right', 85 | }, 86 | ], 87 | }, 88 | footer: { 89 | links: [ 90 | { 91 | title: 'Guides', 92 | items: [ 93 | { 94 | label: 'Chialisp Primer', 95 | to: '/guides', 96 | }, 97 | { 98 | label: 'NFT Developer Guide', 99 | to: '/guides/nft-developer-guide', 100 | }, 101 | ], 102 | }, 103 | { 104 | title: 'Community', 105 | items: [ 106 | { 107 | label: 'Keybase', 108 | href: 'https://keybase.io/team/chia_network.public', 109 | }, 110 | { 111 | label: 'Chia Devs Forum', 112 | href: 'https://developers.chia.net/', 113 | }, 114 | { 115 | label: 'Twitter', 116 | href: 'https://twitter.com/chia_project', 117 | }, 118 | ], 119 | }, 120 | { 121 | title: 'More', 122 | items: [ 123 | { 124 | label: 'GitHub', 125 | href: 'https://github.com/Chia-Network/chia-blockchain', 126 | }, 127 | ], 128 | }, 129 | ], 130 | copyright: `© ${new Date().getFullYear()} Chia Network Inc., Licensed under the Apache License, Version 2.0 | Terms`, 131 | }, 132 | prism: { 133 | theme: lightTheme, 134 | darkTheme: darkTheme, 135 | additionalLanguages: ['json'], 136 | }, 137 | }), 138 | customFields: { 139 | landingTitle: 'Chia Dev Guides', 140 | landingTagline: 'Resources for Chia Developers', 141 | }, 142 | }; 143 | 144 | module.exports = config; 145 | -------------------------------------------------------------------------------- /guides/chialisp-concepts/condition-morphing.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: chialisp-concepts-condition-morphing 3 | slug: /chialisp-condition-morphing 4 | title: Condition Morphing 5 | --- 6 | 7 | You've seen how you can use inner puzzles to output conditions and append them to the output of the outer puzzle. However, sometimes you want to change the output of the inner puzzle to enforce certain rules. This is called **condition morphing**. 8 | 9 | An example of this is the singleton - every coin that its inner puzzle creates which has an odd output, is turned into an inner puzzle of itself. It changes the puzzle in the condition to the singleton with the original puzzle as its new inner puzzle. This can be a bit confusing to think about, but it allows for many things such as keeping track of state. 10 | 11 | ## Example 12 | 13 | Let's try a simpler example of condition morphing that doubles the amount of created coins. 14 | 15 | Write the following in a file named `coin-doubler.clsp`: 16 | 17 | ```chialisp title="coin-double.clsp" 18 | ; Using the dot here means that the inner solution is the rest of the parameters. This avoids the need to nest parentheses. 19 | (mod (INNER_PUZZLE . inner_solution) 20 | 21 | ; Doubles the amount of CREATE_COIN conditions. 22 | (defun morph-condition (condition) 23 | 24 | ; Checks if the opcode is 51, which is CREATE_COIN. 25 | (if (= (f condition) 51) 26 | 27 | ; Create a new condition similar to the original. 28 | (list 29 | ; It's still the same opcode. 30 | 51 31 | 32 | ; The second value, the puzzle hash, is also the same. 33 | (f (r condition)) 34 | 35 | ; The third value, the amount, is doubled. 36 | (* (f (r (r condition))) 2) 37 | ) 38 | 39 | ; If it's not the right opcode, leave it untouched. 40 | condition 41 | ) 42 | ) 43 | 44 | ; Goes through every condition and morphs it. 45 | (defun morph-conditions (conditions) 46 | 47 | ; If there are conditions left in the list. 48 | (if (l conditions) 49 | (c 50 | ; Morph the first condition. 51 | (morph-condition (f conditions)) 52 | 53 | ; Then morph the rest and form a list. 54 | (morph-conditions (r conditions)) 55 | ) 56 | 57 | ; Otherwise, the output has ended. 58 | () 59 | ) 60 | ) 61 | 62 | ; Morph the conditions output from the inner puzzle. 63 | (morph-conditions (a INNER_PUZZLE inner_solution)) 64 | ) 65 | ``` 66 | 67 | Make sure you read the comments and understand it fully before continuing. 68 | 69 | ### Inner Puzzle 70 | 71 | Now we need an inner puzzle to morph the conditions of. 72 | 73 | Write the following in a file named `any-with-signature.clsp`: 74 | 75 | ```chialisp title="any-with-signature.clsp" 76 | (mod (PUBLIC_KEY conditions) 77 | (include condition_codes.clib) 78 | (include sha256tree.clib) 79 | 80 | (c 81 | (list AGG_SIG_ME PUBLIC_KEY (sha256tree conditions)) 82 | conditions 83 | ) 84 | ) 85 | ``` 86 | 87 | Retrieve the libraries used in this example: 88 | 89 | ```bash 90 | cdv clsp retrieve condition_codes sha256tree 91 | ``` 92 | 93 | :::info 94 | Similarly to [the example in the Inner Puzzles guide](/guides/chialisp-inner-puzzles#inner-puzzle), this allows the spender to pick any conditions. However, it also requires a signature. It's essentially the inner and outer puzzle from that example combined. 95 | ::: 96 | 97 | ### Public Key 98 | 99 | You can refer to the [signature guide](/guides/chialisp-bls-signatures) to learn about key pairs and how to use your wallet to sign messages. We will be using similar steps here to get the derived public key. 100 | 101 | Run this to get the derived public key: 102 | 103 | ```bash 104 | chia keys derive child-key --derive-from-hd-path "m/12381/8444/2/0" 105 | ``` 106 | 107 | You will use this public key in the next step. 108 | 109 | ### Currying 110 | 111 | Now, we will wrap this inner puzzle in the outer puzzle we wrote previously. This will require the spend to be signed by a given key, and any coins created will have double the amount. 112 | 113 | First, run this command to get the compiled form of the inner puzzle: 114 | 115 | ```bash 116 | run -i include any-with-signature.clsp 117 | ``` 118 | 119 | Yes, the output is just `2`. 120 | 121 | You can run this command to curry in the public key previously calculated and the inner puzzle: 122 | 123 | ```bash 124 | cdv clsp curry coin-doubler.clsp -a "0xPublicKey" -a 2 125 | ``` 126 | 127 | That should produce an output similar to this: 128 | 129 | ```chialisp 130 | (a (q 2 (q 2 6 (c 2 (c (a 5 7) ()))) (c (q (a (i (= 9 (q . 51)) (q 4 (q . 51) (c 21 (c (* 45 (q . 2)) ()))) (q . 5)) 1) 2 (i (l 5) (q 4 (a 4 (c 2 (c 9 ()))) (a 6 (c 2 (c 13 ())))) ()) 1) 1)) (c (q . 0xPublicKey) (c (q 2 (q 4 (c 4 (c 5 (c (a 6 (c 2 (c 11 ()))) ()))) 11) (c (q 50 2 (i (l 5) (q 11 (q . 2) (a 6 (c 2 (c 9 ()))) (a 6 (c 2 (c 13 ())))) (q 11 (q . 1) 5)) 1) 1)) 1))) 131 | ``` 132 | 133 | Now the inner puzzle and outer puzzle have been combined together. 134 | 135 | ## Conclusion 136 | 137 | This combined puzzle would allow you to spend coins created with it with your public key, but any create coin conditions would have their amounts doubled in the output. Feel free to ask questions you may have on our [Keybase team](https://keybase.io/team/chia_network.public). 138 | -------------------------------------------------------------------------------- /guides/chialisp-concepts/currying.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: chialisp-concepts-currying 3 | slug: /chialisp-currying 4 | title: Currying 5 | --- 6 | 7 | When you are writing puzzles in Chialisp you may want to have certain parameters decided before the coins are created. This is called **currying**. It allows puzzles to be reused but have different content and produce a different hash. 8 | 9 | An example of this is the standard transaction puzzle. One of its parameters is the `SYNTHETIC_PUBLIC_KEY`, which is unique for each address in your wallet. It represents a synthetic child key of your root public key. As such, the puzzle has to be changed for every address. This would be tedious to do without currying, since it allows the original puzzle (also known as the mod) to be used as a template. 10 | 11 | ## Example 12 | 13 | We're going to write a simple example to try currying on the command line. 14 | 15 | Write this in a file named `multiply.clsp`: 16 | 17 | ```chialisp title="multiply.clsp" 18 | (mod (first second) 19 | (* first second) 20 | ) 21 | ``` 22 | 23 | ### Currying 24 | 25 | Now, we are going to make an instance of this program that will set the value of the parameter `first` to `2`. This will effectively turn this program from a multiplier to a doubler. 26 | 27 | You can curry it like this: 28 | 29 | ```bash 30 | cdv clsp curry multiply.clsp -a 2 31 | ``` 32 | 33 | Which should produce the following curried result: 34 | 35 | ```chialisp 36 | (a (q 18 2 5) (c (q . 2) 1)) 37 | ``` 38 | 39 | :::info 40 | This is no longer in Chialisp form, but rather has been compiled to CLVM. You don't need to understand how this works or be able to read it, but only be aware that it does what was mentioned before. 41 | ::: 42 | 43 | You can now run this curried CLVM, and include the value to be doubled as the second parameter, like so: 44 | 45 | ```bash 46 | brun "(a (q 18 2 5) (c (q . 2) 1))" "(5)" 47 | ``` 48 | 49 | It should output twice the value of `5`: 50 | 51 | ```chialisp 52 | 10 53 | ``` 54 | 55 | ### Reuse 56 | 57 | The real use of currying comes from the fact that you can curry it again with a new value: 58 | 59 | ```bash 60 | cdv clsp curry multiply.clsp -a 5 61 | ``` 62 | 63 | Which should produce the following curried result: 64 | 65 | ```chialisp 66 | (a (q 18 2 5) (c (q . 5) 1)) 67 | ``` 68 | 69 | This will do the same thing as the previous curried program, except it will multiply by `5` instead of by `2`. 70 | 71 | ## Convention 72 | 73 | In the previous example, we curried a value into a program, but the program did not declare that this was required. However, often times (especially with puzzles), you will be required to curry the value beforehand to use it properly. To indicate that a parameter is meant to be curried in, you write it in `SCREAMING_SNAKE_CASE`. 74 | 75 | Let's rewrite the previous example with this convention: 76 | 77 | ```chialisp title="multiply.clsp" 78 | (mod (FIRST second) 79 | (* FIRST second) 80 | ) 81 | ``` 82 | 83 | Writing parameters like this doesn't change anything in how they function, but rather how they are expected to be used. This convention makes it clear that you _need_ to specify the value of it before creating coins with it on-chain. 84 | 85 | ## Conclusion 86 | 87 | This is very useful for writing reusable and composable puzzles in Chialisp. It is also commonly used in tandem with [inner puzzles](/guides/chialisp-inner-puzzles). However, currying can be a pretty confusing topic, so if you have any further questions, feel free to ask them on our [Keybase team](https://keybase.io/team/chia_network.public). 88 | -------------------------------------------------------------------------------- /guides/chialisp-concepts/inner-puzzles.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: chialisp-concepts-inner-puzzles 3 | slug: /chialisp-inner-puzzles 4 | title: Inner Puzzles 5 | --- 6 | 7 | Sometimes you want the behavior of your puzzles to be composable, so that you can reuse code in multiple ways. An example of this is the [Chia Asset Token](https://chialisp.com/docs/puzzles/cats) puzzle, which allows you to specify an **inner puzzle**. 8 | 9 | This allows the outer puzzle to enforce certain rules on how it can be spent, while the inner puzzle can do whatever it wants within those rules. In this case, the CAT enforces that it maintains a constant amount in mojos, while the inner puzzle (typically the [Standard Transaction primitive](https://chialisp.com/docs/standard_transaction/)) decides how it can be spent. 10 | 11 | This is typically used in combination with a variety of other concepts, which we will talk about later. However, for the purpose of this guide and to make it easier to follow, we will provide a simple example that only incorporates currying and inner puzzles. 12 | 13 | ## Example 14 | 15 | We're going to write a simple example to try inner puzzles on the command line. 16 | 17 | Write this in a file named `require-signature.clsp`: 18 | 19 | ```chialisp title="require-signature.clsp" 20 | ; Using the dot here means that the inner solution is the rest of the parameters. This avoids the need to nest parentheses. 21 | (mod (PUBLIC_KEY INNER_PUZZLE . inner_solution) 22 | (include condition_codes.clib) 23 | (include sha256tree.clib) 24 | 25 | (c 26 | (list AGG_SIG_ME PUBLIC_KEY (sha256tree inner_solution)) 27 | (a INNER_PUZZLE inner_solution) 28 | ) 29 | ) 30 | ``` 31 | 32 | Retrieve the libraries used in this example: 33 | 34 | ```bash 35 | cdv clsp retrieve condition_codes sha256tree 36 | ``` 37 | 38 | First, note that `PUBLIC_KEY` and `INNER_PUZZLE` are both all caps. Because of this you can tell that they are meant to be [curried](/guides/chialisp-currying) in before used as a puzzle. 39 | 40 | The `c` operator creates a cons pair with two values. Here, it is essentially prepending the `AGG_SIG_ME` condition to the output of the inner puzzle. 41 | 42 | The `a` operator executes a program with its parameters. Here, it is used to run the curried inner puzzle with the inner solution passed in during the spend. It outputs a list of conditions which will get appended to the first condition. 43 | 44 | The `AGG_SIG_ME` condition will verify the `PUBLIC_KEY` signed the message, which is the tree hash of the inner solution. 45 | 46 | ### Inner Puzzle 47 | 48 | Next, we need to write the inner puzzle that will be curried into the example. 49 | 50 | Write this in a file named `any-conditions.clsp`: 51 | 52 | ```chialisp title="any-conditions.clsp" 53 | (mod (conditions) 54 | conditions 55 | ) 56 | ``` 57 | 58 | :::info 59 | This is an exceedingly simple puzzle that just returns any conditions passed into the solution. It is insecure on its own, as it allows anyone to spend it however they want. 60 | ::: 61 | 62 | ### Public Key 63 | 64 | You can refer to the [BLS Signatures guide](/guides/chialisp-bls-signatures) to learn about key pairs and how to use your wallet to sign messages. We will be using similar steps here to get the derived public key. 65 | 66 | Run this to get the derived public key: 67 | 68 | ```bash 69 | chia keys derive child-key --derive-from-hd-path "m/12381/8444/2/0" 70 | ``` 71 | 72 | You will use this public key in the next step. 73 | 74 | ### Currying 75 | 76 | Now, we will wrap this inner puzzle in the outer puzzle we wrote previously. This will require the spend to be signed by a given key, which effectively secures the inner puzzle so that only you can spend it, instead of anyone. 77 | 78 | First, run this command to get the compiled form of the inner puzzle: 79 | 80 | ```bash 81 | run any-conditions.clsp 82 | ``` 83 | 84 | Yes, the output is just `2`. 85 | 86 | You can run this command to curry in the public key previously calculated and the inner puzzle: 87 | 88 | ```bash 89 | cdv clsp curry require-signature.clsp -a "0xPublicKey" -a 2 90 | ``` 91 | 92 | That should produce an output similar to this: 93 | 94 | ```chialisp 95 | (a (q 2 (q 4 (c 4 (c 5 (c (a 6 (c 2 (c 15 ()))) ()))) (a 11 15)) (c (q 50 2 (i (l 5) (q 11 (q . 2) (a 6 (c 2 (c 9 ()))) (a 6 (c 2 (c 13 ())))) (q 11 (q . 1) 5)) 1) 1)) (c (q . 0xPublicKey) (c (q . 2) 1))) 96 | ``` 97 | 98 | Now the inner puzzle and outer puzzle have been combined together. 99 | 100 | ## Conclusion 101 | 102 | The concept of inner puzzles allows for the composition of puzzles. This is commonly used in the wallet, where CATs, DIDs, and NFTs wrap the standard transaction. That way they have the ability to be transferred, yet also have their own set of rules that control their use. If you have any questions about inner puzzles, feel free to ask on our [Keybase team](https://keybase.io/team/chia_network.public). 103 | -------------------------------------------------------------------------------- /guides/chialisp-primer/bls-signatures.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: chialisp-primer-bls-signatures 3 | slug: /chialisp-bls-signatures 4 | title: 5. BLS Signatures 5 | --- 6 | 7 | When creating a spend bundle previously, we have left the `aggregated_signature` field set to the default value of `c0` followed by 190 zeros. This value indicates that there are no signatures. We will detail what signatures are, and how you can use them on the blockchain. 8 | 9 | Chia uses a specific kind of signature called a [BLS Signature](https://crypto.stanford.edu/~dabo/pubs/papers/BLSmultisig.html). It's a form of elliptic curve cryptography. 10 | 11 | One helpful feature of BLS signatures is that they can be non-interactively aggregated. You can take a signature from a party you don't trust, and combine it with another signature to produce a single signature that verifies the combination of all of the messages they were signing. 12 | 13 | ## Digital Signatures 14 | 15 | A [digital signature](https://en.wikipedia.org/wiki/Digital_signature) is a cryptographically secure way to check the author of a message. It is quite similar to written signatures. 16 | 17 | To create a signature, first you need a [key pair](https://en.wikipedia.org/wiki/Public-key_cryptography) that consists of a private key and its corresponding public key. The private key is used to sign messages, whereas the public key is used to verify the signature created for the message. 18 | 19 | ## Example 20 | 21 | :::danger 22 | Your private key should _never_ be shared with anyone other than yourself unless you are fine with them having complete control over the wallet it is for, as well as signing messages on your behalf. The same is true for the mnemonic seed phrase used to generate the key pair. 23 | ::: 24 | 25 | The first thing you need to do is find the fingerprint of the wallet you are going to be using for message signing. 26 | 27 | You can use the following command to do this: 28 | 29 | ```bash 30 | chia keys show 31 | ``` 32 | 33 | :::info 34 | You are not going to be using the root key pair itself to sign messages, but rather a child key derived from it. The `hd_path` represents the path used for deriving the child key from the root. 35 | 36 | The `12381` is specific to BLS signatures, whereas `8444` is specific to Chia. Wallets use the index `2`, and finally the last value is just the key index, starting at `0`. 37 | 38 | You will not need to change the value in this guide, but you can tweak the last value if you want. 39 | ::: 40 | 41 | You can now sign messages using this key pair like so: 42 | 43 | ```bash 44 | chia keys sign --fingerprint "FingerPrint" --hd_path "m/12381/8444/2/0" --message "Message" 45 | ``` 46 | 47 | It will show you the derived public key and signature based on the path and message specified. 48 | 49 | You can use those values to verify that the signature is correct like this: 50 | 51 | ```bash 52 | chia keys verify --public_key "PublicKey" --signature "Signature" --message "Message" 53 | ``` 54 | 55 | If the result is `True`, it is valid. Otherwise, either the public key, signature, or message is incorrect. 56 | 57 | ## Conclusion 58 | 59 | This was just a primer on BLS signatures, and in practice it can be a bit more complicated. They will be put to good use in future guides, and it's a good idea to understand how they work before you dive into them. If you have any questions about BLS signature, feel free to ask on our [Keybase team](https://keybase.io/team/chia_network.public)! 60 | -------------------------------------------------------------------------------- /guides/chialisp-primer/first-smart-coin.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: chialisp-primer-first-smart-coin 3 | slug: /chialisp-first-smart-coin 4 | title: 4. First Smart Coin 5 | --- 6 | 7 | By now, you should understand what Chialisp is and how you can use it to write programs and modules that can be run on the command-line. In this guide, we are going to write a simple **puzzle**, use it to lock a **coin** with a password, and finally spend it. This example is insecure for a variety of reasons which will be explained after, but it's a good tool for learning how smart coins work. 8 | 9 | ## Prerequisites 10 | 11 | The previous guide detailed how to set up the testnet. You will need to follow it to continue. 12 | 13 | :::tip 14 | While this guide can be followed on the command-line like the first, we recommend writing more complicated Chialisp programs like this one that you plan on reusing in a text editor of your choice, then using the command-line to compile it and use the RPC commands. 15 | ::: 16 | 17 | ## Password Puzzle 18 | 19 | Write the following Chialisp code in a file named `password.clsp`: 20 | 21 | ```chialisp title="password.clsp" 22 | ;;; This puzzle locks coins with a password. 23 | ;;; It should not be used for production purposes. 24 | ;;; Use a password that has no meaning to you, preferably random. 25 | 26 | (mod ( 27 | PASSWORD_HASH ; This is the sha256 hash of the password. 28 | 29 | password ; This is the original password used in the password hash. 30 | conditions ; An arbitrary list of conditions to output. 31 | ) 32 | 33 | ; If the hash of the password matches, 34 | (if (= (sha256 password) PASSWORD_HASH) 35 | ; Output the conditions list. 36 | conditions 37 | 38 | ; Otherwise, throw an error. 39 | (x) 40 | ) 41 | ) 42 | ``` 43 | 44 | 1. The puzzle takes in a **curried in** value `PASSWORD_HASH`. 45 | 2. The solution takes in the `password` and desired `conditions`. 46 | 3. If the hash of the password matches the curried in value, output the `conditions`. 47 | 4. Otherwise, throw an error to prevent the spend from occurring. 48 | 49 | ## Puzzles 50 | 51 | We've mentioned previously that Chialisp can be used to write puzzles, but you may be wondering what exactly a puzzle is. A puzzle is a special module that is used to lock a coin with a set of rules. These rules affect how and when they can be spent, and what happens when they are. 52 | 53 | ### Currying 54 | 55 | Currying can be thought of as defining the value of function parameters before it is called. This is usually used with modules to allow the same puzzle to be reused for multiple different scenarios. 56 | 57 | In this example, the curried in `PASSWORD_HASH` represents the hash of the password that is required to spend the coin. Not every instance of this puzzle will have the same password, so we create a parameter and curry the value when we actually make an instance of this puzzle. 58 | 59 | ### Conditions 60 | 61 | A condition consists of a condition number followed by its arguments. They can do a variety of things, from the creation of new coins and requiring other spends to happen at the same time, to various assertions related to the state of the blockchain. 62 | 63 | A complete list of conditions can be found on the [Conditions page](https://docs.chia.net/conditions), but we will only be using one in this tutorial: condition `51`, or `CREATE_COIN`, creates a new coin with the given `puzzle_hash` and `amount` if the spend is valid. It is used to send money to another puzzle hash (which is analagous to an address). 64 | 65 | ## Coins 66 | 67 | Everything on the Chia Blockchain, including the standard transactions used to move money between wallets, is a coin. Coins are identified by their id, which is just a [sha256 hashed](https://en.wikipedia.org/wiki/Cryptographic_hash_function) representation of the following three components: 68 | 69 | - `parent_coin_id`, which is the id of the coin that created this one. 70 | - `puzzle_hash`, which is the hash of the puzzle used to spend the coin. 71 | - `amount`, which is the amount of money locked with the coin, in mojos (a trillionth of an XCH). 72 | 73 | Multiple coins can have the same puzzle hash, and a coin can create multiple children. The only limitation is that no two coins can have the same parent, puzzle hash, and amount, as their ids would be the same. 74 | 75 | A coin can be spent by revealing its puzzle and providing a solution. The solution is then passed to its puzzle, which outputs a list of conditions. 76 | 77 | ## Putting it Together 78 | 79 | We will now use these concepts and the `password.clsp` file you just wrote to create and spend a coin. 80 | 81 | ### Creating the Coin 82 | 83 | :::danger 84 | Don't use a password that you use or plan to use for anything else, as this is not a secure smart coin. The most ideal choice for this is any number of random characters of your choice, such as `x7h2dDkE`. Just write it down for later. 85 | ::: 86 | 87 | The first step is to curry the puzzle with the password's hash and get the puzzle hash and puzzle reveal: 88 | 89 | ```bash 90 | opc -H "$(cdv clsp curry password.clsp --args "$(run "(sha256 'password')")")" 91 | ``` 92 | 93 | Write down both values this produces, the first one being the puzzle hash, and the second being the puzzle reveal. 94 | 95 | You can convert the puzzle hash to an address and send funds to it like so: 96 | 97 | ```bash 98 | cdv encode --prefix txch "PuzzleHash" 99 | chia wallet send --amount 0.01 --fee 0.00005 --address "txch1Address" 100 | ``` 101 | 102 | This will send 10 billion mojos with a fee of 100 million mojos (the current recommended amount to get the transaction to go through quickly) to the address you specify, therefore creating your coin! 103 | 104 | ### Spending the Coin 105 | 106 | There's only one thing left to do, which is to spend the coin that we just created. We are going to be using a few RPC calls to do this. 107 | 108 | First, we need to find the coin that we just created by its puzzle hash: 109 | 110 | ```bash 111 | cdv rpc coinrecords --only-unspent --by puzzlehash "PuzzleHash" 112 | ``` 113 | 114 | Take note of the values in the `coin` object in the output. 115 | 116 | Get the puzzle hash of your wallet address: 117 | 118 | ```bash 119 | chia wallet get_address 120 | cdv decode "txch1WalletAddress" 121 | ``` 122 | 123 | :::caution 124 | Make sure you put the `0x` prefix in front of the wallet's puzzle hash in this command. It isn't required for the other commands, but in this case it will compile as a string without it, which you don't want. 125 | ::: 126 | 127 | Then, get the solution in hex, with the password and your wallet puzzle hash: 128 | 129 | ```bash 130 | opc "('password' ((51 0xWalletPuzzleHash 9900000000)))" 131 | ``` 132 | 133 | This will produce a solution with the password that will create a new coin with the amount minus a fee of 100 million mojos. A coin will go back to your wallet when you spend the coin with this solution. 134 | 135 | We will not be using an aggregated signature for the spend bundle, so we will specify the signature equivalent of zero. Just paste the long value in the below spend bundle. 136 | 137 | Use the coin information you gathered with the `coinrecords` command, the `puzzle_reveal` from the first `opc` command you ran, and the `solution` from the second. 138 | 139 | Write the following in a file named `spendbundle.json`: 140 | 141 | ```json title="spendbundle.json" 142 | { 143 | "coin_spends": [ 144 | { 145 | "coin": { 146 | "amount": 10000000000, 147 | "parent_coin_info": "0xParentCoinInfo", 148 | "puzzle_hash": "0xPuzzleHash" 149 | }, 150 | "puzzle_reveal": "PuzzleReveal", 151 | "solution": "Solution" 152 | } 153 | ], 154 | "aggregated_signature": "0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" 155 | } 156 | ``` 157 | 158 | Finally, run the following command to push the transaction to the Testnet: 159 | 160 | ```bash 161 | cdv rpc pushtx spendbundle.json 162 | ``` 163 | 164 | If all went well, this should spend the coin! Otherwise, retrace your steps carefully to try to find what went wrong. If you still can't figure it out, don't hesitate to ask us on our [Keybase team](https://keybase.io/team/chia_network.public) and we will answer as soon as we can. 165 | 166 | ## Potential Questions 167 | 168 | Here are some questions you may have had when creating and spending the coin. 169 | 170 | ### Why Allow Arbitrary Conditions? 171 | 172 | We allow any conditions to be passed in the solution. While you might think that for this example we would only need to create a single coin, this allows us to reserve network fees, or to enable more complicated functionality later such as interacting with other spends. In this example, we will only use the create coin condition in this list. 173 | 174 | ### Why are Password Coins Insecure? 175 | 176 | When you spend one or more coins, the puzzle and its solution go into the [mempool](https://docs.chia.net/mempool) until the block is inevitably farmed. This means that anyone can read the password in plain text during this time, or after the coin is spent. 177 | 178 | A simple solution to that would be to use a new random password every time you create a coin. However, a malicious farmer can actually change the solution to spends however they would like before adding it to their block. In doing so, they could change where the money will go in order to steal the coin. 179 | 180 | While there are other ways, the most common solution to that is to simply require a [digital signature](https://en.wikipedia.org/wiki/BLS_digital_signature) instead of a password. This is a cryptographically secure way of ensuring that the solution is not tampered with. If it is, the spend will no longer be valid. We will worry about this in a future guide, so you can safely ignore this concept for now. 181 | 182 | So, while a password example is a good idea for learning and testing purposes, it is certainly not feasible for real-world use. 183 | 184 | ## Conclusion 185 | 186 | This is only scratching the surface of what's possible to do with smart coins on the Chia Blockchain. But it's a good foundation of understanding for more complicated examples to come. Every guide in this series builds off of the others, so make sure to take a break to let it soak in, and refresh your memory on concepts that you need to when you come back. We're looking forward to the awesome things you will build with this technology! 187 | -------------------------------------------------------------------------------- /guides/chialisp-primer/intro.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: chialisp-primer-intro 3 | slug: / 4 | title: 1. Intro to Chialisp 5 | --- 6 | 7 | [Chialisp](https://chialisp.com) is a language based on [Lisp]() that is used on the Chia blockchain to dictate how and when [coins](https://docs.chia.net/chia-concepts#coins-and-transactions) can be spent. It's designed to be as simple and efficient as possible, but still provide broad functionality and [Turing Completeness](https://en.wikipedia.org/wiki/Turing_completeness). 8 | 9 | Throughout this guide you will learn the basics of Chialisp, and by the end you should have the skills required to write working programs using it. No prior knowledge of Lisp is required. 10 | 11 | ## Installation 12 | 13 | You can follow the [Chia Dev Tools installation guide](https://github.com/Chia-Network/chia-dev-tools/#install) to install and use Chia Dev Tools. You will be using these tools and a simple text editor of your choice to write and run snippets of code. 14 | 15 | Once you have it set up, run the following command: 16 | 17 | ```bash 18 | run "test" 19 | ``` 20 | 21 | The `run` command compiles Chialisp code. In this case, we are compiling a simple string to make sure it is installed properly. 22 | 23 | If it is working correctly, it should output `"test"`. You can now follow along with any of the code in the coming sections. 24 | 25 | ## Atoms 26 | 27 | An **atom** can represent an integer, string, or hexadecimal number. However, the difference is only known before the code is compiled, and every atom is stored directly as bytes. 28 | 29 | For example, these atoms all have the same value: 30 | 31 | | Representation | Example | Description | 32 | | -------------- | ------- | ----------------------------------- | 33 | | Symbol | `A` | Names and operators | 34 | | String | `"A"` | Used to represent text | 35 | | Integer | `65` | Whole numbers, positive or negative | 36 | | Hexadecimal | `0x41` | Raw byte representation | 37 | 38 | If you are interested in learning more about how atoms are represented, see the [Types](https://chialisp.com/docs/ref/clvm#types) section. 39 | 40 | ## Lists 41 | 42 | A **list** is a nested chain of [cons pairs](https://en.wikipedia.org/wiki/Cons) used to represent a set of values, which are also either atoms or lists. While you can manually create these pairs, and it is a good thing to know how to do, we will focus on the higher-level concept of lists for now, since they are easier to use and more practical. 43 | 44 | The first item in an unquoted list is the operator, and the rest are its operands. The same goes for functions or macros and their arguments. If you want to express a list of values, you either have to use the `list` operator or quote the list. 45 | 46 | This creates a list of values: 47 | 48 | ```bash 49 | run '(list 1 2 3)' 50 | ``` 51 | 52 | And here is an operator: 53 | 54 | ```bash 55 | run '(+ 2 3)' 56 | ``` 57 | 58 | As you can see, just about everything in this language is based on lists, hence the name Lisp (an abbreviation for List Processor). You can see a full list of built-in operators [here](https://chialisp.com/operators). 59 | 60 | ## Example 61 | 62 | Lets try a more complex example: 63 | 64 | ```bash 65 | run '(* (if (> 3 2) 10 5) 10)' 66 | ``` 67 | 68 | If 3 is greater than 2, it's 10, otherwise 5. Then multiply it by 10. The result here is as you would expect, 100. 69 | 70 | ## Conclusion 71 | 72 | Hopefully this guide has been a good introduction into the world of Chialisp. There is a lot more to learn, but this is the foundation that everything else is built on top of. 73 | 74 | If you really want to get started with using it, the best way is to try out these examples yourself, and play around a little yourself. Feel free to ask questions on our [Keybase team](https://keybase.io/team/chia_network.public) that come up along the way. We are always happy to help you learn. 75 | -------------------------------------------------------------------------------- /guides/chialisp-primer/testnet-setup.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: chialisp-primer-testnet-setup 3 | slug: /chialisp-testnet-setup 4 | title: 3. Testnet Setup 5 | --- 6 | 7 | If you haven't already, you will need to [clone the Chia Blockchain repository](https://github.com/Chia-Network/chia-blockchain), then follow the below steps to set it up and configure it for the testnet. 8 | 9 | ## Setup 10 | 11 | :::tip 12 | If you are using Windows, we recommend PowerShell, and you may need to replace forward slashes `/` with backslashes `\`. 13 | ::: 14 | 15 | 1. Open the `chia-blockchain` folder in a command prompt of your choice. 16 | 2. Set the environment variable `CHIA_ROOT` to `~/.chia/testnet10`. 17 | 3. Run `./Install.ps1` on Windows or `./install.sh` on MacOS or Linux. 18 | 4. Run `. ./activate` to use the Python virtual environment. 19 | 5. Run `chia init` to setup and configure Chia. 20 | 6. Run `chia keys generate` to prepare the wallet keys. 21 | 7. Run `chia configure -t true` to use the Testnet. 22 | 8. Download the [Testnet database](https://download.chia.net/testnet10/blockchain_v2_testnet10.sqlite.gz) and place it in the `~/.chia/testnet10/db` folder. 23 | 9. Finally, run `chia start node` to start the full node. 24 | 25 | ## Faucet 26 | 27 | Now you can set up the wallet and use a faucet to receive Testnet coins to use in the upcoming guides. 28 | 29 | 1. Run `chia start wallet` to start the wallet. 30 | 2. Run `chia wallet get_address` to get the next wallet address. 31 | 3. Go to the [Testnet faucet](https://testnet10-faucet.chia.net) and give it your address. 32 | 4. Wait a minute or two and run `chia wallet show` to check your balance. 33 | 34 | ## Conclusion 35 | 36 | You should now be ready to use the Testnet to create and spend smart coins. As always, if you ran into any issues while setting up the Testnet, feel free to ask for support on our [Keybase team](https://keybase.io/team/chia_network.public). 37 | -------------------------------------------------------------------------------- /guides/chialisp-primer/using-modules.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: chialisp-primer-using-modules 3 | slug: /chialisp-using-modules 4 | title: 2. Using Modules 5 | --- 6 | 7 | Up to this point, you have written single expressions and evaluated them on the command-line. However, sometimes you want to split your code into multiple functions or include common libraries. In order to do things like that, you will need to understand what modules are. 8 | 9 | ## Modules 10 | 11 | The `mod` operator creates a context for converting the usage of constants into a single expression. 12 | 13 | :::note 14 | Functions inside the module will not have direct access to the [solution](https://chialisp.com/docs/glossary#solution), so values you need access to will need to be passed in as a function parameter manually. 15 | 16 | In other words, there is no concept of [scope](). 17 | ::: 18 | 19 | This module will add two arbitrary values together: 20 | 21 | ```chialisp 22 | (mod (first second) 23 | (+ first second) 24 | ) 25 | ``` 26 | 27 | And this is an example of defining a constant and a function, followed by their usage: 28 | 29 | ```chialisp 30 | ;;; Raises the number by one order of magnitude. 31 | 32 | (mod (value) 33 | ; Defines a constant value with a name. 34 | (defconstant ORDER_OF_MAGNITUDE 10) 35 | 36 | ; Defines a function that can be called with a value. 37 | (defun raise_magnitude (value) 38 | (* value ORDER_OF_MAGNITUDE) 39 | ) 40 | 41 | ; Calls the previously defined function. 42 | (raise_magnitude value) 43 | ) 44 | ``` 45 | 46 | 1. The module takes in a `value` parameter. 47 | 2. `ORDER_OF_MAGNITUDE` is defined as 10. 48 | 3. The `raise_magnitude` function takes in a `value` parameter (this is different from the `value` defined as a module parameter). 49 | 4. Returns the `value` function parameter multiplied by the `ORDER_OF_MAGNITUDE`. 50 | 5. Calls the function with the module parameter `value`. 51 | 52 | ## Example 53 | 54 | By now you have seen how some aspects of the language work, and we can use these concepts to write and run a simple Chialisp program. We will write a module that calculates the factorial of a number using [recursion](https://en.wikipedia.org/wiki/Recursion). 55 | 56 | Put this in a file named `factorial.clsp`: 57 | 58 | ```chialisp title="factorial.clsp" 59 | ;;; Calculates a factorial recursively. 60 | ;;; f(n) = n * f(n - 1) 61 | ;;; f(n) = n if n <= 2 62 | 63 | (mod (number) 64 | ; Defines the factorial function. 65 | (defun factorial (number) 66 | (if (> number 1) 67 | (* number (factorial (- number 1))) 68 | 1 69 | ) 70 | ) 71 | 72 | ; Calls the function with the number provided. 73 | (factorial number) 74 | ) 75 | ``` 76 | 77 | Run this example with the following command: 78 | 79 | ```bash 80 | brun "$(run factorial.clsp)" "(5)" 81 | ``` 82 | 83 | It will compile it and run the result with a solution where `number` is 5. The result of this should be the factorial of that number, which is 120. There were a few new operators used in these examples. For more information, you should refer to the [operator reference](https://chialisp.com/docs/ref/clvm#the-built-in-opcodes). Below is a detailed explanation of how this works. 84 | 85 | 1. The module takes in a `number` parameter. 86 | 2. The `factorial` function also takes in a `number` parameter. 87 | 3. If the number is greater than 2, returns the number times the previous factorial. 88 | 4. Otherwise, returns the number itself. 89 | 5. Call the recursive function with the `number` module parameter. 90 | 91 | We can visualize this function with the input 5 as follows: 92 | 93 | ```chialisp 94 | (factorial 5) 95 | (* 5 (factorial 4)) 96 | (* 5 (* 4 (factorial 3))) 97 | (* 5 (* 4 (* 3 (factorial 2)))) 98 | (* 5 (* 4 (* 3 (* 2 (factorial 1))))) 99 | (* 5 (* 4 (* 3 (* 2 1)))) 100 | ``` 101 | 102 | Which then simplifies like this: 103 | 104 | ```chialisp 105 | (* 5 (* 4 (* 3 2))) 106 | (* 5 (* 4 6)) 107 | (* 5 24) 108 | 120 109 | ``` 110 | 111 | Everything that would normally be written using iteration in an imperative language, for example array modification, is instead written using recursion in Chialisp. It can be hard to understand at first, but eventually it will make more and more sense. 112 | 113 | ## Conclusion 114 | 115 | Modules allow you to use functional programming in Chialisp, which makes writing it feel more natural. It also allows you to reuse your code and express it in a more clear way. 116 | 117 | If you have any questions about modules, or anything else, remember to come ask questions on our [Keybase team](https://keybase.io/team/chia_network.public). 118 | -------------------------------------------------------------------------------- /guides/crash-course/chialisp.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: /crash-course/chialisp 3 | title: Chialisp 4 | --- 5 | 6 | ```mdx-code-block 7 | import Tabs from '@theme/Tabs'; 8 | import TabItem from '@theme/TabItem'; 9 | ``` 10 | 11 | For this section of the course, you will learn how to set up your development environment, write Chialisp code, and execute it on the command-line. 12 | 13 | ## Dev Tools 14 | 15 | To get started with Chialisp, you will first want to [install Chia Dev Tools](https://github.com/Chia-Network/chia-dev-tools). 16 | 17 | Here is a summary of the instructions: 18 | 19 | ```mdx-code-block 20 | 26 | 27 | ``` 28 | 29 | ```bash 30 | mkdir learning 31 | cd learning 32 | py -m venv venv 33 | ./venv/Scripts/activate 34 | pip install chia-dev-tools 35 | cdv --version 36 | ``` 37 | 38 | 39 | 40 | 41 | ```bash 42 | mkdir learning 43 | cd learning 44 | python3 -m venv venv 45 | . ./venv/bin/activate 46 | pip install chia-dev-tools 47 | cdv --version 48 | ``` 49 | 50 | 51 | 52 | 53 | This will install the Chia Dev Tools within your activated virtual environment. You'll want to make sure this virtual environment is activated before working on Chialisp. You'll see a `(venv)` on the left of your terminal prompt. 54 | 55 | :::info 56 | Virtual environments allow you to install specific Python packages that will only be usable with the environment that is currently active. This allows you to switch between different environments for different projects, or if you just want to use different software versions. 57 | ::: 58 | 59 | ### Chia Dev Tools 60 | 61 | The `cdv` command provides a set of useful commands for building and running Chialisp programs, as well as some utilities for deploying smart coins on the Chia blockchain, which we will cover later on. 62 | 63 | Run the following to see what commands it provides: 64 | 65 | ```bash 66 | cdv 67 | ``` 68 | 69 | For example, a Chialisp file can be built like so: 70 | 71 | ```bash 72 | cdv clsp build something.clsp 73 | ``` 74 | 75 | ### Run 76 | 77 | You also have access to the `run` command that can be used to compile Chialisp code directly. 78 | 79 | :::note 80 | If Chialisp code doesn't depend on any external parameters, the compiler will simplify it to the smallest form it can, which often means that this command will return the final output of the program. 81 | 82 | If this is the case, you can skip the `brun` command. 83 | ::: 84 | 85 | Run the following command: 86 | 87 | ```bash 88 | run '(+ 2 3)' 89 | ``` 90 | 91 | Which should return the following result: 92 | 93 | ```chialisp 94 | 5 95 | ``` 96 | 97 | --- 98 | 99 | :::info 100 | The syntax `(+ 2 3)` may look confusing. In Chialisp, we place the operator first, followed by the operands. This is known as **prefix notation**. Think of this as the equivalent to `2 + 3` in math and most other programming languages. 101 | 102 | It is set up this way because every program in Chialisp is written as a list, where the first item is the operator. `(+ 2 3)` is a list of three elements with the first being the `+` operator, and thus it's a valid Chialisp program. 103 | ::: 104 | 105 | ### Brun 106 | 107 | The `brun` command is different from the `run` command in that it doesn't compile code. Instead, it takes the result of the `run` command and executes it on the Chialisp Virtual Machine (CLVM) directly. 108 | 109 | If you need to pass external parameters into the program, you will need to first compile it with `run`, then use the `brun` command with the parameters. 110 | 111 | For example, let's say that the `run` command produced the following CLVM bytecode output: 112 | 113 | ```chialisp 114 | 2 115 | ``` 116 | 117 | You could run it like so: 118 | 119 | ```bash 120 | brun '2' '(42)' 121 | ``` 122 | 123 | Which should produce the following output: 124 | 125 | ```chialisp 126 | 42 127 | ``` 128 | 129 | So Chialisp can calculate the [meaning of life]()! 130 | 131 | --- 132 | 133 | ## Writing a Chialisp Puzzle {#writing-puzzle} 134 | 135 | Let's start off with some terminology. Firstly, coins on the Chia blockchain use Chialisp programs named **puzzles** to secure the value stored within. The parameters to a puzzle are called its **solution**. 136 | 137 | To create puzzles that require a solution, we will use the `mod` operator. It allows us to take arguments passed in to customize the functionality and result of the puzzle. 138 | 139 | A very basic example would be: 140 | 141 | ```bash 142 | run '(mod (arg1 arg2) (+ arg1 arg2))' 143 | ``` 144 | 145 | Which should return the following result: 146 | 147 | ```bash 148 | (+ 2 5) 149 | ``` 150 | 151 | :::info 152 | What in the world is `(+ 2 5)` that `run` returned? This is an example of Chialisp bytecode that is later executed by the Chialisp Virtual Machine (CLVM). It is not very human-readable, but don't worry about that, as you are not required to understand CLVM bytecode in order to use it. 153 | 154 | Our first command, `run`, will take Chialisp code and compile it to bytecode. Next, `brun` will take that bytecode and execute it. 155 | ::: 156 | 157 | We will then run this puzzle with the `brun` command, followed by a solution of your choice: 158 | 159 | ```bash 160 | brun '(+ 2 5)' '(10 5)' 161 | ``` 162 | 163 | Which should return the following result: 164 | 165 | ```chialisp 166 | 15 167 | ``` 168 | 169 | :::info reminder 170 | We are now using `mod` to demand a solution for our puzzle. Whenever this is the case, you will be required to use the `brun` command after `run`. 171 | ::: 172 | 173 | Pay close attention to the location of quotes and parenthesis. It's easy to get lost! With `brun`, the solution is passed in as a distinct value surrounded by quotes. `(10, 5)` is the solution in this example and translates to `arg1 = 10` and `arg2 = 5`. 174 | 175 | You can run it again with a different solution: 176 | 177 | ```bash 178 | brun '(+ 2 5)' '(20 7)' 179 | ``` 180 | 181 | Which should return the following result: 182 | 183 | ```chialisp 184 | 27 185 | ``` 186 | 187 | At this point you have a working Chialisp puzzle that will take inputs and give back an output. Congrats on making it this far! 188 | 189 | ## Comparisons and If 190 | 191 | Going with a contrived example, let's say we wanted to add two numbers and return `large` if they were `> 100`, or `small` if they were `<= 100`. 192 | 193 | You can compare two values like so: 194 | 195 | ```chialisp 196 | (> apples oranges) 197 | ``` 198 | 199 | If `apples` is larger than `oranges`, this returns `1`. Otherwise, the output is `()`, which is equivalent to `0`. 200 | 201 | You can then use an if statement to return one of two different things depending on the result. 202 | 203 | ```chialisp 204 | (if ) 205 | ``` 206 | 207 | A concrete example of an `if` would be: 208 | 209 | ```bash 210 | run '(if 1 "true" "false")' 211 | ``` 212 | 213 | Which should return the following result: 214 | 215 | ```chialisp 216 | "true" 217 | ``` 218 | 219 | Now, we will add `arg1` and `arg2` with the code `(+ arg1 arg2)` and compare it to the literal value `100`. This comparison will determine whether the `if` is `true` or `false`. We end up with: 220 | 221 | ```bash 222 | run '(mod (arg1 arg2) (if (> (+ arg1 arg2) 100) "large" "small"))' 223 | ``` 224 | 225 | Which should return the following result: 226 | 227 | ```chialisp 228 | (a (i (> (+ 2 5) (q . 100)) (q 1 . "large") (q 1 . "small")) 1) 229 | ``` 230 | 231 | Next, let's put this bytecode through `brun`, giving it a solution: 232 | 233 | ```bash 234 | brun '(a (i (> (+ 2 5) (q . 100)) (q 1 . "large") (q 1 . "small")) 1)' '(10 90)' 235 | ``` 236 | 237 | Which should return the following result: 238 | 239 | ```chialisp 240 | small 241 | ``` 242 | 243 | Now, again with a different solution: 244 | 245 | ```bash 246 | brun '(a (i (> (+ 2 5) (q . 100)) (q 1 . "large") (q 1 . "small")) 1)' '(10 91)' 247 | ``` 248 | 249 | Which should return the following result: 250 | 251 | ```chialisp 252 | large 253 | ``` 254 | 255 | The difference here being the new solution of `(10 91)`. When added together, `10` and `91` are greater than `100`. 256 | 257 | ## Text Editor 258 | 259 | Up to this point, we've been using the command line to write and run Chialisp programs. While this is efficient for quickly prototyping and testing small programs, it doesn't scale very well. 260 | 261 | When writing larger programs in Chialisp, it'll be much easier to use a text editor of your choice and save them to a file. Both [Atom](https://atom.io) and [Visual Studio Code](https://code.visualstudio.com) have extensions to improve the quality of life of writing Chialisp code. However, any LISP-based syntax highlighting will help as well. 262 | 263 | :::info 264 | If you decide to use [Visual Studio Code](https://code.visualstudio.com), we have begun development on a [Chialisp language server extension](https://marketplace.visualstudio.com/items?itemName=ChiaNetwork.chialisp). 265 | 266 | You may need to click the dropdown in the editor to install the prerelease version. 267 | ::: 268 | 269 | ## Chialisp Files 270 | 271 | We will be storing Chialisp code in files, then building and running the files on the command line using Chia Dev Tools. There are a few commands that we can use more effectively after setting up a project in this way. 272 | 273 | ### Convention 274 | 275 | The following file extensions are used for Chialisp: 276 | 277 | | Extension | Description | 278 | | ----------- | ------------------------------- | 279 | | `.clsp` | Chialisp source code | 280 | | `.clvm` | Deserialized CLVM bytecode | 281 | | `.clvm.hex` | Serialized CLVM bytecode | 282 | | `.clsp.hex` | Generated CLVM bytecode | 283 | | `.sym` | Generated Chialisp symbol table | 284 | -------------------------------------------------------------------------------- /guides/crash-course/inner-puzzles.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: /crash-course/inner-puzzles 3 | title: Inner Puzzles 4 | --- 5 | 6 | Puzzles all have something in common, they output a list of conditions. This tells the blockchain what you want to do with the coin. 7 | We did this exact thing in an earlier lesson: 8 | 9 | ```chialisp 10 | (mod (PUBLIC_KEY conditions) 11 | (include condition_codes.clib) 12 | (include sha256tree.clib) 13 | 14 | (c 15 | (list AGG_SIG_ME PUBLIC_KEY (sha256tree conditions)) 16 | conditions 17 | ) 18 | ) 19 | ``` 20 | 21 | Here, we are outputting a custom `conditions` which is passed in as a solution. 22 | 23 | ## Inner Puzzles 24 | 25 | We can create a coin within a coin where the inner coin returns a list of conditions to the outer coin. To do this, we will use `(a INNER_PUZZLE inner_solution)`. The operator `a` means `apply` and is how you execute some code. The inner puzzle will be executed with the inner solution. 26 | 27 | What the inner puzzle and inner solution is exactly is up to the coin creator. Here is a more complex example for an outer coin: 28 | 29 | ```chialisp title="outer-puzzle.clsp" 30 | (mod (PUBLIC_KEY INNER_PUZZLE inner_solution) 31 | (include condition_codes.clib) 32 | (include sha256tree.clib) 33 | 34 | ; Assert the signature matches and append the conditions. 35 | (defun calculate_output (PUBLIC_KEY inner_solution conditions) 36 | (c 37 | (list AGG_SIG_ME PUBLIC_KEY (sha256tree inner_solution)) 38 | conditions 39 | ) 40 | ) 41 | 42 | ; Pass the output of the inner puzzle to `calculate_output`. 43 | (calculate_output PUBLIC_KEY inner_solution (a INNER_PUZZLE inner_solution)) 44 | ) 45 | ``` 46 | 47 | This will first run `(a INNER_PUZZLE inner_solution)`, passing the result to our custom function `calculate_output`. This function will require a signature of the outputted conditions from the inner coin. 48 | 49 | You can think of the outer coin as additional layer to control the inner coin. Almost like a template for your coins. 50 | 51 | ## Inner Puzzle Creation 52 | 53 | Let's create an inner puzzle. This will use a new condition code ASSERT_HEIGHT_RELATIVE, which will make sure a certain number of blocks have passed since coin creation before the coin can be spent. 54 | 55 | ```chialisp title="inner-puzzle.clsp" 56 | (mod (REQUIRED_BLOCKS conditions) 57 | (include condition_codes.clib) 58 | 59 | (c 60 | (list ASSERT_HEIGHT_RELATIVE REQUIRED_BLOCKS) 61 | conditions 62 | ) 63 | ) 64 | ``` 65 | 66 | We will also need to get the appropriate include files: 67 | 68 | ``` 69 | cdv clsp retrieve sha256tree condition_codes 70 | ``` 71 | 72 | ## The Steps 73 | 74 | :::warning 75 | Many of these values used (such as my public key) are specific to me. I left them in to clearly see command usage, but you'll want to substitute where appropriate. 76 | 77 | ::: 78 | 79 | First, let's get our master public key. 80 | 81 | ``` 82 | chia keys show 83 | ``` 84 | 85 | Response: 86 | 87 | ``` 88 | Fingerprint: 1660000549 89 | Master public key (m): b8f7dd239557ff8c49d338f89ac1a258a863fa52cd0a502e3aaae4b6738ba39ac8d982215aa3fa16bc5f8cb7e44b954d 90 | Farmer public key (m/12381/8444/0/0): b4ef65cc62af8cd6d25e72444e1886938cfec436933cfc5e32c14367f846f6728f74a133c30bbab84fd4d0afec0966a0 91 | Pool public key (m/12381/8444/1/0): b6cb156bad3580795ae9377e717a43925ed7622f18ff6ab8c3471f1fdd18ad9906b8e19c22f25fa29fccbf4af3f4acab 92 | First wallet address: txch1kwa0ach5f3djns83cpvsywnwlx4mjqnzyja3vg0jwlsp3cfwes2qlfdf7c 93 | ``` 94 | 95 | You will specifically want the master public key prefixed with `0x`. For me, this value is: 96 | 97 | ``` 98 | 0xb8f7dd239557ff8c49d338f89ac1a258a863fa52cd0a502e3aaae4b6738ba39ac8d982215aa3fa16bc5f8cb7e44b954d 99 | ``` 100 | 101 | Now, let's curry the inner puzzle with some value (in # of blocks) 102 | 103 | ```bash 104 | cdv clsp curry inner-puzzle.clsp -a 20 105 | ``` 106 | 107 | Response: 108 | 109 | ``` 110 | (a (q 2 (q 4 (c 2 (c 5 ())) 11) (c (q . 82) 1)) (c (q . 20) 1)) 111 | ``` 112 | 113 | Once we've created the bytecode for the inner puzzle, we will curry that result in to the outer puzzle, after our public key. 114 | 115 | ```bash 116 | cdv clsp curry outer-puzzle.clsp -a 0xb8f7dd239557ff8c49d338f89ac1a258a863fa52cd0a502e3aaae4b6738ba39ac8d982215aa3fa16bc5f8cb7e44b954d -a '(a (q 2 (q 4 (c 2 (c 5 ())) 11) (c (q . 82) 1)) (c (q . 20) 1))' 117 | ``` 118 | 119 | Response: 120 | 121 | ``` 122 | (a (q 2 (q 2 10 (c 2 (c 5 (c 23 (c (a 11 23) ()))))) (c (q 50 (c (c 4 (c 5 (c (a 14 (c 2 (c 11 ()))) ()))) 23) 2 (i (l 5) (q 11 (q . 2) (a 14 (c 2 (c 9 ()))) (a 14 (c 2 (c 13 ())))) (q 11 (q . 1) 5)) 1) 1)) (c (q . 0xb8f7dd239557ff8c49d338f89ac1a258a863fa52cd0a502e3aaae4b6738ba39ac8d982215aa3fa16bc5f8cb7e44b954d) (c (q 2 (q 2 (q 4 (c 2 (c 5 ())) 11) (c (q . 82) 1)) (c (q . 20) 1)) 1))) 123 | ``` 124 | 125 | :::info 126 | Now that we curried in our public key, the bytecode will be different from key to key. Make sure you use your own key and prefix with 0x! 127 | ::: 128 | 129 | ## Create the Coin 130 | 131 | Now that we have curried the inner puzzle in to the outer puzzle, we will create a coin for our final outer puzzle bytecode. 132 | 133 | # Get Puzzle Hash 134 | 135 | ``` 136 | opc -H "" 137 | ``` 138 | 139 | ``` 140 | opc -H "(a (q 2 (q 2 10 (c 2 (c 5 (c 23 (c (a 11 23) ()))))) (c (q 50 (c (c 4 (c 5 (c (a 14 (c 2 (c 11 ()))) ()))) 23) 2 (i (l 5) (q 11 (q . 2) (a 14 (c 2 (c 9 ()))) (a 14 (c 2 (c 13 ())))) (q 11 (q . 1) 5)) 1) 1)) (c (q . 0xb8f7dd239557ff8c49d338f89ac1a258a863fa52cd0a502e3aaae4b6738ba39ac8d982215aa3fa16bc5f8cb7e44b954d) (c (q 2 (q 2 (q 4 (c 2 (c 5 ())) 11) (c (q . 82) 1)) (c (q . 20) 1)) 1)))" 141 | ``` 142 | 143 | Response: 144 | 145 | ``` 146 | e4fd576c99d4cb789a21b3173d18e916c37634720c9ecd9d25f615d24bd1e3c5 147 | ``` 148 | 149 | # Get Puzzle Reveal 150 | 151 | While we are at it, let's also get our serialized puzzle for the `puzzle_reveal`. 152 | 153 | ``` 154 | opc "" 155 | ``` 156 | 157 | ``` 158 | opc "(a (q 2 (q 2 10 (c 2 (c 5 (c 23 (c (a 11 23) ()))))) (c (q 50 (c (c 4 (c 5 (c (a 14 (c 2 (c 11 ()))) ()))) 23) 2 (i (l 5) (q 11 (q . 2) (a 14 (c 2 (c 9 ()))) (a 14 (c 2 (c 13 ())))) (q 11 (q . 1) 5)) 1) 1)) (c (q . 0xb8f7dd239557ff8c49d338f89ac1a258a863fa52cd0a502e3aaae4b6738ba39ac8d982215aa3fa16bc5f8cb7e44b954d) (c (q 2 (q 2 (q 4 (c 2 (c 5 ())) 11) (c (q . 82) 1)) (c (q . 20) 1)) 1)))" 159 | ``` 160 | 161 | Response: 162 | 163 | ``` 164 | ff02ffff01ff02ffff01ff02ff0affff04ff02ffff04ff05ffff04ff17ffff04ffff02ff0bff1780ff808080808080ffff04ffff01ff32ffff04ffff04ff04ffff04ff05ffff04ffff02ff0effff04ff02ffff04ff0bff80808080ff80808080ff1780ff02ffff03ffff07ff0580ffff01ff0bffff0102ffff02ff0effff04ff02ffff04ff09ff80808080ffff02ff0effff04ff02ffff04ff0dff8080808080ffff01ff0bffff0101ff058080ff0180ff018080ffff04ffff01b0b8f7dd239557ff8c49d338f89ac1a258a863fa52cd0a502e3aaae4b6738ba39ac8d982215aa3fa16bc5f8cb7e44b954dffff04ffff01ff02ffff01ff02ffff01ff04ffff04ff02ffff04ff05ff808080ff0b80ffff04ffff0152ff018080ffff04ffff0114ff018080ff01808080 165 | ``` 166 | 167 | # Get Address 168 | 169 | Now that we have our puzzle hash, we can encode this as an address. 170 | 171 | ```bash 172 | cdv encode -p txch e4fd576c99d4cb789a21b3173d18e916c37634720c9ecd9d25f615d24bd1e3c5 173 | ``` 174 | 175 | Response: 176 | 177 | ``` 178 | txch1un74wmye6n9h3x3pkvtn6x8fzmphvdrjpj0vm8f97c2ayj73u0zsjqanlc 179 | ``` 180 | 181 | We will use this address as the receive address for our new coin. 182 | 183 | # Create Coin 184 | 185 | ```bash 186 | chia wallet send --amount 0.01 --fee 0.00005 --address txch1un74wmye6n9h3x3pkvtn6x8fzmphvdrjpj0vm8f97c2ayj73u0zsjqanlc 187 | ``` 188 | 189 | Response: 190 | 191 | ``` 192 | Submitting transaction... 193 | Transaction submitted to nodes: [{'peer_id': '67095d445d879556da95feeee70174c66b131d4f29bd447df5fbc56789a01f24', 'inclusion_status': 'SUCCESS', 'error_msg': None}] 194 | Run 'chia wallet get_transaction -f 1660000549 -tx 0xcfc2382e19b8c02a251cc4092951aeda45d643d32fe9bbe675761a228a393b1a' to get status 195 | ``` 196 | 197 | Let's get the status. 198 | 199 | ```bash 200 | chia wallet get_transaction -f 1660000549 -tx 0xcfc2382e19b8c02a251cc4092951aeda45d643d32fe9bbe675761a228a393b1a 201 | ``` 202 | 203 | Eventually, this will say confirmed: 204 | 205 | ``` 206 | Transaction cfc2382e19b8c02a251cc4092951aeda45d643d32fe9bbe675761a228a393b1a 207 | Status: Confirmed 208 | Amount sent: 0.01 TXCH 209 | To address: txch1un74wmye6n9h3x3pkvtn6x8fzmphvdrjpj0vm8f97c2ayj73u0zsjqanlc 210 | Created at: 2022-11-01 22:34:50 211 | ``` 212 | 213 | In the meantime, we can start crafting our `spendbundle.json`: 214 | 215 | ``` 216 | { 217 | "coin_spends": [ 218 | { 219 | "coin": { 220 | "amount": 10000000000, 221 | "parent_coin_info": "", 222 | "puzzle_hash": "" 223 | }, 224 | "puzzle_reveal": "", 225 | "solution": "" 226 | } 227 | ], 228 | "aggregated_signature": "" 229 | } 230 | ``` 231 | 232 | Next up, let's get the coin record and coin ID. 233 | 234 | # Retreive Coin Info 235 | 236 | First, you can grab the coin by puzzlehash. If anyone has ever used the same CLVM for a coin, there will be multiple coins returned (this is unlikely since our puzzle included our own public key): 237 | 238 | ```bash 239 | cdv rpc coinrecords --by puzzle_hash e4fd576c99d4cb789a21b3173d18e916c37634720c9ecd9d25f615d24bd1e3c5 240 | ``` 241 | 242 | Response: 243 | 244 | ```json 245 | [ 246 | { 247 | "coin": { 248 | "amount": 10000000000, 249 | "parent_coin_info": "0xdb8e67eb6c0d91206329eb4fe53c403b3b0be29fdd99baa67e574c2318ade1f7", 250 | "puzzle_hash": "0xe4fd576c99d4cb789a21b3173d18e916c37634720c9ecd9d25f615d24bd1e3c5" 251 | }, 252 | "coinbase": false, 253 | "confirmed_block_index": 333655, 254 | "spent_block_index": 0, 255 | "timestamp": 1667356550 256 | } 257 | ] 258 | ``` 259 | 260 | This does not give the coin ID, but does give everything needed to calculate the coin ID. 261 | 262 | :::info 263 | A coin ID is the hash of the parent coin ID, puzzle hash of the coin, and the amount. 264 | ::: 265 | 266 | We can retrieve the coin ID with this template: 267 | 268 | ```bash 269 | cdv inspect -id coins --parent-id "" --puzzle-hash "" --amount "" 270 | ``` 271 | 272 | Example: 273 | 274 | ```bash 275 | cdv inspect -id coins --parent-id 0x2ae27f44c228eeb9b16eb3f878c51e5bc468009eea79fce976e9d0a25b0e2b85 --puzzle-hash 0xaa0dc6276e519a604dd0a750b8efb53c5d65b55f189cc0ca29d498d45b69a216 --amount 10000000000 276 | ``` 277 | 278 | Response: 279 | 280 | ``` 281 | ['43ab980558015de0d255b7eadf763feb9de22233bcdfde22b1c2823dfa2a53b5'] 282 | ``` 283 | 284 | ## Crafting a solution 285 | 286 | The solution we will use is the same `51 CREATE_COIN` condition we've been using throughout this series. To do this, we will need our wallet puzzle hash. 287 | 288 | ```bash 289 | chia wallet get_address 290 | ``` 291 | 292 | Response: 293 | 294 | ``` 295 | txch12zntse5ac4fl5nr83c43rcunjn9zr39r3a6z7zyu9c68ve949kpqkk5w9n 296 | ``` 297 | 298 | ```bash 299 | cdv decode txch12zntse5ac4fl5nr83c43rcunjn9zr39r3a6z7zyu9c68ve949kpqkk5w9n 300 | ``` 301 | 302 | Response: 303 | 304 | ``` 305 | 50a6b8669dc553fa4c678e2b11e39394ca21c4a38f742f089c2e347664b52d82 306 | ``` 307 | 308 | Now, let's get the encoded solution: 309 | :::warning 310 | Remember 0x for your puzzle hash 311 | ::: 312 | 313 | ``` 314 | opc "((((51 0x50a6b8669dc553fa4c678e2b11e39394ca21c4a38f742f089c2e347664b52d82 9950000000))))" 315 | ``` 316 | 317 | Response: 318 | 319 | ``` 320 | ffffffff33ffa050a6b8669dc553fa4c678e2b11e39394ca21c4a38f742f089c2e347664b52d82ff85025110f38080808080 321 | ``` 322 | 323 | This is 4 parenthesis deep because the `outer-puzzle` params list will be passed in surrounded by (), and one of those params is the inner solution, which is surrounded by (). Inside of the inner solution we have another set of () for the list of conditions where each condition is also surrounded by (). 324 | 325 | We will now calculate the **hash for the inner solution**, which is part of AGG_SIG_ME and will be neede for `chia keys sign`: 326 | 327 | ``` 328 | opc -H "(((51 0x50a6b8669dc553fa4c678e2b11e39394ca21c4a38f742f089c2e347664b52d82 9950000000)))" 329 | ``` 330 | 331 | Response: 332 | 333 | ``` 334 | e611d1b5035b2c77eb5a343d47d6c0f5345ae212539b666136ae86ccb95ee47a 335 | ``` 336 | 337 | This will need signed with `chia keys sign`, but `AGG_SIG_ME` introduces some other inputs for a more unique signature. These are the coin ID and the genesis challenge. 338 | 339 | We've already calculated the coin ID with `cdv inspect -id coins`, now we just need the genesis challenge. The easiest way to retrieve this is with: 340 | 341 | ``` 342 | chia show -s 343 | ``` 344 | 345 | Now that we have all the pieces, we will concatenate them together for the final message to be signed. 346 | 347 | # Concatenate Message 348 | 349 | The order for theses is solution hash, coin ID, genesis challenge. 350 | 351 | ```bash 352 | run '(concat 0xe611d1b5035b2c77eb5a343d47d6c0f5345ae212539b666136ae86ccb95ee47a 0x43ab980558015de0d255b7eadf763feb9de22233bcdfde22b1c2823dfa2a53b5 0xd25b25b897564035695996922aa0f9ff9d611bd38cd2ecd0d2383a99a70dfc15)' 353 | ``` 354 | 355 | Response: 356 | 357 | ``` 358 | 0xe611d1b5035b2c77eb5a343d47d6c0f5345ae212539b666136ae86ccb95ee47a43ab980558015de0d255b7eadf763feb9de22233bcdfde22b1c2823dfa2a53b5d25b25b897564035695996922aa0f9ff9d611bd38cd2ecd0d2383a99a70dfc15 359 | ``` 360 | 361 | # Sign Message 362 | 363 | :::info 364 | remove 0x from the message 365 | ::: 366 | 367 | ```bash 368 | chia keys sign --as-bytes --message e611d1b5035b2c77eb5a343d47d6c0f5345ae212539b666136ae86ccb95ee47a43ab980558015de0d255b7eadf763feb9de22233bcdfde22b1c2823dfa2a53b5d25b25b897564035695996922aa0f9ff9d611bd38cd2ecd0d2383a99a70dfc15 --hd_path m 369 | ``` 370 | 371 | Response: 372 | 373 | ``` 374 | Public key: b8f7dd239557ff8c49d338f89ac1a258a863fa52cd0a502e3aaae4b6738ba39ac8d982215aa3fa16bc5f8cb7e44b954d 375 | Signature: 8c6154292b5215f96bbb664f6883bd4bd02db2f844ca99a9a82385ef1e1c983bbb3cf5e8191dc2627e4fd01236ef86c3158d6738f23875080d2bf3eec8caf316735e3851add2eb068dbfbc9c27327072ffbeb77ba26d371e3d6533b2033bc1bc 376 | ``` 377 | 378 | Now, let's formulate the `spendbundle.json`. 379 | 380 | ```json 381 | { 382 | "coin_spends": [ 383 | { 384 | "coin": { 385 | "amount": 10000000000, 386 | "parent_coin_info": "0xdb8e67eb6c0d91206329eb4fe53c403b3b0be29fdd99baa67e574c2318ade1f7", 387 | "puzzle_hash": "0xe4fd576c99d4cb789a21b3173d18e916c37634720c9ecd9d25f615d24bd1e3c5" 388 | }, 389 | "puzzle_reveal": "ff02ffff01ff02ffff01ff02ff0affff04ff02ffff04ff05ffff04ff17ffff04ffff02ff0bff1780ff808080808080ffff04ffff01ff32ffff04ffff04ff04ffff04ff05ffff04ffff02ff0effff04ff02ffff04ff0bff80808080ff80808080ff1780ff02ffff03ffff07ff0580ffff01ff0bffff0102ffff02ff0effff04ff02ffff04ff09ff80808080ffff02ff0effff04ff02ffff04ff0dff8080808080ffff01ff0bffff0101ff058080ff0180ff018080ffff04ffff01b0b8f7dd239557ff8c49d338f89ac1a258a863fa52cd0a502e3aaae4b6738ba39ac8d982215aa3fa16bc5f8cb7e44b954dffff04ffff01ff02ffff01ff02ffff01ff04ffff04ff02ffff04ff05ff808080ff0b80ffff04ffff0152ff018080ffff04ffff0114ff018080ff01808080", 390 | "solution": "ffffffff33ffa050a6b8669dc553fa4c678e2b11e39394ca21c4a38f742f089c2e347664b52d82ff85025110f38080808080" 391 | } 392 | ], 393 | "aggregated_signature": "0x8c6154292b5215f96bbb664f6883bd4bd02db2f844ca99a9a82385ef1e1c983bbb3cf5e8191dc2627e4fd01236ef86c3158d6738f23875080d2bf3eec8caf316735e3851add2eb068dbfbc9c27327072ffbeb77ba26d371e3d6533b2033bc1bc" 394 | } 395 | ``` 396 | 397 | Now, push the transaction: 398 | 399 | ``` 400 | cdv rpc pushtx spendbundle.json 401 | ``` 402 | 403 | If enough blocks have not gone through, it will say `"status": "PENDING"`. 404 | 405 | ``` 406 | { 407 | "status": "SUCCESS", 408 | "success": true 409 | } 410 | ``` 411 | 412 | You can now see the spent block with the same command used earlier: 413 | 414 | ``` 415 | cdv rpc coinrecords --by puzzlehash 0xe4fd576c99d4cb789a21b3173d18e916c37634720c9ecd9d25f615d24bd1e3c5 416 | ``` 417 | 418 | Response: 419 | 420 | ``` 421 | [ 422 | { 423 | "coin": { 424 | "amount": 10000000000, 425 | "parent_coin_info": "0xb74b97e934fdf0daa1ebc3aca5dd033f9b1ca9eb761140e108a8d113a420c6fe", 426 | "puzzle_hash": "0xe4fd576c99d4cb789a21b3173d18e916c37634720c9ecd9d25f615d24bd1e3c5" 427 | }, 428 | "coinbase": false, 429 | "confirmed_block_index": 336196, 430 | "spent_block_index": 336230, 431 | "timestamp": 1667404639 432 | } 433 | ] 434 | ``` 435 | 436 | As you can see, 34 blocks have passed in this example from coin creation to coin spend. 437 | -------------------------------------------------------------------------------- /guides/crash-course/intro-to-chialisp.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: /crash-course/intro-to-chialisp 3 | title: Chialisp 4 | --- 5 | 6 | ```mdx-code-block 7 | import Tabs from '@theme/Tabs'; 8 | import TabItem from '@theme/TabItem'; 9 | ``` 10 | 11 | For this section of the course, you will learn how to set up your development environment, write Chialisp code, and execute it on the command-line. 12 | 13 | :::note 14 | If you are using PowerShell, make sure to install the PowerShell 7.3 preview version: 15 | 16 | ```bash 17 | winget install --id Microsoft.Powershell.Preview --source winget 18 | ``` 19 | 20 | This version fixes nested quoting, which is required for many of the commands on this page. 21 | ::: 22 | 23 | ## Dev Tools 24 | 25 | To get started with Chialisp, you will first want to [install Chia Dev Tools](https://github.com/Chia-Network/chia-dev-tools). 26 | 27 | Here is a summary of the instructions: 28 | 29 | ```mdx-code-block 30 | 36 | 37 | ``` 38 | 39 | ```bash 40 | mkdir learning 41 | cd learning 42 | py -m venv venv 43 | ./venv/Scripts/activate 44 | pip install chia-dev-tools 45 | cdv --version 46 | ``` 47 | 48 | 49 | 50 | 51 | ```bash 52 | mkdir learning 53 | cd learning 54 | python3 -m venv venv 55 | . ./venv/bin/activate 56 | pip install chia-dev-tools 57 | cdv --version 58 | ``` 59 | 60 | 61 | 62 | 63 | This will install the Chia Dev Tools within your activated virtual environment. You'll want to make sure this virtual environment is activated before working on Chialisp. You'll see a `(venv)` on the left of your terminal prompt. 64 | 65 | :::info 66 | Virtual environments allow you to install specific Python packages that will only be usable with the environment that is currently active. This allows you to switch between different environments for different projects, or if you just want to use different software versions. 67 | ::: 68 | 69 | ### Chia Dev Tools 70 | 71 | The `cdv` command provides a set of useful commands for building and running Chialisp programs, as well as some utilities for deploying smart coins on the Chia blockchain, which we will cover later on. 72 | 73 | Run the following to see what commands it provides: 74 | 75 | ```bash 76 | cdv 77 | ``` 78 | 79 | For example, a Chialisp file can be built like so: 80 | 81 | ```bash 82 | cdv clsp build something.clsp 83 | ``` 84 | 85 | ### Run 86 | 87 | You also have access to the `run` command that can be used to compile Chialisp code directly. 88 | 89 | :::note 90 | If Chialisp code doesn't depend on any external parameters, the compiler will simplify it to the smallest form it can, which often means that this command will return the final output of the program. 91 | 92 | If this is the case, you can skip the `brun` command. 93 | ::: 94 | 95 | Run the following command: 96 | 97 | ```bash 98 | run '(+ 2 3)' 99 | ``` 100 | 101 | Which should return the following result: 102 | 103 | ```chialisp 104 | 5 105 | ``` 106 | 107 | --- 108 | 109 | :::info 110 | The syntax `(+ 2 3)` may look confusing. In Chialisp, we place the operator first, followed by the operands. This is known as **prefix notation**. Think of this as the equivalent to `2 + 3` in math and most other programming languages. 111 | 112 | It is set up this way because every program in Chialisp is written as a list, where the first item is the operator. `(+ 2 3)` is a list of three elements with the first being the `+` operator, and thus it's a valid Chialisp program. 113 | ::: 114 | 115 | ### Brun 116 | 117 | The `brun` command is different from the `run` command in that it doesn't compile code. Instead, it takes the result of the `run` command and executes it on the Chialisp Virtual Machine (CLVM) directly. 118 | 119 | If you need to pass external parameters into the program, you will need to first compile it with `run`, then use the `brun` command with the parameters. 120 | 121 | For example, let's say that the `run` command produced the following CLVM bytecode output: 122 | 123 | ```chialisp 124 | 2 125 | ``` 126 | 127 | You could run it like so: 128 | 129 | ```bash 130 | brun '2' '(42)' 131 | ``` 132 | 133 | Which should produce the following output: 134 | 135 | ```chialisp 136 | 42 137 | ``` 138 | 139 | So Chialisp can calculate the [meaning of life]()! 140 | 141 | --- 142 | 143 | ## Writing a Chialisp Puzzle {#writing-puzzle} 144 | 145 | Let's start off with some terminology. Firstly, coins on the Chia blockchain use Chialisp programs named **puzzles** to secure the value stored within. The parameters to a puzzle are called its **solution**. 146 | 147 | To create puzzles that require a solution, we will use the `mod` operator. It allows us to take arguments passed in to customize the functionality and result of the puzzle. 148 | 149 | A very basic example would be: 150 | 151 | ```bash 152 | run '(mod (arg1 arg2) (+ arg1 arg2))' 153 | ``` 154 | 155 | Which should return the following result: 156 | 157 | ```bash 158 | (+ 2 5) 159 | ``` 160 | 161 | :::info 162 | What in the world is `(+ 2 5)` that `run` returned? This is an example of Chialisp bytecode that is later executed by the Chialisp Virtual Machine (CLVM). It is not very human-readable, but don't worry about that, as you are not required to understand CLVM bytecode in order to use it. 163 | 164 | Our first command, `run`, will take Chialisp code and compile it to bytecode. Next, `brun` will take that bytecode and execute it. 165 | ::: 166 | 167 | We will then run this puzzle with the `brun` command, followed by a solution of your choice: 168 | 169 | ```bash 170 | brun '(+ 2 5)' '(10 5)' 171 | ``` 172 | 173 | Which should return the following result: 174 | 175 | ```chialisp 176 | 15 177 | ``` 178 | 179 | :::info reminder 180 | We are now using `mod` to demand a solution for our puzzle. Whenever this is the case, you will be required to use the `brun` command after `run`. 181 | ::: 182 | 183 | Pay close attention to the location of quotes and parenthesis. It's easy to get lost! With `brun`, the solution is passed in as a distinct value surrounded by quotes. `(10, 5)` is the solution in this example and translates to `arg1 = 10` and `arg2 = 5`. 184 | 185 | You can run it again with a different solution: 186 | 187 | ```bash 188 | brun '(+ 2 5)' '(20 7)' 189 | ``` 190 | 191 | Which should return the following result: 192 | 193 | ```chialisp 194 | 27 195 | ``` 196 | 197 | At this point you have a working Chialisp puzzle that will take inputs and give back an output. Congrats on making it this far! 198 | 199 | ## Comparisons and If 200 | 201 | Going with a contrived example, let's say we wanted to add two numbers and return `large` if they were `> 100`, or `small` if they were `<= 100`. 202 | 203 | You can compare two values like so: 204 | 205 | ```chialisp 206 | (> apples oranges) 207 | ``` 208 | 209 | If `apples` is larger than `oranges`, this returns `1`. Otherwise, the output is `()`, which is equivalent to `0`. 210 | 211 | You can then use an if statement to return one of two different things depending on the result. 212 | 213 | ```chialisp 214 | (if ) 215 | ``` 216 | 217 | A concrete example of an `if` would be: 218 | 219 | ```bash 220 | run '(if 1 "true" "false")' 221 | ``` 222 | 223 | Which should return the following result: 224 | 225 | ```chialisp 226 | "true" 227 | ``` 228 | 229 | Now, we will add `arg1` and `arg2` with the code `(+ arg1 arg2)` and compare it to the literal value `100`. This comparison will determine whether the `if` is `true` or `false`. We end up with: 230 | 231 | ```bash 232 | run '(mod (arg1 arg2) (if (> (+ arg1 arg2) 100) "large" "small"))' 233 | ``` 234 | 235 | Which should return the following result: 236 | 237 | ```chialisp 238 | (a (i (> (+ 2 5) (q . 100)) (q 1 . "large") (q 1 . "small")) 1) 239 | ``` 240 | 241 | Next, let's put this bytecode through `brun`, giving it a solution: 242 | 243 | ```bash 244 | brun '(a (i (> (+ 2 5) (q . 100)) (q 1 . "large") (q 1 . "small")) 1)' '(10 90)' 245 | ``` 246 | 247 | Which should return the following result: 248 | 249 | ```chialisp 250 | small 251 | ``` 252 | 253 | Now, again with a different solution: 254 | 255 | ```bash 256 | brun '(a (i (> (+ 2 5) (q . 100)) (q 1 . "large") (q 1 . "small")) 1)' '(10 91)' 257 | ``` 258 | 259 | Which should return the following result: 260 | 261 | ```chialisp 262 | large 263 | ``` 264 | 265 | The difference here being the new solution of `(10 91)`. When added together, `10` and `91` are greater than `100`. 266 | 267 | ## Text Editor 268 | 269 | Up to this point, we've been using the command line to write and run Chialisp programs. While this is efficient for quickly prototyping and testing small programs, it doesn't scale very well. 270 | 271 | When writing larger programs in Chialisp, it'll be much easier to use a text editor of your choice and save them to a file. Both [Atom](https://atom.io) and [Visual Studio Code](https://code.visualstudio.com) have extensions to improve the quality of life of writing Chialisp code. However, any LISP-based syntax highlighting will help as well. 272 | 273 | :::info 274 | If you decide to use [Visual Studio Code](https://code.visualstudio.com), we have begun development on a [Chialisp language server extension](https://marketplace.visualstudio.com/items?itemName=ChiaNetwork.chialisp). 275 | 276 | You may need to click the dropdown in the editor to install the prerelease version. 277 | ::: 278 | 279 | ## Chialisp Files 280 | 281 | We will be storing Chialisp code in files, then building and running the files on the command line using Chia Dev Tools. There are a few commands that we can use more effectively after setting up a project in this way. 282 | 283 | ### Conventions 284 | 285 | The following file extensions are used for Chialisp: 286 | 287 | | Extension | Description | 288 | | ----------- | ------------------------------- | 289 | | `.clsp` | Chialisp source code | 290 | | `.clvm` | Deserialized CLVM bytecode | 291 | | `.clvm.hex` | Serialized CLVM bytecode | 292 | | `.clsp.hex` | Generated CLVM bytecode | 293 | | `.sym` | Generated Chialisp symbol table | 294 | 295 | You will be writing code in `.clsp` files. 296 | 297 | ## Putting it Together 298 | 299 | Using a text editor and files allows us to format our code nicely. 300 | 301 | Put the following in a file named `first.clsp`: 302 | 303 | ```chialisp title="first.clsp" 304 | (mod (arg1 arg2) 305 | (if (> (+ arg1 arg2) 100) 'large' 'small') 306 | ) 307 | ``` 308 | 309 | Now, we can execute the file by name: 310 | 311 | ```bash 312 | run first.clsp 313 | ``` 314 | 315 | This output will be exactly the same as before, but our code is a bit easier to manage. 316 | 317 | We will still execute the output like so: 318 | 319 | ```bash 320 | brun '(a (i (> (+ 2 5) (q . 100)) (q 1 . "large") (q 1 . "small")) 1)' '(50 51)' 321 | ``` 322 | 323 | And, using nesting, `$()` will execute anything within `()` first. We can simplify further with: 324 | 325 | ```bash 326 | brun "$(run first.clsp)" "(50 51)" 327 | ``` 328 | 329 | ## Defining Functions 330 | 331 | A function will give a name to some lines of code, often taking an input and returning a result. Let's create a new file to practice functions inside of Chialisp. 332 | 333 | Create a file named `sum.clsp`: 334 | 335 | ```chialisp title="sum.clsp" 336 | (mod (arg1 arg2) 337 | (defun sum (s1 s2) 338 | (+ s1 s2) 339 | ) 340 | 341 | (sum arg1 arg2) 342 | ) 343 | ``` 344 | 345 | This example is silly because we are just adding two numbers, but it shows that we can define a function with parameters. Now, while our solution parameters are still `arg1` and `arg2`, we've introduced `s1` and `s2`. We define the function following this structure: 346 | 347 | ```chialisp 348 | (defun function_name (parameters) 349 | function body) 350 | ) 351 | ``` 352 | 353 | We can then refer to this function by name later on in our code body: 354 | 355 | ```chialisp 356 | (function_name arguments) 357 | ``` 358 | 359 | ## More Complicated Function 360 | 361 | Now that we have a basic function, we can build on this to create a sum function to add all values from a list. 362 | 363 | ```chialisp 364 | (mod (items) 365 | (defun sum (items) 366 | (if items 367 | (+ (f items) (sum (r items))) 368 | 0 369 | ) 370 | ) 371 | 372 | (sum items) 373 | ) 374 | ``` 375 | 376 | Chialisp will use a lot of recursion. In this example, we will use `(f items)` to refer to the first element in the list, and `(r items)` to refer to the rest of the items in the list. By saying `+ (f items) (sum (r items)))`, we are adding the first element with a recursive call to the sum of the rest of the elements. This will repeat until items is empty, returning 0. 377 | 378 | Imagine passing in a list `(10 5 3 7)`, we would have a call stack like this: 379 | 380 | ```chialisp 381 | (+ 10 (sum (list 5 3 7))) 382 | ↪ (+ 5 (sum (list 3 7))) 383 | ↪ (+ 3 (sum (list 7))) 384 | ↪ (+ 7 (sum (list))) 385 | ↪ 0 386 | ``` 387 | 388 | We make our way through these calls until we return (0). We then work our way back up adding 0 with 7, 7 with 3, 10 with 5, and finally 15 with 10. 389 | 390 | Because we need to stop the recursive calls when the list is empty, we check if the `items` has a value. This can be done with `if items`. 391 | 392 | ### Invoking our Code 393 | 394 | We now have just a single parameter called `items`. This is expected to be a list, so we will pass a solution that is a list. We would normally pass a solution in `()` and a list is surrounded with `()`, so it may look like `"((10 5 3 7))"`: 395 | 396 | ``` 397 | 398 | brun "$(run sum.clsp)" "((10 5 3 7))" 399 | 400 | ``` 401 | 402 | Response: 403 | 404 | ``` 405 | 25 406 | ``` 407 | -------------------------------------------------------------------------------- /guides/crash-course/notes.md: -------------------------------------------------------------------------------- 1 | You can get information on your plotNFT: 2 | 3 | :::warning 4 | How do we create a plot NFT from the terminal, get an address for faucet, etc? 5 | ::: 6 | 7 | ``` 8 | chia plotnft show 9 | ``` 10 | 11 | List out plot NFTs with `chia plotnft show`. From here you can grab the launcher ID, which is used to identify your plot NFT, and get a pool login link like `chia plotnft get_login_link -l acd777a0d537e8e4e457e94ebb89ue158b984b8f9722f46cac67cb893e569510f`. Which by the way, you don’t want to share out this link to the world as it’s like a username and password for whatever pool you are using. 12 | 13 | Another useful command is `chia farm summary` which is the equivalent of the Farming page in the GUI. 14 | 15 |
16 | Exercise: Create a plot 17 | Let’s go through a quick CLI plotting example following [this documentation](https://github.com/Chia-Network/chia-blockchain/wiki/CLI-Commands-Reference#madmax) (or `chia plotters madmax -h`). 18 | 19 | For this you will need your farmer public key and your pool contract address. 20 | 21 | First, issue `chia keys show` to find your farmer public key. Next, use `chia plotnft show` to find the contract address. 22 | 23 | The values will look something like: 24 | 25 | `8914eed5ca5737ed6bb36225910d110cfc4d567115cfbb19cc19f600736aabf2a6709995aef9de37152d29f35ed9cdd6` 26 | 27 | `xch1fafdg7w35l4ujyz4vcuj3k78s5gwj395gs8tszkfwjj40melx75scxgw8h` 28 | 29 | The entire plotting command will look something like: 30 | 31 | ``` 32 | chia plotters madmax -k 32 -n 1 -r 7 -t temp -d . -f 8914eed5ca5737ed6bb36225910d110cfc4d567115cfbb19cc19f600736aabf2a6709995aef9de37152d29f35ed9cdd6 -c xch1fafdg7w35l4ujyz4vcuj3k78s5gwj395gs8tszkfwjj40melx75scxgw8h 33 | ``` 34 | 35 | where -n is the number of plots you want to create and `temp` is the name of a directory for temp files (create one with `mkdir temp`). `.` is the current directory for the destination. 36 | 37 | These are just a few examples of how to use the CLI. But now that we have the CLI ready we can go through some additional steps to make sure our farm is set up properly and the plots we created are working. 38 | 39 |
40 | 41 | ## Chia Dev Tools and Environment 42 | 43 | For the following Sections we suggest Atom or Visual Studio Code for the editor of choice. This is because they both currently have extensions to help you develop in Chialisp. For Atom, it is [language-chialisp](https://atom.io/packages/language-chialisp) and [Chialisp Language](https://marketplace.visualstudio.com/items?itemName=Rigidity.chialisplanguage) in VS Code. 44 | 45 | You will also need to install Chia Dev Tools. To do this, you'll first need Python installed. For this we will first create a directory for our project and virtual environment, then install `chia-dev-tools` inside of the virtual environment. 46 | 47 | ``` 48 | mkdir chialisp 49 | cd chialisp 50 | python3 -m venv .venv 51 | . .venv/bin/activate 52 | pip install chia-dev-tools 53 | ``` 54 | 55 | This includes CLVM tools, which will include commands like `run` and `brun`. It will also install a version of the Chia blockchain so we should have access to various Chia commands. 56 | 57 | ``` 58 | brun --help 59 | ``` 60 | 61 | ``` 62 | cdv --help 63 | ``` 64 | -------------------------------------------------------------------------------- /guides/simulator/simulator-user-guide.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: simulator-user-guide 3 | slug: /simulator-user-guide 4 | title: Simulator User Guide 5 | --- 6 | 7 | ```mdx-code-block 8 | import Tabs from '@theme/Tabs'; 9 | import TabItem from '@theme/TabItem'; 10 | ``` 11 | 12 | ## Intro 13 | 14 | This document will guide you through the process of setting up Chia's Simulator. For additional technical resources, see the following: 15 | 16 | - [Simulator RPC API](https://docs.chia.net/rpc-reference/simulator 'Simulator RPC API') 17 | - [Simulator CLI Reference](https://docs.chia.net/cli-reference/simulator 'Simulator CLI Reference') 18 | 19 | :::note 20 | 21 | It is possible to run the simulator and either Chia's testnet or mainnet simultaneously. This is because the simulator will use its own ports and directories. 22 | 23 | ::: 24 | 25 | --- 26 | 27 | ### Install chia-dev-tools 28 | 29 | The simulator is included in the `chia-dev-tools` GitHub repository. If you have already installed the latest version of `chia-dev-tools`, feel free to skip to the [next section](#install-and-configure-the-simulator). 30 | 31 | 1. Open a new terminal window and run the following to clone the chia-dev-tools repository, using the `main` branch: 32 | 33 | ```bash 34 | git clone https://github.com/Chia-Network/chia-dev-tools.git -b main 35 | ``` 36 | 37 | 2. Change to the cloned repository: 38 | 39 | ```bash 40 | cd chia-dev-tools 41 | ``` 42 | 43 | 3. Create and activate a virtual environment: 44 | 45 | ```mdx-code-block 46 | 54 | 55 | ``` 56 | 57 | ```powershell 58 | python -m venv venv 59 | .\venv\Scripts\Activate.ps1 60 | ``` 61 | 62 | ```mdx-code-block 63 | 64 | 65 | ``` 66 | 67 | ```bash 68 | python3 -m venv venv 69 | . ./venv/bin/activate 70 | ``` 71 | 72 | ```mdx-code-block 73 | 74 | 75 | ``` 76 | 77 | ```bash 78 | python3 -m venv venv 79 | . ./venv/bin/activate 80 | ``` 81 | 82 | ```mdx-code-block 83 | 84 | 85 | ``` 86 | 87 | 4. Install `.` (chia-dev-tools): 88 | 89 | ```bash 90 | pip install . 91 | ``` 92 | 93 | Several packages will be installed, including a bundled copy of `chia-blockchain`. This process will typically take several minutes. 94 | 95 | 5. `chia-dev-tools` should now be installed and configured properly. To test it, run: 96 | 97 | ```bash 98 | cdv --help 99 | ``` 100 | 101 | You should get a usage statement. At this point, you're ready to set up the simulator. 102 | 103 | ### Install and configure the simulator 104 | 105 | The simulator commands can all be accessed under `cdv sim`. For a full list of the simulator commands, see our [Simulator CLI Reference](https://docs.chia.net/docs/13cli/simulator 'Simulator CLI Reference'). 106 | 107 | 1. Install the simulator 108 | 109 | ```bash 110 | cdv sim create 111 | ``` 112 | 113 | If you do not already have any keys in your OS keychain, you will be prompted to create one: 114 | 115 | `No keys in keychain. Press 'q' to quit, or press any other key to generate a new key.` 116 | 117 | After pressing any key (other than `q`), a new public/private key pair will be generated: 118 | 119 | `Generating private key` 120 | 121 | If you already have one or more keys installed, you will be prompted to select one: 122 | 123 | ```bash 124 | Fingerprints: 125 | If you already used one of these keys, select that fingerprint to skip the plotting process. Otherwise, select any key below. 126 | 1) 3339549250 127 | 2) 1239193935 128 | 3) 378808701 129 | Choose a simulator key [1-3] ('q' to quit, or 'g' to generate a new key): 2 130 | ``` 131 | 132 | This command will create several k-19 plots. These plots are significantly smaller than the k-32 plots used on mainnet (8 MiB vs 100 GiB). They will take less than a minute to create on most computers. 133 | 134 | This command will also install a new version of Chia that contains a config file that is already set up for the simulator to run on its own ports. 135 | 136 | 2. Now that you have the simulator environment set up, you can set the CHIA_ROOT env var to point to this environment. This will enable you to run the simulator from outside of chia-dev-tools: 137 | 138 | ```mdx-code-block 139 | 147 | 148 | ``` 149 | 150 | ```powershell 151 | $env:CHIA_ROOT='~/.chia/simulator/main' 152 | ``` 153 | 154 | ```mdx-code-block 155 | 156 | 157 | ``` 158 | 159 | ```bash 160 | export CHIA_ROOT=~/.chia/simulator/main 161 | ``` 162 | 163 | ```mdx-code-block 164 | 165 | 166 | ``` 167 | 168 | ```bash 169 | export CHIA_ROOT=~/.chia/simulator/main 170 | ``` 171 | 172 | ```mdx-code-block 173 | 174 | 175 | ``` 176 | 177 | Note that by setting CHIA_ROOT to the simulator in the current Powershell/terminal window, this enables you to run the simulator in tandem with a full node running on either the testnet or on mainnet. This is because the simulator uses different ports than a normal full node. 178 | 179 | ### Use the simulator 180 | 181 | This section will cover the basic commands for using the simulator. 182 | 183 | 1. Start the simulator: 184 | 185 | ```bash 186 | chia start simulator 187 | ``` 188 | 189 | This command is the equivalent of `chia start node` on testnet and mainnet. 190 | 191 | 2. Start your Chia wallet: 192 | 193 | ```bash 194 | chia start wallet 195 | ``` 196 | 197 | Result: 198 | 199 | ```bash 200 | chia_wallet: started 201 | ``` 202 | 203 | 3. Verify that the Chia simulator is running and synced: 204 | 205 | ```bash 206 | chia show -s 207 | ``` 208 | 209 | The result will show that the network is `simulator0` and the block height is 1: 210 | 211 | ```bash 212 | Network: simulator0 Port: 44159 RPC Port: 22840 213 | Node ID: fba97a7cc4d9d96e581c0d28a77a3f6ca5f3a8be668164c2ae033ededc9a3c47 214 | Genesis Challenge: eb8c4d20b322be8d9fddbf9412016bdffe9a2901d7edb0e364e94266d0e095f7 215 | Current Blockchain Status: Full Node Synced 216 | 217 | Peak: Hash: 3cf2239c9d43050497b2b895d33e4c1427edc35bcced8e070da2b9ca60008e0f 218 | Time: Mon Sep 26 2022 21:00:46 HKT Height: 1 219 | 220 | Estimated network space: 0.000 MiB 221 | Current difficulty: 1024 222 | Current VDF sub_slot_iters: 1024 223 | Total iterations since the start of the blockchain: 11942 224 | 225 | Height: | Hash: 226 | 1 | 3cf2239c9d43050497b2b895d33e4c1427edc35bcced8e070da2b9ca60008e0f 227 | ``` 228 | 229 | 4. Farm a new block 230 | 231 | There are two ways to farm a new block. The simpler solution is with a CLI call: 232 | 233 | ```bash 234 | cdv sim farm 235 | ``` 236 | 237 | Result: 238 | 239 | ```bash 240 | Farmed 1 Transaction blocks 241 | Block Height is now: 2 242 | ``` 243 | 244 | If you want to direct the farming rewards to a specific address, you can call the RPC: 245 | 246 | ```bash 247 | chia rpc full_node farm_block '{"address":""}' 248 | ``` 249 | 250 | Result: 251 | 252 | ```bash 253 | { 254 | "new_peak_height": 3, 255 | "success": true 256 | } 257 | ``` 258 | 259 | For more info on this command, see the [RPC documentation](https://docs.chia.net/docs/12rpcs/simulator#farm_block). 260 | 261 | 5. Show your wallet's status (including the prefarm): 262 | 263 | ```bash 264 | chia wallet show 265 | ``` 266 | 267 | Result (in step 4 we farmed two blocks, thereby receiving 4 TXCH in rewards): 268 | 269 | ```bash 270 | Wallet height: 3 271 | Sync status: Synced 272 | Balances, fingerprint: 502984008 273 | 274 | Chia Wallet: 275 | -Total Balance: 21000004.0 txch (21000004000000000000 mojo) 276 | -Pending Total Balance: 21000004.0 txch (21000004000000000000 mojo) 277 | -Spendable: 21000004.0 txch (21000004000000000000 mojo) 278 | -Type: STANDARD_WALLET 279 | -Wallet ID: 1 280 | 281 | Connections: 282 | Type IP Ports NodeID Last Connect MiB Up|Dwn 283 | FULL_NODE 127.0.0.1 44159/44159 fba97a7c... Sep 27 04:46:26 0.0|0.1 284 | -Height: No Info -Hash: No Info -Trusted: True 285 | ``` 286 | 287 | Note that your wallet is a normal Chia wallet, but it's running within the simulator. This could be helpful, for example, for testing reorgs. You can manually set up a reorg with the simulator and see how your wallet handles it. 288 | 289 | 6. Edit the simulator's configuration 290 | 291 | The simulator's config is stored in `~/.chia/simulator/main/config/config.yaml`. Just as with mainnet and testnet, if you make changes to this config, you will need to restart the simulator for the changes to take effect. This will not affect your regular Chia node. 292 | 293 | 5. Enable/disable auto farming 294 | 295 | By default, as soon as a new spend bundle enters the mempool, a new block will be farmed. In certain cases this may not be the desired behavior. To disable auto farming, run the following command: 296 | 297 | ```bash 298 | cdv sim autofarm off 299 | ``` 300 | 301 | Result: 302 | 303 | ```bash 304 | Auto farming is now off 305 | ``` 306 | 307 | This action will take effect immediately; there is no need to restart the simulator. 308 | 309 | To enable auto farming, run: 310 | 311 | ```bash 312 | cdv sim autofarm on 313 | ``` 314 | 315 | Result: 316 | 317 | ```bash 318 | Auto farming is now on 319 | ``` 320 | -------------------------------------------------------------------------------- /guides/tutorials/application-structure.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: application-structure 3 | slug: /application-structure-tutorial 4 | title: Application Structure 5 | --- 6 | 7 | # Basic structure of an app using chia 8 | 9 | ``` 10 | 11 | CHIA Your Code 12 | | +--------------------+ +----------+ 13 | Node RPC <---|-> | Specialized Wallet |<----->| Database | 14 | ^ | +--------------------+ +----------+ 15 | | | ^ ^ 16 | | | | | 17 | | | | v 18 | v | | +------------------+ 19 | Wallet RPC --|-------+ | State management | 20 | | +------------------+ 21 | | ^ 22 | | 23 | v 24 | User 25 | ``` 26 | 27 | ### Concerns for developing chia apps 28 | 29 | - The app likely needs a connection to the chia RPC at least for now. 30 | 31 | - A "wallet" type system is needed to track blockchain traffic so that the app's 32 | concept of the current state can be recovered from the same information that's 33 | represented in the blockchain and in order to keep the state presented to the 34 | end user consistent via the node API and a well designed set of arguments to 35 | the chialisp code. Coins touched in a block are available via the full node's 36 | get_additions_and_removals and the solutions via get_puzzle_and_solution. By 37 | checking out each block, it'll be possible to find specially formatted 38 | coin solutions and track them. 39 | 40 | - The app needs at a minimum to allow the user to take actions in a comprehensible 41 | way, which means using a combination of the wallet and node's RPC API to 42 | 43 | 1. Establish which public and private keys to use when interacting with coins 44 | on the blockchain via get_transactions, get_coin_record_by_name and 45 | get_private_key and the master_sk_to_wallet_sk function. 46 | 47 | 2. Send transactions to the blockchain via push_tx. 48 | 49 | - It's likely that the app won't be able to guarantee that it remains running for 50 | the full duration of the purpose of the code it deploys, therefore any state 51 | picked up from the blockchain should be stored in and retrieved from a local 52 | cache database. 53 | 54 | - If more than one party is cooperating over the coin in question, then either an 55 | identifier picking out the coin in question needs to be sent out of band or 56 | something identifiable by the recipient needs to be embedded in the coin 57 | solution. 58 | -------------------------------------------------------------------------------- /guides/tutorials/coin-spend-rpc.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: coin-spend-rpc 3 | slug: /coin-spend-rpc-tutorial 4 | title: RPC Coin Spend 5 | --- 6 | 7 | This tutorial teaches you how to spend a coin with any puzzle using RPC calls. We will be using the [password-locked coin](/guides/chialisp-first-smart-coin) puzzle as an example. 8 | 9 | ## Get your coin's info (amount, puzzle hash & parent info) 10 | 11 | RPC call for spending a coin requires you to specify which coin you are spending. For unique identification, you need the coin's amount, puzzle hash, and parent info. Those three pieces of information are also enough to calculate the coin's ID. 12 | 13 | If you know the puzzle hash or receive address of the coin you are looking for, you can use [Chia Dev Tools](https://github.com/Chia-Network/chia-dev-tools) to get the coin's information. 14 | 15 | **Example for the password-locked coin:** 16 | 17 | ```bash 18 | cdv rpc coinrecords --by puzzlehash 4843c869bba5f65aa1e806cd372dae5668ca3b69640d067e86837ca96b324e71 19 | ``` 20 | 21 | Click through this [tutorial](https://chialisp.com/docs/tutorials/tools_and_setup) to learn more about tools and setup. 22 | 23 | ## Get serialized puzzle and solution 24 | 25 | The next thing you need to know to spend the coin is the coin's puzzle and solution. Puzzles and solutions are provided in a serialized format, so we need to get that for each. The puzzle has to be compiled to low-level Chialisp and is serialized as normal. 26 | 27 | To serialize the solution, you need to slightly modify the solution format to make it valid Chialisp program. For that, you need to quote your solution. For example, in case of the solution `(hello 0x5f5767744f91c1c326d927a63d9b34fa7035c10e3eb838c44e3afe127c1b7675 2)` you need to change it to `(q . (hello 0x5f5767744f91c1c326d927a63d9b34fa7035c10e3eb838c44e3afe127c1b7675 2))` which makes it valid Chialisp program that can be compiled. 28 | 29 | **Example for the password-locked coin:** 30 | 31 | **Puzzle:** `(a (q 2 (i (= (sha256 5) (q . 0x2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824)) (q 4 (c 2 (c 11 (c 23 ()))) ()) (q 8)) 1) (c (q . 51) 1))` 32 | 33 | **Serialized puzzle:** `0xff02ffff01ff02ffff03ffff09ffff0bff0580ffff01a02cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b982480ffff01ff04ffff04ff02ffff04ff0bffff04ff17ff80808080ff8080ffff01ff088080ff0180ffff04ffff0133ff018080` 34 | 35 | **Solution:** `(hello 0x5f5767744f91c1c326d927a63d9b34fa7035c10e3eb838c44e3afe127c1b7675 2)` (as valid Chialisp program `(q . (hello 0x5f5767744f91c1c326d927a63d9b34fa7035c10e3eb838c44e3afe127c1b7675 2))`) 36 | 37 | **Serialized solution:** `0xff8568656c6c6fffa05f5767744f91c1c326d927a63d9b34fa7035c10e3eb838c44e3afe127c1b7675ff0280` 38 | 39 | _WARNING: You have to change this solution and replace the target puzzle hash with your own to get your coins back_ 40 | 41 | ### Serialization using [clvm_tools](https://github.com/Chia-Network/clvm_tools) 42 | 43 | The `opc -H ` command can be used for getting the serialized version of our puzzle and solution as well. The serialized version will be included in the response **on the second line**. 44 | 45 | ```bash 46 | opc -H '(a (q 2 (i (= (sha256 5) (q . 0x2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824)) (q 4 (c 2 (c 11 (c 23 ()))) ()) (q 8)) 1) (c (q . 51) 1))' 47 | ``` 48 | 49 | **Example response:** 50 | 51 | ``` 52 | 4843c869bba5f65aa1e806cd372dae5668ca3b69640d067e86837ca96b324e71 53 | ff02ffff01ff02ffff03ffff09ffff0bff0580ffff01a02cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b982480ffff01ff04ffff04ff02ffff04ff0bffff04ff17ff80808080ff8080ffff01ff088080ff0180ffff04ffff0133ff018080 54 | ``` 55 | 56 | ### Serialization using [Chia Dev Tools](https://github.com/Chia-Network/chia-dev-tools) 57 | 58 | Follow repository's README to set up a new project and serialize puzzle. 59 | 60 | In short: paste your compiled puzzle/solution to your work file and call `chialisp build`. That will generate `.hex` files with a serialized version of your puzzle/solution (depending on your work file). 61 | 62 | ### Serialization using [Chialisp web tool](https://clisp.surrealdev.com/) 63 | 64 | Paste your puzzle in the text area and click **Compile**. The serialized result will be displayed in the **Serialized** section. 65 | 66 | ## Spend a coin with RPC call 67 | 68 | To spend your coin, you only need to call [push_tx](https://docs.chia.net/full-node-rpcs#push_tx) RPC (broadcast transaction example) with values specific to your spend. 69 | 70 | ```bash 71 | curl --insecure --cert ~/.chia/mainnet/config/ssl/full_node/private_full_node.crt --key ~/.chia/mainnet/config/ssl/full_node/private_full_node.key -d '{ "spend_bundle": { 72 | "aggregated_signature": "0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", 73 | "coin_spends": [ 74 | { 75 | "coin": { 76 | "amount": 1, 77 | "parent_coin_info": "0xccd5bb71183532bff220ba46c268991a00000000000000000000000000004082", 78 | "puzzle_hash": "0x4843c869bba5f65aa1e806cd372dae5668ca3b69640d067e86837ca96b324e71" 79 | }, 80 | "puzzle_reveal": "0xff02ffff01ff02ffff03ffff09ffff0bff0580ffff01a02cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b982480ffff01ff04ffff04ff02ffff04ff0bffff04ff17ff80808080ff8080ffff01ff088080ff0180ffff04ffff0133ff018080 ", 81 | "solution": "0xff8568656c6c6fffa05f5767744f91c1c326d927a63d9b34fa7035c10e3eb838c44e3afe127c1b7675ff0280" 82 | } 83 | ] 84 | }}' -H "Content-Type: application/json" -X POST https://localhost:8555/push_tx 85 | ``` 86 | 87 | The [`spend_bundle`](https://docs.chia.net/spend-bundles) object contains an `aggregated_signature`, which we can later assert in the puzzle, and `coin_spends`: a list of objects for all of the coins we are spending. If `aggregated_signature` is not necessary for your puzzle, use 0xc followed by 191 zeros (as in the example above). However, it's worth noting that a puzzle that doesn't use a signature is usually unsafe and should be used only for testing purposes. 88 | 89 | The `coin_solution` contains information about the `coin` it is spending (`amount`, `parent_coin_info`, and `puzzle_hash`). It also includes a serialized puzzle as a `puzzle_reveal` and serialized `solution`. Note: if this is your time constructing a spend bundle, the `puzzle_hash` is the puzzlehash of the receive address that you wish to send to `coin` to. 90 | 91 | If you fill in all your information correctly and send this request, your coin will be spent according to its provided solution, and the response `{"status": "SUCCESS", "success": true}` should be returned from the RPC call. 92 | 93 | If your puzzle requires an aggregated signature, stay tuned for more tutorials. 94 | 95 | --- 96 | 97 | If you have further questions, join our [Keybase team](https://keybase.io/team/chia_network.public) and ask in the _#chialisp_ channel. 98 | -------------------------------------------------------------------------------- /guides/tutorials/custom-puzzle-lock.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: custom-puzzle-lock 3 | slug: /custom-puzzle-lock-tutorial 4 | title: Custom Puzzle Lock 5 | --- 6 | 7 | This tutorial teaches you how to lock a coin with a custom-made puzzle. 8 | 9 | ## Create a puzzle 10 | 11 | Create whatever puzzle you want for your coin. We'll use a password-locked coin as an example for this tutorial. 12 | 13 | ```chialisp 14 | (mod (password new_puzhash amount) 15 | (defconstant CREATE_COIN 51) 16 | 17 | (if (= (sha256 password) (q . 0x2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824)) 18 | (list (list CREATE_COIN new_puzhash amount)) 19 | (x) 20 | ) 21 | ) 22 | ``` 23 | 24 | `0x2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824` is the sha256 hash of the word `hello`. 25 | 26 | **Example valid solution:** `(hello 0x5f5767744f91c1c326d927a63d9b34fa7035c10e3eb838c44e3afe127c1b7675 2)`. 27 | 28 | If password is correct, the puzzle will create a new coin with 2 mojos and lock it using a new puzzle hash `0x5f5767744f91c1c326d927a63d9b34fa7035c10e3eb838c44e3afe127c1b7675`. 29 | 30 | **Any remaining change goes to a farmer as a fee**. 31 | 32 | ## Get compiled version of the custom puzzle 33 | 34 | There are multiple ways how you can get compiled version of your custom puzzle. 35 | 36 | ### Using [clvm_tools](https://github.com/Chia-Network/clvm_tools) (official) 37 | 38 | You can compile your custom puzzle from the terminal using the clvm_tools repository (included in the official Chia repository). All you need to do is to use the `run` command with your puzzle provided as an argument. 39 | 40 | ```bash 41 | run '(mod (password new_puzhash amount) 42 | (defconstant CREATE_COIN 51) 43 | 44 | (if (= (sha256 password) (q . 0x2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824)) 45 | (list (list CREATE_COIN new_puzhash amount)) 46 | (x) 47 | ) 48 | )' 49 | ``` 50 | 51 | results in `(a (q 2 (i (= (sha256 5) (q . 0x2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824)) (q 4 (c 2 (c 11 (c 23 ()))) ()) (q 8)) 1) (c (q . 51) 1))`. 52 | 53 | ### Using [Chialisp web tool](https://clisp.surrealdev.com/) (unofficial) 54 | 55 | Paste your custom puzzle into the text area and hit **Compile**. The compiled version will appear in the **Run Output** section. 56 | 57 | ## Get puzzle hash from a puzzle 58 | 59 | ### Using [clvm_tools](https://github.com/Chia-Network/clvm_tools) 60 | 61 | You can get the hash of your Chialisp puzzle with the `opc -H ` command included in the official clvm_tools repository. 62 | 63 | ```bash 64 | opc -H '(a (q 2 (i (= (sha256 5) (q . 0x2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824)) (q 4 (c 2 (c 11 (c 23 ()))) ()) (q 8)) 1) (c (q . 51) 1))' 65 | ``` 66 | 67 | The response of this command will be a puzzle hash **on the first line** and a serialized version of your puzzle on the second line. 68 | 69 | **Example response:** 70 | 71 | ``` 72 | 4843c869bba5f65aa1e806cd372dae5668ca3b69640d067e86837ca96b324e71 73 | ff02ffff01ff02ffff03ffff09ffff0bff0580ffff01a02cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b982480ffff01ff04ffff04ff02ffff04ff0bffff04ff17ff80808080ff8080ffff01ff088080ff0180ffff04ffff0133ff018080 74 | ``` 75 | 76 | As you can see from the first line of this response, puzzle hash for our custom puzzle is `0x4843c869bba5f65aa1e806cd372dae5668ca3b69640d067e86837ca96b324e71` 77 | 78 | ### Using Chialisp 79 | 80 | You can also use Chialisp itself to get the hash of the Chialisp puzzle. The puzzle to get a puzzle hash is following: 81 | 82 | ```chialisp 83 | (mod (puzzle) 84 | (defconstant TREE 1) 85 | 86 | (defun sha256tree1 (TREE) 87 | (if (l TREE) 88 | (sha256 2 (sha256tree1 (f TREE)) (sha256tree1 (r TREE))) 89 | (sha256 1 TREE) 90 | ) 91 | ) 92 | 93 | (sha256tree1 puzzle) 94 | ) 95 | ``` 96 | 97 | A solution to this puzzle then needs to contain the compiled puzzle we want to hash in the first position (wrap the compiled puzzle with parentheses and provide it as a solution). 98 | 99 | **Example solution for the password-locked coin:** 100 | `((a (q 2 (i (= (sha256 5) (q . 0x2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824)) (q 4 (c 2 (c 11 (c 23 ()))) ()) (q 8)) 1) (c (q . 51) 1)))` 101 | 102 | The resulting hash for this example puzzle is again `0x4843c869bba5f65aa1e806cd372dae5668ca3b69640d067e86837ca96b324e71`. 103 | 104 | ## Convert puzzle hash to a receive address 105 | 106 | You can convert a puzzle hash to a receive address and vice-versa. An address is just an encoded puzzle hash. And since a puzzle hash matches specific puzzle, it also means that a receive address matches a specific puzzle. 107 | 108 | You can use [Chia explorer's online tool](https://www.chiaexplorer.com/tools/address-puzzlehash-converter) for converting between puzzle hash to receive address. The puzzle hash is encoded to bech32m format with xch prefix to form a receive address. The receive address for the puzzle hash `0x4843c869bba5f65aa1e806cd372dae5668ca3b69640d067e86837ca96b324e71` is `xch1fppus6dm5hm94g0gqmxnwtdw2e5v5wmfvsxsvl5xsd72j6ejfecsdnkf2e`. 109 | 110 | ## Send Chia to the receive address 111 | 112 | Use the Chia GUI or CLI to send a transaction as you would typically do with the amount you want. As a receive address, set the address from the previous step (password-locked coin example: `xch1fppus6dm5hm94g0gqmxnwtdw2e5v5wmfvsxsvl5xsd72j6ejfecsdnkf2e`). That will lock your coin with a new puzzle. 113 | 114 | --- 115 | 116 | If you have further questions, join our [Keybase team](https://keybase.io/team/chia_network.public) and ask in the _#chialisp_ channel. 117 | -------------------------------------------------------------------------------- /guides/tutorials/video-series/announcements-oracles.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: announcements-oracles 3 | slug: /announcements-oracles-video-series 4 | title: Announcements, Oracles 5 | --- 6 | 7 | In this video, Adam Kelly discusses announcements and oracles. 8 | 9 |
10 | 11 |
12 | --- 13 | 14 | If you have further questions, join our [Keybase team](https://keybase.io/team/chia_network.public) and ask in the _#chialisp_ channel. 15 | -------------------------------------------------------------------------------- /guides/tutorials/video-series/coin-lifecycle-and-testing.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: coin-lifecycle-and-testing 3 | slug: /coin-lifecycle-and-testing-video-series 4 | title: Coin Lifecycle and Testing 5 | --- 6 | 7 | In these videos, Chia developer Matt Hauff covers creating your first smart coin in Chia and running tests through the example of a piggybank smart coin. 8 | 9 | If you haven't watched [the video on setting up your environment](/guides/tools-and-setup-video-series), do that first. 10 | 11 | You can download the piggybank coin example files [here](/files/Piggybank_Example.zip). 12 | 13 | ## 2 - Start Writing Your First Smart Coin 14 | 15 |
16 | 17 |
18 | 19 | ## 3 - Finish Writing Your First Smart Coin 20 | 21 |
22 | 23 |
24 | 25 | ## 4 - Securing a Smart Coin 26 | 27 |
28 | 29 |
30 | Video 4 Slides Download 31 | 32 | ## 5 - Currying 33 | 34 |
35 | 36 |
37 | 38 | ## 6 - Driver Code 39 | 40 |
41 | 42 |
43 | 44 | ## 7 - Writing Smart Coin Tests 45 | 46 |
47 | 48 |
49 | 50 | ## 8 - Deploying a Smart Coin to the Blockchain 51 | 52 |
53 | 54 |
55 | 56 | ## 9 - Spending Your Smart Coin 57 | 58 |
59 | 60 |
61 | 62 | --- 63 | 64 | If you have further questions, join our [Keybase team](https://keybase.io/team/chia_network.public) and ask in the _#chialisp_ channel. 65 | -------------------------------------------------------------------------------- /guides/tutorials/video-series/developing-applications.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: developing-applications 3 | slug: /developing-applications-video-series 4 | title: Developing Applications 5 | --- 6 | 7 | Chia developer Matthew Howard gives a high level overview of the concepts involved in developing applications on Chia. 8 | 9 |
10 | 11 |
12 | 13 | --- 14 | 15 | If you have further questions, join our [Keybase team](https://keybase.io/team/chia_network.public) and ask in the _#chialisp_ channel. 16 | -------------------------------------------------------------------------------- /guides/tutorials/video-series/multiple-issuance-cat.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: multiple-issuance-cat 3 | slug: /multiple-issuance-cat-video-series 4 | title: Multiple Issuance CAT 5 | --- 6 | 7 | In this video, Matt Hauff (aka quexington on Keybase), walks you through creating a multiple issuance Chia Asset Token (CAT). Watch the [Single Issuance CAT video](https://chialisp.com/docs/tutorials/single_issuance_CAT 'Video tutorial to create a single-issuance CAT') first before watching this one. 8 | 9 |
10 | 11 |
12 | 13 | [CAT Admin Tool Github Repo](https://github.com/Chia-Network/CAT-admin-tool) 14 | 15 | --- 16 | 17 | If you have further questions, join our [Keybase team](https://keybase.io/team/chia_network.public) and ask in the _#chialisp_ channel. 18 | -------------------------------------------------------------------------------- /guides/tutorials/video-series/programming-chialisp.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: programming-chialisp 3 | slug: /programming-chialisp-video-series 4 | title: Programming in Chialisp 5 | --- 6 | 7 | This video is an exercise in using fundamental Chialisp commands to print out the lyrics to the blockchain version of a [classic song](https://en.wikipedia.org/wiki/99_Bottles_of_Beer). 8 | 9 | You will learn Chialisp basics, including: 10 | 11 | - print 12 | - calling functions 13 | - using modules 14 | - looping over data 15 | - [cons](https://en.wikipedia.org/wiki/Cons) 16 | - building lists 17 | - recursion 18 | 19 |
20 | 21 |
22 | 23 | Test your understanding of the concepts in the video by printing out the full list of the lyrics of the song. Your result should look similar to: 24 | 25 | ```bash 26 | 27 | (q. "99 full nodes on the net, 99 full nodes on the net. 28 | Go out of town, your server goes down, 98 full nodes on 29 | the net." "98 full nodes on the net, 98 full nodes on the 30 | net. Go out of town, your server goes down, 97 full nodes 31 | on the net." "97 full nodes on the net, 97 full nodes on 32 | the net. Go out of town, your server goes down, 96 full 33 | nodes on the net." [...] "1 full nodes on the net, 1 full 34 | nodes on the net. Go out of town, your server goes down, 35 | 0 full nodes on the net.") 36 | 37 | ``` 38 | 39 | --- 40 | 41 | If you have further questions, join our [Keybase team](https://keybase.io/team/chia_network.public) and ask in the _#chialisp_ channel. 42 | -------------------------------------------------------------------------------- /guides/tutorials/video-series/security-arguments-signing.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: security-arguments-signing 3 | slug: /security-arguments-signing-video-series 4 | title: Security, Arguments, Signing 5 | --- 6 | 7 | In this video, Adam Kelly discusses security and checking arguments and signatures. 8 | 9 |
10 | 11 |
12 | 13 | --- 14 | 15 | If you have further questions, join our [Keybase team](https://keybase.io/team/chia_network.public) and ask in the _#chialisp_ channel. 16 | -------------------------------------------------------------------------------- /guides/tutorials/video-series/single-issuance-cat.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: single-issuance-cat 3 | slug: /single-issuance-cat-video-series 4 | title: Single Issuance CAT 5 | --- 6 | 7 | In this video, Matt Hauff (aka quexington on Keybase), walks you through the one-time issuance of a Chia Asset Token (CAT). 8 | 9 |
10 | 11 |
12 | 13 | [CAT Admin Tool Github Repo](https://github.com/Chia-Network/CAT-admin-tool) 14 | 15 | --- 16 | 17 | If you have further questions, join our [Keybase team](https://keybase.io/team/chia_network.public) and ask in the _#chialisp_ channel. 18 | -------------------------------------------------------------------------------- /guides/tutorials/video-series/singleton-contracts.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: singleton-contracts 3 | slug: /singleton-contracts-video-series 4 | title: Singleton Contracts 5 | --- 6 | 7 | Singletons are a fundamental concept in Chia. In this video, Chia developer Matthew Howard explains what Singletons are and how they're involved in creating Ethereum-like contracts in Chia. 8 | 9 |
10 | 11 |
12 | 13 | --- 14 | 15 | If you have further questions, join our [Keybase team](https://keybase.io/team/chia_network.public) and ask in the _#chialisp_ channel. 16 | -------------------------------------------------------------------------------- /guides/tutorials/video-series/state-coins-announcements.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: state-coins-announcements 3 | slug: /state-coins-announcements-video-series 4 | title: State, Coins, Announcements 5 | --- 6 | 7 | Adam Kelly discusses managing state, coin creation, and announcements in this Chialisp video. 8 | 9 |
10 | 11 |
12 | 13 | --- 14 | 15 | If you have further questions, join our [Keybase team](https://keybase.io/team/chia_network.public) and ask in the _#chialisp_ channel. 16 | -------------------------------------------------------------------------------- /guides/tutorials/video-series/tools-and-setup.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: tools-and-setup 3 | slug: /tools-and-setup-video-series 4 | title: Tools and Setup 5 | --- 6 | 7 | In this video, Chia developer Matt Hauff goes over what you need to set up so that you can start building in the next section: [Coin Lifecycle and Testing](/guides/coin-lifecycle-and-testing-video-series). 8 | 9 | ## 1 - Environment Setup 10 | 11 |
12 | 13 |
14 | 15 | --- 16 | 17 | If you have further questions, join our [Keybase team](https://keybase.io/team/chia_network.public) and ask in the _#chialisp_ channel. 18 | -------------------------------------------------------------------------------- /guides/tutorials/video-series/why-chia-is-great.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: why-chia-is-great 3 | slug: /why-chia-is-great-video-series 4 | title: Why Chia is Great 5 | --- 6 | 7 | Welcome to the Chialisp tutorial series. 8 | 9 | This video is a high level overview of the design decisions made in the Chia that lend themselves to strengths for certain financial use cases. 10 | 11 |
12 | 13 |
14 | 15 | Watch the following videos to learn more about the mindset and basic skills needed to program in Chialisp. 16 | 17 | --- 18 | 19 | If you have further questions, join our [Keybase team](https://keybase.io/team/chia_network.public) and ask in the _#chialisp_ channel. 20 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "chia-dev-guides", 3 | "version": "0.0.0", 4 | "private": true, 5 | "scripts": { 6 | "docusaurus": "docusaurus", 7 | "start": "docusaurus start", 8 | "build": "docusaurus build", 9 | "swizzle": "docusaurus swizzle", 10 | "deploy": "docusaurus deploy", 11 | "clear": "docusaurus clear", 12 | "serve": "docusaurus serve", 13 | "write-translations": "docusaurus write-translations", 14 | "write-heading-ids": "docusaurus write-heading-ids" 15 | }, 16 | "dependencies": { 17 | "@cmfcmf/docusaurus-search-local": "^0.11.0", 18 | "@docusaurus/core": "^2.1.0", 19 | "@docusaurus/preset-classic": "^2.1.0", 20 | "@easyops-cn/docusaurus-search-local": "^0.31.0", 21 | "@mdx-js/react": "^1.6.22", 22 | "clsx": "^1.1.1", 23 | "prism-react-renderer": "^1.3.1", 24 | "react": "^17.0.2", 25 | "react-dom": "^17.0.2", 26 | "yarn": "^1.22.19" 27 | }, 28 | "devDependencies": { 29 | "@docusaurus/module-type-aliases": "^2.0.1" 30 | }, 31 | "browserslist": { 32 | "production": [ 33 | ">0.5%", 34 | "not dead", 35 | "not op_mini all" 36 | ], 37 | "development": [ 38 | "last 1 chrome version", 39 | "last 1 firefox version", 40 | "last 1 safari version" 41 | ] 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /sidebars.js: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | 3 | /** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ 4 | const sidebars = { 5 | tutorialSidebar: [ 6 | { 7 | type: 'category', 8 | label: 'Chialisp Primer', 9 | collapsible: true, 10 | collapsed: true, 11 | link: { 12 | type: 'generated-index', 13 | slug: '/chialisp-primer', 14 | title: 'Chialisp Primer', 15 | description: 16 | 'This guide will teach you the basics of Chialisp, a smart coin language used on the Chia blockchain. You will learn the skills required to write basic programs that can dictate how and when coins (including XCH) can be spent.', 17 | }, 18 | items: [ 19 | 'chialisp-primer/chialisp-primer-intro', 20 | 'chialisp-primer/chialisp-primer-using-modules', 21 | 'chialisp-primer/chialisp-primer-testnet-setup', 22 | 'chialisp-primer/chialisp-primer-first-smart-coin', 23 | 'chialisp-primer/chialisp-primer-bls-signatures', 24 | ], 25 | }, 26 | { 27 | type: 'category', 28 | label: 'Chialisp Concepts', 29 | collapsible: true, 30 | collapsed: true, 31 | link: { 32 | type: 'generated-index', 33 | slug: '/chialisp-concepts', 34 | title: 'Chialisp Concepts', 35 | description: 36 | 'This guide introduces some key Chialisp concepts. Understanding these concepts will enable you to write Chialisp programs more easily.', 37 | }, 38 | items: [ 39 | 'chialisp-concepts/chialisp-concepts-currying', 40 | 'chialisp-concepts/chialisp-concepts-inner-puzzles', 41 | 'chialisp-concepts/chialisp-concepts-condition-morphing', 42 | ], 43 | }, 44 | { 45 | type: 'category', 46 | label: 'NFT Guide', 47 | collapsible: true, 48 | collapsed: false, 49 | link: { 50 | type: 'generated-index', 51 | slug: '/nft-developer-guide', 52 | title: 'NFT Developer Guide', 53 | description: 54 | "This tutorial will guide you through the process of creating DIDs that conform to Chia's DID standard, as well as minting NFTs that adhere to Chia's NFT standard.", 55 | }, 56 | items: [ 57 | 'nft/nft-intro', 58 | 'nft/nft-cli', 59 | 'nft/nft-rpc', 60 | 'nft/nft-bulk-mint', 61 | ], 62 | }, 63 | { 64 | type: 'category', 65 | label: 'CAT Guide', 66 | collapsible: true, 67 | collapsed: true, 68 | link: { 69 | type: 'generated-index', 70 | slug: '/cat-developer-guide', 71 | title: 'CAT Developer Guide', 72 | description: 73 | "These guides will guide you through the process of creating CATs that conform to Chia's CAT standard.", 74 | }, 75 | items: ['cat/cat-creation-tutorial'], 76 | }, 77 | { 78 | type: 'category', 79 | label: 'Custody Tool', 80 | collapsible: true, 81 | collapsed: true, 82 | link: { 83 | type: 'generated-index', 84 | slug: '/custody-tool-description', 85 | title: 'Custody Tool', 86 | description: 87 | "How to use Chia's Custody Tool to secure your own coins.", 88 | }, 89 | items: [ 90 | 'custody/custody-tool-description', 91 | 'custody/custody-tool-user-guide' 92 | ], 93 | }, 94 | 'datalayer/datalayer-user-guide', 95 | 'simulator/simulator-user-guide', 96 | { 97 | type: 'category', 98 | label: 'Tutorials', 99 | collapsible: true, 100 | collapsed: true, 101 | items: [ 102 | { 103 | 'Video Series': [ 104 | 'tutorials/video-series/why-chia-is-great', 105 | 'tutorials/video-series/developing-applications', 106 | 'tutorials/video-series/tools-and-setup', 107 | 'tutorials/video-series/programming-chialisp', 108 | 'tutorials/video-series/coin-lifecycle-and-testing', 109 | 'tutorials/video-series/singleton-contracts', 110 | 'tutorials/video-series/state-coins-announcements', 111 | 'tutorials/video-series/security-arguments-signing', 112 | 'tutorials/video-series/announcements-oracles', 113 | 'tutorials/video-series/single-issuance-cat', 114 | 'tutorials/video-series/multiple-issuance-cat', 115 | ], 116 | }, 117 | 'tutorials/custom-puzzle-lock', 118 | 'tutorials/coin-spend-rpc', 119 | 'tutorials/application-structure', 120 | 'tutorials/offers-gui', 121 | 'tutorials/offers-cli', 122 | ], 123 | }, 124 | ], 125 | }; 126 | 127 | module.exports = sidebars; 128 | -------------------------------------------------------------------------------- /src/components/HomepageFeatures/index.js: -------------------------------------------------------------------------------- 1 | import clsx from "clsx"; 2 | import React from "react"; 3 | import styles from "./styles.module.css"; 4 | 5 | const FeatureList = [ 6 | { 7 | title: "NFT Developer Guide", 8 | Svg: require("@site/static/img/chia_NFT.svg").default, 9 | dest_url: "/guides/nft-developer-guide", 10 | description: ( 11 | <>Find out more about minting NFTs on Chia - the secure, sustainable blockchain 12 | ), 13 | }, 14 | { 15 | title: "Get Started with Chialisp", 16 | Svg: require("@site/static/img/chialisp_logo.svg").default, 17 | dest_url: "/guides", 18 | description: ( 19 | <> Learn the fundamentals of Chialisp - the smart coin programming language 20 | ), 21 | }, 22 | { 23 | title: "Developer Forum", 24 | Svg: require("@site/static/img/chiadevs-icon.svg").default, 25 | dest_url: "https://developers.chia.net/", 26 | description: ( 27 | <>Connect with Chia developers, discuss your projects and get help from the community. 28 | ), 29 | }, 30 | ]; 31 | 32 | function Feature({ Svg, title, description, dest_url }) { 33 | return ( 34 |
35 |
36 | 37 | 38 | 39 |
40 |
41 | 42 |

{title}

43 |
44 |

{description}

45 |
46 |
47 | ); 48 | } 49 | 50 | export default function HomepageFeatures() { 51 | return ( 52 |
53 |
54 |
55 | {FeatureList.map((props, idx) => ( 56 | 57 | ))} 58 |
59 |
60 |
61 | ); 62 | } 63 | -------------------------------------------------------------------------------- /src/components/HomepageFeatures/styles.module.css: -------------------------------------------------------------------------------- 1 | .features { 2 | display: flex; 3 | align-items: center; 4 | padding: 2rem 0; 5 | width: 100%; 6 | } 7 | 8 | .featureSvg { 9 | height: 200px; 10 | width: 200px; 11 | } 12 | -------------------------------------------------------------------------------- /src/css/custom.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --ifm-color-primary: #3aac59; 3 | --ifm-color-primary-dark: #349b50; 4 | --ifm-color-primary-darker: #31924c; 5 | --ifm-color-primary-darkest: #29783e; 6 | --ifm-color-primary-light: #40bd62; 7 | --ifm-color-primary-lighter: #47c168; 8 | --ifm-color-primary-lightest: #61ca7e; 9 | --ifm-code-font-size: 95%; 10 | --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1); 11 | } 12 | [data-theme='dark'] { 13 | --ifm-color-primary: #3aac59; 14 | --ifm-color-primary-dark: #349b50; 15 | --ifm-color-primary-darker: #31924c; 16 | --ifm-color-primary-darkest: #29783e; 17 | --ifm-color-primary-light: #40bd62; 18 | --ifm-color-primary-lighter: #47c168; 19 | --ifm-color-primary-lightest: #61ca7e; 20 | --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3); 21 | } 22 | 23 | h4 { 24 | font-size: 20px; 25 | } 26 | 27 | .videoWrapper { 28 | position: relative; 29 | padding-bottom: 56.25%; /* 16:9 */ 30 | height: 0; 31 | } 32 | .videoWrapper iframe { 33 | position: absolute; 34 | top: 0; 35 | left: 0; 36 | width: 100%; 37 | height: 100%; 38 | } -------------------------------------------------------------------------------- /src/pages/index.js: -------------------------------------------------------------------------------- 1 | import Link from '@docusaurus/Link'; 2 | import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; 3 | import HomepageFeatures from '@site/src/components/HomepageFeatures'; 4 | import Layout from '@theme/Layout'; 5 | import clsx from 'clsx'; 6 | import React from 'react'; 7 | import styles from './index.module.css'; 8 | 9 | function HomepageHeader() { 10 | const { siteConfig } = useDocusaurusContext(); 11 | return ( 12 |
13 |
14 |

{siteConfig.customFields.landingTitle}

15 |

{siteConfig.tagline}

16 |
17 | 18 | Let's get started! 19 | 20 |
21 |
22 |
23 | ); 24 | } 25 | 26 | export default function Home() { 27 | const { siteConfig } = useDocusaurusContext(); 28 | return ( 29 | 34 | 35 |
36 | 37 |
38 |
39 | ); 40 | } 41 | -------------------------------------------------------------------------------- /src/pages/index.module.css: -------------------------------------------------------------------------------- 1 | .heroBanner { 2 | padding: 4rem 0; 3 | text-align: center; 4 | position: relative; 5 | overflow: hidden; 6 | } 7 | 8 | @media screen and (max-width: 996px) { 9 | .heroBanner { 10 | padding: 2rem; 11 | } 12 | } 13 | 14 | .buttons { 15 | display: flex; 16 | align-items: center; 17 | justify-content: center; 18 | } 19 | -------------------------------------------------------------------------------- /src/theme/prism-chialisp.js: -------------------------------------------------------------------------------- 1 | (function (Prism) { 2 | // Functions to construct regular expressions 3 | // simple form 4 | // e.g. (interactive ... or (interactive) 5 | function simple_form(name) { 6 | return RegExp('(\\()' + name + '(?=[\\s\\)])'); 7 | } 8 | // booleans and numbers 9 | function primitive(pattern) { 10 | return RegExp('([\\s([])' + pattern + '(?=[\\s)])'); 11 | } 12 | 13 | // Patterns in regular expressions 14 | 15 | // Symbol name. See https://www.gnu.org/software/emacs/manual/html_node/elisp/Symbol-Type.html 16 | // & and : are excluded as they are usually used for special purposes 17 | var symbol = '[-+*/_~!@$%^=<>{}\\w]+'; 18 | // symbol starting with & used in function arguments 19 | var marker = '&' + symbol; 20 | // Open parenthesis for look-behind 21 | var par = '(\\()'; 22 | var endpar = '(?=\\))'; 23 | // End the pattern with look-ahead space 24 | var space = '(?=\\s)'; 25 | 26 | var language = { 27 | comment: /;.*/, 28 | string: { 29 | pattern: /"(?:[^"\\]|\\.)*"/, 30 | greedy: true, 31 | inside: { 32 | argument: /[-A-Z]+(?=[.,\s])/, 33 | symbol: RegExp('`' + symbol + "'") 34 | } 35 | }, 36 | keyword: [ 37 | { 38 | pattern: RegExp( 39 | par + 40 | '(?:(?:lexical-)?let\\*?|(?:cl-)?if|defconstant|i|include)' + 41 | space 42 | ), 43 | lookbehind: true 44 | }, 45 | { 46 | pattern: RegExp( 47 | par + '(?:sha256|x|a|=|concat|\\+|\\-|\\/|\\*|logand|logior|logxor|lognot|ash|lsh|substr|strlen|sha256|point_add|pubkey_for_exp)(?=\\s+|\\))' 48 | ), 49 | lookbehind: true, 50 | alias: 'builtin', 51 | }, 52 | { 53 | pattern: RegExp( 54 | par + '(?:q[q]*|unquote)(?=\\s+|\\))' 55 | ), 56 | lookbehind: true, 57 | alias: 'quotes', 58 | }, 59 | { 60 | pattern: RegExp( 61 | par + '(?:f|r|list|c|l)' + space 62 | ), 63 | lookbehind: true, 64 | alias: 'listop', 65 | }, 66 | ], 67 | boolean: { 68 | pattern: primitive('\\(\\)'), 69 | lookbehind: true 70 | }, 71 | hexadecimal: { 72 | pattern: /0x[0-9a-fA-F]+/ 73 | }, 74 | number: { 75 | pattern: RegExp('([\\s([])' + '[-+]?\\d+(?:\\.\\d*)?'), 76 | lookbehind: true 77 | }, 78 | brun: /(\$ )*(brun|run|opd|opc)/, 79 | defun: { 80 | pattern: RegExp( 81 | par + 82 | '(?:cl-)?(?:defun\\*?|defmacro|defun-inline)\\s+' + 83 | symbol + 84 | '\\s+\\([\\s\\S]*?\\)' 85 | ), 86 | lookbehind: true, 87 | inside: { 88 | keyword: /^(?:cl-)?def\S+/, 89 | // identifier: RegExp(symbol), 90 | // See below, this property needs to be defined later so that it can 91 | // reference the language object. 92 | arguments: null, 93 | function: { 94 | pattern: RegExp('(^\\s)' + symbol), 95 | lookbehind: true 96 | }, 97 | punctuation: /[()]/ 98 | } 99 | }, 100 | mod: { 101 | pattern: RegExp( 102 | par + 103 | '(?:cl-)?(?:mod)' + 104 | '\\s+\\([\\s\\S]*?\\)' 105 | ), 106 | lookbehind: true, 107 | inside: { 108 | keyword: /^mod/, 109 | // See below, this property needs to be defined later so that it can 110 | // reference the language object. 111 | arguments: null, 112 | function: { 113 | pattern: RegExp('(^\\s)'), 114 | lookbehind: true 115 | }, 116 | punctuation: /[()]/ 117 | } 118 | }, 119 | car: { 120 | pattern: RegExp(par + symbol + space), 121 | lookbehind: true 122 | }, 123 | punctuation: [ 124 | // open paren, brackets, and close paren 125 | /(?:['`,]?\(|[)\[\]])/, 126 | // cons 127 | { 128 | pattern: /(\s)\.(?=\s)/, 129 | lookbehind: true 130 | }, 131 | ] 132 | }; 133 | 134 | var arg = { 135 | 'lisp-marker': RegExp(marker), 136 | rest: { 137 | argument: { 138 | pattern: RegExp(symbol), 139 | alias: 'variable' 140 | }, 141 | varform: { 142 | pattern: RegExp(par + symbol + '\\s+\\S[\\s\\S]*' + endpar), 143 | lookbehind: true, 144 | inside: { 145 | string: language.string, 146 | boolean: language.boolean, 147 | number: language.number, 148 | symbol: language.symbol, 149 | punctuation: /[()]/ 150 | } 151 | } 152 | } 153 | }; 154 | 155 | var forms = '\\S+(?:\\s+\\S+)*'; 156 | 157 | var arglist = { 158 | pattern: RegExp(par + '[\\s\\S]*' + endpar), 159 | lookbehind: true, 160 | inside: { 161 | 'rest-vars': { 162 | pattern: RegExp('&(?:rest|body)\\s+' + forms), 163 | inside: arg 164 | }, 165 | 'other-marker-vars': { 166 | pattern: RegExp('&(?:optional|aux)\\s+' + forms), 167 | inside: arg 168 | }, 169 | keys: { 170 | pattern: RegExp('&key\\s+' + forms + '(?:\\s+&allow-other-keys)?'), 171 | inside: arg 172 | }, 173 | argument: { 174 | pattern: RegExp(symbol), 175 | alias: 'variable' 176 | }, 177 | punctuation: /[()]/ 178 | } 179 | }; 180 | 181 | language['defun'].inside.arguments = Prism.util.clone(arglist); 182 | language['defun'].inside.arguments.inside.sublist = Prism.util.clone(arglist); 183 | language['mod'].inside.arguments = Prism.util.clone(arglist); 184 | language['mod'].inside.arguments.inside.sublist = Prism.util.clone(arglist); 185 | 186 | Prism.languages.chialisp = language; 187 | }(Prism)); 188 | -------------------------------------------------------------------------------- /src/theme/prism-dark-theme-chialisp.js: -------------------------------------------------------------------------------- 1 | // Original: https://github.com/dracula/visual-studio-code 2 | // Converted automatically using ./tools/themeFromVsCode 3 | var theme = { 4 | plain: { 5 | color: "#F8F8F2", 6 | backgroundColor: "#282A36", 7 | fontWeight: "bold", 8 | }, 9 | styles: [ 10 | { 11 | types: ["keyword"], 12 | style: { 13 | color: "rgb(189, 147, 249)", 14 | }, 15 | }, 16 | { 17 | types: ["listop", "class-name", "quotes"], 18 | style: { 19 | color: "rgb(80, 250, 123)", 20 | }, 21 | }, 22 | { 23 | types: ["builtin"], 24 | style: { 25 | color: "rgb(5, 227, 223)", 26 | }, 27 | }, 28 | { 29 | types: ["number", "hexadecimal", "string", "boolean"], //numbers and hexes must be the same color 30 | style: { 31 | color: "rgb(255, 184, 108)", 32 | fontWeight: "normal", 33 | }, 34 | }, 35 | { 36 | types: ["punctuation", "symbol"], 37 | style: { 38 | color: "rgb(248, 248, 242)", 39 | }, 40 | }, 41 | { 42 | types: ["variable"], 43 | style: { 44 | fontStyle: "italic", 45 | }, 46 | }, 47 | { 48 | types: ["comment"], 49 | style: { 50 | color: "rgb(98, 114, 164)", 51 | fontWeight: "normal", 52 | }, 53 | }, 54 | { 55 | types: ["function", "car"], 56 | style: { 57 | color: "rgb(241, 250, 140)", 58 | }, 59 | }, 60 | ], 61 | }; 62 | 63 | module.exports = theme; 64 | -------------------------------------------------------------------------------- /src/theme/prism-include-languages.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | import ExecutionEnvironment from "@docusaurus/ExecutionEnvironment"; 8 | import siteConfig from "@generated/docusaurus.config"; 9 | 10 | const prismIncludeLanguages = (PrismObject) => { 11 | if (ExecutionEnvironment.canUseDOM) { 12 | const { 13 | themeConfig: { prism: { additionalLanguages = [] } = {} }, 14 | } = siteConfig; 15 | window.Prism = PrismObject; 16 | additionalLanguages.forEach((lang) => { 17 | require(`prismjs/components/prism-${lang}`); // eslint-disable-line 18 | }); 19 | 20 | require("./prism-chialisp"); 21 | 22 | delete window.Prism; 23 | } 24 | }; 25 | 26 | export default prismIncludeLanguages; 27 | -------------------------------------------------------------------------------- /src/theme/prism-light-theme-chialisp.js: -------------------------------------------------------------------------------- 1 | // Original: https://github.com/dracula/visual-studio-code 2 | // Converted automatically using ./tools/themeFromVsCode 3 | var theme = { 4 | plain: { 5 | color: "#383a42", 6 | backgroundColor: "#fafafa", 7 | fontWeight: "bold", 8 | }, 9 | styles: [ 10 | { 11 | types: ["keyword"], 12 | style: { 13 | color: "#990096", 14 | }, 15 | }, 16 | { 17 | types: ["listop", "class-name", "quotes"], 18 | style: { 19 | color: "#006100", 20 | }, 21 | }, 22 | { 23 | types: ["builtin"], 24 | style: { 25 | color: "#127EAF", 26 | }, 27 | }, 28 | { 29 | types: ["number", "hexadecimal", "string", "boolean"], //numbers and hexes must be the same color 30 | style: { 31 | color: "#B35C00", 32 | fontWeight: "normal", 33 | }, 34 | }, 35 | { 36 | types: ["punctuation", "symbol"], 37 | style: { 38 | color: "#383a42", 39 | }, 40 | }, 41 | { 42 | types: ["variable"], 43 | style: { 44 | fontStyle: "italic", 45 | }, 46 | }, 47 | { 48 | types: ["comment"], 49 | style: { 50 | color: "#73737D", 51 | fontWeight: "normal", 52 | }, 53 | }, 54 | { 55 | types: ["function", "car"], 56 | style: { 57 | color: "#0045DB", 58 | }, 59 | }, 60 | ], 61 | }; 62 | 63 | module.exports = theme; 64 | -------------------------------------------------------------------------------- /static/.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/.nojekyll -------------------------------------------------------------------------------- /static/CNAME: -------------------------------------------------------------------------------- 1 | devs.chia.net -------------------------------------------------------------------------------- /static/files/Piggybank_Example.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/files/Piggybank_Example.zip -------------------------------------------------------------------------------- /static/files/tutorials/4-Securing_a_Smart_Coin_Slides-Chialisp.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/files/tutorials/4-Securing_a_Smart_Coin_Slides-Chialisp.pdf -------------------------------------------------------------------------------- /static/files/tutorials/Piggybank_Example.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/files/tutorials/Piggybank_Example.zip -------------------------------------------------------------------------------- /static/img/chia-logo-white.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /static/img/chia-logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /static/img/chia_NFT.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /static/img/chia_leaf_green.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 8 | 9 | 10 | 11 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /static/img/chiadevs-icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /static/img/chialisp_logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 25 | 26 | 28 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 47 | 48 | 49 | 52 | 53 | 54 | 59 | 60 | 61 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /static/img/coin_lifecycle_testing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/coin_lifecycle_testing.png -------------------------------------------------------------------------------- /static/img/data_layer/01_downloads_windows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/data_layer/01_downloads_windows.png -------------------------------------------------------------------------------- /static/img/data_layer/02_downloads_mac.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/data_layer/02_downloads_mac.png -------------------------------------------------------------------------------- /static/img/data_layer/03_start_chia_mac.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/data_layer/03_start_chia_mac.png -------------------------------------------------------------------------------- /static/img/data_layer/04_wallet_farming_mode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/data_layer/04_wallet_farming_mode.png -------------------------------------------------------------------------------- /static/img/data_layer/05_create_private_key.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/data_layer/05_create_private_key.png -------------------------------------------------------------------------------- /static/img/data_layer/06_seed_phrase.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/data_layer/06_seed_phrase.png -------------------------------------------------------------------------------- /static/img/data_layer/07_choose_key.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/data_layer/07_choose_key.png -------------------------------------------------------------------------------- /static/img/data_layer/08_not_synced.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/data_layer/08_not_synced.png -------------------------------------------------------------------------------- /static/img/data_layer/09_start_data.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/data_layer/09_start_data.png -------------------------------------------------------------------------------- /static/img/data_layer/10_synced.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/data_layer/10_synced.png -------------------------------------------------------------------------------- /static/img/data_layer/11_copy_address.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/data_layer/11_copy_address.png -------------------------------------------------------------------------------- /static/img/data_layer/12_send_money.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/data_layer/12_send_money.png -------------------------------------------------------------------------------- /static/img/data_layer/13_send_pending.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/data_layer/13_send_pending.png -------------------------------------------------------------------------------- /static/img/data_layer/14_cant_send.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/data_layer/14_cant_send.png -------------------------------------------------------------------------------- /static/img/dev-guides-logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /static/img/docusaurus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/docusaurus.png -------------------------------------------------------------------------------- /static/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/favicon.ico -------------------------------------------------------------------------------- /static/img/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 10 | 11 | 23 | 24 | 29 | 30 | 31 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/cancel/1_actions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/cancel/1_actions.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/cancel/2_cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/cancel/2_cancel.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/cancel/3_cancel_on_chain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/cancel/3_cancel_on_chain.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/cancel/4_cancel_off_chain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/cancel/4_cancel_off_chain.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/cancel/5_pending_cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/cancel/5_pending_cancel.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/cancel/6_cancelled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/cancel/6_cancelled.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/issues/01_xch_wallet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/issues/01_xch_wallet.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/issues/02_ckc_wallet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/issues/02_ckc_wallet.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/issues/03_100xch_for_1mckc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/issues/03_100xch_for_1mckc.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/issues/04_100xch_for_1mckc_fail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/issues/04_100xch_for_1mckc_fail.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/issues/05_accept_offer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/issues/05_accept_offer.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/issues/06_insufficient_funds.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/issues/06_insufficient_funds.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/issues/07_0.1xch_wallet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/issues/07_0.1xch_wallet.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/issues/08_0.25_shibe_for_0.1_xch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/issues/08_0.25_shibe_for_0.1_xch.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/issues/09_accept_unknown_warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/issues/09_accept_unknown_warning.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/issues/10_unknown_success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/issues/10_unknown_success.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/issues/11_invalid_offer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/issues/11_invalid_offer.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/issues/12_0.1xch_wallet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/issues/12_0.1xch_wallet.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/issues/13_1usds_wallet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/issues/13_1usds_wallet.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/issues/14_view_offer_0.1xch_10usds.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/issues/14_view_offer_0.1xch_10usds.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/issues/15_cancel_off_chain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/issues/15_cancel_off_chain.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/issues/16_canceled_off_chain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/issues/16_canceled_off_chain.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/issues/17_accept_a_canceled_offer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/issues/17_accept_a_canceled_offer.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/issues/18_confirmed_canceled_offer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/issues/18_confirmed_canceled_offer.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/issues/19_0xch_wallet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/issues/19_0xch_wallet.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/issues/20_11usds_wallet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/issues/20_11usds_wallet.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/issues/21_1xch_wallet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/issues/21_1xch_wallet.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/issues/22_0usds_wallet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/issues/22_0usds_wallet.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/issues/23_pending_accept.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/issues/23_pending_accept.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/issues/24_show_details.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/issues/24_show_details.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/issues/25_one_coin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/issues/25_one_coin.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/issues/26_cant_send_offer_pending.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/issues/26_cant_send_offer_pending.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/issues/27_send_0.1xch_to_self.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/issues/27_send_0.1xch_to_self.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/issues/28_0.1_coin_in_offer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/issues/28_0.1_coin_in_offer.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/issues/29_0.1xch_available.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/issues/29_0.1xch_available.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/issues/30_send_while_offer_pending.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/issues/30_send_while_offer_pending.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/offer_multiple_accept/1_multiple_accept_dialog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/offer_multiple_accept/1_multiple_accept_dialog.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/offer_multiple_accept/2_confirmed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/offer_multiple_accept/2_confirmed.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/offer_multiple_accept/3_ckc_wallet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/offer_multiple_accept/3_ckc_wallet.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/offer_multiple_accept/4_usds_wallet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/offer_multiple_accept/4_usds_wallet.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/offer_multiple_create/1_plus_buttons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/offer_multiple_create/1_plus_buttons.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/offer_multiple_create/2_save_multiple_offer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/offer_multiple_create/2_save_multiple_offer.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/offer_multiple_create/3_manage_multiple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/offer_multiple_create/3_manage_multiple.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/offer_single_accept/10_wallet_post_trade.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/offer_single_accept/10_wallet_post_trade.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/offer_single_accept/1_chia_wallet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/offer_single_accept/1_chia_wallet.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/offer_single_accept/2_view_an_offer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/offer_single_accept/2_view_an_offer.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/offer_single_accept/3_select_offer_file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/offer_single_accept/3_select_offer_file.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/offer_single_accept/4_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/offer_single_accept/4_open.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/offer_single_accept/5_accept_offer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/offer_single_accept/5_accept_offer.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/offer_single_accept/6_accept_offer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/offer_single_accept/6_accept_offer.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/offer_single_accept/7_success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/offer_single_accept/7_success.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/offer_single_accept/8_pending_confirm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/offer_single_accept/8_pending_confirm.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/offer_single_accept/9_confirmed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/offer_single_accept/9_confirmed.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/offer_single_create/1_usds_wallet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/offer_single_create/1_usds_wallet.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/offer_single_create/2_create_offer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/offer_single_create/2_create_offer.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/offer_single_create/3_save_offer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/offer_single_create/3_save_offer.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/offer_single_create/4_save_dialog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/offer_single_create/4_save_dialog.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/offer_single_create/5_share_offer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/offer_single_create/5_share_offer.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/offer_single_create/6_share_on_offer_bin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/offer_single_create/6_share_on_offer_bin.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/offer_single_create/7_view_on_offer_bin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/offer_single_create/7_view_on_offer_bin.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/offer_single_create/8_pending_accept.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/offer_single_create/8_pending_accept.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/unknown_cat/1_unknown_cat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/unknown_cat/1_unknown_cat.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/wallet_add/1_xch_balance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/wallet_add/1_xch_balance.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/wallet_add/2_add_usds.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/wallet_add/2_add_usds.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/wallet_add/3_adding_usds_token.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/wallet_add/3_adding_usds_token.png -------------------------------------------------------------------------------- /static/img/offers_img/gui_tutorial/wallet_add/4_two_wallets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/gui_tutorial/wallet_add/4_two_wallets.png -------------------------------------------------------------------------------- /static/img/offers_img/offers/1_alice_1_xch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/offers/1_alice_1_xch.png -------------------------------------------------------------------------------- /static/img/offers_img/offers/2_offer_1_xch_251_ckc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/offers/2_offer_1_xch_251_ckc.png -------------------------------------------------------------------------------- /static/img/offers_img/offers/3_bob_view_xch_ckc_offer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/offers/3_bob_view_xch_ckc_offer.png -------------------------------------------------------------------------------- /static/img/offers_img/offers/4_alice_251_ckc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/offers/4_alice_251_ckc.png -------------------------------------------------------------------------------- /static/img/offers_img/offers/5_bob_1_xch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/offers_img/offers/5_bob_1_xch.png -------------------------------------------------------------------------------- /static/img/tools_and_setup_graphic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chia-Network/chia-dev-guides/7ba75220ac6bbcad018293b4bfb68fc9be58efe3/static/img/tools_and_setup_graphic.png -------------------------------------------------------------------------------- /static/img/undraw_docusaurus_tree.svg: -------------------------------------------------------------------------------- 1 | 2 | Focus on What Matters 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | --------------------------------------------------------------------------------