Skip to content

Latest commit

 

History

History
420 lines (230 loc) · 33.5 KB

File metadata and controls

420 lines (230 loc) · 33.5 KB

Lead Picture

Blockchain Program Blackpaper

v.1.1 · April 9, 2026 · by https://www.hyperlinks.space/, fmr. Some DAO

The aim of this text is to give anyone, regardless of technical background, a comprehensive understanding of how to build a tokenized blockchain program using underlying principles and features, as well as ideas for opportunities ahead.

What is Blockchain Program?

Blockchain Program is a tokenized smart contract architecture for building multi-user, scalable onchain programs and services: Blockchain Deals-style platforms, bulletin boards, mobility-style services, and more. The pattern is portable: you can reproduce the same layering on another chain after mapping its NFT and fungible token standards. This repository is one implementation. The architecture uses NFTs and fungible tokens as units to store, retrieve, update, and process onchain program entities. The top-level controller contract is BlockchainProgram with recv_internal, which governs NFT collections and routes core management operations across the program.


Contents

1 · Motivation

The main aim of this section is to reveal the considerations that led to the creation of this technology and to show real benefits it can bring to our world.

1.2 · Goals & Values

Blockchain Program was created to give people an opportunity to create programs taking the benefits of tokenization and blockchain architecture. We support openness (while preserving sensitive data security), effectiveness, and fairness, and believe blockchain technologies can bring more of these values to everyday services and applications.

1.3 · Benefits of Tokenization for Blockchain Programs

Let’s think about what benefits tokenization for blockchain programs brings to different social groups involved in their work.

Tokenization for blockchain programs can bring numerous benefits to various social groups involved in their work. Here are some potential advantages for different stakeholders:

  1. Developers and Contributors:
  • Financial Incentives: Tokenization allows developers to be directly rewarded for their contributions through tokens or cryptocurrencies, providing new revenue streams and financial incentives.
  • Open and Collaborative Ecosystem: Blockchain architecture fosters an open and collaborative environment where developers can contribute to the project, propose improvements, and participate in decision-making processes.
  • Trust and Security: Blockchain-based programs offer enhanced security and trust because transactions and data are stored in a distributed network, reducing the risk of single points of failure or malicious attacks.
  1. Users and Consumers:
  • Ownership and Control: Tokenization grants users ownership rights in the program or platform, allowing them to have a say in the governance and direction of the project.
  • Transparent and Auditable: Blockchain programs built on blockchain technology provide transparency, as the code and transactions are often open and auditable, ensuring that users can verify the integrity of the system.
  • Data Privacy and Security: Blockchain architecture reduces the reliance on central authorities, giving users greater control over their personal data and reducing the risk of data breaches.
  1. Investors and Token Holders:
  • Access to Investment Opportunities: Tokenization allows fractional ownership, enabling broader access to investment opportunities, including early-stage projects, that were traditionally limited to venture capitalists or wealthy individuals.
  • Liquidity and Tradeability: Tokens can be traded on cryptocurrency exchanges, providing investors with liquidity and the ability to buy, sell, or transfer their investments more easily.
  • Governance Participation: Token holders often have voting rights and can participate in the governance of the project, influencing decision-making processes and the evolution of the program.
  1. Communities and Society:
  • Inclusion and Access: Blockchain programs can provide access to financial services, digital identity, and other applications to underserved populations, bridging the digital divide and promoting financial inclusion.
  • Empowerment and Local Economies: Tokenization can empower local communities by enabling them to participate in blockchain networks, share resources, and contribute to local economic ecosystems.
  • Trust and Accountability: Blockchain architecture promotes trust and accountability within communities and society at large.

It's important to note that the benefits of tokenization and blockchain architecture can vary depending on the specific context, implementation, and adoption of these technologies. Additionally, challenges such as scalability, user experience, and regulatory considerations may also need to be addressed for wider adoption and to maximize the benefits for all social groups involved.

2 · Architectural Principles

This section presents the main architectural ideas that open up possibilities for multi-user, mass-adoptable, and scalable blockchain programs built on tokenized smart contract backends.

