I'm part of a team making a mobile wallet for cryptocurrency. We have a database of addresses, and I was thinking about ways that we might be able to conserve space in this table.
So suppose the user has 5 priv/pub key pairs. Then I think we can actually get
(P2PKH):
5 +
(P2SH):
5 (1 of 1) + 20 (1 of 2) + 60 (1 of 3) + 120 (1 of 4) + 120 (1 of 5) +
20 (2 of 2) + 60 (2 of 3) + 120 (2 of 4) + 120 (2 of 5) +
60 (3 of 3) + 120 (3 of 4) + 120 (3 of 5) +
120 (4 of 4) + 120 (4 of 5) +
120 (5 of 5)
= 1310
Unique addresses from these 5 key pairs. We can do this because we can use different addresses in the
redeemScript and we can rearrange the order of those addresses.
Is this a viable system? Is there some reason why it would not be a good idea to do this?
It probably wouldn't produce the greatest anonymity. And another problem is that using all these addresses might cause a bit of blockchain bloat, and it would make the transactions bigger and cause the user to need to pay larger fees. So while this is an interesting idea, I don't see us actually using this method in our wallet.