3 ms·
Cryptocurrencies have one of essentially two different accounting models: The account model: These networks have accounts and balances. You make a tx sending t
by CuriousCosmic 5y ago
Cryptocurrencies have one of essentially two different accounting models:
The account model: These networks have accounts and balances. You make a tx sending tokens from one account to another. It looks like normal banking more or less.
The UTxO model: These networks don't have accounts at all. Instead they have what are called "Unspent Transaction Outputs" or UTxO. Every transaction takes in a set of UTxO and outputs a set of UTxO. All the balances of assets in the inputs must sum up to the same values as the assets in the newly created UTxO and you can only ever spend a UTxO once. To spend a given UTxO some criteria must be met. The most often criteria is some signature that only validates with the public key of the private key being used to sign the Tx. This also can be generalised to other multi-signature schemes or even to supporting smart contracts (via policy ids and script refs/hashes).
Ethereum really was the network to push the account model into the forefront and now most networks choose to implement this over the UTxO model due to the ease with which you can get good UX and dev experience. Bitcoin, Bitcoin forks (SW or chain forks), Monero, Cardano, Ergo, Nervos, IOTA 2.0, and a few others use the UTxO model or some extension of it (ex: EUTxO or the Cell Model). One of the big upsides of the UTxO model is that all state is kept local instead of global however this local state also adds a number of complexities that make the model unintuitive to many.
------
So to answer your question: You'd create a Tx from your wallet. This Tx would consume some set of UTxO based on what you want to do and would then produce a number of UTxO going to any number of "accounts". In many UTxO networks, derivative keys are supported and you can give each person you want to receive money from a different derivative public key/address. If they were to send you money, it would go to your derivative address and it would be completely independent from all the rest of your UTxO until you do something on chain to tie them together (say by a delegation Tx in a PoS network, by merging UTxO, or by using UTxO from multiple derivative addresses in one Tx).
As for how you'd that the UTxO is valid: Essentially it just needs to exist on chain and not already been spent somewhere else. Monero for example uses this to their advantage with the "sum to 0" rule to provide a zero knowledge non-interactive proof that a given Tx must be valid without knowing the contents, sender, or recipients.