2.1 · Bird’s eye view

Once deployed on a blockchain, Blockchain Program looks like a layered, growing, updatable and upgradable network of smart contracts sending messages and interacting asynchronously. It has three layers: an NFT layer, an NFT Collections layer, and a top layer consisting of one contract—BlockchainProgram—that acts as the index and master contract.

2.1.1 · NFT layer

This is the essential layer of smart contracts that stores the largest amount of program data. In fact, to build a program using Blockchain Program principles we use an abstraction of NFT to represent any entity, no matter if it is a sword in a computer game, taxi-driver passport, or a smart contract of a voting game. When developing a program, we can implement different NFT and token standards according to our needs.

2.1.2 · NFT Collections layer

Contracts of this layer follow an editable NFT collection pattern: grouping and managing NFTs, plus domain specific functions, data structures, and getters. Comparable collection standards exist on several chains under different names.

2.1.3 · BlockchainProgram

This smart contract manages the whole smart contract network. It performs various functions related to managing collections of tokens. Those functions allow us to effectively manage all the smart contracts in the network. Let’s stipulate its main functions:

  1. It keeps track of some important information about the contract, such as the sequence number, public key, owner's address, the index of the next collection, and a dictionary of collections.
  2. The contract allows the owner to change the ownership of the contract to a new address.
  3. The owner can withdraw funds from the contract, but only if the balance is sufficient.
  4. The owner can edit the code of the contract.
  5. The contract allows the deployment of new collections. Each collection has its own code and data.
  6. The contract allows the deployment of individual items within a collection.
  7. The contract supports batch deployment of multiple items within a collection.
  8. The owner can edit the content of a collection.
  9. The owner can change the ownership of a collection to a new address.
  10. The owner can edit the content of an item within a collection.
  11. The owner can destroy an SBT item within a collection.
  12. The owner can revoke ownership of an SBT within a collection.
  13. The owner can transfer ownership of an item to another address.
  14. The contract provides methods to retrieve the balance of the contract and the sequence number.
  15. The contract can receive messages from external sources and perform certain actions based on the received message.
  16. The contract provides getters to retrieve the contract's data, including the public key, owner's address, next collection index, and a list of deployed collection addresses.

2.4 · General Visual Representation

The scheme below illustrates the network of smart contracts described in §2.1 and shows how messages are sent and proxied.

General visual representation

As we can see there are three layers of smart contracts: BlockchainProgram, NFT Collections, and NFTs.

2.5 · How to expand this technology?

We can consider the following ideas:

Widen functionality of layers: Explore the possibility of widening the functionality of the existing architecture. These layers can provide enhanced functionalities, such as improved data storage, access control, or scalability solutions.

Add new layers: Introduce new layers to the technology stack that can serve specific purposes. For example, we might consider incorporating a layer for blockchain powered identity management, blockchain powered storage, or blockchain powered governance.

Fungible tokens everywhere: We can further explore fungible token models (in this codebase, Jetton style assets) and how they extend tokenized applications. Use fungible units to represent votes, stakes, or balances that pair with NFT based entities, with standards adapted per chain.

Expand the functionality of smart contracts: Smart contracts are a core component of blockchain applications. Look for ways to expand the capabilities of smart contracts within the Blockchain Program framework.

Combine standards and invent new ones: Investigate the possibility of combining different standards within the blockchain ecosystem to leverage the strengths of each. For example, we can explore integrating NFT standards with other token standards or interoperability protocols to enhance the capabilities of the blockchain applications.

Store any data: Consider expanding the types of data that can be stored and processed within the Blockchain Program framework.

Build Blockchain Management: Operate the program with other smart contracts, build groups of access, voting systems, and role models to operate expanding functionality.

3 · Features

This section describes basic technical features that make Blockchain Program work. We can manage interactions (except get-methods for retrieving data) by sending messages to BlockchainProgram, which can proxy messages to other contracts.

3.1 · Deal with smart contracts

Blockchain Program provides basic features to manage smart contracts within your program.

