OpenZeppelin in Preda programming language

This page describes porting the OpenZeppelin contracts into a PREDA model. The OpenZeppelin contracts consist of multiple parts: Library V5, Upgradeable Plugin, and Subgraph. This is the porting of some parts of version 5. The Upgradeable plugin is ported on its own later. The subgraph is not ported, as it's out of the smart contract programming scope. The OpenZeppelin uses semantic versioning to release new changes. This is the porting of the version 5, the latest by the end of 2023. Parts and what is not ported The OpenZeppelin smart contracts or utilities around them are grouped into various categories. Wizard - Interactive smartcontract generator. Access Control - utility to limit function calls. Tokens - NFT, Cryptocurrency, etc. Governance - Decentralized Autonomous Organization (DAO) tools. Utils - additional useful smartcontracts to use in your projects: Cryptography, Math, Introspection, and many more.We don't implement a wizard, as it's out of the smart contract programming scope.

Read More

The Preda Guide

Preda is a programming language to write distributed intelligent contracts that can execute transactions in parallel. If you are unfamiliar with the smart contract or want to see what Preda is, look at Programming Language: Preda, where I wrote some notes about it. This page describes the projects I wrote in the Preda programming language: "Preda Scale-out Smart Contracts Hackathon". The best way to learn a technology is by creating something. I will also provide general lessons and valuable resources that helped me write something on Preda. Brainstorming For the hackathon, we need some ideas to work on. The project will benefit from the parallel execution. Invalid directions Top Smartcontracts As Preda was targeting top smartcontracts, let's take inspiration from them. However, complete intelligent contracts are all for DeFi. DeFi doesn't solve real-world problems, so let's skip it.  Top Transactions The Bridges and Exchanges load the highest traffic on Ethereum. These smartcontracts are easy to implement, so let's skip it. Right direction The best way is to implement something impossible with the current smartcontracts and only available with the Preda's parallel execution. But before working on it, let's create small intelligent contracts to have an understanding of the program in Preda. And lastly, we are always relying on the libraries with the best practices that save us a lot of headaches. So, here is the list of the projects that I will be working on:(Library 1) The OpenZeppelin library is a state-of-the-art library for Ethereum. Let's convert it to Preda to bootstrap the creation of smart contracts. (Library 2) OpenZeppelin Upgradables: This is an interesting part of creating an upgradable contract. Maybe upgrade a certain state, rather than all smartcontract? (Small project 1) Mistransfer: a project that recovers tokens sent to a wrong smart contract. I wrote it for a Chainlink hackathon. And I believe it should be everywhere. So, let's implement it. (Small project 2) Malpie: a loyalty program for apps where users provide their data in exchange for a product discount. (Project)Where does Preda outshine? What kind of app is it possible to make on the blockchain? More in the next section.Real-time app Parallel execution enables real-time applications that were not possible on the blockchain before. What kind of real-time app? Do you know the original motivation behind the creation of the Ethereum? According to the legends, Vitalik was playing World of Warcraft, and one day, Blizzard Studio decided to remove one of his favorite game items. Outraged, he created a distributed platform where "Code is a law." It's a beautiful legend, so let it be. However, Ethereum doesn't allow the creation of a game such as World of Warcraft. But with Preda, we can create it. Each popular multiplayer, real-time game is a session. With Preda, we can make each session a scope with access from the users in that session. This allows, for example, to create a Layer 2 on Ethereum with the PREDA model. Fine-tuned, it could keep thousands of users online with less technical cost than without Preda.Preda tricks return type is inserted in the beginning after the "function" keyword. to make the contract read-only, replace "view" with "const."

Read More

Programming Language: Preda

