CN109347651A - The method and system of block catenary system modeling and security verification based on MSVL - Google Patents

The method and system of block catenary system modeling and security verification based on MSVL Download PDF

Info

Publication number
CN109347651A
CN109347651A CN201810981891.1A CN201810981891A CN109347651A CN 109347651 A CN109347651 A CN 109347651A CN 201810981891 A CN201810981891 A CN 201810981891A CN 109347651 A CN109347651 A CN 109347651A
Authority
CN
China
Prior art keywords
block
catenary system
user
function
msvl
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201810981891.1A
Other languages
Chinese (zh)
Other versions
CN109347651B (en
Inventor
王小兵
朱云凯
段振华
赵亮
田聪
张南
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xidian University
Original Assignee
Xidian University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xidian University filed Critical Xidian University
Priority to CN201810981891.1A priority Critical patent/CN109347651B/en
Publication of CN109347651A publication Critical patent/CN109347651A/en
Application granted granted Critical
Publication of CN109347651B publication Critical patent/CN109347651B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/14Network analysis or design
    • H04L41/145Network analysis or design involving simulating, designing, planning or modelling of a network
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • G06F8/24Object-oriented
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/14Network analysis or design
    • H04L41/142Network analysis or design using statistical or mathematical methods
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
    • H04L63/1433Vulnerability analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • Computer Hardware Design (AREA)
  • Algebra (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Mathematical Physics (AREA)
  • Probability & Statistics with Applications (AREA)
  • Pure & Applied Mathematics (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The invention belongs to formalization method fields, disclose a kind of method and system of block catenary system modeling and security verification based on MSVL, are modeled with MSVL to block catenary system in MC, indicated with program p;With the property of PPTL description block catenary system, indicated with equation φ;In MC, the property φ that the modeling program p of MSVL is added and is described with PPTL verifies the safety of block catenary system.Block chain of the invention is modeled with MSVL program, the safety property of block chain is described with PPTL, and PPTL is the proposition subset of PTL, MSVL is the executable subset of PTL, thus MSVL and PPTL can be unified in MC and execute, compared to other methods, the present invention is not needed using other formal language, it does not need to call other tool and a large amount of proof by hand, it is only necessary to provide the PPTL formula of property to be verified, it was demonstrated that process is automatically performed by MC yet.

Description

The method and system of block catenary system modeling and security verification based on MSVL
Technical field
The invention belongs to Computer-aided Design Technology field more particularly to a kind of block catenary system modelings based on MSVL With the method and system of security verification.
Background technique
Currently, the prior art commonly used in the trade is such that currently, using the technology hair of the system application of block chain technology Exhibition can be roughly divided into three phases.First stage main development is digital encryption money-system;Second stage is mainly sent out Exhibition is financial system;Three phases main development is block chain society.It is currently under the initial stage of two-stage, and centainly not The period can be chronically at.Block chain is to carry out a group organization data with time cue, and be at regular intervals packaged data Specific data structure made of these blocks is linked at block, then with chain and time sequencing, ensure that its trackability, and Guarantee that it can not distort and can not forge in a manner of cryptography, is a distribution, decentralization, open shared general ledger This.The data structure of block chain can be simply described as follows: a kind of chain structure based on timestamp, the basic composition of block chain Unit is block, and block contains block head and block body, and block head includes six fundamentals: the abstract of previous block Value, is the character string by the encrypted regular length of hash;Timestamp;Dig mine disaster degree;It trades in the block abstract of packing Value;The random number obtained after digging mine and largely calculating;The digest value of this block chain.As long as block body contains the period All Activity, using the data structure of Merkle tree, All Activity is the leaf node of Merkle tree, then every two node Generate father's node, and so on until generate root node.
Block chain has five big characteristics: decentralization, collective's maintenance, may be programmed, is secure and trusted time series data.Even Block chain has above five big characteristics and block chain technology is widely used, but block chain technology remains safety The problem of aspect, all there may be safety problems for different technologies level.Safe precaution measure in node layer, with traditional server It compares, each of block catenary system calculate node is it may be said that be all " running nakedly ", each calculate node is highly susceptible to Various rogue attacks.Intelligent contract on contract layer, ether mill may be one section of js code, there are many potential leakages Hole, these loopholes are easy to be used by people.In data Layer, account name needs of the user on block chain are announced out, pass through use The account name at family, it is easy to obtain the Transaction Information and account balance of the account of user, privacy concern is also a big problem.Cause This, block catenary system is a distributed system, it increases the possibility of threat and risk, is to reduce itself with regard to system Safety rather than increase safety.So carrying out safety verification to block chain is necessary.
Hacker in 2016 successfully steals 3,600,000 ether coin using the loophole in intelligent contract by The Dao.The After DAO event occurs, ether mill founder VitalikButerin proposes modification ether mill code, implements to ether mill block chain Hacker is stolen the transaction record rollback of fund by hard bifurcated, also by few while obtaining community major part miner and supporting Number people's is strongly opposed to, has eventually led to the division of ether mill community.On July 19th, 2017, multi-signature wallet Parity1.5 And there are security breaches in the above version, 150,000 ETH are stolen, covalent 30,000,000 dollars of value.Being stolen event twice is all because of area Loophole in block catenary system, it can be seen that, the security performance for reinforcing each technology layer is to improve the important guarantee of block chain safety, Middle Formal Verification is an effective ways for solving block catenary system security audits.Formal Verification, which is namely based on, to be had been established Formalization specification, the correlation properties of institute's specification system are analyzed and are verified, whether desired spy is met with evaluation system Property.Formal Verification can not ensure that the performance of system is correct completely, but can understand and analyze system to the maximum extent System, and the mistakes such as inconsistency therein, ambiguity, incompleteness are found as much as possible.The major technique packet of Formal Verification Include model verifying and theorem proving.The present invention exactly starts in terms of this, makes the model framework of a Formal Verification, uses The mode of Formal Verification removes verifying system loophole that may be present.
In conclusion problem of the existing technology is: there is the account for being readily available user in existing block chain technology The Transaction Information and account balance at family, safety are lower.
Summary of the invention
In view of the problems of the existing technology, the present invention provides a kind of modeling of block catenary system and safety based on MSVL Property verifying method and system.
The invention is realized in this way a method of the modeling of block catenary system and security verification based on MSVL, institute The method for stating the modeling of block catenary system and security verification based on MSVL models block catenary system with MSVL in MC, uses journey Sequence p is indicated;With the property of PPTL description block catenary system, indicated with equation φ;In MC, be added MSVL modeling program p and The property φ described with PPTL verifies the safety of block catenary system.
Further, the method for the modeling of block catenary system and security verification based on MSVL utilizes p pairs of MSVL program Block catenary system is modeled;Utilize the property of PPTL equation φ description block catenary system.
Further, it is described based on MSVL block catenary system modeling and security verification method the following steps are included:
Step 1 models block catenary system using MSVL language, and the structural body in data structure indicates block catenary system In block, transaction, the communication between user and user;In modeling, with the basic operation in function representation block catenary system; P2p network, set, that is, user's collection on vertex are modeled using the graph structure in data structure;
Step 2, respectively from data Layer, network layer, layer of knowing together, excitation layer, the property that contract layer looks for user to be concerned about, use The description of PPTL formula, verifies the safety of block chain modeling;
The PPTL formula of the MSVL program of modeling and descriptive nature is verified in MC, checks block catenary system by step 3 Whether safety property meets.
Further, the user type in block catenary system modeled using MSVL language to block catenary system is divided into four kinds, It is indicated respectively with four parameters specifically:
K1: indicate that user whether there is or not routing function, determines that can the user communicate with other users;
K2: indicate that user whether there is or not wallet function, determines that can the user trade with other users;
K3: indicating user whether there is or not mine function is dug, and determines whether the user has and obtains the qualification rewarded and common recognition mechanism Whether effectively;
K4: indicate that user whether there is or not management function, determines whether the user has the right issued currency;
Indicate logical between block, transaction, user and user in block catenary system using the structural body in data structure Letter, specifically:
Block information in block chain is indicated with structural body structBlock;
Transaction Information in block chain is indicated with structural body structTrade;
User information in block chain is indicated with structural body structNodes;
Communication is indicated with structural body struct Edges between user in block chain;
Function function representation in block catenary system, specifically:
Functionpass indicates entry into a simple authentication function of block catenary system;
Function BAAC_max indicates that common recognition mechanism-liveness of block catenary system and credit rating weigh the pros and cons calculation Method, for calculating the miner for obtaining reward;
Functionpay indicates the function of the payment by the transfer of accounts in a transaction;
Functionrecord indicates to generate the function of the All Activity record before new block;
The traversal detection function that functionp2p indicates p2p network user's node and its is in communication with each other.
Further, PPTL formula is determined according to the safety property specifically to be verified, the property verified as needed first, Define proposition;Then according to the logical relation of proposition, corresponding reasonable PPTL formula is obtained.
Further, it is specifically included with the method that MSVL models the block catenary system verified:
(1) user type in modeling program is indicated with four parameters:
K1: user whether there is or not routing function,;K2: whether there is or not wallet functions by user;K3: whether there is or not dig mine function by user;K4: user Whether there is or not management functions;
(2) four structural bodies are defined to indicate the user in block catenary system, transaction, block;Structural body struct Block: the block information in block chain indicates that structural body includes five members: ID is used to table with structural body struct Block Show the digest value of current block;PreID is used to indicate the digest value of previous block;Ntrade is used to indicate the transaction of All Activity It is packaged digest value, i.e. the hash value of Merkle tree root node;X is used to indicate to dig the random number that mine process generates;When t is used to indicate Between stab;
(3) the function function representation in block catenary system, specifically:
Functionpass indicates entry into a simple authentication function of block catenary system;
Function BAAC_max indicates that common recognition mechanism-liveness of block catenary system and credit rating weigh the pros and cons calculation Method, for calculating the miner for obtaining reward;
Functionpay indicates the function of the payment by the transfer of accounts in a transaction;
Functionrecord indicates to generate the function of the All Activity record before new block;
The traversal detection function that functionp2p indicates p2p network user's node and its is in communication with each other.
Further, structural body struct Trade: the Transaction Information in block chain indicates with structural body struct Trade, Structural body includes four members: num is used to indicate transaction number;FromNode is used to indicate the sender of transaction;ToNode is used To indicate the recipient of transaction;PayBalancekey is used to indicate transaction amount;
Structural body structNodes: the user information in block chain indicates with structural body structNodes, structural body packet Include eight members: address is used to indicate the address of user, for storing the address of account balance;What k1 was indicated is that user has Without routing function;What k2 was indicated is that whether there is or not wallet functions by user;What k3 was indicated is that whether there is or not dig mine function by user;What k4 was indicated is to use Whether there is or not management functions at family;SendBalance is used to indicate the monetary amount of distribution reward;Balance is used to indicate account balance; Baac indicates that each the activity of the user and credit rating proportion in common recognition mechanism, weight proportion determine reward;
Structural body struct Edges: communication indicates structural body with structural body struct Edges between the user in block chain Including four members: the sender of the message of fromAddress expression communication link;The message of toAddress expression communication link Recipient;Weight indicates weight on the side of data structure graph structure;State indicates to have between any two user node boundless In the presence of, promising 1, it is not 0.
Further, the property that data Layer needs is described and is verified with PPTL formula are as follows:
The safety property of data Layer:, cannot if do not routed or Sorry, your ticket has not enough value without wallet or sender Transaction;
It is traded, and has wallet, and sender's remaining sum is enough paid, specifically described:
Define p: both parties have routing;
Define q: both parties have wallet;
Define r: transaction sender's money is enough;
Define c: it trades successfully;
Property description is PPTL formula are as follows: [] (<>c->p ∧ q ∧ r).
Another object of the present invention is to provide the modelings of block catenary system and safety described in a kind of implementation based on MSVL The system of block the catenary system modeling and security verification based on MSVL of the method for verifying, the block linkwork based on MSVL The system of construction in a systematic way mould and security verification includes:
Model building module, for establishing the model of block in structured data type specification block catenary system;
Security property definition module, the safety property for being verified required for determining, and described using PPTL formula;
Authentication module, for checking whether the safety property of block catenary system meets.
Another object of the present invention is to provide the modelings of block catenary system and safety described in a kind of realize based on MSVL The information data processing terminal of the method for verifying.
X may be software, it may be possible to a hardware, it is also possible to the system of some agreement, we demonstrate that whether it reaches The demand that I is expected.X reach my demand target test can, but existing measuring technology be only used for search Some bug, see we function whether meet demand, while inputting many test cases, see whether this result meets us Requirement, for example I has found common loophole now, but not can prove that your without other loopholes.Therefore, we use mathematics hand Section goes reasoning to prove it, and code is become formula, goes to prove that it occurs either with or without other problems.In conclusion Formal Verification Method is the method for solution safety problem more complete at present, its target is the correctness and reliability in order to improve code
In conclusion advantages of the present invention and good effect are as follows: formalization method is applied to the safety of block catenary system Verifying;Formalization method is that, for the security verification of computer software and hardware, had accurate based on mathematical logic inference Errorless feature common are model inspection, theorem proving;The basic thought of model checking method are as follows: searched by state space Whether rope confirmation block catenary system has certain properties.Block a chain modeling program M and specification q are given, is generated corresponding Then Contract Model M proves that M=> q, i.e. specification formula q are set up in Contract Model M, it is full thus to demonstrate contract program M Sufficient specification q.MSVL language is a kind of formalization systematical modeling and simulation, carries out verifying using property of the MSVL to system and generally comprises Three basic modules below: 1) systematical modeling and simulation MSVL, for model intuitive, that block catenary system is explicitly described, without Consider specific implementation details;2) powerful and concise description system should meet the logical representation of property (attribute specification) PPTL;3) a set of verifying system modelling logical consistency is provided and whether system meets the method for the property verified.
Block chain of the invention is modeled with MSVL program, and the safety property of block chain is described with PPTL, and PPTL For the proposition subset of PTL, MSVL is the executable subset of PTL, thus MSVL and PPTL can be unified in MC and execute, compared to Other methods, the present invention do not need not needing to call other tool and a large amount of card by hand using other formal language yet It is bright, it is only necessary to provide the PPTL formula of property to be verified, it was demonstrated that process is automatically performed by MC.
Detailed description of the invention
Fig. 1 is the method flow of block the catenary system modeling and security verification provided in an embodiment of the present invention based on MSVL Figure.
Fig. 2 is the system structure of block the catenary system modeling and security verification provided in an embodiment of the present invention based on MSVL Schematic diagram;
In figure: 1, model building module;2, security property definition module;3, authentication module.
Fig. 3 is the user type of block chain modeling provided in an embodiment of the present invention and its schematic diagram of function.
Fig. 4 is the process signal that the program of each particular transactions of block chain modeling provided in an embodiment of the present invention executes Figure.
Fig. 5 is the schematic diagram of the p2p network communication of six nodes of block chain modeling provided in an embodiment of the present invention.
Fig. 6 is the schematic diagram of the data structure of the specific block of block chain modeling provided in an embodiment of the present invention.
Fig. 7 is the schematic diagram of the structural stratification of block chain provided in an embodiment of the present invention.
Fig. 8 is that verifying property provided in an embodiment of the present invention returns to model schematic when meeting.
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to embodiments, to the present invention It is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not used to Limit the present invention.
For the safety problem being concerned about based on user in current block catenary system;Formalization method is applied to area by the present invention Block catenary system security verification, the security verification for computer software and hardware.The present invention builds block chain using MSVL Mould, with the property of PPTL description block chain, finally verified in MC, determine whether the property of block chain correct.
Application principle of the invention is explained in detail with reference to the accompanying drawing.
As shown in Figure 1, the side of block the catenary system modeling and security verification provided in an embodiment of the present invention based on MSVL Method the following steps are included:
S101: it is modeled with the block catenary system that MSVL verifies needs, with structured data type come description block Block in catenary system, user, transaction etc.;In addition, in modeling, with the basic operation in function representation block catenary system;
S102: set about from the data Layer of block catenary system, network layer, common recognition layer, contract layer respectively to determine required test The safety property of card, and these properties are described using PPTL formula;
S103: the PPTL formula of the MSVL program of modeling and description block chain property is unified in MC, checks block chain Whether the safety property of system meets.
As shown in Fig. 2, the modeling of block catenary system and security verification provided in an embodiment of the present invention based on MSVL is System includes:
Model building module 1, for establishing the model of block in structured data type specification block catenary system;
Security property definition module 2, the safety property for being verified required for determining, and described using PPTL formula;
Authentication module 3, for checking whether the safety property of block catenary system meets.
Application principle of the invention is further described with reference to the accompanying drawing.
The embodiment of the present invention verifies the PPTL formula of the MSVL program of modeling and descriptive nature in the same MC, If be proved to be successful, the block catenary system of needs verifying meets the property, otherwise just violates property.Present invention MSVL journey Sequence p to model for block catenary system to be verified, and required property is described using PPTL equation φ, in order to judge block Whether catenary system meets this property, needs to prove the validity of formula p → φ, if p → φ is effective, block catenary system is full Sufficient property, otherwise block catenary system just violates the property.
The Data Structures of MSVL have:
(1) shaping: int
(2) floating type: float
(3) character type: char
(4) character string type: string
(5) basic data type pointer: int*/char*/float*/string*
(6) structural body: struct
(7) structural body pointer: struct*.
The main sentence that MSVL program is related to:
(1) null statement: empty;
(2) basic assignment statement:
(3) next sentence: Ox;
(4) always sentence: x;
(5) projected sentences: (s1,...,sm)prj s;
(6) sequential statement:
(7) parallel subqueries:
(8) conditional statement:
(9) while statement:
(10) state frame sentence:
(11) section frame sentence:
(12) Await sentence:Wherein, x1,...,xhOccur from the variable in b;
As shown in figure 3, the side of block the catenary system modeling and security verification provided in an embodiment of the present invention based on MSVL Method includes the following steps:
The first step models the block catenary system verified with MSVL, wherein with structured data type Carry out the user in description block catenary system, trades, block etc.;Specifically:
Block information in block chain is indicated with structural body structBlock.
Transaction Information in block chain is indicated with structural body structTrade.
User information in block chain is indicated with structural body structNodes.
Communication is indicated with structural body struct Edges between user in block chain.
And some functions in block chain, then function representation is used, specifically:
Functionpass indicates entry into a simple authentication function of block catenary system, is similar to and logs in behaviour Make;
Function BAAC_max expression block catenary system common recognition mechanism --- liveness and credit rating are weighed the pros and cons Algorithm (BAAC), for calculating the miner for obtaining reward;
Functionpay indicates the function of a transaction payment by the transfer of accounts;
Functionrecord indicates to generate the function of the All Activity record before new block;
The traversal detection function that functionp2p indicates p2p network user's node and its is in communication with each other.
Second step is determined the safety property in the block catenary system for needing to verify, and is described using PPTL formula These properties.PPTL formula is determined according to the property specifically to be verified, the property verified as needed first, definition life Topic obtains corresponding reasonable PPTL formula then according to the logical relation of proposition.
The PPTL formula of the MSVL program of modeling and descriptive nature is unified in MC by third step, checks block catenary system Property whether meet.
MSVL program for description block chain model and the PPTL formula for descriptive model property may be converted into PTL formula, it is possible to execute, and obtain a result in the same MC.MC is for executing MSVL language, and authentication module can To complete the Property Verification based on PPTL formula.
The main thought of modeling is as follows:
The detailed description of P2P network:
Full distributed non-structural P 2 P network, using the organizational form based on completely random figure, each node random access net Network.As shown in fig. 6, being broadcast the message by the way of flooding, the disadvantage is that waste of resource.Advantage is serious forgiveness height, highly-safe, Privacy is strong.
The detailed description of transaction flow:
Three phases, application transaction are broadly divided into, verifying transaction records transaction, as shown in Figure 3.Respectively to three phases It adds a concrete explanation:
First stage: application transaction needs to meet k1 function, that is, routing function, then waits the response of other side, right One standards of measurement of Fang Tongyi transaction are exactly the credit score of transaction initiator, only meet the ideal letter of transaction recipient With integral, the response of other side can be just obtained.If obtaining other side's agreement, into next stage, otherwise transaction terminates.
Second stage: after response, the amount of money of transaction is inputted by transaction initiator, while verifying whether the user has money Packet function, that is, meet k2, whether verifying wallet balances are enough later, enter next stage if the verification passes, do not pass through Credit score reduces one point, and transaction terminates.
Phase III: transaction is bundled in block, and adds turnover on the weight of the user by transaction book keeping operation, makees Forelock row reference data is rewarded after generating for block.
The detailed description of common recognition algorithm:
Reward mechanism and its common recognition algorithm --- liveness and credit rating weigh the pros and cons algorithm (balance Algorithm ofactivity and credit, BAAC).
Application principle of the invention is further described combined with specific embodiments below.
There are six user's node A, B, C, D, E, F.Corresponding in the structure of figure is node, the communication transaction between user Side in corresponding diagram, the weight above side is all the sum of turnovers of two users.
The common recognition algorithm of block chain modeling, can be mainly divided into five steps:
The turnover that each user sends is summarized, is denoted as SA, SB, SC, SD, SE, SF by the first step.By each The turnover that user receives summarizes, and is denoted as RA, RB, RC, RD, RE, RF.
Second step sums it up the weight on each node side associated there, and here it is be used as to send with the node The total turnover of person and recipient represent active value (Activity) of the user in block catenary system with this, be denoted as A1, A2, A3, A4, A5, A6, the adduction of A A1, A2, A3, A4, A5, A6, i.e. A=sum (A1, A2, A3, A4, A5, A6).Such as following table institute Show:
A1=RA+SA A2=RB+SB A3=RC+SC A4=RD+SD A5=RE+SE A6=RF+SF
Third step checks that the credit value of user, the credit ratio of each user are that current credit and total credit value obtain ratio, It is denoted as C1, C2, C3, C4, C5, C6, it is 100 that total credit value is arranged here, and user credit is up to 1.
4th step, BAAC common recognition algorithm is to change A percentage with total remaining sum of the user, multiplied by the user's The credit ratio C/100 of user credit, product are denoted as M1, M2, M3, M4, M5, M6.It is as shown in the table:
M1 (A1/A)*(C1/C)
M2 (A2/A)*(C2/C)
M2 (A3/A)*(C3/C)
M4 (A4/A)*(C4/C)
M5 (A5/A)*(C5/C)
M6 (A6/A)*(C6/C)
5th step, in block generation, the maximum user of M is the miner user for obtaining reward, available reward. It solves max (M1, M2, M3, M4, M5, M6).
Code is realized:
With structured data type come the user in description block catenary system, trade, block etc., specifically:
Block information in block chain is indicated with structural body structBlock.
Transaction Information in block chain is indicated with structural body structTrade.
User information in block chain is indicated with structural body structNodes.
Communication is indicated with structural body struct Edges between user in block chain.
And some functions in block chain, then function representation is used, specifically:
Functionpass indicates entry into a simple authentication function of block catenary system, is similar to and logs in behaviour Make;
Function BAAC_max expression block catenary system common recognition mechanism --- liveness and credit rating are weighed the pros and cons Algorithm (BAAC), for calculating the miner for obtaining reward;
Functionpay indicates the function of a transaction payment by the transfer of accounts;
Functionrecord indicates to generate the function of the All Activity record before new block;
The traversal detection function that functionp2p indicates p2p network user's node and its is in communication with each other.
It is as follows to model the main code realized:
K1: user determines that can the user communicate with other users whether there is or not routing function.K1 indicates for 0 without routing function Can, i.e., the user cannot communicate with other any users.Routing function is the basic function of user, if without k1, Certainly without subsequent k2, k3 and k4.Correspondingly, k1 indicates routing function for 1.
K2: user determines that can the user trade with other users whether there is or not wallet function.K2 indicates no wallet function for 0 Can, i.e., the user cannot trade with other any users, briefly, because the user does not have money to trade.Wallet Function is also one of basic function of user, if without k2, certainly without subsequent k3 and k4.Correspondingly, k2 indicates for 1 Wallet function.
K3: user whether there is or not dig mine function, determine the user whether have obtain reward qualification and common recognition mechanism whether Effectively.K3 indicates that the i.e. user cannot participate in digging mine without mine function is dug for 0, cannot also reward.Dig the height that mine function is user One of grade function, a few users just have.Correspondingly, k3 indicates to dig mine function for 1.
K4: user determines whether the user has the right issued currency whether there is or not management function.K4 indicates no pipe for 0 Function is managed, i.e. the user cannot issue currency.Management function is the supreme power that user can have the function of, a system is only only A user has management function one by one, is responsible for the issue of currency of entire block catenary system, the user institute role is also with regard to phase When in block catenary system itself.Correspondingly, k4 indicates management function for 1.
In embodiments of the present invention, due to being the safety property verified, so the property chosen are as follows: the item for generation of transferring accounts Part verifying, avoids generation of unnecessarily transferring accounts.
Property description: it if do not routed or Sorry, your ticket has not enough value without wallet or sender, cannot trade.
Above-mentioned property is equivalent to: in case of transaction, then both parties centainly have routing, and being had wallet, and is sent out Kelly-up volume is sent enough to pay.It is described in detail below:
Define p: both parties have routing;
Define q: both parties have wallet;
Define r: transaction sender's money is enough;
Define c: it trades successfully
Property description is PPTL formula are as follows: [] (<>c->p ∧ q ∧ r)
It whether true needs to verify [] (<>c->p ∧ q ∧ r).The property that the formula indicates is, when transaction occurs, one Surely there are these three atomic propositions of p, q and r while setting up.And the meaning that these three atomic propositions of p, q and r indicate is respectively: transaction Both sides have routing;Both parties have wallet;Sender's money of trading is enough.This namely hands over incident necessary condition.If this is public Formula meets, then proves that block chain account transfer safety property can meet, be otherwise unsatisfactory for.
Verify property result:
Meet, the MC is returned the result as shown in Figure 8.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all in essence of the invention Made any modifications, equivalent replacements, and improvements etc., should all be included in the protection scope of the present invention within mind and principle.

