BRUN coinID

From mojo_puzzler
Jump to navigation Jump to search
Return to: Chialisp

Example 1

coinID == sha256(parent_ID <-concatenated with-> puzzlehash <-concatenated with-> amount)


brun '(sha256 2)' '(0x6ba5e9a4b7b1c2fc92eec6231175ec82bb861312eacd51794b8f7be4c4b7fe9b7a1c65d48c6034d4185ffb2ffa50c366216950c922bc2eacf62abe57e436607802)' 0x36fc9d6043f2432acc39ea1345c6495e735708c2f17075fe631a8227e270a9c0


Notice the initial leading "0x", the lack of a leading "0x" before the second item despite how it returns in the RPC below, and the leading "0" before the amount despite how it returns in the RPC.


{'coin': {'amount': 2,'parent_coin_info': '0x6ba5e9a4b7b1c2fc92eec6231175ec82bb861312eacd51794b8f7be4c4b7fe9b', 'puzzle_hash': '0x7a1c65d48c6034d4185ffb2ffa50c366216950c922bc2eacf62abe57e4366078'}, 'coinbase': False, 'confirmed_block_index': 651830, 'spent': True, 'spent_block_index': 651970, 'timestamp': 1627783077}