This article is devoted to the study of law and computer algorithms as means regulating social and technical processes. The objective of the work is to study the possibilities of using computer code to regulate social relations, as well as the impact of this process on traditionally used legislative procedures. This article uses a comparative analysis, which allows the authors to draw an analogy between law and computer algorithm and between social relations and technical operations. The authors propose the thesis that the computer code regulating technical processes can be used to a certain extent in the legal sphere. One such example is smart contracts, which are used in certain areas. The authors have studied different approaches to the definition of the term "smart contract" and formulated their own definition of this concept.