|
| 1 | +# Contacts |
| 2 | + |
| 3 | +## Notes |
| 4 | + |
| 5 | +- Address reuse, using output descriptors/xpubs would allow you to generate addresses on demand for someone (onchain) |
| 6 | +- Lightning, can store a friends nodeid / pub key which can be used to push payments to them, or even chat (see whatsats / sphinx.chat) |
| 7 | +- If the output descriptor for a contact is a xpriv then it means that you can sign transactions, maybe some apps would separate contacts by those you can sign and those you can only send (maybe then such contacts are named “Devices” or “Wallets”). |
| 8 | +- (onchain) Each contact is able to show a balance, so it would appear that a contact could be seen as a fake payment channel of sorts, as it would allow you to do automatic coin selection and swap funds back and forth without needing to do any manual coin selection |
| 9 | +- Lightning, a contact could also represent a real payment channel |
| 10 | +- A contact can have a url to another users Tor hidden service (server) which can allow both parties to message each other |
| 11 | +- Another use case for the contacts could be to perform social multisig signing. Using this tor hidden service which is able to send a request to your friend/business partner. |
| 12 | + |
| 13 | +## Output Descriptors / xpubs |
| 14 | +While you should never ever share your seed phrase, or a private key for one of your accounts or addresses. |
| 15 | + |
| 16 | +You can however share the address, or extended public key (xpub) for an account. |
| 17 | + |
| 18 | +## Use Cases |
| 19 | +If you share an extended public key for one of your accounts with someone it is possible for them to generate billions of addresses without ever being able to generate the private keys of those addresses or the account itself. |
| 20 | + |
| 21 | +### Online Shops |
| 22 | +A merchant can enter an extended public key on their ecommerce software -- and every time a customer goes to checkout, a new address would be shown to them. |
| 23 | + |
| 24 | +#### Employers |
| 25 | +If you dont want to have to give a new address to your employer every 2 - 4 weeks for your salary, you can also share with them an xpub which they can use in their wallet to generate new addresses every time they have to pay your salary. |
| 26 | + |
| 27 | +###### Why not just get your salary into one address? |
| 28 | +If you were to get your salary paid into just one address -- then anytime you make a payment using funds from this address, you will be exposing your entire salary history. |
| 29 | + |
| 30 | +## Questions |
| 31 | + |
| 32 | +### How are contacts private? |
| 33 | + |
| 34 | +For security purposes -- the wallet should ask you to set a pin which would encrypt all of the wallet data including contacts. The wallet does not need access to phone numbers. |
| 35 | + |
| 36 | +### What happens if someone leaks my contact details? |
| 37 | + |
| 38 | +Others may have a record of all the addresses of that xpub. If they have made payments, then they will also be leaking their addresses. |
| 39 | + |
| 40 | +### What happens if the name gets leaked? |
| 41 | + |
| 42 | +You can put any name you want. |
| 43 | + |
| 44 | +## Design Challenges |
| 45 | + |
| 46 | +What happens if you need to send a payment to a contact which hasn't sent you any coins prior? |
| 47 | + |
| 48 | +- Coinjoin some other coins before making the payment? |
| 49 | +- Select from a coin join balance? |
| 50 | +- Wallet can suggest a more private means of payment instead of onchain (lightning)? |
| 51 | +- Coin swap? |
| 52 | + |
| 53 | +## Concept: Sharing Output Descriptors in vCard |
| 54 | + |
| 55 | +```typescript |
| 56 | +import { vCardJS } from 'vcards-js'; |
| 57 | + |
| 58 | +//create a new vCard |
| 59 | +const vCard = vCardsJS(); |
| 60 | + |
| 61 | +//set basic properties shown before |
| 62 | +vCard.firstName = 'Satoshi'; |
| 63 | +vCard.middleName = ''; |
| 64 | +vCard.lastName = 'Nakamoto'; |
| 65 | +vCard.uid = '69531f4a-c34d-4a1e-8922-bd38a9476a53'; |
| 66 | +vCard.organization = 'Bitcoin'; |
| 67 | + |
| 68 | +vCard.note = 'Notes on Satoshi'; |
| 69 | + |
| 70 | +//set bitcoin contacts |
| 71 | +vCard.bitcoin['output_descriptor'] = "pkh([d34db33f/44'/0'/0']xpub6ERApfZwUNrhLCkDtcHTcxd75RbzS1ed54G1LkBUHQVHQKqhMkhgbmJbZRkrgZw4koxb5JaHWkY4ALHY2grBGRjaDMzQLcgJvLJuZZvRcEL/1/*)"; |
| 72 | +vCard.bitcoin['bip47'] = "PM8TJJkFHmwP97D8CGrQPQtqgd3GJZvEt9tPewbMtYQK8R7kU65e1HMtmUSoNnkQ8u9hGGGi2sGcddacho9Q8XGp1Uvvz8oJSYrZWpoLzGmJb1sfX1tM"; |
| 73 | +vCard.bitcoin['ln_node_id'] = ""; |
| 74 | +vCard.bitcoin['btc_pay'] = ""; |
| 75 | + |
| 76 | +vCard.version = '3.0'; //can also support 2.1 and 4.0, certain versions only support certain fields |
| 77 | +``` |
0 commit comments