Digital currencies are all around us. Nowadays, it is relatively easy to become a holder of a digital currency, but it is not at all easy to become an issuer of a digital currency. Swaptacular tries to make creating and issuing new digital currencies possible for everyone. The Swaptacular Project consists of three things:
- The overall network architecture
- A set of interoperability protocols
- Reference implementations for the interoperability protocols
In Swaptacular's network architecture, there are five types of nodes:
- Accounting Authorities manage user account balances. They form the backbone of the network.
- Currency Issuers create currencies and issue money into existence. In Swaptacular, they are also called "debtors".
- Debtors Agents are proxies that connect currency issuers to accounting authorities.
- Currency Holders can make and receive payments. In Swaptacular, they are also called "creditors".
- Creditors Agents are proxies that connect currency holders to accounting authorities.
+-----------+ +-----------+
| Currency | | Currency |
| Holder | | Issuer |
+-----------+ +-----------+
Payments | Issuing |
Web API | Web API |
| |
+-----------+ +----------------+ +-----------+
| Creditors | | Accounting | | Debtors |
| Agent |==========| Authority |==========| Agent |
+-----------+ +----------------+ +-----------+
Swaptacular Messaging Protocol
The diagram above shows the simplest possible Swaptacular network. Real networks can consist of thousands of different nodes. One important thing to note is that one creditors agent can connect currency holders to many different accounting authorities (the same is true for debtors agents). The following diagram tries to illustrate the connections that exist between different types of nodes:
+--------+ +--------+
|Currency| |Currency|
| Issuer | | Issuer |
+--------+ +--------+
| Issuing |
| Web API |
| |
+---------------+ +---------------+
| Debtors | | Debtors |
| Agent | | Agent |
+---------------+ +---------------+
|| ||
|| ||
|| ||
+----------------------+
| Accounting |
| Authority |
+--------+ +----------------------+
|Currency| || ||
| Holder | || Swaptacular ||
+--------+ || Messaging ||
Payments | || Protocol ||
Web API | || ||
| || ||
+--------+ +-----------------+ +-----------------+
|Currency|-----| Creditors | | Creditors |
| Holder | | Agent | | Agent |
+--------+ +-----------------+ +-----------------+
| || ||
| || ||
+--------+ || ||
|Currency| || ||
| Holder | +----------------------+
+--------+ | Accounting |
| Authority |
+----------------------+
The above diagram shows a creditors agent that connects three currency holders to two different accounting authorities. It also shows two debtors agents being connected to the same accounting authority.
Another important thing to note is that different network nodes (accounting authorities, creditors agents, debtors agents) can be operated by different organizations or individuals. Thus, very much like Internet, Swaptacular's network is decentralized by its nature.
At the core of Swaptacular's network architecture is the Swaptacular Messaging Protocol, which governs the communication between accounting authorities and debtors/creditors agents. The protocol uses a two-phase commit schema, which allows for the implementation of currency exchanges in the spirit of Circular Multilateral Barter.
In order to allow currency holders to use a client application of their choice, Swaptacular recommends the following OpenAPI specification for the Payments Web API.
Since interchangeability of client applications for currency issuing is not of critical importance, Swaptacular does not make recommendations about the Issuing Web API. The current reference implementation uses a Simple Issuing Web API.
- Accounting Authority
- Debtors Agent
- Creditors Agent
- Service that manages OAuth2 login and consent
- Currency Issuer UI
- Currency Holder UI
All the above implementations try to:
- Be correct.
- Be as simple as possible.
- Be useful in the real world.
- Demonstrate that an implementation that does scale very well horizontally, is indeed possible.
A fully functional demo deployment from this source code repository can be found here:
- Currency Issuer UI
- Currency Holder UI
- Debtors Agent Swagger
UI (client_id:
swagger-ui
, client_secret:swagger-ui
) - Creditors Agent Swagger
UI (client_id:
swagger-ui
, client_secret:swagger-ui
)