Embedded Permission - Blockchain Patterns (2024)

Disclaimer: This is a summary of patterns we have observed during our research and should not be considered any form of technical or investment advice. Also, the given “known examples” do not imply they are the best implementations of the said pattern or any superior to any other implementation of the pattern not listed.

Summary

Restrict invocation of individual functions in the smart contract to a permissioned set of accounts by embedding permission controls into the contract.

Context

By default, all the smart contracts running on the blockchain can be accessed and called by all the network participants and other smart contracts due to equal rights. However, most applications require only a permissioned set of accounts to be able to call relevant smart contract functions.

Problem

A smart contract by default has no owner, meaning that once deployed the deployer of the smart contract has no special privilege on the smart contract. A permission-less function can be triggered by unauthorised users. For example, a permission-less function discovered in a smart contract library used by the Parity multi-sig wallet caused the freezing of about 500K Ether. How to ensure only a permissioned account(s) can invoke a smart contract function?

Forces

  • Security – The functions defined in a smart contract should be called only by the authorised participants. Due to the transparency and equal rights of public blockchains, all the smart contracts are also publicly available to everyone connecting to the Internet. In contrast, in a conventional software system, interactions are either through a user interface or API, where it is possible to enforce access control policies.
  • Cost – Permission checking introduce additional logic into a smart contract. On public blockchains, higher transaction fees need to be paid to execute complex smart contract logic.

Solution

The solution is to track and enforce who can access what function(s) on a smart contract. Add access control to every smart contract function to check whether the caller has permission to call the function. Authorised callers can be defined as a list of account addresses. Then at run time, the transaction sender’s address should be first checked against the list of authorised addresses. If there is a match, the rest of the smart contract logic could be executed. Otherwise, the function should not execute further.

Embedded Permission - Blockchain Patterns (1)

Embedded permission pattern

If a set of smart contract functions depend on the same set of authorised addresses and/or follow the same validation logic, it could be implemented as a separate function and bind to each function. For example, in Solidity, function modifiers are used to change or restrict the behaviour of a smart contract function. In public blockchains, smart contract data can be read without calling respective read-only functions (the process is a bit complicated but can be done). Hence, no additional security is achieved by embedding permissions into read-only functions. However, such constraints are still effective when users do not have direct access to a blockchain node to query such public data. For example, this is effective in consortium blockchains when a user does not run a node. As a general practice, all functions that can modify ledger data must enforce permissions. Permissions could be enforced using access control techniques such as mandatory, role-based, and attribute-based access control. While it is possible to update the list of authorised account addresses after deploying a smart contract, additional functionality is needed to do so. Further, updates should be performed only by an authorised address(es).

Benefits

  • Security – Only the participants and smart contracts that are authorised by the smart contract can call the corresponding functions successfully. The authorisation is implemented in smart contracts running on blockchain, which leverages the properties provided by blockchain.

Drawbacks

  • Cost – On a public blockchain, extra code that implements the permission control mechanism introduce additional deployment and run-time costs.
  • Lack of flexibility – Permissions need to be defined in the smart contract before its deployment hence they are difficult to change. However, permissions may be required to be dynamic. A mechanism is needed to support dynamic granting and removal of permissions.

Related Patterns

  • Multiple authorisation pattern enables a set of addresses to show their permission to execute a smart contract function.
  • Off-chain secret enabled dynamic authorisation allows dynamic binding of an authorised party to a smart contract function.

Known uses

  • The Mortal contract discussed in the Solidity tutorial restricts the permission of invoking the selfdestruct function to the owner of the contract where owner is a variable defined in the contract code itself.
  • The Restrict access pattern suggested in the Solidity tutorial uses modifier to restrict who can make modifications to the state of the contract or call the functions of the contract.
Embedded Permission - Blockchain Patterns (2024)

FAQs

What is an example of a permission blockchain? ›

For example, a bank may be running a permissioned blockchain operated through a designated number of nodes internal to the bank to track money transfers. You cannot access this type of blockchain because you won't have the permissions required.

Can anyone access a smart contract? ›

By default, all the smart contracts running on the blockchain can be accessed and called by all the network participants and other smart contracts due to equal rights.

How to design a smart contract? ›

How to create a smart contract
  1. The concept. The first step is defining what you want your contract to do. ...
  2. The coding. Next is the process of actually coding your smart contract using a programming language. ...
  3. The testing. ...
  4. Compiling. ...
  5. Deploying. ...
  6. Follow through. ...
  7. Costs in dollars and cents.

What are the problems with Permissioned blockchain? ›

Disadvantages of permissioned blockchains

Since a permissioned blockchain only allows a specific set of authenticated users, security is said to be tight. However, with the chain allowing only a permissioned set of users there can also be a risk of overriding consensus by the private group and network operators.

Is Ethereum a permissioned blockchain? ›

Permissionless blockchains such as Ethereum are borderless, trustless, decentralized public networks that can be accessed, participated in, and validated by anyone. The state of a permissionless blockchain at any given instance of time can be completely reproduced by any user who wishes to validate a past transaction.

What are the algorithms of Permissioned blockchain? ›

Most commonly, organizations that deploy permissioned blockchains use one (or more) of the following three protocols: Practical Byzantine Fault Tolerance (PBFT), federated, or round-robin consensus.

What companies use Permissioned blockchain? ›

Toyota, Ticketmaster and Siemens are just a few of the global brands that are using private and public blockchain technology. Consumers are just beginning to experience use of blockchain technologies across industries such as auto leasing, concert tickets and utilities.