In the middle of 2023, I joined a Preda hackathon that kicked out on 18th November 2023. I already have an interest in programming languages. So, I will use this hackathon to try out a new language. But what is Preda programming language? The Language Specification Official website: https://www.preda-lang.org/ Preda is a programming language used to increase transaction throughput for applications on blockchain platforms. Preface The applications in the blockchain platforms are called smartcontracts. Ethereum invented intelligent contracts, the first blockchain platform, in 2015. Even in 2023, Ethereum is the most popular blockchain platform, setting the global trends in the cryptocurrency ecosystem. The Ethereum blockchain network has the Ethereum Virtual Machine (EVM), where smart contracts are executed. The platform provides various programming languages to write a smartcontract targeting EVM. The most popular programming language is Solidity: https://soliditylang.org/. However, EVM could process a single transaction simultaneously, which means a considerable delay during the high traffic. There are many ways to solve the scalability issues. Most of the blockchain trend goes into building a blockchain of blockchains: Cosmos, Polkadot, Layer 2 blockchains, etc. Preda is taking an unusual direction to increase scalability by creating distributed intelligent contracts. Distributed Smartcontracts  To understand a distributed smartcontract, think about a popular web application. Imagine a web application that serves thousands of requests at a time. How would you scale the server to serve multiple requests? The intuitive way to execute multiple requests simultaneously is by creating multiple copies of the application (as a cluster) that run the requests in parallel. But there is a better approach. You could split the app into smaller inter-connected parts rather than creating a copy of the same code. Then, create a cluster of the parts that have a heavy load. When an app consists of multiple inter-connected parts running in parallel, this app is called a distributed application. Almost all modern web applications are distributed with at least a client, server, and database. Similarly, a distributed smart contract consists of multiple parts that execute the transactions together. As I mentioned in the Preface, the current EVM supports a single transaction simultaneously. So, Solidity is created for a single transaction as well. To create distributed intelligent contracts, we need a blockchain that supports distributed systems and a programming language to execute and make asynchronous calls between various allocated parts. Even in modern EVM, you can split an app into multiple intelligent contracts. But their interaction is synchronous, so it blocks all requests until other smart contracts won't complete the execution. Contract A could send request A to contract B by making the requests asynchronous. Meanwhile, execute the request B from the transaction pools. Preda is the programming language used to make asynchronous calls between smart contracts, which solves the second problem for scalable execution.From dioxide.network But why was Preda invented? This is a Smartcontract. Motivation behind Preda As in most aspects of social interactions, the top 1% of the services get the majority of the traffic. So, scalability is needed for them.Source: https://www.theblock.co/data/on-chain-metrics/ethereum/top-20-gas-consuming-smart-contracts-30d Just look at Uniswap, which has about the 18th transactions, while Scroll has 2 thousand transactions. All other two million transactions deployed on Ethereum get less than 2000 transactions. Notes on specification Preda is a new programming language that extends Solidity by adding asynchronous calls between intelligent contracts. To support such kinds of smart contracts, the Preda team also created a blockchain network for that: https://dioxide.network/ The Preda programming language specification Old: https://www.preda-lang.org/pdf/preda-model-sole.pdf The Preda programming language specification: https://preda-lang.org/pdf/PREDA_Model_as_an_Experimental_New_Smart_Contract_Language.pdf Here are the notes I took by highlighting the critical parts of Preda. Preda stands for Parallel Relay Execution Distributed Architecture. Preda introduces two models:Programmable Scope: an isolated state of the smartcontract. Define the scope by data access pattern, which narrows and minimizes the data dependency between the states. Asynchronous Function Relay: a transaction logic that moves execution from one programmable scope to another. The function relay is defined with the explicit data dependency.In Solidity on Ethereum, the smartcontracts are defined as a set of variables (state) and functions (transaction functions). The state and functions are described in the global scope. However, it presents two significant challenges in scaling intelligent contracts. 1. Partitioning the state requires understanding the data access patterns associated with the state variables. The Preda solves it by introducing a Programmable Contract Scope (κ-scope). 2. A function defined on a global scope requires the availability of all functions and state variables. The Asynchronous Functional Relay (λ-relay) narrows the scope for a function to execute. The λ-relay decomposes the execution of k-scopes in the order of data dependency. In Preda, when invoking a function, it must provide a target k-scope, an analogy 'this' pointer in C++. Special k-Scopes Engine Scopes = φθ(i): one instance of k-scope built in for each instance of the execution engine to represent a scope available for immediate read/write by any function executing the current execution engine. The engine scope is not allowed to be the target of λ-relay nor be referred to by specifying θ(i). The variables and functions in the engine scope can be accessed only by the i-th engine. Global Scopes =  φΩ: a built-in k-scope that logically singletones the entire network. PREDA model strictly prohibits referring to a specific instance of an execution engine or making assumptions on the underlying configuration (for example, the number of execution engines). In PREDA, the scopes are defined by fine-grained boundaries of contract states. The actual partitioning strategy is left to the hosting execution engine. Relaying A function initiating a transaction must trigger a λ-relay to execute on another k-scope. The λ-relay is converted into a relay transaction by the host. The relay transaction will be passed to the memory pool as an unordered pending transaction in the destination engine. Global scope transactions will be executed first before conducting an engine scope. Cross-contract invocation can be carried out immediately without doing a relay transaction. Syntax State variable defined and instantiated in a k-scope as: var_type @scope var_name; The @scope specifies a k-scope. It can be:@global, which is by default, thus can be omitted. @engine, for engine scopes. @address or @uint: a keyed k-scope based on the Solidity elementary type name.Functions in the k-scope are always defined as: function fun_name(arg_type arg,..)        @scope modifiers returns (ret_type) &#123;&#125; The @scope values are identical to the variable definition. In the destination k-scope, the target scope and global variables are merged and available as read-only variables. Symbols defined in the current engine are available for read and write. relay @key (var1, var2, ...) &#123;&#125; relay @global (var1, var2, ..) &#123;&#125; The above code defines a relay transaction to continue the execution in another scope. The relay defines a lambda function that is executed in the destination scope. // scope a relay func_name_k(var1, var2); // scope b function func_name_k(var1, var2) @scope public &#123;&#125; Besides passing a lambda function, Preda can also call a named function as defined above. The named functions must be public. The named transaction could be a cross-contract call as well as: relay @key ExtContr(a_addr).named_func_k(var1, var2); relay ExtContr(a_addr).named_func_k(var1, var2); Here, the @key is defining the scope of the ExtContr. The mappings are defined as: mapping<type => type> @scope var_name; Note that any current Solidity smartcontract can be compiled into Preda as is. In this case, all variables and functions will be in the global scope. The global scope is not scalable; therefore, the design goal of the developers is to minimize the global scope. Potential Execution EngineMulti-core single node. Sharded node Multiple Single Nodes across the internetThe guideline on how to use Preda is described on Preda Guideline.