3.1.1 · Mint smart contracts

There are three ways to mint new smart contracts in the Blockchain Program network.

  • Collection Deployment | see code ↗ | - deploy_collection mints new collections under master governance.
  • NFT Item Deployment | see code ↗ | - deploy_item deploys individual NFT items via the collection contract.
  • Batch NFT Deploy | see code ↗ | - batch_nft_deploy deploys multiple NFTs in one flow.

3.1.2 · Change code of smart contracts

These methods help us upgrade smart contracts:

  • Edit Program Code | see code ↗ | - edit_code upgrades the main contract code.
  • Edit Collection Code (coming soon)
  • Edit NFT Code (coming soon)

3.1.3 · Delete smart-contracts

We can even implement functions that will allow us to burn tokens, such as:

  • Destroy SBT Item | see code ↗ | - destroy_sbt_item burns SBT items via BlockchainProgram.
  • Delete program (coming soon)
  • Delete NFT (coming soon)
  • Delete NFT Collection (coming soon)

3.2 · Deal with Data

BlockchainProgram provides functions to deal with data from your program.

3.2.1 · Store Data

We can mint a new smart contract on the blockchain to store new data. Use the methods for creating smart contracts described in §3.1.1 for that purpose.

3.2.2 · Update Data

We can take advantage of the Editable NFT Standard to update data in smart contracts. We can use the following methods for that purpose:

  • Edit Collection Content | see code ↗ | - edit_collection_content updates collection content and metadata.
  • Edit NFT Item Content | see code ↗ | - edit_item_content updates NFT content and metadata.

3.2.3 · Retrieve Data

  • Use Program Get-Methods | see code ↗ | - get_dapp_data returns owner, next collection index, and collections dictionary.
  • Use Collection Get-Methods | see code ↗ | - e.g. get_collection_data, get_nft_address_by_index, royalty_params, get_nft_content in the same file.
  • Use NFT Get-Methods | see code ↗ | - get_nft_data and get_editor (line 224).

3.2.4 · Process Data (Coming soon)

3.3 · Deal with Program

Program owners have additional functionality and opportunities to maintain, scale, and improve the program.

3.3.1 · Own & Benefit Securely

Here are essential functions and opportunities for owners of the program:

  • Change program Owner | see code ↗ | - change_owner updates the program owner.
  • Withdraw Funds | see code ↗ | - withdraw_funds sends native currency on the host chain to the owner.
  • Manage Program Collectively: use a multisig, a DAO smart contract, or a custom governance smart contract.

3.3.2 · Upgrade Program

We can upgrade the program using the methods described in §3.1.2.

3.3.3 · Build UI

Build a serverless frontend with the wallet and chain SDKs for your target network. Wallet-connect-style flows work well for submitting transactions to BlockchainProgram.

4 · Blockchain Program Concept

Blockchain Program is an approach that combines a tokenized blockchain backend architecture with a serverless frontend. The core idea is to enable seamless program functionality by extracting required information from the BlockchainProgram smart contract network.

To illustrate the concept, consider a Blockchain Deals Platform. The program can retrieve real-time data by parsing deal and order collections directly from the BlockchainProgram smart contract network, without a centralized backend for that core state.

The interaction between the program and smart contracts is bidirectional. When users engage in program processes, they can trigger changes in corresponding smart contracts by sending messages or transactions.

By tokenizing program functionality and integrating it with blockchain infrastructure, Blockchain Program ensures data integrity, immutability, and a resilient architecture without centralized failure points.

Moreover, this architecture enables a more collaborative environment by allowing users to participate directly in governance and decision-making through smart contracts.

In summary, Blockchain Program combines tokenized architecture with serverless frontend to support transparent, secure, and resilient blockchain application development.

5 · Use Cases

The aim of this section is to show how the underlying features work in particular examples.

5.1 · Blockchain Deals

Here is a concept of a Blockchain Deals Platform: coordinated deals between counterparties with settlement and dispute paths enforced by smart contracts.

