User contributions for Gneale

Jump to navigation Jump to search
Search for contributionsExpandCollapse
⧼contribs-top⧽
⧼contribs-date⧽
(newest | oldest) View ( | ) (20 | 50 | 100 | 250 | 500)

17 November 2023

  • 15:5515:55, 17 November 2023 diff hist +579 N EvenCreated page with "===== Return to: Chialisp ===== ===== Return to: Additional Functions ===== (mod (num) (defun remainder (x y) (r (divmod x y))) (defun even (num) (if (= (remainder num 2) 0) (q . even) (x))) (even num) ) ==Example Usage== brun '(a (q 2 4 (c 2 (c 5 ()))) (c (q (a (i (= (a 6 (c 2 (c 5 (q 2)))) ()) (q 1 . "even") (q 8)) 1) 6 (divmod 5 11)) 1))' '(10)' "even" brun '(a (q 2 4 (c 2 (c 5 ()))) (c (q (a (i (..." current
  • 15:5415:54, 17 November 2023 diff hist +374 N RemainderCreated page with "===== Return to: Chialisp ===== ===== Return to: Additional Functions ===== (mod (x y) (defun remainder (x y) (r (divmod x y)) ) (remainder x y) ) ==Example Usage:== brun '(a (q 2 2 (c 2 (c 5 (c 11 ())))) (c (q 6 (divmod 5 11)) 1))' '(10 3)' 1 brun '(a (q 2 2 (c 2 (c 5 (c 11 ())))) (c (q 6 (divmod 5 11)) 1))' '(10 4)' 2" current
  • 15:5415:54, 17 November 2023 diff hist +71 N Additional FunctionsCreated page with "===== Return to: Chialisp ===== * Remainder * Even" current
  • 15:5315:53, 17 November 2023 diff hist +651 N Greatest Common DivisorCreated page with "===== Return to: Chialisp ===== ===== Return to: Recursive Functions ===== (mod (num1 num2) (defun remainder (x y) (r (divmod x y))) (defun gcd (num1 num2) (if (= num2 0) num1 (gcd num2 (remainder num1 num2)))) (gcd num1 num2) ) ==Example Usage== brun '(a (q 2 4 (c 2 (c 5 (c 11 ())))) (c (q (a (i (= 11 ()) (q . 5) (q 2 4 (c 2 (c 11 (c (a 6 (c 2 (c 5 (c 11 ())))) ()))))) 1) 6 (divmod 5 11)) 1))' '(99..." current
  • 15:5215:52, 17 November 2023 diff hist +518 N LengthCreated page with "===== Return to: Chialisp ===== ===== Return to: Recursive Functions ===== (mod (lst) (defun length (lst) (if (l lst) (+ 1 (length (r lst))) lst) ) (length lst) ) ==Usage Example 1:== brun '(a (q 2 2 (c 2 (c 5 ()))) (c (q 2 (i (l 5) (q 16 (q . 1) (a 2 (c 2 (c 13 ())))) (q . 5)) 1) 1))' '((10 20))' 2 ==Usage Example 2:== brun '(a (q 2 2 (c 2 (c 5 ()))) (c (q 2 (i (l 5) (q 16 (q . 1) (a 2 (c 2 (c 13..." current
  • 15:5215:52, 17 November 2023 diff hist +1,244 N IterateCreated page with "===== Return to: Chialisp ===== ===== Return to: Recursive Functions ===== ==Example 1== (mod (n) (defun iterate (n) (if (= n 0) n (list n (iterate (- n 1))) ) ) (iterate n) ) ==Example 1 usage:== brun '(a (q 2 2 (c 2 (c 5 ()))) (c (q 2 (i (= 5 ()) (q . 5) (q 4 5 (c (a 2 (c 2 (c (- 5 (q . 1)) ()))) ()))) 1) 1))' '(50)' (50 (49 (48 (47 (46 (45 (44 (43 (42 (41 (40 (39 (38 (37 (softfork (35 (all (any (not (31 (pubkey_for_exp (point_..." current
  • 15:5115:51, 17 November 2023 diff hist +183 N BinaryCreated page with "===== Return to: Chialisp ===== ===== Return to: Recursive Functions ===== <pre> (defun binary (n) (if (= n 1) (* n 2) (* 2 (binary (- n 1))))) </pre>" current
  • 15:5015:50, 17 November 2023 diff hist +164 N PowerCreated page with "===== Return to: Chialisp ===== ===== Return to: Recursive Functions ===== (defun power (X N) (if (= N 0) 1 (* X (power X (- N 1)))))" current
  • 15:5015:50, 17 November 2023 diff hist +474 N AppendCreated page with "===== Return to: Chialisp ===== ===== Return to: Recursive Functions ===== <big>Appending lists in a solution:</big> (mod (list1 list2) (defun append (list1 list2) (if (l list1) (c (f list1) (append (r list1) list2)) list2) ) (append list1 list2) ) ==Example Usage:== brun '(a (q 2 2 (c 2 (c 5 (c 11 ())))) (c (q 2 (i (l 5) (q 4 9 (a 2 (c 2 (c 13 (c 11 ()))))) (q . 11)) 1) 1))' '((99 33)(1 2 3))' Outputs: <pre>(99 33 1 2 3)</pre>" current
  • 15:5015:50, 17 November 2023 diff hist +139 N Recursive FunctionsCreated page with "===== Return to: Chialisp ===== * Append * Power * Binary * Iterate * Length * Greatest Common Divisor" current
  • 15:4915:49, 17 November 2023 diff hist +6,361 N Mempool Dump - Wallet SpendCreated page with "===== Return to: Chialisp ===== <pre>chia wallet send -a 0.000000000001 -t xch1tv0g7uc6jw0ypgy7hfvwe7627wurpmm459fashwnvx7jr0rh9xqqp8y98t</pre> Outputs: <pre>Transaction submitted to nodes: [('26aa4fcfe513852f37afa6cf9972458a78d16c18d6d43ce6cb95d26a037c8745', 1, None)] Do chia wallet get_transaction -f 4270401300 -tx 0xeb081681e3c7757f6687e59eab28f39c16e6e11a9ba7e79333f95d083e60baeb to get status</pre> <pre>cdv rpc mempool|grep '''eb081681e3c7757f6687e59e..." current
  • 15:4815:48, 17 November 2023 diff hist +4,488 N RPC get block record by heightCreated page with "===== Return to: Chialisp ===== <big>Example:</big> <pre> 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 '{ "height": 1002908 }' -H "Content-Type:application/json" -X POST https://localhost:8555/get_block_record_by_height | python -m json.tool </pre> <pre> { "block_record": { "challenge_block_info_hash": "0xdb3909f6aebe8cad513597ffd4d28fd446b39..." current
  • 15:4715:47, 17 November 2023 diff hist +39,101 N RPC get additions and removalsCreated page with "===== Return to: Chialisp ===== <big>Example</big> <pre> 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 '{ "header_hash": "0x2d2a429c130e39c66f5f5720730e6fbc7b0ad8f15e74370705a29e618ca83a01" }' -H "Content-Type:application/json" -X POST https://localhost:8555/get_additions_and_removals | python -m json.tool </pre> <pre> { "additions": [ {..." current
  • 15:4515:45, 17 November 2023 diff hist +1,558 N Example puzzle reveal and solutionCreated page with "===== Return to: Chialisp ===== <h1>Example 1</h1> This is spend using standard transaction from GUI: Puzzle reveal: <pre>(a (q 2 (q 2 (i 11 (q 2 (i (= 5 (point_add 11 (pubkey_for_exp (sha256 11 (a 6 (c 2 (c 23 ()))))))) (q 2 23 47) (q 8)) 1) (q 4 (c 4 (c 5 (c (a 6 (c 2 (c 23 ()))) ()))) (a 23 47))) 1) (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 . 0xb0ae2c321d9fe66b0cfc17a2772dabf692f2081632f..." current
  • 15:4415:44, 17 November 2023 diff hist +537 N Cdv rpc blockspendsCreated page with "===== Return to: Chialisp ===== <code>cdv rpc blockspends --coinid e256eaae0884064d54ebafbdf82d32ae876a0cb4881ac13fc496c61cc2c94d02 -h 998859</code> "coin": { "amount": 200, "parent_coin_info": "0xc7f245646ece920927bd21ce977a203fa5d1d7a5eb3f9c6ee8789a7af3f34bdb", "puzzle_hash": "0x8a3bf47feade69aefbad6e8219933c78f57ddb2c3d107de5403a0fc9848d813a" }, "puzzle_reveal": "0xff01ffff33ffa058bb585420abf3275685a71e2ea26637890881f..." current
  • 15:4415:44, 17 November 2023 diff hist +219 N AuditingCreated page with "===== Return to: Chialisp ===== * cdv rpc blockspends * Example puzzle_reveal and solution * RPC get_additions_and_removals * RPC get_block_record_by_height * Mempool Dump - Wallet Spend" current
  • 15:4315:43, 17 November 2023 diff hist +10 Binary TreeNo edit summary current
  • 15:4215:42, 17 November 2023 diff hist +2,775 N Binary TreeCreated page with "===== Return to: Chialisp ===== 1 / \ / \ / \ / \ / \ / \ 2 3 / \ / \ / \ / \ 4 6 5 7 / \ / \ / \ / \ 8 12 10 14..."
  • 15:4115:41, 17 November 2023 diff hist +1,426 N Map of NumberingsCreated page with "===== Return to: Chialisp ===== Because atoms have no type information, the meaning of an atom is determined when a function is applied to it. For example, sometimes an atom that was read in as a string is treated as an integer. Below is an incomplete cross reference for when Chialisp returns unexpected results while compiling or running. === Chialisp Numberings Table === {| class="wikitable" |+ ''' !String !Integer !Example Code !Example Code Output |-..." current
  • 15:4015:40, 17 November 2023 diff hist +4 Inner PuzzlesNo edit summary current
  • 15:4015:40, 17 November 2023 diff hist +175 N Inner PuzzlesCreated page with "===== Return to: Chialisp ===== <H1>Useful Links:</H1> https://github.com/geraldneale/py-chialisp-inner_outer https://docs.chia.net/guides/chialisp-inner-puzzles"
  • 15:3815:38, 17 November 2023 diff hist +2,521 N CurryingCreated page with "===== Return to: Chialisp ===== <h2>Example 1</h2> *<code>cdv clsp curry -i include io_puz.clvm -a 0x7cac37d6245033e764e02b27b4898645df9dbd5ea5d2d8ef030cfa600ca33090 -a 0x2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824 -a ff01ffff33ffa0656214f18f80a85a30f97cafa0fdfd29578d5e8030316b21e36552f9172c49d1ff018080 -x</code> <h2>Example 2</h2> *<code>cdv clsp curry -i include io_puz.clvm -a 0x7cac37d6245033e764e02b27b4898645df9dbd5ea5d2d8ef030cfa600..." current
  • 15:3715:37, 17 November 2023 diff hist +347 N SignaturesCreated page with "===== Return to: Chialisp ===== <H1>Useful Commands:</H1> chia keys show --show-mnemonic-seed <H1>Useful Links:</H1> * https://github.com/geoffwalmsley/clsp-template <H1>Useful Files:</H1> * http://mojopuzzler.org/agg_sig.py Best Resource * http://mojopuzzler.org/new-orig.py * http://mojopuzzler.org/custom_puzzle-gwalmsley.clsp"
  • 15:3615:36, 17 November 2023 diff hist +558 N Simplest Test CoinsCreated page with "===== Return to: Chialisp ===== Create file simplest.clsp <code>1</code> Create file solution.clsp <code>(list (q . (51 0x656214f18f80a85a30f97cafa0fdfd29578d5e8030316b21e36552f9172c49d1 2)))</code> The idea is to create unspent coins where you can put anything into the solution with as little frictions as possible. The purpose is to assist in conceiving the most complex spend bundles possible with multi-coin communication. If we had to worry about puzzleh..." current
  • 15:2615:26, 17 November 2023 diff hist +3,073 N Cdv rpc coinrecords --by puzhashCreated page with "===== Return to: Chialisp ===== == Example 1: == <code>cdv rpc coinrecords --by puzhash 36b2ecf8590cb1683eacf1c9e40b7cb98c9fdfb2ad8af118392a1b9359f23d95 -nd</code> <pre> { "6af8fe5233c4e8e82434d13cc6f55eda77cc0588e99322aba7a04bd31da53f37": { "coin": { "amount": 1, "parent_coin_info": "0x17850c7bf14b11512809c9770319484979537aa164b91f2f3d07bfb90d2ae851", "puzzle_hash": "0x36b2ecf8590cb1683eacf1c9e40b7cb98c9fd..." current
  • 15:2515:25, 17 November 2023 diff hist +20 Cdv clsp treehash trigger.clvmNo edit summary current
  • 15:2415:24, 17 November 2023 diff hist +575 N Cdv clsp treehash trigger.clvmCreated page with "===== Return to: Chialisp ===== <h2>Example 1</h2> <code>cdv clsp treehash ff02ffff01ff04ffff04ff04ffff04ff0bffff04ff17ff80808080ffff04ffff04ff06ffff04ff05ff808080ff808080ffff04ffff01ff333eff018080b7846ec58082c70a9278b7b09c409ca115890a217c489bf731c523e5f9ef5216</code> <pre> b7846ec58082c70a9278b7b09c409ca115890a217c489bf731c523e5f9ef5216 </pre> Quexington 20211103: "UNKOWN_UNSPENT sometimes actually means BAD_PUZZLE_REVEAL. You can verify by cdv clsp tree..."
  • 15:2315:23, 17 November 2023 diff hist +593 N Cdv inspect --id coinsCreated page with "===== Return to: Chialisp ===== <pre>cdv inspect --id coins -pid 54b1d3f8bbe8d3d6da8649f87c179d581e261d88c86d08c01f8025ca44b1b599 -ph 3ee61c1d32f9237348562eaa9e0141162c745fa0de9c670960e757b22bdc3843 -a 100 [<bytes32: 08065ebabd71655425b186cc661c600954d089358b61799a2584f59329345957>] cdv inspect --id coins '{"amount": 100, "parent_coin_info": "0x54b1d3f8bbe8d3d6da8649f87c179d581e261d88c86d08c01f8025ca44b1b599", "puzzle_hash": "0x3ee61c1d32f9237348562eaa9e..." current
  • 15:2315:23, 17 November 2023 diff hist +2,677 N Cdv inspect spendbundles ./spend bundle.json -dbCreated page with "===== Return to: Chialisp ===== '''cdv inspect spendbundles ./spendbundle.json -db''' <pre> [{'aggregated_signature': '0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', 'coin_solutions': [{'coin': {'amount': 1, 'parent_coin_info': '0x58f7ef38d959f3bceb389ce331e7bec12ca01e3c7cc4e..." current
  • 15:2215:22, 17 November 2023 diff hist +55,465 N Cdv rpc blocks -s x -e yCreated page with "<big>Example 1 - to look at block # 1856381</big> <pre>cdv rpc blocks -s 1856381 -e 1856382</pre> Output once disassembled: <pre>(q ((0x23671bf4576156bcdc06565580d158f146d23c1e24dc1f736815ec3162cd99ff (a (q 2 (q 4 (c 4 (c 5 (c 11 ()))) (c (c 6 (c 23 (q 1000))) ())) (c (q 50 . 51) 1)) (c (q . 0xadd78539b7deeb604c5c193da399966494b5eaa0373846e5b3667cc8b215b73a85ac90f32f7c9ed6881b9bca565fb56b) (c (q . 0x2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824) 1))) 1..." current
  • 15:2115:21, 17 November 2023 diff hist −742 Cdv rpc coinrecords --by idNo edit summary current
  • 15:2015:20, 17 November 2023 diff hist −4 Cdv rpc blockspends --by idNo edit summary current
  • 15:1915:19, 17 November 2023 diff hist +1 Cdv rpc blockspends --by idNo edit summary
  • 15:1915:19, 17 November 2023 diff hist −2 Cdv rpc blockspends --by idNo edit summary
  • 15:1915:19, 17 November 2023 diff hist −2 Cdv rpc blockspends --by idNo edit summary
  • 15:1815:18, 17 November 2023 diff hist +1,267 N Cdv rpc blockspends --by idCreated page with "cdv rpc blockspends -id 771603bf328849808dabbde3e130aa73b2e713fbba3f36b433632e2027a980ba --block-height 4249434 Outputs: { "coin": { "amount": 1000, "parent_coin_info": "0x06f493784fa690fa1ee109895d4e3a04a51d33ebef8eae3d749f6c92f300abcb", "puzzle_hash": "0xcdd65092b78f75a38d48b8e63654959e03f3be2fc7741452cde84f154b5deb57" }, "puzzle_reveal": "0xff02ffff01ff02ffff01ff02ffff03ff0bffff01ff02ffff03ffff09ff05ffff1dff0bffff1effff0bff0bffff0..."
  • 15:1815:18, 17 November 2023 diff hist +34 Useful CDV examplesNo edit summary
  • 15:1415:14, 17 November 2023 diff hist +1,264 N Cdv rpc coinrecords --by idCreated page with "cdv rpc blockspends -id 771603bf328849808dabbde3e130aa73b2e713fbba3f36b433632e2027a980ba --block-height 4249434 Outputs: { "coin": { "amount": 1000, "parent_coin_info": "0x06f493784fa690fa1ee109895d4e3a04a51d33ebef8eae3d749f6c92f300abcb", "puzzle_hash": "0xcdd65092b78f75a38d48b8e63654959e03f3be2fc7741452cde84f154b5deb57" }, "puzzle_reveal": "0xff02ffff01ff02ffff01ff02ffff03ff0bffff01ff02ffff03ffff09ff05ffff1dff0bffff1effff0bff0bffff02..."

