SmartPay/DACRS WHITE PAPER
DACRS: Distributed Autonomous Corporations RuntimeSystem
Abstract
As an innovative payment method, Bitcoin andother cryptocurrenties have become the hot issue around the world. Decentralizedand low-cost make it an inundate tendency for the future development. With the user-scaleexpansion, Bitcoin cannot meet all the different payment requirements, andbrings the age of Bitcoin 2.0(Like BTS, NXT, and NMC). However, each coin has onenew function, which causes the overissue and fragmentization of cryptocurrenties.
In response to the problem ofcryptocurrenties’ fragmentization, Distributed Autonomous Corporations Runtime System(DACRS) has been designed and developed by SoyPay team. This paper will introduce the operation mode, detailsand technical principles of the system. And also present some practicalapplications to unveil its great power and potential on payment application.
1 Foreword
The concept of Bitcoin 2.0 has become a hot issue now.New cryptocurrenties are coming out continuouslyaround the world, but only a very few of them survive. Each new coin declaresthat it will achieve some new function. The coins born to meet the needs thatBitcoin cannot satisfy cause the overissue of cryptocurrencies. Every paymentapplication can find one or more matched coins. Fragmentization of cryptocurrentieshas become a big problem.
Fragmentization of cryptocurrenties built an environmentfor speculation, which makes the Bitcoin 2.0 entangle in suspicion of scam. Functionisolation, large currency fluctuation Influence seriously affects the cryptocurrenties’development. 3I publish their plan to integrate PTS, AGS and DNS into BTS fewdays ago, which fully prove the fragmentization has a bad influence on cryptocurrentiesto some degree.
To fix this problem, SoyPay team comes out the conceptof Distributed Autonomous Corporations Runtime System, and has put into practice.The system will build a basic runtime environment for DACs, and developers justneed to focus on the core logic of new Applications which may achieve thefunctions the traditional DACs possessed. On DACRS, different DACs can sharethe data and the assets are able to exchange. It will solve cross chaintransactions and the fragmentization problem.
2 Introduction
Distributed AutonomousCorporations Runtime System (DACRS) is P2P application platform run in thenetwork, which provide the developers basic infrastructures (P2P network,signature validation, block rollback, user data rollback, authority verificationetc.).
In DACRS, every application is equalto one traditional DAC [1] (Distributed AutonomousCorporation), and can achieve most the functions of DAC. Operation of this kindof “corporation” will be implemented in the form of script. Development workwill be easier in this mode for developers just need to concentrate on the corelogic’s realization. It may save time and resource for DAC design and development.
2.1 Virtual Machine
DACRS simulates an 8051 processor(RAM 64 K, ROM64K).
While the virtual machine isrunning, application can read all the information of DACRS, read-write theapplication’s private database and modify the system account (need authority check).
The C/C++ code can be compiled bythe Keil or IAR for 8051.
2.2 SmartCoin
SmartCoinis the cryptocurrency of DACRS, which use to regulate the transaction volume (toprevent the flooding attacks DACRS) and steps of contract (to preventthe resources abuse of developers). The function is similar to the XRP ofripple, and the coins can use as the medium of asset exchange between theapplications.
2.3 ApplicationRegistration
Through DACRS, the developers can design and registerall kind of applications to achieve a variety of financial needs.
Developers use C/C++ to develop different kinds ofapplications, and register them into DACRS. System will allocate the privatedatabase, virtual machine and application account for the applications.
2.4 Account
Application Account
System will generate the account for everyapplication. And account balance only can be modified when run the contract.Application account is use as the intermediate account generally.
User Account
All the registered users will have their user accountswhich contain users’ public key and their authorization information. Only the authorizedapplications can modify the account according to the limits of authority, anyother operations need to verify the users’ signature.
2.5 TransactionType
2.5.1 System Transaction
System transaction includes the direct accounttransfer, application register, authorization etc. System transaction, as thebasic function of DACRS, is mainly used to support the system’s basicpayment requirements. It is not tied up with the user-defined transaction.
2.5.2 User-defined Transaction (Application Related)
The application related transaction is calleduser-defined transaction in DACRS. When using this kind of transaction, userneed to send to the package includes application ID and black box data. Systemwon’t analyze the black box data, but send it to the virtual machine instead.
Black box data should be the signed data packageswhich contain the contract contents, execution conditions match the applicationrequirements. After received the package, the correspondingvirtual machine will run it automatically.
When running the application code, the virtual machinecan modify the content of the database, and output the orders to change to useraccount (need to check the authority). All the implementationprocess will not rely on any third party.
2.6 Authorization
The applications have to beunder the authorization before using. Authorized content mainly includes the payment duration and transfer limited,which can restrict the application’s deduction right to the user account in acertain period.
If the application contains any bugs or maliciouscode, users may suffer losses once they authorized. It makes nodifference for users withoutauthorization.
When running the user-defined transaction, system willperform authority check and balance check on the account operational order outputfrom virtual machine to prevent the malicious applications and ensure thetransaction amounts corresponds.
2.7 OpenPlatform
As an open platform, all the registered users can be anapplication developer of DACRS to expand the system functions and also chargefor the application.
Developers can achieve different kind of applicationsin DACRS, such as decentralized lottery, secured transaction, transaction’sarbitration etc. And it will make the payment of cryptocurrency much easy,quick and powerful.
3 Technique
3.1 Security
DACRS may use POS (Proof of Stake) early, and may change to DPOS (DelegatedProof of Stake) in later period to ensure the security.
3.2 Anonymity
DACRS default that the transaction can be traced justlike Bitcoin, not seek for the anonymity deliberately. Nonetheless, system is possibleto achieve the function of anonymity by develop a specific application.
3.3 BlockSize
The common transaction data will be compressed intoabout 110 bytes (the average of Bitcoin is 700 bytes). One contract may justadd as low as 10 bytes to block.
With the same transaction volume, the blockchain sizemay be 3 times smaller than Bitcoin’s.
3.4 ResourcesRecovery
If an application has been out of operation for a longtime, the allocated database and virtual machine would be retrieved compulsively.
When the application’s virtual machine runs the user-definedtransaction, it will charge for the fuel fee by steps. Application will beforce out without fuel.
The private database also should be charged accordingto numbers of memory bytes and memory time. System will delete the stale data andrecover the resource automatically.
3.5 System Diagram
4 Payment Applications
DACRS’s simple and flexible functions will meet thepayment requirements in daily life. And it can make the cryptocurrency paymentbe much easier and safer.
This chapter will discuss about the executionconditions, rules and some details of the payment applications. DACRS will achievebut not just the secured transaction, P2P game platform and P2P financingplatform, of which the secured transaction will be the main application.
4.1 Secured Transaction
Secured transaction is a loan or a credit transactionin which the buyer acquires a security interest in collateral owned by the sellerand is entitled to foreclose on or repossess the collateral in the event of theseller's default. The terms of the relationship are governed by a contract, orsecurity agreement.[3]
The key point of secured transaction is disputesolving mechanism. Tradition payment applications like PayPal, Alipay settlethe disputes by using the specific customer service staffs to judge accordingto the evidence that the trading parties provided. However, DACRS solvedisputes by distributed arbitration.
4.1.1 Related Concepts
Distributed Arbitration
Everyone can register the arbitrator account in DACRSsystem to provide the arbitration service and also can charge for it. All thearbitrations the arbitrator participates will be recorded and open to thepublic.
Evidence
The evidences that the traditional secured transactionrefers to are consist of the chatting records, express waybill number, and someother proof stored in their servers. When the customer service staffs receivethe users’ complaints, they will give the judgment according to the evidencesthey have.
In DACRS system, when the trading parties communicateon chat software, all the messages they send have been encrypted by private key.If one side breaks the contract, the other can submit the evidence to thethird-party arbitrator. Arbitrator should make a judgment on the basis of it.
Arbitration Application
Arbitration applicationis a program developed by the third-party developer and runs in DACRS system. Theinput will be the signed package which is composed in the prescribedformat. Different application can support different contractcontents and meet various requirements. When miner receives this kind of transaction,system will run the application according to the account transfer instruction.
4.1.2 Arbitrator
DACRS system brings in the concept of arbitrator forthe first time. When carry on transactions in DACRS, except the buyer, sellerin common transaction, the participated roles also joins the arbitrator whensome disputes appear and needs someone to coordinate and arbitrate. In specificpayment application, developers can choose whether to join the arbitrator roleor not according to their different needs. This chapter will introduce theconcept of arbitrator in DACRS, and a detailed analysis and decomposition comesin next chapter which are about the payment application.
Definition
Arbitrator refers to who registers in the system, hasthe right to confirm and sign the transaction, and is appointed to be the performerto provide the arbitration service when disputes occur. Arbitrator is acompletely neutral individual that are decided by the trading parties throughconsultation.
In DACRS system, arbitrator is an independent profession.Everyone can register the arbitrator account in the system to provide the arbitrationservice. The professional arbitrator will replace the customer serviceadministrator in traditional transaction platform.
Credit and Profit
The arbitrator can built their credibility by accept thearbitration orders and also can charge commissions. All the arbitrations thatan arbitrator involved will be recorded and open to the public. When the arbitratorsjoin in a multi-party arbitration, the result that most of the arbitratorsagree with will be chosen as the final verdict. The minority who make a wrong arbitrationwill be recorded. When the trading parties want to choose an arbitrator, theycan refer to the arbitration number, complaint amount and misjudgment ratio todesignate the arbitrator.
The professional arbitrator will be divided intoseveral levels. By join in arbitration, arbitrators can build credibility andupgrade their level. High-level arbitrator would gain the trust from mostpeople, which may bring more arbitration orders. With higher level, arbitratormay have more choices, and they can make more profits by increase the commission.
Collision Prevent
In the transaction process,arbitrator may collude with one trading party due to the benefit seduction. Toprevent the collusion between arbitrator and one side, trading parties canchoose single arbitration or multi-party arbitration. In multi-party arbitration,the final result should be subjected to most of the arbitrators. Forexample, in three-party arbitration, the result that 2 or more arbitratorsagree with will be the final result.
Since all the arbitration dataare open to the public, if the arbitrator has a high ratio of wrongarbitration, their credibility and order quantity would be affected. For long-terminterests, arbitrator will not collude with the trading parties certainly. Inthis case, trading parties want to bride arbitrator need to pay in high price,and even higher than the amount of loss. The single arbitrator asks for high credibilityof arbitrator or the trust between trading parties.
4.1.3 Single Arbitration Application
Conditions
1. Trading parties have register account in DACRS,and freeze some coins as deposit. When the contract broke, deposit may becharged according to the verdict.
2. The trading parties choose an arbitration applicationbased on their needs.
3. Designate the arbitrator.
Transaction Process
Buyer: A
Seller: B
Arbitrator: C
Buyer Aorganizes the contract contents like the timeout, transaction amount and other termsin the prescribed data format. A sign the file and send to seller B. Afterchecking and confirming the contents, B sign and broadcast it. After minerchecks the package and put it into the block, A’s coins will transfer to B directly(Within the limited time, B cannot use the coins). When reach a certain blockheight, B will send the commodity to A.
Normal Transaction
If there is noany dispute, the coins will be unfrozen after timeout. Then B can get the coinsand the transaction complete.
AbnormalTransaction
In the transaction process,trading parties may cause disputes due to all kinds of problems, and it isexisted that one party cheat and break the contract. When thedisputes with the contract cannot be settled through negotiation, there must bea neutral third-party involvement.
Complaint
If A hasn’treceived the commodity or the commodity has some problem which is not compliedwith the contract, and B rejects to solve it, A can initiate a proceeding bysubmitting a complaint in accordance with the contract. B provides theevidences to arbitrator C, and applies for arbitration.
Arbitration
Arbitrator C getsthe evidence and communicates with trading parties. Then C makes a verdict and sendsthe arbitration package. Miner receives the package and performs the verdict automatically.C charges the commission, then transaction complete.
The system onlyprovides single arbitration at present. Above just introduce the process of singlearbitration.
Attack Prevention
1. A applies for arbitration, butarbitrator C doesn’t reply.
If buyer A send the requests for arbitration, but C doesn’t reply intime. A can send the package of arbitration requests to the system (a fee willbe charge). System will deduct the deposit from C’s account, then transfer to A’saccount and freeze it. When the time out but C hasn’t replied it, the frozencoins cannot be recovered. In addition, all the arbitrations are recorded into block.If arbitrators don’t reply the requests will have a direct influence on theircredibility, which force them response the arbitration requests without delay.
2. A frame arbitrator C that Chasn’t responded the arbitration request.
In the case that A frame C, A need to pay forsending the package of arbitration requests first. After C aware the balancechange and A’s action, he can send out the subsequent arbitration package torecover the deducted coins. Miner receives the file and enforces the verdict.In this case, A cannot make any profit but lost the commission. On thiscondition, only when A is emergent and doesn’t care about the commission thathe may frame C.
3. Arbitrator C colludes with oneparty.
Arbitrator C is decided by A and B, and they need to sign and confirmit. A and B may not believe in C, if C has no any credibility record. Also theycan choose the multi-party arbitration when they can trust C. In multi-partyarbitration, the result that most arbitrators agree with will be chose as thefinal verdict. Single arbitrator’s judgment may not be the final verdict. If C’sjudgment is contrary to the majority, the wrong arbitration will be recordedand affect the credibility. To get more arbitration orders, C shouldn’t colludeswith any trading party.
4.1.4 Multi-party Arbitration
Similar to Single Arbitration, multi-party arbitration can be achieved just by set down the transactionrules and develop the related application. It will be no more details discussedin this article.
4.2 P2P Game Platform
Now the online games are all managed by a centralizedcompany, and fair and rules of the game are decided by them. To ensure thefair of the decentralized P2P games will need to solve the problem of randomnumber’s generation and result’s execution. DACRS will settle these problemsfor developers by creating games in smart contract. Moreover, DACRS alsoprovide a perfect rewards system for developers.
4.2.1 Dice
Player
1. Game player: A, B
2. A,B register the DACRS accounts, and have sent some coins as deposit
Rule
A, B choose a random number separately. If the result ofadding two numbers is an even number, then A win; otherwise, B win.
Background
A, B don’t trust each other. They are self-concern andeager to win the game by all means.
Algorithm
The algorithm of the game and the punishment rule of renegeare made by the developers who have registered in DACRS.
Process
1. A generates a random number “e” and computesthe checksum. Use a random number “f” to encrypt “e” and package it. A sign thepackage with private key then send to B.
Game APP ID
Betting Amount
e that is encrypted by f
e’s checksum
A’s signature
2. receive the packager andcheck A’s signature first. Then B generates a random number “h”, computes the checksumand encrypts “h” with random number “i”. Combine all the data in one package,then sign it and send to A.
Game APP ID
Betting Amount
e that is encrypted by f
e’s checksum
A’s signature
h that is encrypted by i
h’s checksum
B’s signature
3. After receive the package, Apublish the random number “f” and send to B.
Attack may happen in this step. Following part will discussabout attack prevention.
Package received in step 2
random number f
A’s signature
4. B get A’s random number,and then send package with the random number “i” to A.
Package received in step 3
random number i
B’s signature
5. Now A and B have known therandom numbers of each other, therefore, they can figure out the result. Thensend the data package like below to the system. System executes the result automatically,and transaction complete.
1
2
3
4
4
4
5
6
Game APP ID
transaction amount
Commission
Hash of step 1’s package
Hash of step 1’s package
……
A’s signature
B’s signature
DACRS will use the package receive in step 5 as theinput of related game application and run it. If the minimum commissionhas been stipulated, the commission in step 5 must be higher than the stipulatedone. Otherwise, it will fail to run the application and transaction can’tcomplete. The commission’s existing will motivate the third-party developerseffectively.
If the package of step 5 has been put into the block,system would reject the packages from step 1 to 4 when they were sent afterthat and vice versa.
A and B can send the data package of step 5 in onetime after N times’ play. That may alleviate strain on system.
Attack Prevention
In above process, attack may explode in step 3. The protocolproposed in this chapter is not the final protocol, just a designed one to verifyits practicability. Following part will discuss about the causes and solutionsabout attack.
1. A send a fake random number.B may find out that the checksum is a wrong one when decode it, and then rejectto send the following package. It means nothing to A for cheating in this way.
2. If B knows that he lost thegame by calculating A and B’s random numbers, B may very likely reject to sendthe following package and break the contract. In this instance, A can send thepackage of step 3 to system with a fee charged. Miner uses the package as inputand run the application, and system will judge that B lost the game and deductB’s deposit. B may get nothing but a default record by doing that.
3. When A gets the package, Acan frame that B broke the contract and abscond with the money and send thepackage to DACRS. Miner put it into the block, and system will decide that Blost the game. In this case, B can submit a complaint by sign and send therandom number for encrypting to system. Miner computes the result according toall the packages and output the right outcome.
In this case, A hasn’t got B’s random number yet and not known the resultwhen he frame B. If A lost the game finally, B will certainly complain for it.A can’t get any benefit, also will lost the commission.
If B send a wrong random number to A after receiving the package of Step3 and finding out himself lost the game. Similarly, A can find that the checksumis incorrect, and then send the package to system. System will judge B lost thegame and deduct B’s deposit. It is more kicks than halfpence.
4.3 P2PLending
As a new way for lending, peer-to-peer lending’s highinterest rate and returns arouse public concern from large amount of investors.However, the negative news, such as overdue loans, platform collapses,company's legal representative absconds with money and investors lost all themoney etc., can be heard without end.
DACRS is a decentralized platform which will provideinvestors a safer transaction method. It can reduce the risks above. P2Plending on DACRS can avoid the problems of centralized platform effectively.
1. Compensation’s payment doesn’t dependon any third party. System transfers the compensation automatically.
2. Guarantee companies are completely transparentand no black box operation.
3. Even no need for a lending platform to distributethe transaction information. Investors can evaluate the guarantee companies’credibility and reduce costs by analyzing DACRS’s public general legerdirectly.
4.3.1 Participants
Borrower A,Guarantoror a guarantee company B,Lender C (C maybe one or morepeople:C1, C2, C3, C4, C4…...Cn)
4.3.2 Normal Transaction
1. A, B, C have register accounts in DACRS.
2. A choose B who is providing guarantee businessto guarantee for him in some ways.
3. B makes an evaluation about A’s financialsituation, credit and risk. Then decide whether to guarantee for A or not andcharge a commission.
4. AB negotiate and confirm the repayment plan (monthlybalance, matching principal repayment etc.), deposit, payback period and otherterms. They sign and send the contract with minimum investment amount, interestrate and other rules to DACRS. System will freeze B’s stipulated deposit automatically.
5. Bpublishes the contract contents on third-party information platform.
6. When noticing the contract, Investor C willevaluate about B’s deposit and guarantee records, A’s loan amount, and returnon investment. Then C decides whether to invest or not based on his own financialsituation.
7. Once decides to join the investment, C sign andaccept the contract with provide key, then confirm the amount and send to DACRS.System will transfer the coins to A automatically when the contractual terms ofloan are met.
8. A repays the loan with interest on schedule accordingto the contract terms. After the contract expired, system will unfreeze thedeposit and allocate coins in accordance with the contract terms.
4.3.3 Abnormal Transaction
In the case that A concealed hisreal financial situation and passed B’s verification or A fails in investmentthat cannot repay the loan in time, the deposit of B will be transferred toinvestor C automatically according to the contract. B and C share the risks.
4.3.4 FAQ
FAQ1: If B has to freeze the same amount of deposit as thatof the loan, it may be equivalent that B lends the money to A directly. Isthere a need to make a transaction on DACRS?
ANS: B doesn’t need to freeze that much amounts as the loan.With higher deposit, C’s risk will be smaller, and B may charge a higher commissionwhich will make C’s interest lower. C can refer to B’s guarantee records orevaluate the risk by other means, estimate his own ability before acting. Meanwhile,it has competition among guarantors, and the market will achieve a balance atsome point ultimately.
FAQ2: As mention above, B’s deposit will be deducted when A breakthe contract. If there are many defaults, then B would go bankrupt anyway?
ANS: As a guarantor, B should carefully examine and verify A’sfinancial situation. Also, they can sign a mortgage contract to pledge the realassets or use some other measures to control risk. B’s operation and risksare same as that of the current guarantee company in the market.
FAQ3: After carrying the operation of period of time, B figuresout that the small loans A participated in are all in a low default rate andthe risk is controllable. Therefore, B wants to promise the investors to repay themin full if A broke the contract. But B cannot freeze 100% of the amount. Isthis possible?
ANS: In this case, B should change to another transaction application.Add the term into the application: except B’s frozen deposit, system also candeduct the balance of B’s account. The application and contract terms are authorizedand signed by B, also all the execution results are predictable that there isno any logic or security problem. If B’s account balance is insufficient,unsuccessful deduction would severely impact on B’s credibility. Once happen,it will be written in B’s records, and affect B’s future orders directly. Whetherto accept this kind of contract and bear the risk, it is all depend on investorC.
FAQ4: Is DACRS system can support various kinds of terms andrules? Such as only pay for 60% if A break the contract, or deduct the guarantor’sdeposit after N months.
ANS: Yes. All the rules that are able to represent withnumbers can be set down by application. The results are known and predictablein advance. When participants sign and accept the contract, all the terms andrules will be performed automatically.
FAQ5: Can A set the rule that to raise asmuch as 1 million in one month, otherwise the raising plan will be aborted?
ANS: It should refer to FAQ4. When it comes to the deadline,A cannot raise as much as the specified amount, then all the funds will bereturn to investors. Borrower is not able to use the fund before it reaches thespecified amount.
4.4 Others
In addition to the aboveapplications, DACRS will achieve more functions by application design anddevelop. Below are some examples,
1. Digital asset Release and distributedtransaction.
2. Asset anchoring.
3. Coinjoin.
5 Competition Analysis
1. All the innovative design of BTS, Nubits, NXTand other cryptocurrencies are hard-coded into the system. Therefore, the expansibilityis restricted that makes it not quick response to the new requirements and beimpossible to support some minor applications.
2. Ethereum opened the door to programmable DACapplications. However, Ethereum save the executable code as the contractcontent into the package, which cause the oversize of package and expansion ofblock.
3. DACRS share the application executable code and optimizethe communication protocol to minimize the block size and keep the application flexible.
6 References
[1] DAC:
http://baike.baidu.com/view/66060.htm?fr=aladdin#8http://en.wikipedia.org/w/index.php?title=Decentralized_Autonomous_Organization&redirect=no#Decentralized_Autonomous_Corporations.2FCompanies_.28DACs.29[2] Secured transaction:
http://en.wikipedia.org/wiki/Secured_transactionPS: This is the first draft, and there may be some spelling and grammatical mistakes. Welcome to point out, and we will update it anytime.
Download the Whitepaper:
Chinese:
https://drive.google.com/file/d/0B4M_T-O86dohem1XOHMweWZ4bFE/view?usp=sharingEnglish:
https://drive.google.com/file/d/0B4M_T-O86dohZWpMVHFYUDMzU00/view?usp=sharing