ordinals / ord

👁‍🗨 Rare and exotic sats
https://ordinals.com
Creative Commons Zero v1.0 Universal
3.86k stars 1.38k forks source link

Put UTXO info into wallet database #3991

Open raphjaph opened 1 month ago

raphjaph commented 1 month ago

This would allow much quicker commands for subsequent calls in wallet with many utxos. It would then only fetch utxos it can see in the Bitcoin Core wallet but are not yet in the database. Would also delete utxos according to that information

1stBitcoinSent commented 1 week ago

any thoughts 🤔 on a new database architecture

cryptoni9n commented 5 days ago

if this happens, would the wallet db be part of the index.redb, or be it's own new db? I'm just wondering how sharing indexes would work in the future if the wallet is included as part of the index.redb.

raphjaph commented 5 days ago

We already have a wallet.redb for storing pending etchings. So it's a completely seperate file from index.redb. You can have a look at the logic in src/wallet.rs, there you'll see two tables in the db already. If we add UTXOs to that database it would probably be something like:

define_table! { OUTPOINT_TO_UTXO_ENTRY, &OutPointValue, &UtxoEntry }