16 November 2023

  • 18:2518:25, 16 November 2023 diff hist +12 Useful RPC examplesNo edit summary current
  • 18:2418:24, 16 November 2023 diff hist +1,630 N Get Puzzle and SolutionCreated page with "===== Return to: Chialisp ===== Example: Pre-farm 18.75M coin's puzzle & solution https://www.chiaexplorer.com/blockchain/coin/0x1fd60c070e821d785b65e10e5135e52d12c8f4d902a506f48bc1c5268b7bb45b <pre>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 '{ "coin_id": "0x1fd60c070e821d785b65e10e5135e52d12c8f4d902a506f48bc1c5268b7bb45b","height": 229316 }' -..." current
  • 18:2318:23, 16 November 2023 diff hist +73 N Useful RPC examplesCreated page with "===== Return to: Chialisp ===== *Get Puzzle and Solution"
  • 18:2318:23, 16 November 2023 diff hist +350 N BRUN Hello WorldCreated page with "===== Return to: Chialisp ===== <h2>Example 1</h2> brun '( q . "Hello World")' "Hello World" <h2>Example 2</h2> <code>brun '(sha256 2)' '("hello")'</code> 0x2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824 <code>brun '(sha256 2)' '("world")'</code> 0x486ea46224d1bb4fb680f34f7c9ad96a8f24ec88be73ea8e5a6c65260e9cb8a7" current
  • 18:2218:22, 16 November 2023 diff hist +1,465 N BRUN coinIDCreated page with "===== Return to: Chialisp ===== <h2>Example 1</h2> coinID == sha256(<span style="background:#00FF00">parent_ID</span> <-concatenated with-> <span style="color:#FFFFFF; background:#FF69B4">puzzlehash</span> <-concatenated with-> <span style="background:#00FFFF">amount</span>) <code>brun '(sha256 2)' '(<span style="background:#00FF00">0x6ba5e9a4b7b1c2fc92eec6231175ec82bb861312eacd51794b8f7be4c4b7fe9b</span><span style="color:#FFFFFF; background:#FF69B4">7a1..." current
  • 18:2218:22, 16 November 2023 diff hist +86 N Useful BRUN examplesCreated page with "===== Return to: Chialisp ===== * BRUN coinID * BRUN Hello World" current
  • 18:2018:20, 16 November 2023 diff hist +802 N Useful RUN examplesCreated page with "===== Return to: Chialisp ===== <H1>Example 1: </H1> coinID == sha256(parent_ID + puzzlehash + amount) <code>run '(sha256 (concat 0xeb8c4d20b322be8d9fddbf9412016bdf00000000000000000000000000000022 0xa4cdba512b00c504ccc047b49d7688f1ad8b74d7859ef8d2ac2a81517d2d11a4 1750000000000))'</code> 0x942754fd860bf64910f9394e298aae77ea4aff194e665d8a4475ef6f43b0ef0b <H1>Example 2: </H1> Announcement = (sha256 coinID message) <code>run '(sha256 (sha256 (concat 0xf1a59..." current
  • 18:1918:19, 16 November 2023 diff hist +46 ConditionsNo edit summary current
  • 18:1918:19, 16 November 2023 diff hist +562 N Useful CDV examplesCreated page with "===== Return to: Chialisp ===== * cdv rpc blocks -s x -e y - For looking at block outputs * cdv inspect spendbundles ./spendbundle.json -db * cdv inspect --id coins - For getting coinID * cdv rpc coinrecords --by id - For following up on parent coins block height to get puzzle reveal and solution. * cdv clsp treehash trigger.clvm.hex - To verify puzzle you ha..."
  • 18:1818:18, 16 November 2023 diff hist +3,775 N ConditionsCreated page with "big>Conditions</big> Conditions are split into two categories: "this spend is only valid if X" and "if this spend is valid then X". Here is the complete list of conditions along with their format and behaviour. '''AGG_SIG_UNSAFE - [49]''' - (49 pubkey message): This spend is only valid if the attached aggregated signature contains a signature from the given public key of the given message. This is labeled unsafe because if you sign a message once, any other coins you h..."
  • 18:1718:17, 16 November 2023 diff hist +966 N Github setup notesCreated page with "<h1>Initial setup of account on a new machine. Change the first two commands to match your github account info.</h1> $ git config --global user.name "mp_zero" $ git config --global user.email [email protected] $ git config --global init.defaultBranch main $ git config --global core.editor "code --wait" $ git config --global core.editor pull.rebase false <h1>SSH key setup</h1> $ ssh-keygen -t rsa -C "[email protected]" $ ssh-add ~/.ssh/id_rsa $ cat ~/.s..." current
  • 18:1718:17, 16 November 2023 diff hist +206 N DatabaseCreated page with "==Useful Command:== <pre>watch -n10 'sqlite3 ~/.chia/mainnet/db/blockchain_v2_mainnet.sqlite "SELECT timestamp, hex(puzzle_hash), hex(amount) FROM coin_record ORDER BY confirmed_index DESC LIMIT 40;"'</pre>" current
(newest | oldest) View ( | ) (20 | 50 | 100 | 250 | 500)