According to an opinion smart contract is a special protocol intended to contribute, verify or implement the negotiation or performance of the contract. The key element of smart contracts as well as one of most attractive things is opportunity to perform reliable transactions without intermediaries or any third parties. These transactions are trackable, transparent and irreversible. Smart contracts contain all the information about the contract terms and execute all envisaged actions automatically.
According to another opinion smart contracts are self-executing electronic instructions drafted in computer code. Smart contracts self-execute the stipulations of an agreement when predetermined conditions are triggered. The parties “sign” the smart contract using cryptographic security and deploy it to a distributed ledger, or blockchain.
Considering both information technology and legal aspects of the smart contracts’ nature, the smart contract application issue frequently rises many complex questions currently being unregulated in most of jurisdictions.
2. Legal issues related to Smart Contracts
Previous post mirrored certain of major legal issues related to smart contracts. Nevertheless, it is not possible to cover absolutely all aspects of pros and cons or drawbacks of new technology in general and smart contracts particularly. In this regard it is important to notice that legislative bodies of the countries willing to legally regulate of smart contracts will have to pay attention also to following questions:
Smart contract equality to traditional contract.  Legislators will have to identify smart contracts as an act equal to a traditional contract or it will be identified as the tool for enforcement of obligations;
Certifying Authority. States most likely will need to create a regulator dealing with certification keys and monitoring of involved parties into transaction in order to create a reliable mechanism and avoid any fraudulent actions or misconduct of the contracting parties.
Understanding of coded terms. If a contract is partly expressed in code, then the understanding of that code by the parties is relevant.  This relevance can be a matter of regulation, such as whether particular parties (such as consumers) can be bound by terms which they do not understand, or it can be a matter of fundamental contract law, such as whether there was sufficient mutual understanding of the terms to form the contract at all;
Evidence of coded terms. Even though the parties can agree to express specific terms of their relationship in computer code, it is important that that expression is admissible in any judicial and arbitral proceedings which arise out of that relationship.  An inability to admit this record of the parties’ agreement would impair its legal effectiveness.
3. Smart Contract’s Structure
Each smart contract has a small database and provides methods for changing its data. Since contracts are replicated across all nodes, their databases also are. Data changes occur via transactions.
A smart contract usually has at least the following structure:
The amount of sending currency
Gas limit per transaction (it’s the maximum amount of units of gas you are willing to spend on a transaction)
Price per gas unit (the payment received by the network participant for calling a smart contract code)
Arbitrary data (optional) – If you’re told that you can sendarbitrary data yourself, it means you can send anything you want. 
ERC stands for “Ethereum Request for Comments”, while ERCXX are technical standards used for smart contracts on the Ethereum blockchain. Most of the major tokens on the Ethereum blockchain are ERC20-compliant. ERC20 tokens must use ‘gas’ to process transactions. Gas represents the work needed to perform a computation, for example a smart contract. Gas is not a token or a cryptocurrency. Gas is paid out in Ethereum. Transactions with more gas will be prioritized by the blockchain network, and processed more quickly.
Every transaction in Ethereum requires Gas to be mined, and the Gas costs Ethers. So, each Smart contract transaction requires Ethers (which is paid not by the Smart Contract itself but rather by the users). Gas is an abstract number that represents the relative complexity of operations. While gas is fixed per operation, the amount a user pays per gas — gas price — is dynamic and dictated by market conditions. Gas price is a value representing how much Ether the user is willing to pay per gas. When a user sends a transaction, they specify the gas price, and the total fee that they pay is equal to formula: gas_price multiply to gas_used. Miners are paid out this fee and so they prioritize transactions with a higher gas price. The higher gas price you are willing to pay, the faster your transaction will be processed.
5. Stages of Smart Contracts creation
To create a Smart contract, you need to go through several stages as follows:
Compiling – After writing a contract in Solidity, use Solc to compile it. It’s from the C++ libraries (different implementations complementing each other again) which can be installed here.
Testing – The tests needs to cover the features of your code and assert that everything is working as predicted. As we are writing smart contracts that can deal with money, writing tests is a really important task for us. This includes: a) code review; b) testing audits; c) correctness proofs.
6. Language for writing Ethereum Smart-Contract: Solidity
A contract in the sense of Solidity is a collection of code (its functions) and data (its state) that resides at a specific address on the Ethereum blockchain. Solidity is a contract-oriented, high-level language that is designed to target the Ethereum Virtual Machine (EVM – The Ethereum Virtual Machine or EVM is the runtime environment for smart contracts in Ethereum). The code is statically typed, supports inheritance, libraries and complex user-defined types among other features.
7. Deploying smart contract in Ethereum blockchain
Once you have written a contract, you need to test it by actually deploying it and testing if they are functioning as expected. This is where testnets come to the rescue. Testnets simulate the Ethereum network and EVM. They enable developers to upload and interact with smart contracts without paying the cost of gas.
The simplest way to explain blockchain is that it is a decentralized technology for recording information including transactions, property rights, identities, money balances, etc. Particularly, blockchain is a huge list of records containing information known as “blocks”, which are linked to each other by a code “hash” and secured using advanced means of cryptography. Blockchain represents a high-performance tool for maintaining integrity of information, specifically about any kind of transactions, providing a reliable degree of trust that information will be kept unaltered. Thanks to the distributed mechanism once the transaction is validated taking form of a “block” it automatically becomes available to all participants of the network and can not be altered or modified, otherwise all the participants to the network will notice that chain was hacked or altered.
How does it work?
Blockchain is a particular type of so-called distributed ledger technology “DLT” which in fact is a mechanism of recording and sharing information across multiple ledgers. Each of that ledgers have the exact same data records and are collectively maintained and controlled by a distributed network of computer servers. Blockchain uses specific mathematical algorithms to create and verify a continuously growing data recording in form of blocks. Once these blocks are added they can not be removed due to this fact all records take form of a chain of blocks.
A new addition to the chain (database) is initiated by one participant to the network, who creates a new “block” of data, containing all sorts of information. A new block is shared automatically to all participants in the network being in the same time encrypted and secured. A specific feature of the blockchain is validation of the block by other participants to the network. They collectively determine the block’s validity in accordance with an algorithmic validation method, known as “consensus mechanism”.
Collective determination of block’s validity as well as high degree of security of such data recording in addition to full transparency of transaction records which can be easily checked across the network, makes blockchain an extremely advanced and useful tool for new generation of technology, including fintech, commerce etc.
Key element – Consensus mechanism
There are many ways of structuring blockchain consensus mechanisms, but two of them which are best-known examples of consensus mechanisms are Proof of Work (PoW) mechanism and the Proof of Stake (PoS) mechanism.
3.1. Proof of Work – this mechanism is most commonly used in cryptocurrency industry. Participants to the network solve a sort of sophisticated mathematical calculations or algorithms in order to get permission to add a new block to the blockchain. Each new block is the result of these calculations and after every block calculation becomes more and more complicated, so Proof of Work mechanism requires more electricity for processing information which brings significant amount of expenses. This sort of sophisticated calculations is called “mining” due to such calculations are carried out, new coins are generated taking form of a digital reward. The cryptocurrency as Litecoin, Bitcoin Cash, Monero etc. are based on PoW mechanism
3.2. Proof of Stake – within this mechanism, a participant must prove ownership of a certain asset (in case of equity transactions) or an amount of coins (in case of cryptocurrency) in order to be allowed to participate in the validation process of transactions. For instance, when it comes to the cryptocurrencies, a validator of any transaction has to prove his “stake” (a certain amount) of all existing type of coins in order to be allowed participating in validating transactions. The chances to become a validator of future blocks are higher depending on the amount of stake (or coins) the participants own, if stake is larger, chances are higher to become validator, in a way the degree of reliability is more significant. The benefit is that the validator gets paid a transaction fee for his validation services by the transacting parties.
4.1. Public – is completely decentralized and uncontrolled, which means that nobody has control over the network, ensuring the data can’t be changed once validated on the blockchain. Anyone can view the ledger and participate in the consensus process to determine which transaction blocks are added. Public blockchains are built to be accessible by anyone with access to the Internet. Some well know examples of Public Blockchains would be Bitcoin and Ethereum.
4.2. Consortium – this network is not under private control or public, it is usually operated by a group of entities without having a decisive leader. The consensus process for new transaction blocks is controlled by a fixed set of members, such a platform provides many benefits as efficiency and transaction privacy. According to some experts this platform is optimal for organizational collaboration.
4.3. Private – this network is controlled by one organization or person having very limited access permission. The private blockchain typically requires a trustful agent to reach the consensus even when using the same blockchain technology, for which it adopts consensus object different from the public blockchain. The transaction speed of a privately run blockchain can be faster than other blockchain solutions because there are fewer nodes on the chain and trust levels are high. This sort of blockchain is often used in database management.
The Legal Side
5.1. Governing Law
By its decentralized and global scale nature blockchain rises a lot of jurisdictional questions, as the nodes on a blockchain can be located anywhere in the world. Due to this fact a every transaction could potentially fall under the jurisdiction of the location where the node in the network is located. This can generate a number of complex legal issues with a special focus on governing law, taking into account that every jurisdiction has own specific contract law principles and identification of appropriate legal regulations is quite important.
Most likely the issue of liability would be a top risk related to blockchain transactions especially when it comes to the security and confidentiality. Deriving from the nature of each type of blockchain certain risks could arise, as inability to control or stop functioning of public blockchain, or in event of breach, malfunctioning or misconduct of private blockchain. In that cases who is going to be liable for the risks occurred or who is responsible if laws are broken using blockchain?
5.3. The enforceability of smart contracts
Thanks to the blockchain technology a new sort of technical-legal tool has been created, so-called “smart contracts”. Smart contracts are blockchain based mechanisms which are automatically executed when specific circumstances or conditions coded into the smart contract are met. When conditions are fulfilled the execution of the smart contract happens automatically without being enforced by the third party. This creates a new level of development in contract law but at the same time brings new challenges due to its new and unregulated field. Smart contracts twists both legal and technology knowledge.
5.4. Data privacy
One of the most important advantages of the blockchain is the protection of data, once data is recorded in blocks it cannot be altered without other participants to the network knowing that one block was altered or hacked. So, blockchain technology has close ties with data privacy, particularly where the relevant data is personal data or metadata sufficient to reveal someone’s personal details as well as commercial secrets. In order to find solution to these risks there is a need to create a tool for privacy-protecting within blockchains. This might include other legal risks especially when it comes to carrying out the Know Your Customer proceedings etc. It remains to be seen how stakeholders involved into the industry will tackle the balance of privacy versus transparency.
5.5. Intellectual property
Protection of intellectual property rights is one of common question related legal issues referred to blockchain. Despite of various opinions blockchain offers new possibilities for intellectual property protection and registration and as evidence which can be used as probative material in court. Potential use cases include: evidence of creatorship and provenance authentication, registering and clearing intellectual property rights; controlling and tracking the distribution of unregistered or registered intellectual property rights.
With regard to the above mentioned legal issues related to the blockchain technology we will refer in our next blogs.
The U.S. Supreme Court rejected an appeal challenging the use of a Confederate battle emblem on the Mississippi state flag. The application was submitted by an African-American lawyer who said that the emblem on the Mississippi flag is “an official endorsement of white supremacy” and “unconstitutional relic of slavery”.
According to the petitioner’s opinion, the confederate battle emblem on the current official state flag of Mississippi “encourages or incites private citizens to commit acts of racial violence in violation of the Equal Protection Clause of the 14th Amendment.”. In this respect he filed a suit against the Mississippi Governor. Governor Phil Bryant has called the lawsuit “frivolous”, saying that if the flag design is to be reconsidered, it should be done by a statewide vote as it was more than 16 years ago.
In his appeal to the Supreme Court, the lawyer called for the Supreme Court to declare unconstitutional Mississippi regulation on how the flag should be designed and displayed.
The Supreme Court judges did not comment on the ending of the lawsuit sought to have the flag declared “an official endorsement of white supremacy” and “unconstitutional relic of slavery”.
It should be noticed that the case was rejectedby the US District Court for the Southern District of Mississippi, and further rejected by the 5th Circuit Court of Appeals explaining that “Exposure to a discriminatory message, without a corresponding denial of equal treatment, is insufficient to plead injury in an equal protection case”.
The Mississippi state flag has incorporated the Confederate battle flag in its upper left corner and it is in use since 1894. The flag was repealed in 1906 but remained in de facto use. When a referendum failed for a new design in April 2001, the state legislature voted to readopt the historic design the same month. The Mississippi flag is the only U.S. state flag to include the Confederate battle flag’s saltire.
Sweden Supreme Court ruled, in a case of a man with spinal cord injury, that it is illegal to grow cannabis to self-medicate even there was an emergency situation. According to the judgment he was fined kronor 5200 (around $616) for growing and consuming the oil of the plant.
Anders Thörn was paralyzed from the chest downwards after injured his spinal cord in an accident in 1994. Following the pain got worse, and medical treatments became ineffective, Mr. Thörn started growing cannabis in his house, which he ingested as an oil. He suffers from cramps and difficult neuropathic pains that occur in the damaged spinal cord. The medical care provided to him had either a bad effect or caused adverse side effects. In order to alleviate the suffering, he grew and has used cannabis.
He was acquitted by the district court which found that he had “been in an emergency situation and that his conduct could not be considered unjustifiable”.
The court of appeal decided quite opposite and said the situation was not severe enough to justify growing the cannabis. So, the court of appeal issued a suspended sentence and fine of kronor 11,700 for drug offence.
The Supreme Court took into account his circumstances but explained that this did not mean that he was allowed to grow cannabis. The top court also noted that “the drug has been intended for consumption and not supported by the doctor’s prescription” as well as the fact that home-grown cannabis contained minimal amounts of psychoactive substances.
The Supreme Court found the “emergency situation” and explained that it is not applicable in Thörn’s case because an emergency in regards to a criminal offense is not meant to deal with a permanent problem.
In the light of these facts the court decided that the crime constituted only a minor drug offence and reduced the fine applied by the court of appeal to 5,200 kronor.
Sweden has a “zero tolerance” approach to drugs, but it has become more permissive of using cannabis for medication purposes during recent years.
According to the judgment, this does not mean that the man will have to stop using cannabis. He became one of the first people in Sweden to be granted permission to use medical cannabis on prescription.