Is Solana a Permissioned blockchain? ›

Solana's under the radar feature for institutions

SPEs allow developers to use Solana's software for permissioned blockchains powered by the Solana Virtual Machine (SVM) — meaning Solana's software powers blockchains that can meet the more rigorous compliance standards faced by institutions like banks, for instance.

How do you trigger a smart contract? ›

Triggering Mechanisms: They are triggered by events. These events can be external (like a payment received) or internal (like a specific date and time). Once an event aligns with the predefined conditions, the contract automatically executes the associated actions.

Can smart contract get your private key? ›

As the wallet provider does not have access to the private key, it is the user's responsibility to safeguard their keys securely. Their loss could result in a permanent loss of funds. Thus, the integration of smart contracts has brought about innovative solutions that go beyond traditional wallets.

How do people make money from smart contracts? ›

How to Make Money with Smart Contracts
  1. Yield Farming: Yield farming involves lending your cryptocurrency to decentralized finance (DeFi) platforms in exchange for interest or rewards. ...
  2. Staking: Many blockchain networks allow users to stake their tokens in exchange for rewards.
Aug 22, 2024

Is it expensive to create a smart contract? ›

Although it's possible to find a smart contract development company ready to help you for nearly $500, the price may reach even more than $5,000. The deployment costs directly depend on the complexity of the project.

How do I create a smart contract without coding? ›

In this post, we'll review some of the top smart contract creation tools in the market and explain why they stand out.
  1. 1) OpenZeppelin. One of the most popular tools used in the smart contract world is OpenZeppelin. ...
  2. 2) Hardhat. Another popular development platform is Hardhat. ...
  3. 3) BlockCAT.

What are the 4 major parts of a smart contract? ›

What Are the Four Major Parts of a Smart Contract? It depends on the blockchain and how it is programmed. Generally speaking, smart contracts have state variables (data), functions (what can be done), events (messages in and out), and modifiers (special rules for specific users).

What is a private or Permissioned blockchain? ›

A private blockchain allows only selected and verified participants; the operator has the right to override, edit, or delete entries on the blockchain. Permissioned blockchains allocate specific roles or permissions to various users on the network.

What is an example of a permission set in Salesforce? ›

For example, let's say your org has a custom object called Conference Room. A mobile app called Conference Room Sync has read and update access to the object. You can create a permission set to allow updates to the object only when the Conference Room Sync connected mobile app generates the user's session.

What is consent in a blockchain? ›

Every information discussed with the patient about the surgery is recorded along with the consent provided by the patient using blockchain. This makes the consent immutable and encrypted and ethical. Blockchain is even used for informed consent for medical trials.

Top Articles
20+ Amazing PTA Fundraising Ideas for Every Occasion | 99Pledges | Start a fundraiser!
8 Largest Cattle Ranches In The Us - Largest.org
Vaya Timeclock
La connexion à Mon Compte
Truist Park Section 135
OSRS Fishing Training Guide: Quick Methods To Reach Level 99 - Rune Fanatics
Myhr North Memorial
30% OFF Jellycat Promo Code - September 2024 (*NEW*)
Craigslist Phoenix Cars By Owner Only
Jscc Jweb
Hmr Properties
Nonuclub
Missing 2023 Showtimes Near Landmark Cinemas Peoria
Maplestar Kemono
Nashville Predators Wiki
Cpt 90677 Reimbursem*nt 2023
Noaa Ilx
Msu 247 Football
Dwc Qme Database
Www Va Lottery Com Result
Gotcha Rva 2022
Integer Division Matlab
Victory for Belron® company Carglass® Germany and ATU as European Court of Justice defends a fair and level playing field in the automotive aftermarket
Jayme's Upscale Resale Abilene Photos
Ticket To Paradise Showtimes Near Cinemark Mall Del Norte
What Is a Yurt Tent?
Ascensionpress Com Login
Democrat And Chronicle Obituaries For This Week
They Cloned Tyrone Showtimes Near Showbiz Cinemas - Kingwood
Bursar.okstate.edu
Xfinity Outage Map Lacey Wa
Hypixel Skyblock Dyes
Exploring The Whimsical World Of JellybeansBrains Only
Msnl Seeds
Troy Gamefarm Prices
Kelley Blue Book Recalls
Merkantilismus – Staatslexikon
The Closest Walmart From My Location
Gun Mayhem Watchdocumentaries
303-615-0055
Seminary.churchofjesuschrist.org
Updates on removal of DePaul encampment | Press Releases | News | Newsroom
Lamont Mortuary Globe Az
Mybiglots Net Associates
Samsung 9C8
Paradise leaked: An analysis of offshore data leaks
Latina Webcam Lesbian
Join MileSplit to get access to the latest news, films, and events!
Uno Grade Scale
Naughty Natt Farting
211475039
Latest Posts
Article information

Author: Sen. Emmett Berge

Last Updated:

Views: 5685

Rating: 5 / 5 (80 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Sen. Emmett Berge

Birthday: 1993-06-17

Address: 787 Elvis Divide, Port Brice, OH 24507-6802

Phone: +9779049645255

Job: Senior Healthcare Specialist

Hobby: Cycling, Model building, Kitesurfing, Origami, Lapidary, Dance, Basketball

Introduction: My name is Sen. Emmett Berge, I am a funny, vast, charming, courageous, enthusiastic, jolly, famous person who loves writing and wants to share my knowledge and understanding with you.