Where is the puzzle corresponding to the puzzle hash stored?

This question was asked at chia_network.public on Keybase.

2 Likes

The puzzles for spent coins can be found with the get_puzzle_and_solution full node rpc call.

1 Like

What about before a coin is spent? I understand the puzzle is hidden before a successful spend – so where is the clvm stored in the meantime? Surely the puzzlehash itself is not reversible back to clvm.

2 Likes

If the coin has not been spent, you have to know the puzzle to be able to spend the coin. Only puzzles of the spent coins are stored on blockchain.

Users are responsible for remembering and storing their own puzzles in order to spend their coins. Usually these are regenerated on the fly by wallet software, based on templates.

3 Likes

That makes sense! Thank you!

1 Like