The service can provide stronger payment guarantees because deal state and escrow style balances can be tied to order NFTs. Counterparties see rewards or deposits on the balance of order NFTs issued for each deal. After completion, the winning party can receive an order NFT with completion proof and funds on that contract balance. Optional arbitration can be modeled with admin roles. Fees can be taken on successful completion.

Offer side scenario: A user opens the app, connects a wallet, and registers a profile stored as an NFT. They create a new deal listing (reward, terms, deadlines). They sign a transaction that mints an order NFT holding terms and locked value in one flow. They wait for responses, can cancel while rules allow, and pick a counterparty; the order NFT records who is bound to perform.

Counterparty scenario: Another user browses open deal NFTs, filters by category, reward, status, and applies. They sign with their wallet (paying network fees). If selected, they execute the work and confirm completion; settlement follows the rules encoded in the order path and any confirmation window.

Admin scenario: Admins hold role NFTs. Disputes can be escalated to admins; they can signal outcomes through BlockchainProgram governed flows and receive incentives if your tokenomics define that.

Technical features: To build this shape of program with NFT technology, leverage BlockchainProgram and the collection contracts in this repository.

  1. Deploy NFT collections for deals, participants, counterparties, admins, or other domains you need.
  2. Store primary records as NFTs with metadata for terms, skills, status, and preferences.
  3. Let the master contract own or govern collections so mint and edit paths stay consistent.
  4. Route state changes through the master contract so updates land on the correct NFT fields.
  5. Keep authoritative data onchain for auditability.
  6. Extend with transfers, history, token settlement, and a frontend that reads and writes against the contracts.

The narrative is the same architecture as elsewhere in this paper: Blockchain Deals is one product story; the Blockchain Program layering is what you can port to other chains with a rewrite of the contract language and token wiring.

5.2 · Betting

Here is a concept of a blockchain betting service “Blockchain Bet”.

Blockchain Bet is a betting service that provides real payment guarantees through its blockchain architecture. Users receive tokens for each bet and earn rewards for winning bets when they hold the right tokens in their wallet. Additionally, the prize pool is held in staking during events, allowing users and agents to receive additional benefits. In the future, an automated feature is planned for users to create their own proposals and oracles for bets.

User scenario: Users vote on the outcome of real events (such as presidential elections). After the event, the outcome is determined, and those who guessed correctly receive their vote back with a proportionate part of the prize pool and any staking profits. Users determine the amount to bet.

Offer for users: Earn profits by betting on current events. A blockchain-powered voting system helps guarantee fair payouts and transparent results. Receive extra winnings for staking the amount of your bet while the game is on.

Influencer scenario: Influencers, such as admins of Telegram chats or owners of Telegram channels, enter a special bot to view available betting games, select a game, and generate a post to advertise in a channel to attract participants. After the outcome is determined, influencers receive a reward that can be withdrawn to their cold wallet.

Offer for influencers: Try a new way to monetize your audience. Take benefits from low entry cost and high speed for checking profit hypotheses. Get transparent payout, secured by blockchain architecture of the service and additional profits from staking coins.

MVP: The service issues proposals (like “who will be next president of the USA? Trump / Biden / other”), while influencers can generate their proxy smart contracts to attract an audience and receive payments.

Technical features: Tokens are equivalent to votes in the service. Users select their stake in the chain’s native asset and in voting tokens, where one voting token equals one vote. The final prize pool value, based on the outcome, is distributed to the winning bettors’ token wallets. The diagram below illustrates the voting flow in a Jetton style layout used in this codebase.

Blockchain Bet mechanism

On the first and second steps, the user sends the amount of their bet through an Influencer’s proxy (a smart contract that calculates the Influencer’s reward) to the Jetton-Master of Votes (a smart contract that accepts bets and mints Jettons back to the user according to their vote count). On the third step, the Jetton-Master mints the corresponding amount of Jettons to the user.

Tokenization: Tokens play a vital role in our architecture. After making a bet, users get Jettons that prove their rights to the reward, with additional profit from staking if they win. Apart from that, users can get achievements in the form of NFT, which will allow them to access some additional privileges on our service, such as increased staking percentage or access to some VIP-offers.