Claims (10)

1. a kind of method of block catenary system modeling and security verification based on MSVL, which is characterized in that described to be based on MSVL Block catenary system modeling and security verification method in MC with MSVL to block catenary system model, indicated with program p;With The property of PPTL description block catenary system, is indicated with equation φ;In MC, the modeling program p of MSVL is added and is described with PPTL Property φ, verify block catenary system safety.
2. the method for block catenary system modeling and security verification based on MSVL as described in claim 1, which is characterized in that The method of the modeling of block catenary system and security verification based on MSVL builds block catenary system using MSVL program p Mould;Utilize the property of PPTL equation φ description block catenary system.
3. the method for block catenary system modeling and security verification based on MSVL as described in claim 1, which is characterized in that It is described based on MSVL block catenary system modeling and security verification method the following steps are included:
Step 1 models block catenary system using MSVL language, and the structural body in data structure indicates in block catenary system Communication between block, transaction, user and user;In modeling, with the basic operation in function representation block catenary system;It uses Graph structure in data structure models p2p network, set, that is, user's collection on vertex;
Step 2, respectively from data Layer, network layer, layer of knowing together, excitation layer, the property that contract layer looks for user to be concerned about, using PPTL Formula description, verifies the safety of block chain modeling;
The PPTL formula of the MSVL program of modeling and descriptive nature is verified in MC, checks the safety of block catenary system by step 3 Whether property property meets.
4. the method for block catenary system modeling and security verification based on MSVL as claimed in claim 3, which is characterized in that The user type in block catenary system modeled using MSVL language to block catenary system is divided into four kinds, respectively with four parameter lists Show specifically:
K1: indicate that user whether there is or not routing function, determines that can the user communicate with other users;
K2: indicate that user whether there is or not wallet function, determines that can the user trade with other users;
K3: indicate user whether there is or not dig mine function, determine the user whether have obtain reward qualification and common recognition mechanism whether Effectively;
K4: indicate that user whether there is or not management function, determines whether the user has the right issued currency;
The communication between block, transaction, user and user in block catenary system, tool are indicated using the structural body in data structure Body are as follows:
Block information in block chain is indicated with structural body struct Block;
Transaction Information in block chain is indicated with structural body struct Trade;
User information in block chain is indicated with structural body struct Nodes;
Communication is indicated with structural body struct Edges between user in block chain;
Using the function in the function representation block catenary system in MSVL, specifically:
Function pass indicates entry into a simple authentication function of block catenary system;
Function BAAC_max indicates that common recognition mechanism-liveness of block catenary system and credit rating weigh the pros and cons algorithm, uses To calculate the miner for obtaining reward;
Function pay indicates the function of the payment by the transfer of accounts in a transaction;
Function record indicates to generate the function of the All Activity record before new block;
The traversal detection function that function p2p indicates p2p network user's node and its is in communication with each other.
5. the method for block catenary system modeling and security verification based on MSVL as claimed in claim 3, which is characterized in that PPTL formula determines that the property verified as needed first defines proposition according to the safety property specifically to be verified;Then root According to the logical relation of proposition, corresponding reasonable PPTL formula is obtained.
6. the method for block catenary system modeling and security verification based on MSVL as claimed in claim 3, which is characterized in that It is specifically included with the method that MSVL models the block catenary system verified:
(1) user type in modeling program is indicated with four parameters:
K1: user whether there is or not routing function,;K2: whether there is or not wallet functions by user;K3: whether there is or not dig mine function by user;K4: user whether there is or not Management function;
(2) four structural bodies are defined to indicate the user in block catenary system, transaction, block;Structural body struct Block: area Block information in block chain indicates that structural body includes five members with structural body struct Block: ID is used to indicate to work as proparea The digest value of block;PreID is used to indicate the digest value of previous block;Ntrade is used to indicate that the transaction of All Activity is packaged abstract Value, i.e. the hash value of Merkle tree root node;X is used to indicate to dig the random number that mine process generates;T is used to indicate timestamp;
(3) the function function representation in block catenary system, specifically:
Function pass indicates entry into a simple authentication function of block catenary system;
Function BAAC_max indicates that common recognition mechanism-liveness of block catenary system and credit rating weigh the pros and cons algorithm, uses To calculate the miner for obtaining reward;
Function pay indicates the function of the payment by the transfer of accounts in a transaction;
Function record indicates to generate the function of the All Activity record before new block;
The traversal detection function that function p2p indicates p2p network user's node and its is in communication with each other.
7. the method for block catenary system modeling and security verification based on MSVL as claimed in claim 6, which is characterized in that Structural body struct Trade: the Transaction Information in block chain indicates that structural body includes four with structural body struct Trade Member: num is used to indicate transaction number;FromNode is used to indicate the sender of transaction;ToNode is used to indicate connecing for transaction Receptor;PayBalancekey is used to indicate transaction amount;
Structural body struct Nodes: the user information in block chain indicates that structural body includes with structural body struct Nodes Eight members: address is used to indicate the address of user, for storing the address of account balance;That k1 is indicated is user whether there is or not Routing function;What k2 was indicated is that whether there is or not wallet functions by user;What k3 was indicated is that whether there is or not dig mine function by user;That k4 is indicated is user Whether there is or not management functions;SendBalance is used to indicate the monetary amount of distribution reward;Balance is used to indicate account balance; Baac indicates that each the activity of the user and credit rating proportion in common recognition mechanism, weight proportion determine reward;
Structural body struct Edges: communication indicates that structural body includes with structural body struct Edges between the user in block chain Four members: the sender of the message of fromAddress expression communication link;ToAddress indicates that the message of communication link receives Person;Weight indicates weight on the side of data structure graph structure;State indicates there be boundless deposit between any two user node , promising 1, it is not 0.
8. the method for block catenary system modeling and security verification based on MSVL as claimed in claim 3, which is characterized in that The property that data Layer needs is described and is verified with PPTL formula are as follows:
The safety property of data Layer: it if do not routed or Sorry, your ticket has not enough value without wallet or sender, cannot trade;
It is traded, and has wallet, and sender's remaining sum is enough paid, specifically described:
Define p: both parties have routing;
Define q: both parties have wallet;
Define r: transaction sender's money is enough;
Define c: it trades successfully;
Property description is PPTL formula are as follows: [] (<>c->p ∧ q ∧ r).
9. it is a kind of implement claim 1 described in based on MSVL block catenary system modeling and security verification method based on The system of block the catenary system modeling and security verification of MSVL, which is characterized in that the block linkwork construction in a systematic way based on MSVL The system of mould and security verification includes:
Model building module, for establishing the model of block in structured data type specification block catenary system;
Security property definition module, the safety property for being verified required for determining, and described using PPTL formula;
Authentication module, for checking whether the safety property of block catenary system meets.
10. a kind of block catenary system modeling realized described in claim 1~8 any one based on MSVL and security verification The information data processing terminal of method.
CN201810981891.1A 2018-08-27 2018-08-27 MSVL (modeling, simulation and verification language) -based block chain system modeling and security verification method and system Active CN109347651B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810981891.1A CN109347651B (en) 2018-08-27 2018-08-27 MSVL (modeling, simulation and verification language) -based block chain system modeling and security verification method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810981891.1A CN109347651B (en) 2018-08-27 2018-08-27 MSVL (modeling, simulation and verification language) -based block chain system modeling and security verification method and system

