Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: Cubic Earth on June 02, 2015, 08:43:36 PM



Title: SPV client backed by personal full node?
Post by: Cubic Earth on June 02, 2015, 08:43:36 PM
Running a full node on a phone seems like it will never make sense.  SPV clients are convenient, but there are several unfortunate security and privacy tradeoffs.

It seems like it would relatively straightforward to run full node at home that was setup as a personal SPV server.  Your phone could pair with the server and all everything between the two would be encrypted.  Friends and family could link to it as well.

Does anyone know of any projects along these lines?  In addition to boosting the security and privacy on the SPV side, it would give users a very good reason to run full node, which would help the network as a whole. 


Title: Re: SPV client backed by personal full node?
Post by: tspacepilot on June 02, 2015, 08:48:25 PM
I think the only thing you have to do to implement this is to:

a) run a full node at home
b) modify an spv client to connect to that node and only that node.

I guess I don't fully understand the motivation, though.  Once you're running a full node, why do you need your spv client to connect to that node and only that node.   That is, what do you gain by only using this personal node instead of connecting to a full set of peers?

EDIT: maybe I don't know enough about the "security and privacy" tradeoffs you mention in the OP.  FWIW, Andreas Schildbach's Android Bitcoin Wallet is completely open source, so you should be able to modify/override the getPeers section of that project to connect only to your personal node.


Title: Re: SPV client backed by personal full node?
Post by: TierNolan on June 02, 2015, 09:27:48 PM
Connecting to your own node means that there is less risk of a withholding attack.  You get accurate information about the header chain.

Your personal node won't withhold transactions from you.  Peers cannot falsely claim that a transaction was received, but they can fail to tell you about a transaction.

It also gives privacy benefits.  You don't have to tell your peers which transactions you are interested in.

Bitcoin core doesn't support encrypted connections (and neither does the android app, I assume).  The app would need to be updated, though you could get away with just writing a proxy for your local node. 


Title: Re: SPV client backed by personal full node?
Post by: elbandi on June 02, 2015, 10:07:52 PM
If you use android wallet (https://play.google.com/store/apps/details?id=de.schildbach.wallet), set your personal full node ip address as trusted peer. (settings menu). wallet will connect only to that peer.


Title: Re: SPV client backed by personal full node?
Post by: tspacepilot on June 02, 2015, 10:52:19 PM
If you use android wallet (https://play.google.com/store/apps/details?id=de.schildbach.wallet), set your personal full node ip address as trusted peer. (settings menu). wallet will connect only to that peer.

That's very cool.  Looks like OP basically can do this without any work!

FWIW, I prefer to use the android bitcoin wallet from the fdroid repo: https://f-droid.org/repository/browse/?fdid=de.schildbach.wallet (https://f-droid.org/repository/browse/?fdid=de.schildbach.wallet).  Same app, but it's nice to support free software (imo) and the free software repo.


Title: Re: SPV client backed by personal full node?
Post by: spin on June 03, 2015, 07:42:20 AM
It also makes practical sense at home if you load your wallet and it uses the internet to sync when there is already a node in the home network which would be faster.

Same with PC based SPV wallets.  Multibit should add this also.


Title: Re: SPV client backed by personal full node?
Post by: Cubic Earth on June 04, 2015, 05:48:09 AM
Interesting.  Thanks for the replies.  I've got something to test out and look into more deeply.

TierNolan elucidated my concerns quite well.  It seems like one shortcoming of an AndroidWallet / BitcoinCore pairing is the channel between them is unencrypted.  I guess you could set up a VPN link from phone to home, but that would be cumbersome.

I'm guessing Android Wallet uses some sort of bloom filter to protect privacy, under that likely assumption that the user is connecting to untrusted nodes.  If the Wallet was connected only to the users own full node, I would think only the relevant transaction data would need to be transmitted.  Superfluous data, sent to hide the true signal in a sea of noise, would be unnecessary.



Title: Re: SPV client backed by personal full node?
Post by: instagibbs on June 25, 2015, 01:22:06 PM
Unfortunately the wallet silently fails, so you lose any privacy benefits if it can not connect.

I think connecting to a Tor hidden node makes more sense for now, since it's already authenticated and encrypted. The wallet currently doesn't connect to those though.


Title: Re: SPV client backed by personal full node?
Post by: tspacepilot on June 25, 2015, 02:19:19 PM
Unfortunately the wallet silently fails, so you lose any privacy benefits if it can not connect.

I think connecting to a Tor hidden node makes more sense for now, since it's already authenticated and encrypted. The wallet currently doesn't connect to those though.

If he's running the default version of Android Wallet then it would still hve the bloom filter to protect privacy to some extent (at the cost of bandwitdh, obviously).  CubicEarth, did you end up setting this up?


Title: Re: SPV client backed by personal full node?
Post by: jim618 on June 25, 2015, 04:10:36 PM
It also makes practical sense at home if you load your wallet and it uses the internet to sync when there is already a node in the home network which would be faster.

Same with PC based SPV wallets.  Multibit should add this also.

MultiBit HD will automatically connect to a Bitcoin Core or XT node that is running on localhost.
It will also connect to a random connection of peers too as it uses transaction propagation to ascertain whether transaction have been sent to the Bitcoin network ok.

It uses various criteria (block height, ping time) to determine which node to connect to when syncing so, as long as your local node is up to date, it should pick that one to use as the ping time will obviously be great.


Title: Re: SPV client backed by personal full node?
Post by: Cubic Earth on June 26, 2015, 06:54:27 AM
Unfortunately the wallet silently fails, so you lose any privacy benefits if it can not connect.

I think connecting to a Tor hidden node makes more sense for now, since it's already authenticated and encrypted. The wallet currently doesn't connect to those though.

If he's running the default version of Android Wallet then it would still hve the bloom filter to protect privacy to some extent (at the cost of bandwitdh, obviously).  CubicEarth, did you end up setting this up?

Not yet.  I (mostly) give up being a computer nerd in the summer time.  I fight forest fires in the wilderness, often sleeping in a tent for weeks on end, and occasionally flying around mountain ranges in a helicopter.  At some point, perhaps in a few months, I will try to connect the pieces as described, and I will report my findings in this thread.


Title: Re: SPV client backed by personal full node?
Post by: tspacepilot on June 26, 2015, 07:07:41 AM
Unfortunately the wallet silently fails, so you lose any privacy benefits if it can not connect.

I think connecting to a Tor hidden node makes more sense for now, since it's already authenticated and encrypted. The wallet currently doesn't connect to those though.

If he's running the default version of Android Wallet then it would still hve the bloom filter to protect privacy to some extent (at the cost of bandwitdh, obviously).  CubicEarth, did you end up setting this up?

Not yet.  I (mostly) give up being a computer nerd in the summer time.  I fight forest fires in the wilderness, often sleeping in a tent for weeks on end, and occasionally flying around mountain ranges in a helicopter.  At some point, perhaps in a few months, I will try to connect the pieces as described, and I will report my findings in this thread.

Wow, sounds much more thrilling than talking on an internet forum.  Have fun and come back safely!