Why Nostr? What is Njump?
2024-09-17 16:48:10
in reply to

jimbocoin on Nostr: Yes. To be precise, #Bitcoin does not have an “account” model. It has a ...

Yes. To be precise, #Bitcoin does not have an “account” model. It has a transaction model. Transactions involve previously unspent outputs (UTXOs) and yield new outputs. Outputs are locked using scripts, the hashes of which we call “addresses”.

So then what is a wallet? A wallet is, essentially, information that allows the user to:

1. Generate addresses.
2. Create transactions involving those addresses.
3. Determine whether a transaction involves its addresses.

The wallet is the closest thing you have to an “account” in Bitcoin. To discover incoming payments, your wallet needs to connect to a node, which has visibility into all transactions. (The exact mechanism for how the wallet talks to the node can vary).

Strictly speaking the wallet doesn’t need any secret information. It works on what are called “public” data, such as your XPUB, which can be used to generate addresses. You don’t necessarily want to leak this data for privacy reasons, but an entity that gets a hold of it cannot spend your coins.

A keystore, in Sparrow parlance, is something that stores the secret information—the “keys” or seed material. While your wallet needs to at least occasionally connect to a node to discover transactions or broadcast new ones, a keystore has no such need. Its job is solely to secure the seed material while in use.

(Aside: Super strictly speaking, Sparrow allows keystores which contain only public info, such as an XPUB to create watch-only wallets. But the core idea here is that keystores hold secrets and wallets interface with the world.)

So when you create a wallet in Sparrow, it sets up a file with info about the keystores in use. This file has a name and lives on your hard drive. You can create a password to encrypt the file, which protects against malicious code on your computer reading its contents.

If you create two wallet files with different names, but all the same parameters (keystores, etc.) those two wallets will generate the same sequences of addresses and have the same signing capabilities. It’s the same as if you made two text files and pasted the same information into both. The two text files are different files but contain the same information. Same with making duplicate wallets.

In fact, it’s a good practice to make a duplicate right away as practice. Making a duplicate wallet is the same as your recovery procedure. That is, your recovery procedure consists of making a “new” wallet that yields the same addresses to receive and sign.
Author Public Key
npub1v9qy0ry6uyh36z65pe790qrxfye84ydsgzc877armmwr2l9tpkjsdx9q3h