Payshares
Payshares is an open source platform for value exchange that is based on Ripple.
Design
Servers run a software implementation of the protocol, and use the internet to connect to and communicate with other Payshares servers, forming a global value exchange network. Each server stores a record of all “accounts” on the network. These records are stored in a database called the “ledger”. Servers propose changes to the ledger by proposing “transactions”, which move accounts from one state to another by spending the account’s balance or changing a property of the account. All of the servers come to agreement on which set of transactions to apply to the current ledger through a process called “consensus”. The consensus process happens at a regular interval, typically every 2 to 4 seconds. This keeps each server’s copy of the ledger in sync and identical.
Ledger
The ledger contains a record of every account on the network, and its associated balances, trust lines, and offers. It is a “snapshot” of the state of the Payshares network in time. Each Payshares server stores the current ledger, and at the end of each consensus round applies a transaction set to move the ledger from the current state to a new state. Depending on storage constraints, Payshares servers may or may not also store a history of previous transactions.
Distributed Exchange
Accounts can create offers to sell one currency for another. Accounts create an offer using an OfferCreate transaction and the offer is stored in the ledger. Each offer an account creates requires a 5-XPR reserve. If two offers are created that match each other, for instance, one offer buying what another offer is selling, and vice versa, each account will be updated with the new balances.
Additionally, offers on the distributed exchange provide a pathway for users to send one currency and the recipient to receive another. As an example, suppose an account creates an offer buying USD and selling EUR. Now, an account holding only USD can send another account EUR, by using the USD/EUR offer. The sending account’s USD balance decreased, the account that set the offers USD balance is increased and EUR balance is decreased, and the account receiving the payment EUR balance is increased.
Payshares Currency (XPR)
The initial Payshares ledger contained one account, the “root account”, which held a balance of 100 Billion XPR. XPR is the native currency of Payshares, and cannot be created (or “issued”) by any account, although new XPR units are introduced through a process called “inflation”. To reduce the effects of sociopolitical risk, the Payshares Developers may increase the supply to 1 Trillion Units.
Each account in the ledger is required to maintain a minimum balance of 20 XPR. Additionally, each transaction applied to a ledger costs the transaction account a small fraction of XPR (as of February 2014, this fee is 1/100000 of 1 XPR). In this regard, Payshares functions as an anti-spam mechanism: the minimum balance prevents ledger bloat, while the transaction fee prevents the network from being overwhelmed by erroneous transactions meant to cause a large scale denial of service, by making it prohibitively costly for attackers. For a regular user, the fee is negligible: 100,000 transactions can be sent for less than 1 XPR, or less than 1 cent.
Additionally, XPR units act as a “bridge currency” on the distributed exchange, facilitating a path between two currencies which may not have a direct exchange.
Credits
Payshares allows accounts to hold and issue credits. Credits represent external assets defined by the issuer such as contracts, commodities, and currency. Gateways hold an external asset in exchange for a credit issued from their account and are similar to an escrow service. 1% inflation of the XPR currency is injected annually and distributed weekly through a voting system. Each account's vote is weighted based on the percentage of the total XPR it holds. At the end of the week, inflation is distributed to the elected recipients.
Design
Servers run a software implementation of the protocol, and use the internet to connect to and communicate with other Payshares servers, forming a global value exchange network. Each server stores a record of all “accounts” on the network. These records are stored in a database called the “ledger”. Servers propose changes to the ledger by proposing “transactions”, which move accounts from one state to another by spending the account’s balance or changing a property of the account. All of the servers come to agreement on which set of transactions to apply to the current ledger through a process called “consensus”. The consensus process happens at a regular interval, typically every 2 to 4 seconds. This keeps each server’s copy of the ledger in sync and identical.
Ledger
The ledger contains a record of every account on the network, and its associated balances, trust lines, and offers. It is a “snapshot” of the state of the Payshares network in time. Each Payshares server stores the current ledger, and at the end of each consensus round applies a transaction set to move the ledger from the current state to a new state. Depending on storage constraints, Payshares servers may or may not also store a history of previous transactions.
Distributed Exchange
Accounts can create offers to sell one currency for another. Accounts create an offer using an OfferCreate transaction and the offer is stored in the ledger. Each offer an account creates requires a 5-XPR reserve. If two offers are created that match each other, for instance, one offer buying what another offer is selling, and vice versa, each account will be updated with the new balances.
Additionally, offers on the distributed exchange provide a pathway for users to send one currency and the recipient to receive another. As an example, suppose an account creates an offer buying USD and selling EUR. Now, an account holding only USD can send another account EUR, by using the USD/EUR offer. The sending account’s USD balance decreased, the account that set the offers USD balance is increased and EUR balance is decreased, and the account receiving the payment EUR balance is increased.
Payshares Currency (XPR)
The initial Payshares ledger contained one account, the “root account”, which held a balance of 100 Billion XPR. XPR is the native currency of Payshares, and cannot be created (or “issued”) by any account, although new XPR units are introduced through a process called “inflation”. To reduce the effects of sociopolitical risk, the Payshares Developers may increase the supply to 1 Trillion Units.
Each account in the ledger is required to maintain a minimum balance of 20 XPR. Additionally, each transaction applied to a ledger costs the transaction account a small fraction of XPR (as of February 2014, this fee is 1/100000 of 1 XPR). In this regard, Payshares functions as an anti-spam mechanism: the minimum balance prevents ledger bloat, while the transaction fee prevents the network from being overwhelmed by erroneous transactions meant to cause a large scale denial of service, by making it prohibitively costly for attackers. For a regular user, the fee is negligible: 100,000 transactions can be sent for less than 1 XPR, or less than 1 cent.
Additionally, XPR units act as a “bridge currency” on the distributed exchange, facilitating a path between two currencies which may not have a direct exchange.
Credits
Payshares allows accounts to hold and issue credits. Credits represent external assets defined by the issuer such as contracts, commodities, and currency. Gateways hold an external asset in exchange for a credit issued from their account and are similar to an escrow service. 1% inflation of the XPR currency is injected annually and distributed weekly through a voting system. Each account's vote is weighted based on the percentage of the total XPR it holds. At the end of the week, inflation is distributed to the elected recipients.
Comments