Read More

Turkmens are descendants of Oghuzes and Persians?

Turkmen are primarily descendants of Iranian nomads who lived between the Aral Sea and the Caspian Sea. When you are learning the history of a nation, you do a comprehensive analysis of the country from all aspects: tradition, language, and anthropology. Most people who talk about Turkmen as people who came from Altai do not know who the Turkmen are or their traditions. Without knowing the history, you might get the generalized view that ancient Turkmen were nomadic warriors who drank horse milk and ate horse meat. They were a people with slanted eyes and built Kurgans for their ancestors. But Turkmens didn't have slanted eyes, except for the minority. They never farmed horses for meat or milk. And they never built Kurgans for the ancestors.Regarding horse tradition, Turkmenians raised horses for races and battles only. These breeds, in medieval times, were known as Turkoman Horses. These horses are the ancestors of all racing horses in the world. The German Trakehner breed's ancestor: "Turkmen Atti"Turcmanatti by Johan Meno Haas in the 1790s.The English Throughbroud's ancestor: Byerly Turk:You do a DNA analysis, and the closest to all horses are not Arabian, but Akhal Teke (one of the lineage of Turkmen horses named after the Teke tribe). The Turkmen horses are indigenous to Central Asia and have been famous since the Antique period. The Chinese conquered modern Xinjiang, part of Central Asia, to acquire these horses as they were well-known there as Heavenly horses. Ancient Greek and Roman historians described them as the best in the world. This breed has thousands of years of history. And while the breed's name has changed, it's still part of Antique Central Asian history. But here is the thing: Neither Central Asian sedentary Iranians nor Nomadic Turk-Mongolian people except Turkmens were breeding them. From the ancient nomads, this tradition is carried out by Turkmens. And not by one tribe in the region to say it's the influence, but by all tribes, so it's part of national culture. A depiction of Turkmen horse in the Read Dead Redemption 2 (click to see on Wiki Fandom):  The same goes for all other aspects of Turkmen culture. Turkmen have a heavy influence from other people around them and, to a lesser degree, by people along the "Silk Road". But it's a cultural exchange that went bidirectional. As much as Turkmens have it, they also influenced other people.This is the problem of Iranians. When they see Iranian influence, they brag about Greater Iran. Still, when influenced, they want to dismiss the national terminology, discussing regional and Islamic shared culture. To make it fair, either ignore "Iranian" influence by removing national appearance. Or accept that you have Arabic and Turkic influence, too. This is especially seen on Wikipedia, where Nowruz is an Iranian national holiday and Iranian influence. Just like anything that interacted with them. But Turkmen carpets are Iranian because they're part of their day-to-day culture, and they should not be connected with Turkmen only.  

Read More

Manva Chat

Chats https://topai.tools/s/anime-character-chatbot https://kajiwoto.ai/https://goatchat.ai/chat/animeai GoatChat talks to the anime character. Comis https://neuralcanvas.io/ Create Photorealistic Comics Series with AIhttps://www.fotor.com/features/ai-comic-generator/ Create and visualize your stories into captivating comics using Fotor’s AI comic generator. Let AI revolutionize the way you create comics and enjoy the innovatively fast and easy AI tool to generate engaging comic scenes!https://aicomicfactory.com/ Create Stunning Comics without Drawing Skills using our cutting-edge AI Comic Generator. Bring Your Comic Dreams to Life with AI Creativity.https://www.plugger.ai/tasks/ai-comic-generator an innovative AI-powered tool that magically transforms text into captivating comic stripsSimilar apps https://chrisgliddon.com/a-trip-down-memory-lane-microsoft-comic-chat-6f23b8a64295 Story of the Microsoft Comic Chat released in mid 1990s.https://kurlander.net/DJ/Videos/ComicChatVideo.shtml Video showcase of the comic chat.https://grail.cs.washington.edu/wp-content/uploads/2015/08/comics.pdf Paper about chat. Learn the purpose of why they created it. I guess it increases the engagement. Attemptshttps://www.youtube.com/watch?v=0Bd4NRqC5DYCan ChatGPT & AI make Comics?https://bootcamp.uxdesign.cc/how-i-created-my-first-comic-book-using-chatgpt-and-midjourney-a0a930b35f8eComic bot made with chat gpthttps://aicontentfy.com/en/blog/chatgpt-and-potential-for-creating-ai-generated-web-comics Potential of chats

Read More

Welcome to Ahmetson.com

Hello and Welcome to the Medet Ahmetson's thoughts.

Read Posts