Skip to content

Commit

Permalink
[guides] refs fibercrypto#130 - Document generic wallet ops. Full wal…
Browse files Browse the repository at this point in the history
…let contract.
  • Loading branch information
olemis committed Dec 8, 2019
1 parent 4fb4d0a commit 02bdfe1
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions content/dev-docs/guides/v2.wallet.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,23 @@ Wallet also need to interact with the peer-to-peer network to get information fr

This leaves us with four necessary, but separable, parts of a wallet system: a public key distribution subsystem, a set of signing strategies, a blockchain aware visor, and a networked component. In the subsections below, we will describe specific contracts and possible relations between them.

In most cases, wallet contracts are obliged to implement generic operations like setting and reading a human readable label. All wallets shall have an identifier. The wallet instance should facilitate a way to calculate balances of the addresses it owns or manages.

To help protect against theft, the system offers users the option of encrypting the wallet files which contain the private keys. In order to provide support for multiple encryption strategies, this feature is betond wallet contract.

Note: We speak about distributing public keys generically. In many cases, hashes will be distributed instead of public keys, with the actual public keys only being distributed when the outputs they control are spent.

#### Peer-to-peer exchange

Every altcoin plugin must provide a way to broadcast transactions for further confirmation by peers across the network. Abstract types are used to identify peers either by name or by network routing address identifier. This is a top-level plugin entry point that could usually be implemented by a singleton instance. Since this is a global service not bound to any particular address, generic wallet operartions are not part of this contract.

#### Full-Service Wallets

This kind of wallets perform three of the four main functions: it generates private keys, derives the corresponding public keys, helps distribute those public keys as necessary, monitors for outputs spent to those public keys, creates and signs transactions spending those outputs. It does not broadcast the signed transactions though.

The main advantage of full-service wallets is that they are easy to implement. A single instance does everything the user needs to receive and spend coins.

The main disadvantage of full-service wallets is that they store the private keys on a device connected to the Internet. The compromise of such devices is a common occurrence, and an Internet connection makes it easy to transmit private keys from a compromised device to an attacker. Encryption is not enough since that approach protects the private keys when they aren’t being used, but it cannot protect against an attack designed to capture the encryption key or to read the decrypted keys from memory.



0 comments on commit 02bdfe1

Please sign in to comment.