Re: Decentralized BIP 47 payment code directory

Re: Decentralized BIP 47 payment code directory
From: Prayank @ 2022-02-28 14:56 UTC (permalink / raw)
  To: Bitcoin Dev

[-- Attachment #1: Type: text/plain, Size: 2158 bytes --]

Hello World,

There was some discussion about BIP 47 on twitter recently: https://twitter.com/BitcoinQ_A/status/1356177927285714946
BIP 47 improves privacy however there are a few reasons why its less used:

1.Some developers consider it spams Bitcoin without improving anything: https://twitter.com/LukeDashjr/status/1280475865827151878

2.Paynym (a centralized directory managed by Samourai) and Samourai wallet is the only implementation used for BIP 47 right now. Centralized payment code directory isn't good for privacy and security.

There can be few other important issues which I missed in this email. I have few ideas to solve these 2 problems with the use of TXT records and domains. Since buying domain, managing DNS etc. is mostly centralized I won't share the example using normal DNS. Below proof of concept uses GNS (GNU Name Service):

```

Payment code for Alice: PM8TJggVVXFKAmfkjnA1CQcrSbGScUKRsVohpfMpSM56f6jg5uQTPJvNS1wKDGV17d9NWLqoVzsJ8qURqpUECmSFLcUuC4g3aMtoXp2fChY1ZEqzG16f

Start GNUnet: 

gnunet-arm -s

Create identity:

gnunet-identity -C alice

Check public key:

gnunet-identity -d

alice - 000G005XCTRJ0DJGPVPNY66GAY52C61KA8A7CA92PKT51PHNVWY9JF8WB4 - ECDSA

Add payment code as TXT record which expires in 90 days:

gnunet-namestore -z alice -a -e "90 d" -p -t TXT -n pay -V "PM8TJTLJbPRGxSbc8EJi42Wrr6QbNSaSSVJ5Y3E4pbCYiTHUskHg13935Ubb7q8tx9GVbh2UuRnBc3WSyJHhUrw8KhprKnn9eDznYGieTzFcwQRya4GA"

Check payment code:

gnunet-gns -t TXT -u pay.alice

pay.alice:
Got `TXT' record: PM8TJTLJbPRGxSbc8EJi42Wrr6QbNSaSSVJ5Y3E4pbCYiTHUskHg13935Ubb7q8tx9GVbh2UuRnBc3WSyJHhUrw8KhprKnn9eDznYGieTzFcwQRya4GA

```

Similarly notification transaction can be replaced with `gnunet-publish`. Nostr is still a work in progress and I think it could also be used for such things in future. Everything looks achievable and involves basic things but we still see people posting their bitcoin address on social media to get donations.

Related:

Q&A: https://bitcoin.stackexchange.com/questions/106971/how-to-accept-donation-correctly/
New proposal: https://gist.github.com/Kixunil/0ddb3a9cdec33342b97431e438252c0a


-- 
Prayank

A3B1 E430 2298 178F

[-- Attachment #2: Type: text/html, Size: 3611 bytes --]

 permalink raw reply	[|nested]
From: Peter @ 2022-03-01 17:31 UTC (permalink / raw)
  To: bitcoin-dev

[-- Attachment #1: Type: text/plain, Size: 1411 bytes --]

Hi,

Regarding to BIP47 there's a newer version (v3 and v4) proposed here:
https://github.com/OpenBitcoinPrivacyProject/rfc/blob/master/obpp-05.mediawiki

This newer version addresses some issues from v1.

Now the notification from Alice to Bob is a transaction from Alice to Alice as a bare 1 of 3 multisig. The other 2 pubkeys represent Alice's payment code and Bob's payment identifier. Eliminating the toxic change issue.

The overhead is a one time 64 byte for the two pubkeys. This overhead would be amortized over the lifetime of the Alice / Bob relationship.

Additionally the first economic payment from Alice to Bob can be included along with the notification transaction.

Payment codes are recoverable from the bip32 seed. No extra backups required.

This new version is in production with Samourai wallet.

This BIP47 v3 allows Alice to receive Bob's address without exposing her IP/identity to Charlie who can watch Alice receive the payment code material from Bob without knowing if Alice acted by sending a payment to Bob.

An xpub doesn't accomplish this because if you have your xpub in a crowdfunding platform the platform or anyone who hacks it can identify your payments. With the payment code you can associate yourself publicly with your payment code and no one (who is not the sender) will know if you received funds as your payment code is not visible in the blockchain.

Regards

Peter

[-- Attachment #2: Type: text/html, Size: 1897 bytes --]

 permalink raw reply	[|nested]
From: Prayank @ 2022-03-02  4:45 UTC (permalink / raw)
  To: dizzle;  Bitcoin Dev

[-- Attachment #1: Type: text/plain, Size: 1445 bytes --]

Hi Peter,

> Regarding to BIP47 there's a newer version (v3 and v4) proposed here: https://github.com/OpenBitcoinPrivacyProject/rfc/blob/master/obpp-05.mediawiki

> Now the notification from Alice to Bob is a transaction from Alice to Alice as a bare 1 of 3 multisig. The other 2 pubkeys represent Alice's payment code and Bob's payment identifier. Eliminating the toxic change issue.

Thanks for sharing the link. Removing toxic change sounds good and certainly an improvement.

> An xpub doesn't accomplish this because if you have your xpub in a crowdfunding platform the platform or anyone who hacks it can identify your payments. With the payment code you can associate yourself publicly with your payment code and no one (who is not the sender) will know if you received funds as your payment code is not visible in the blockchain.

Crowdfunding platform can also be self hosted like BTCPay server. In this case XPUB is not shared with anyone as long as machine running BTCPay is secure. Problem with this setup is users need to setup BTCPay, running all the time and manage gap limit. No such thing is required in using BIP 47 payment codes.

There is also a [rust library][1] to use BIP 47 and I found the link on twitter yesterday. I think this can be helpful for application developers to implement BIP 47 payment codes in different bitcoin projects.

[1]: https://github.com/rust-bitcoin/rust-bip47


-- 
Prayank

A3B1 E430 2298 178F

[-- Attachment #2: Type: text/html, Size: 2043 bytes --]

 permalink raw reply	[|nested]