Publications (2)

Publication Number Publication Date
CN109347651A true CN109347651A (en) 2019-02-15
CN109347651B CN109347651B (en) 2021-06-01

Family

ID=65291653

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810981891.1A Active CN109347651B (en) 2018-08-27 2018-08-27 MSVL (modeling, simulation and verification language) -based block chain system modeling and security verification method and system

Country Status (1)

Country Link
CN (1) CN109347651B (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109919756A (en) * 2019-02-22 2019-06-21 西南财经大学 Fund transfer system, checking method and method of commerce based on Merkle tree backtracking location technology
CN110071968A (en) * 2019-04-16 2019-07-30 深圳前海微众银行股份有限公司 A kind of message storage method and device based on block chain
CN110163517A (en) * 2019-05-24 2019-08-23 燕山大学 It is a kind of to be had a holiday regular block catenary system modeling method based on G- limitation service
CN110427179A (en) * 2019-06-26 2019-11-08 西安电子科技大学 MSVL programming automatic generation method and system towards intelligent contract language
CN111062038A (en) * 2019-11-23 2020-04-24 同济大学 Intelligent contract formalization verification system and method based on state space
CN111880779A (en) * 2020-07-17 2020-11-03 盛视科技股份有限公司 System application source code generation method and device
CN113434132A (en) * 2021-05-08 2021-09-24 西安电子科技大学 Intelligent course arrangement modeling verification method and system
RU2770746C1 (en) * 2020-12-20 2022-04-21 Автономная некоммерческая организация высшего образования "Университет Иннополис" Distributed ledger system

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107330701A (en) * 2017-07-28 2017-11-07 中链科技有限公司 The method and apparatus of the intelligent contract of implantation

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107330701A (en) * 2017-07-28 2017-11-07 中链科技有限公司 The method and apparatus of the intelligent contract of implantation

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
胡凯 等: "智能合约的形式化验证方法", 《信息安全研究》 *
蔡维德 等: "基于区块链的应用系统开发方法研究", 《软件学报》 *

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109919756A (en) * 2019-02-22 2019-06-21 西南财经大学 Fund transfer system, checking method and method of commerce based on Merkle tree backtracking location technology
CN109919756B (en) * 2019-02-22 2023-04-18 西南财经大学 Transfer system, checking method and transaction method based on Merkle tree backtracking positioning technology
CN110071968A (en) * 2019-04-16 2019-07-30 深圳前海微众银行股份有限公司 A kind of message storage method and device based on block chain
CN110163517A (en) * 2019-05-24 2019-08-23 燕山大学 It is a kind of to be had a holiday regular block catenary system modeling method based on G- limitation service
CN110163517B (en) * 2019-05-24 2021-04-20 燕山大学 Block chain system modeling method based on G-limited service vacation rule
CN110427179A (en) * 2019-06-26 2019-11-08 西安电子科技大学 MSVL programming automatic generation method and system towards intelligent contract language
CN111062038A (en) * 2019-11-23 2020-04-24 同济大学 Intelligent contract formalization verification system and method based on state space
CN111880779A (en) * 2020-07-17 2020-11-03 盛视科技股份有限公司 System application source code generation method and device
CN111880779B (en) * 2020-07-17 2023-12-26 盛视科技股份有限公司 System application source code generation method and device
RU2770746C1 (en) * 2020-12-20 2022-04-21 Автономная некоммерческая организация высшего образования "Университет Иннополис" Distributed ledger system
CN113434132A (en) * 2021-05-08 2021-09-24 西安电子科技大学 Intelligent course arrangement modeling verification method and system

Also Published As

Publication number Publication date
CN109347651B (en) 2021-06-01

Similar Documents

Publication Publication Date Title
CN109347651A (en) The method and system of block catenary system modeling and security verification based on MSVL
Zheng et al. An overview on smart contracts: Challenges, advances and platforms
Perera et al. Blockchain technology: Is it hype or real in the construction industry?
Bai et al. Formal modeling and verification of smart contracts
Xu et al. A taxonomy of blockchain-based systems for architecture design
CN110535836A (en) A kind of trust block chain common recognition method of based role classification
CN102243748A (en) Electronic debt management operation system device and realization method of electronization and financial commercialization of claim and debt
Panda et al. Distributed ledger technology in the construction industry using corda
Alqahtani et al. Formal verification of functional requirements for smart contract compositions in supply chain management systems
CN109816532A (en) A kind of assets digitlization anchoring system based on block chain technology
Eisele et al. Blockchains for transactive energy systems: Opportunities, challenges, and approaches
Luo et al. Overview of intelligent online banking system based on HERCULES architecture
Yang et al. Research and analysis of blockchain data
Wu et al. ChainIDE 2.0: facilitating smart contract development for consortium blockchain
Scott et al. Archival study of blockchain applications in the construction industry from literature published in 2019 and 2020
Chen et al. Risk propagation of delayed payment in stakeholder network of large hydropower project construction considering risk resistance and mitigation
Coutinho et al. Carbon emission and cost of blockchain mining in a case of peer-to-peer energy trading
US11334925B1 (en) Normalization and secure storage of asset valuation information
Masteika et al. Bitcoin double-spending risk and countermeasures at physical retail locations
Kabanda Model Structure for Block Chain Technology and Cryptocurrency for the financial services sector in Zimbabwe
Antal et al. Distributed Ledger Technology Review and Decentralized Applications Development Guidelines. Future Internet 2021, 13, 62
Cai et al. Advanced Blockchain Technology
Mokdad et al. Empirical Evaluation of Blockchain Smart Contracts: Ethereum, EOSIO, and Stellar as Examples
Kocaoğullar et al. Towards private on-chain algorithmic trading
Baby et al. A review analysis on smart contract vulnerabilities using blockchain

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant