Last active
August 29, 2015 14:07
-
-
Save matiu/07786e0d875b4093accb to your computer and use it in GitHub Desktop.
Copay, joining a wallet overview
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Joining a wallet | |
================ | |
Creator (C) <-> Joining Peer (J) | |
(J) | |
<- Hello (secret random, peerPubkey) encrypted with creatorPubkey | |
(C) | |
(async._addConnectedPeer, emit 'connect', w.sendWalletId) | |
-> walletId (wallet options) | |
(J) | |
(peer creates the wallet with the wallet Id and sends: | |
<- walletReady (walletId) | |
(C) | |
(w._onData) | |
-> PublicKeyRing, AddressBook, TxProposals. |
Storage
- All devices, store WALLET_CRITICAL_DATA (WCD):
- Extended Private Key
- WalletID
- Pub Key Ring (could be incomplete) (i.e. copayers Extended Public Key, and copayer's aliases)
- if (!isComplete) Wallet Creation URL
Device mobility is possible when moving the WCD on a file or similar between devices. New devices can sync Wallet Extended Data (WED) from the Copa Server.
Communication (WED)
Communications thru Shared mailbox ONLY happen when the ring is complete.
- copayerId = pub key derivation of the ext pub key of certain path.
- walletEncKey = f(pkr)
- mailboxId = f(walletId, pkr)
- mailboxWriteSecret= f2(walletId, prk) (for the server to limit who can write the shared mbox)
All message have header: mailboxWriteSecret, which is checked by the server.
Shared mailbox
It is created by any of the copayers
/walletMailbox/<mailboxId>/list/<type>
/walletMailbox/<mailboxId>/state/<type>/copayerId
-> Signed with copayerId, encrypted with walletEncKey.
State (overwritten, one item per copayer)
- Indexes
- My name
- My Addressbook
...
List (limited list, FIFO).
- Tx proposals
TODO: TxProposals expiration / deletion policy
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Proposal:
Shared string: URL + Secret. URL is something like:
https://copay.io/wallets/<id>
(c)
POST URL /wallets
<- walletId.
(J)
GET URL.
<- wallet opts, pkr, status
POST URL
pkr
GET URL/status
[...]
Then everyone uses the mailboxes.
no more helo, walletId, walletReady, pubkeyring messages.