Turnover of Jettons: Voting period for each proposal will be limited, there will always be some time between termination of voting and determining the outcome of an event. Due to this fact, Jettons can change their valuation over time. Let’s see how this will work on the example of the proposal to vote on the outcome of the presidential elections. This betting offer may be minted a year before the elections themselves and users may have an opportunity to vote within, let’s say, just a month after the minting of the proposal. In this case, someone who learns about this game only after voting ends may want to buy Jettons from other users to participate. On the other hand, somebody who has voted for the favorite may want to sell his Jettons at a lower rate than his potential reward, but get his money back earlier to lower the risk level. Change of favorite or expectations, news on the candidates and elections may drive sales on the secondary market too. For this reason, we plan to build a special Jettons exchange to help buyers of Voting Jettons to find sellers, explore offers and trade Jettons.

Oracles: We plan to support many kinds of events, from the birth of a popular blogger’s kittens to rap battles or football matches. Each event type can use a different oracle model.

At first, the service deploys proposals. Later, anyone will be able to mint a betting game for an event and choose an oracle type from a list.

For a small or personal event—for example, a question about how many kittens will be born—the blogger can act as the oracle. Users decide whether to trust that offer. The oracle address is stored in the smart contract for that offer. The outcome is settled by a transaction signed from that wallet.

For a rap battle, a multisig wallet can represent the judges. Every judge must sign the transaction that records the outcome.

For football matches, cryptocurrency rates, or other outcomes that depend on external data, we can use off-chain oracles that report results into the contracts.

Moderation and Appeals: We want the content on our service to comply with universal moral standards, that's why we plan to check the user-generated proposals on the compliance to our terms and conditions. Of course we are aiming for blockchain mechanism of moderation and arbitration implementation. We will deploy the NFT collection of moderator’s badges and will implement a mechanism of getting moderator’s NFT for some specific activities on our service, that will allow users to vote on whether to post some proposals or not. Of course users will get some additional amount of coins from the prize pool for voting. We plan to use similar mechanics for the Appeals. When the oracle determines the outcome, rewards do not go to users instantly; users have some time to file an appeal. If some previously determined percent of users voted for the appeal, moderators come into the game, double check the situation and vote for the real outcome.

5.3 · Taxi (Coming soon)

6 · Opportunities

In this section we reveal the main opportunities that Blockchain Program brings for blockchain architecture.

6.1 · Tokenize anything!

The flexibility of the tokenized blockchain backend allows for the creation of various services across different industries and sectors. The NFT layer in the architecture can represent any entity, whether it's a virtual item in a game, a passport for a taxi driver, or a smart contract for a voting game. The technology provides flexibility in terms of representing different entities as NFTs and storing their metadata and files on-chain. This opens up the possibility of tokenizing a wide range of assets and entities across different markets. NFTs can represent a wide range of digital or physical assets, such as:

Digital collectibles: We can tokenize and create NFTs for digital artwork, virtual items in games, music, videos, and other forms of digital content.

Real world assets: Physical assets like real estate, art pieces, luxury goods, or even intellectual property rights can be tokenized and represented as NFTs on the blockchain.

Identity and reputation: We can tokenize identity-related information, such as verified credentials or reputation scores, to enhance trust and interoperability in various industries like finance, education, and healthcare.

Financial instruments: NFTs can be used to tokenize financial assets like equity in companies, bonds, derivatives, and other investment instruments, providing fractional ownership and liquidity.

Intellectual property: Tokenizing intellectual property rights, such as patents, trademarks, or copyrights, can enable more efficient licensing, tracking, and monetization of creative works.

6.2 · Hack different markets with blockchain

The markets where this technology can be applied are diverse and include but are not limited to:

Art and collectibles: Tokenization can revolutionize the art market by providing provenance, authenticity, and fractional ownership of artworks. It can also enable new forms of digital art and collectibles.

