ksedgwic / Wallet32

20 stars 11 forks source link

Support sending to / create/receiving to stealth addresses #13

Open dabura667 opened 10 years ago

dabura667 commented 10 years ago

Just want to gauge your thoughts on it.

To send to a stealth involves maybe 2-3 ecc operations and a slight alteration to the output creation process.

To create a stealth address involves generating two keypairs. (though you can do p2sh multisig with a single shared stealth address) One for scanning balances, and one for spending balances.

If you are open to it, I have a few friends who are helping implement stealth address on other projects who I could bring over to help implement if you would like.

ksedgwic commented 10 years ago

Can SPV clients scan for stealth addresses? I'm not sure how this would work.

karelbilek commented 10 years ago

(note: I don't really understand stealth addresses very much, and well, SPV very much)

I think it's impossible with bloom filtering, that's why darkwallet uses something called "prefix filtering", but I am not really sure.

dabura667 commented 10 years ago

You can reference the Dark Wallet obelisk servers.

Here's how the data is organized on a table in their servers. https://wiki.unsystem.net/en/index.php/DarkWallet/Stealth#Database_file_format

Basically it's just a table of the stealth info categorized from every transaction up til now (considering it's new, not that many now)

The prefix bitfield is currently not being used, but it is not for a purpose of increasing privacy. Having no prefix is the most privacy and the longer the prefix, the less the privacy but the more savings you can have on processing. (if you have a long prefix, it is effectively adding a brute force requirement to the sender... so I don't think prefixes have much use as of current)

If you are interested in implementing Receiving / creating stealth, I would recommend #darkwallet on freenode as well as the unsystem wiki I linked up there. Also checking out Dark Wallet's stealth.js would help.

Sending to stealth is fairly simple, and doesn't require anything special on the SPV server end.

I haven't looked too much into your code base yet, but what kind of server are you using?

ksedgwic commented 10 years ago

There is no specialized server for Wallet32. It's an SPV client based on bitcoinj. Since SPV clients use bloom filters to receive information about their addresses I'm unclear how to add support for stealth addresses.

karelbilek commented 10 years ago

Now that I have looked more into it - yep, bloom filters and stealth addresses are not friendly together.

On Sat, Jun 7, 2014 at 11:15 PM, Ken Sedgwick notifications@github.com wrote:

Wallet32 is an SPV client based on bitcoinj. Since SPV clients use bloom filters to receive information about their addresses I'm unclear how to add support for stealth addresses.

— Reply to this email directly or view it on GitHub https://github.com/ksedgwic/Wallet32/issues/13#issuecomment-45421403.

dabura667 commented 10 years ago

Re: support for addresses in the client. You could always connect to the obelisk servers used for Dark Wallet... (this would be in the future) So probably not realistic for the near future.

For now, supporting sending TO stealth address does not require anything server side to be special, just adding a new script to output creation and adding new definitions to what is a valid Bitcoin address, and that's about it.

dabura667 commented 10 years ago

@ksedgwic Where is the com.google.bitcoin.core.AddressFormatException etc. located? The only thing I see in the bitcoin folder is crypto...

I'm sorry if this is some java thing, I am not too familiar with java.

I will try to get the ability to send to stealth into a PR sometime this week if I can get around to it.

ksedgwic commented 10 years ago

core/src/main/java/com/google/bitcoin/core/AddressFormatException.java