Wallet (blockchain)

From Open Transactions
Revision as of 18:14, 3 September 2014 by Justusranvier (talk | contribs) (Address Identification: Update descriptions of series ID and address ID)
Jump to navigation Jump to search

Introduction

In order to avoid ambiguity, the terms "blockchain wallet" and "blockchain address" refers to the cryptocurrency for which is pool is tracking receipts. This differentiation is necessary to avoid confusion with OT wallets or nym addresses.

Responsibilities

The blockchain wallet tracks and manipulates cryptocurrencies balances on the appropriate blockchain. The wallet notifies the audit server of received deposits, constructs outgoing transactions, and monitors the state of all relevant incoming and outgoing transactions.

An audit server requires access to a wallet provider for every cryptocurrency its operator wishes to accept deposits for, and this wallet must support the Voting Pool Wallet API.

Wallets should understand both hierarchical determinism and multisig capability, and also output coloring.

Address Identification

Series Identifier

Since one wallet will need to handle multiple pools and series, a series identifier must include the pool for which it belongs.

A wallet identifier is defined as: (pool,series).

Pool
UUID for a specific voting pool. This UUID is persistent even as members are added or removed.
Series
An index number that starts at 1 and increases monotonically (from the Keyset Definition)

Address Identifier

An address identifier is defined as (series identifier,branch,index)

Branch
0 for change addresses, 1-through-n for deposit addresses.

Note the branch represents the position of a server’s xpub in the standard order for a given series. The audit server must reference the keyset definition to obtain the correct transaction server ID-to-branch mapping for a given series since the standard order will change between series.

Index
The index applied to the xpubs in a given series to obtain the desired multisig output script.

When the audit server needs to query a specific address from the blockchain wallet, will pass the address identifier instead of a raw blockchain address or script.

Wallet Creation

When an audit server first initializes a voting pool contract, it must create the appropriate cryptocurrency wallets via the importmultisigwallet call to a wallet provider of the appropriate coin type (Bitcoin, Litecoin, etc).

The audit server must call this function for every defined series in the keyset, and must provide the xpubs in standard order (defined below).

When the private keys for a series are brought online, the wallet must call updatemultisigwallet to load them into the blockchain wallet.

Extended private keys must be loaded in the same order as their corresponding public keys. An audit server must return an error to the operator if he attempts to load the wrong extended private key.