Gaming and virtual worlds: NFTs have gained significant traction in the gaming industry, allowing players to own, trade, and monetize in-game items and virtual land. Virtual worlds can also benefit from blockchain services built on this technology.

Blockchain finance (DeFi): Tokenization can enable new financial instruments and protocols in the DeFi space, such as tokenized stocks, commodities, or lending/borrowing markets.

Supply chain and logistics: By tokenizing goods and tracking their provenance on the blockchain, supply chain management can be enhanced with improved transparency, efficiency, and trust.

Identity and credentials: Tokenized identity solutions can streamline identity verification processes, facilitate secure sharing of personal data, and enable self-sovereign identity.

Content creation and distribution: NFTs can revolutionize the media and entertainment industry by providing new models for content creation, distribution, and monetization, empowering creators and reducing intermediaries.

6.3 · Bring AI to Blockchain

Apart from that, we can think about how to bring AI to blockchain. Of course, considering the risks and threats of AI. Here's a description of the possibilities and opportunities that can arise from combining AI, blockchain, and neural networks:

Blockchain AI: By integrating AI with blockchain, we can create a blockchain AI network. Traditional AI models often rely on centralized servers, which can be vulnerable to single points of failure, data breaches, and censorship. With blockchain, AI models can be distributed across a network of nodes, making the system more robust, transparent, and resistant to attacks.

Secure and Private Data Sharing: Blockchain technology provides a tamper-resistant platform for storing and sharing data. By utilizing smart contracts, we can establish rules and permissions for accessing data, ensuring privacy and security. AI algorithms can then be trained on this shared data without exposing the underlying sensitive information, thereby enabling collaborative and privacy preserving AI models.

Tokenized Incentives: The use of tokens within the blockchain can serve as incentives for participation in the AI network. For example, individuals can contribute their computational resources, such as processing power or storage, to the network and be rewarded with tokens in return. This incentivizes the growth of the network and encourages active participation from various stakeholders.

Neurotransmitter Tokens: In the context of neural networks, tokens can be used as "neurotransmitters" to facilitate communication between different smart contracts representing neurons. These tokens can carry information, instructions, or value between the nodes of the neural network, enabling the exchange of data and coordination between different components.

Enhanced Machine Learning Models: Integrating AI with blockchain can help improve machine learning models in several ways. Firstly, the transparency and immutability of blockchain can enhance the auditability and accountability of AI algorithms, addressing concerns around biased or unfair decision-making. Secondly, by utilizing the distributed nature of blockchain, AI models can leverage a larger pool of diverse and securely shared data for training, leading to more accurate and robust models.

New Business Models: The fusion of AI, blockchain, and neural networks can unlock novel business models. For instance, blockchain AI marketplaces can emerge, where individuals can buy and sell AI algorithms, services, or even trained models directly, eliminating the need for intermediaries. This can promote innovation, empower individual developers, and create a more accessible and competitive AI ecosystem.

Autonomous Smart Contracts: AI embedded within smart contracts can enable autonomous and intelligent decision-making based on predefined rules and conditions. For example, in blockchain finance, AI-powered smart contracts can automatically assess and execute complex financial transactions, mitigate risks, and optimize investment strategies, all while ensuring transparency and security.

Trust and Verification: Blockchain's inherent trust and transparency can be leveraged to verify the authenticity and integrity of AI models and their outputs. This is particularly relevant in critical domains like healthcare or autonomous vehicles, where ensuring the reliability and trustworthiness of AI systems is essential.

These opportunities represent a glimpse of the potential that lies ahead by combining AI, blockchain, and neural networks. However, it's important to note that these concepts are still evolving, and their practical implementation and widespread adoption may require further research, development, and collaboration within the AI and blockchain communities.

7 · Let’s create!

We appreciate your contributions, making programs, extensions, discoveries and findings.

Let’s play… Big. Let’s play… Wondering! Let’s create a blockchain world.

I believe we can do it…. Together…

Special thanks to developers and open blockchain communities whose standards and tools make architectures like this possible, and to the OpenAI team for useful tooling.