Do Fuel wallets need to track the user's UTXO set?

This might be a naive question, but after 5 years of Ethereum-only development, I have become accustomed to the account model.

I understand that Fuel uses an UTXO model. Does this mean that a wallet implemention, e.g. Fuel Wallet, needs to locally track all of the user’s UTXOs?

If yes, what happens if the UTXOs are deleted from the local data store? Do Fuel nodes provide methods for querying this data?

Fuel, unlike Ethereum’s single native asset “ETH”, has support for multiple native assets. This means all native tokens will have the same properties, resulting in a more consistent developer experience.

For example in the beta-3 testnet playground you can easily query all native asset balances for a particular address like this :slight_smile:

query {
  balances(filter: { owner: "0xf65d6448a273b531ee942c133bb91a6f904c7d7f3104cdaf6b9f7f50d3518871" }, first: 5) {
    nodes {
      amount
      assetId
    }
  }
}

If you want to dig deeper take a look at all of these other useful sample queries we’ve brewed up!

1 Like

To add to @calldelegation’s answer:

All Fuel nodes need to store all UTXOs (since UTXOs are the “state” of the chain). Our node implementation indexes these UTXO by owner, and lets users query their current UTXOs over the GraphQL RPC API (@calldelegation’s example).

Wallets are welcome to cache their own UTXOs (reduces the number of network calls made), but it’s always trivial to just query the UTXOs from the node.

2 Likes

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.