Onboarding
On-boarding via a referral
Referrer's client creates a
payment transaction
with the receiver's mobile phone number and submits it to the network. In this case the receiver's has not created a user account yet. Referrer can optionally specify a receiver's character trait to appreciate as part of the transaction.The transaction gets to the
Karmachain transactions pool
. An active verifier sees the transaction and figures out that receiver hasn't registered yet. It sends a text message to the receiver's mobile phone, with link to download the app to his mobile phone with information about the amount of coin sent, and the optional character trait appreciation. The verifier also stores the id of the pending payment transaction as thereferral transaction id
for the receiver's mobile phone number, so it can be included in the attestation it provides to the user in the next step.Receiver downloads the Karma Coin mobile app and signs-up using his mobile phone number. This involves verifying his mobile number with the verifier and setting a unique available nickname. The verifier sends a signed attestation about the verified number and its association with an receiver's account id. The attestation includes the referrer's payment transaction id stored in the previous step.
Receiver creates and signs a
new user transaction
. It adds to it the verifier's attestation and thereferral transaction id
obtained by it in step 5 above.A block producer gets the
new user transaction
from the pool and processes it. The attestation includes the referrer's payment transaction id. The producer locates thispayment transaction
in the pool by its id, and adds it to the block it is producing. Thenew user transaction
is processed first and thepayment transaction
second. As part of processing of thenew user transaction
, the new user's online account is created and the new user's balance is updated with asign-up reward
. Next, it updates the referrer's account with thereferral reward
and updates balances based on thepayment transaction
. The referral reward payment is added to the payment translation'stransaction event
emitted by the producer. Note that in case that thepayment transaction
identified by the id is not in the pool, then no referral reward is assigned.
The chain should now have the following state:
- Receiver has a new account on chain.
- Receiver's account is updated with the coin amount sent in the payment transaction from the referrer.
- A point is added to their character score in the receiver's account if the payment transaction included an appreciation.
- Receiver's account is updated with the sign-up reward when applicable.
- Referrer's account is updated with the referral reward and is debited the amount sent to the receiver.
- The transaction fee is debited from referrer's account unless it was paid by the protocol via a subsidy.
- The
payment transaction
is on-chain. - The
new user transaction
is on-chain. - Balances are updated with the payment transaction fees. e.g. the fee is either minted by the protocol and assigned to verifier or paid by the referring user to the verifier.
Note that the block producer can only get the
payment transaction
fee (from the referrer or from the protocol) if it adds the 2 transactions to a block it is creating. So it has an incentive to behave according to the protocol.
Referral reward and signup rewards are assigned while the protocol hasn't reached the limit of minting of coins for these rewards. See tokenomics for more info.
On-boarding without a referral
- New user signs-up via a Karma Coin client and verifies his mobile phone number using the active verifier.
- The verifier sends the user a signed attestation with his account number, verified mobile phone number and nickname.
- User queries the verifier for any payment transaction id associated with his mobile phone number. Since there is none, no transaction id is returned.
- The new user creates, signs and submits a
new user transaction
to the Karma Coin blockchain which includes the verifier's attestation. It sets the referral's account id to void to signal that there is no referral for this new account creation. - A block producer gets the transaction from the memory pool, executes the transaction, adds the new user account and the transaction to the chain and gets the transaction fee from the user or from the protocol if a subsidy is applicable. It also assigns the new user sign-up reward when applicable according to the protocol.
Verifiers are run by the Karma Coin foundation and have an off-chain incentive to pay the transaction fees for new user accounts. e.g. mandate to see Karma Coin grows in terms of unique users.
The chain should now have the following state:
- Receiver has a new account on chain.
- Receiver's account is updated with the sign-up reward when applicable.
- The new transaction fee is debited from verifier account unless it was paid by the protocol.
- The
new user transaction
is on-chain.
Copyright (c) 2022 by the Karma Coin Authors. This work is licensed under the Karma Coin License.