Skip to content

Commit 31757a1

Browse files
committed
docs(foundations): add references relating to tx
1 parent f27480c commit 31757a1

File tree

2 files changed

+81
-0
lines changed

2 files changed

+81
-0
lines changed

coinjoins/abstractions/contacts.md

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
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+
```

transaction.md

+4
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ listunspent
4444

4545
> “Segwit improves the situation here by making signature data, which does not impact the UTXO set size, cost 75% less than data that does impact the UTXO set size. This is expected to encourage users to favour the use of transactions that minimise impact on the UTXO set in order to minimise fees, and to encourage developers to design smart contracts and new features in a way that will also minimise the impact on the UTXO set.”
4646
47+
- https://medium.com/@blairlmarshall/how-does-a-bitcoin-transaction-actually-work-1c44818c3996
48+
4749
## Broadcasting
4850

4951
![tx-vending-machine](assets/img/tx-broadcast.svg)
@@ -54,6 +56,8 @@ listunspent
5456
>
5557
> the more confirmations your transactions has, the safer you are
5658
59+
- https://medium.com/@blairlmarshall/how-do-miners-validate-transactions-c01b05f36231
60+
5761
[1]: https://en.bitcoin.it/wiki/UTXO "UTXO Definition"
5862
[2]: https://coincentral.com/utxo-beginners-explainer/
5963
[3]: https://medium.com/bitbees/what-the-heck-is-utxo-ca68f2651819

0 commit comments

Comments
 (0)