user95071: Just saw good question on Telegram:
So I working on an algorithm that would download and process bitcoin blocks, specifically the transactions in them. I want to take every output address of every transaction in a block and query my database if any users own this address as their deposit address. Initially I thought an output can only have one address and so I can just credit the person who owns it with the amount of that output. But now I found out that an output can actually have multiple addresses to it and thats called multisig. I don’t really understand the concept of this. So what if a person uses his deposit address that I’ve given them as first address and they also use another address of their own as second address in a single output? Can they use that output with their address to waste it so then so I lose the money they deposited?

user5406: Addresses are just a shorthand to encode a locking script. When a locking script requires multiple signatures to be unlocked, it's still a single address. So, when you're writing an indexer, you can likely get away with simply not distinguishing singlesig and multisig addresses in the first iteration.

95071: <p>Just saw good question on Telegram:</p>

<p>So I working on an algorithm that would download and process bitcoin blocks, specifically the transactions in them. I want to take every output address of every transaction in a block and query my database if any users own this address as their deposit address. Initially I thought an output can only have one address and so I can just credit the person who owns it with the amount of that output. But now I found out that an output can actually have multiple addresses to it and thats called multisig. I don’t really understand the concept of this. So what if a person uses his deposit address that I’ve given them as first address and they also use another address of their own as second address in a single output? Can they use that output with their address to waste it so then so I lose the money they deposited?</p>
 5406: <p>Addresses are just a shorthand to encode a locking script. When a locking script requires multiple signatures to be unlocked, it's still a single address. So, when you're writing an indexer, you can likely get away with simply not distinguishing singlesig and multisig addresses in the first iteration.</p>
