You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A combination of off-chain and on-chain transactions define the interaction of the client with the system.
3
+
A service instance is represented by a smart contract on a blockchain. The contract's state changes with transactions on it by the user and the service provider.
4
4
5
-
* a fiat on-ramp sells service tokens in the sense of a gift card to the client who's on-chain account will be credited with the corresponding amount
6
-
* alternative: accepting crypto currencies might trigger the same
7
-
* the client exposes a fraction of her balance to the service
8
-
* this is an on-chain transaction of transferring tokens from a client's account back to the service account
9
-
* in return the client is credited with internal service tokens (GEEZ)
10
-
* the client starts and uses services
11
-
* which then debit their usage from the client's GEEZ account
5
+
* at first, the contract is created by the service manager with references to the provider's and the user's addresses so to allow only interaction from these accounts
6
+
* the user deposits a small amount to start the contract
7
+
* both the user and the provider can intermittently withdraw funds from the contract
8
+
* the user may deposit more funds to extend the duration of the contract
9
+
* either the user or the provider call "stop" on the contract, or the contract runs out of funds
10
+
* after this point, the contract cannot be started again, the balances don't change anymore
12
11
13
-
This approach has some
14
12
15
-
### CONS
16
-
- it is a bit laborous for the client
17
-
- fiat payment, then on-chain transfer of tokens
18
-
- there are some parts which depend on "trust" like the account of GEEZ which is presumably held in an internal and opaque database
13
+
## On-ramp, off-ramp
19
14
20
-
### PROS
21
-
- only a fraction of the client's holding are at stake, the rest is kept in an on-chain account
22
-
- a fiat on-ramp process allows more users to use the system
23
-
- not everybody can, wants, or is allowed to use cryptocurrencies
24
-
- low transaction fees
25
-
- fiat on-ramp: \<5% charged to the service
26
-
- on-chain transfer: $0.05 or lower charged to the client
15
+
All services on this platform are payable in a token, named BCA1, that represents the value of one Euro per token.
16
+
Such tokens can be purchased using fiat money in our on-ramp service. And, token holders can request a payout to a bank account by returning the tokens.
27
17
28
-
##Transactions
18
+
### The user buys service tokens using fiat and gets credited
29
19
30
-
Let's have a closer look at the transactions involved.
31
-
32
-
### The client buys service tokens using fiat and gets credited
33
-
34
-
The client buys in a conventional fiat transaction some tokens. This is reflected by minting new tokens to the client's on-chain account.
20
+
The user buys in a conventional fiat transaction some tokens. This is reflected by minting new tokens to the user's on-chain account.
35
21
36
22

37
23
38
24
39
-
### The client charges her account
40
-
41
-
Using an on-chain transaction, the client transfers a number of tokens to the _serviceAccount_.
42
-
43
-
This is reflected in crediting the client's off-chain account with "Geez" tokens of the same amount.
25
+
### The user deposits tokens for service micro-payments
44
26
45
-

27
+
Using an on-chain transaction, the user transfers a number of tokens to a smart contract representing a service instance.
46
28
29
+

47
30
48
-
### Services debit the client's account for micropayments
49
31
50
-
In an off-chain setup, or on a private blockchain with minimal transaction fees, services can debit client accounts for their service usage.
32
+
### Balances of both parties are managed in the smart contract
51
33
52
-
This is immediately reflected in an updated balance in the client's account.
34
+
After the contract is started, the user's and the provider's balances are maintained. These balances determine how much each party can withdraw from the contract. While the user's balance diminishes with time, the provider's balance will increase.
- the service manager which manages the user's account and communicates with both the user and the service providers
6
+
- the service account that owns the contract
7
+
- the user who requests and funds the service
6
8
- the service provider which provides services and manages them
9
+
- represented by the service controller which reacts to events of the contract
7
10
8
11

9
12
10
13
11
-
## Starting a service
14
+
## Setting up a new service instance
12
15
13
16
The user requests a new service with the service manager.
14
17
15
-
The service manager invokes the setup process with the service provider.
18
+
The service manager invokes the setup process with the service provider and deploys a new smart contract for this service instance.
16
19
17
-
After the process ends successfully, the service providers hands over the credentials in a secure way to the user via the service manager.
20
+
To progress in the setup, the user must first deposit enough funds in the contract.
18
21
19
-
At this time, the user can use the service.
22
+
After the setup process ends successfully, the service provider hands over, in a secure way, the access credentials to the user via the service manager.
The user requests a service he has subscribed to be shutdown.
27
-
28
-
The service manager invokes the shutdown process with the service provider.
29
+
The user requests a subscribed service to be shutdown with a call to the "stop" method of the contract. Or, the user's deposit on the contract is exhausted.
29
30
30
-
At the end of the process, the service provider acknowledges the sunsetting of the service and send this via the service manager to the user.
31
+
The service controller reacts to the Stop event and invokes the shutdown process of the service.
The service manager debits the user's account periodically for the services in use.
38
+
The contract is effectively calculating the user's and the provider's balances on arrival of a transaction.
38
39
39
-
The time periods of a tick are per hour: from one up to 24 hours.
40
+
Since the parameters of the contract are known, these balances can also be deterministically calculated off-chain.
40
41
41
-
A service is in use after it has been started. The usage ends with the stopping of the service.
42
-
If the user's account runs out of credits, then the service is stopped immediately and the usage ends.
42
+
This has the same effect as micro-payments. Users only pay for their usage and service providers earn a revenue stream. If the calculated balance is reasonably high, then a provider might withdraw their balance.
43
+
44
+
A service is in use after it has been started with a first deposit by the user. The usage ends with the stopping of the service, or if the user's balance runs out of funds.
43
45
44
46
At start of a service an initial setup fee can be charged. This fee also includes a potential tear down fee when the service is shut down; there is no extra fee due when the servicing ends.
45
47
46
-
At the end of the time period, the user's account is charged.
48
+
### Contract simulation
47
49
48
-
### Process of billing
49
-

50
+
The [spreadsheet](./img/Tokenized_Service_Contract_Simulation.ods) contains simulations for a short lived and a long-running service contract and the calculation of the user's and the provider's balances.
50
51
51
-
### Details of the accounting class
52
-

52
+

53
+
This shows the balances of the user and the provider over the lifespan of the service contract. The user regularly deposits coins to fund the service. Also, the provider withdraws funds as soon as they reach a certain amount.
53
54
54
55
## Registering a service controller
55
56
@@ -60,4 +61,3 @@ The service controller runs on the service provider's infrastructure.
60
61
Between the two there is a secure VPN connection installed such that either party is assured to only communicate with the other and nobody else is listening.
61
62
62
63

0 commit comments