A smart contract is a computer protocol that allows for verification, facilitation or enforcement of the performance or negotiation. Smart Contracts facilitate transactions that are free from the intervention of third parties. Smart Contracts also allow for the exchanging of money, shares or any other value in a non-conflictual and transparent manner. The vending machine analogy will be used to describe smart contracts. In general, you need to go to a lawyer or notary and wait for the document to be delivered. Smart contracts are easy to use. You simply need to drop your crypto token (for example bitcoin) into a vending machine. Your escrow and social identity, or any other account will be created.
Smart contracts also set penalties and rules just like a traditional contract but enforce obligations automatically. This article will demonstrate how to create smart agreements on Stellar Blockchain. Stellar Blockchain is one the best blockchain platforms for financial operations that can be performed decentralized.
Stellar Smart Contracts – What are they?
Stellar Smart Contracts (SSC) are Smart Contracts. Stellar Smart Contracts (SSCs) can be described as a combination of executed and related transactions through different constraints. These are just a few examples of constraints you can use when creating SSCs.
- Multisignature: What keys must be used to authorise a specific operation? What are the parties required to agree on a situation in order to execute steps? Multisignature is a concept that requires multiple signatures from different parties to sign transactions emanating from an account.
- Atomicity/Batching: What must all operations be done together or they will fail? What are the conditions that will make it fail or succeed? Batching is the process of including multiple operations in a single transaction. Atomicity makes sure that any given sequence of operations submitted to the network fails if any one operation fails.
- Sequence: In which order should transaction series be processed What are the dependencies, and what are their limitations? The sequence number on the Stellar Network shows the concept of the order. Utilizing sequence numbers in transaction manipulation is a way to ensure that transactions are not executed if an alternate transaction is submitted.
- Time Bounds: When can a transaction occur? Time bounds restrict the validity of transactions for a specific time period. The SSC allows for the representation of time periods using time bounds.
Here are the steps for creating Stellar Smart Contracts
Stellar Smart Contracts will be created using the Stellar Javascript SDK, Node JS and the Stellar testnet.
Make pairs of public/seed keys
The Stellar SDK provides a random key generated method:Stellar.Keypair.random()2 pairs are created and saved locally in a file to run the scripts one after the other.
Add funds to the account
The platform will validate a stellar account with a minimum amount in Lumens (XLM). You can ask the friendbot on testnet to fund your account with 10000 Lumens. You would need to send an HTTP request to the exchange platform to add XLMs and exchange fiats to your account.
Read More : https://www.leewayhertz.com/create-stellar-smart-contracts/