How XO remembers wallet state
Watch on YouTube (opens in a new tab)- Speaker
- monsterbitar
- Space
- Published
- Length
Transcript
To make that lock script, for pay to public key hash, one part of that lock script is the hash of a key. But, you need to have it not only when you make this lock script, you also need to have the same key available when you try to do the unlocking later. And so, normally for wallets, they just store all the keys. And whenever you need a key, they just go look that key up. But, in XO, we store a reference to that key, and then that reference we store on that output, not on chain, but inside of our own internal state systems, we store a reference to how that key was made, so that we can recreate the key when we need it later.
And when you come to the point where it's time to spend this pay to public key hash funds, since you are actively consuming the output, you're also removing the state in the state system. So, you have a natural point where state can be forgotten or can be archived.


