Spaceship icon Data storage proxy SC
Data storage proxy smart contract
An infrastructural contract that allows secure storage of data, versatile access capabilities
and an interesting security model. Has lots of possible applications and great extendability.
BC2
Features
Decentralized security

Stored in TON BC

All data is securely stored in TON blockchain which provides outstanding redundancy, decentralization, SC and data access options.

Safe stor

Security options

Data access can be configured granularly with different access options, writing can be protected or restricted in many different ways.

Usage flexibility

Usage flexibility

Stored data can be freely accessed by any user (if permitted) or by any smart contract in different ways with help of internal messages.


  • Data is stored into separate boxes with many features for each one:
  • Box ownership control: each box can have its own owner
  • An owner can be a person (wallet) or some complex smart contract
  • Complex smart contract can programmatically change box contents
  • Box can even be protected from contract owner, if neccessary
  • If box is not protected contract owner can manipulate it too
  • Programmatic access control with different options
  • Data can be accessed manually with a free getter method by some client
  • Inside the blockchain data can be returned as a response to specific message
  • Last, but not least, data can be injected into a proxied (forwarded) message
  • Each of those options can be allowed or forbidden per each specific box
  • It is possible to willingly protect the box from contract owner
  • This provides some safety guarantees and autonomy for the box owner
  • Contract owner would not be able to impair box options or alter contents
  • It is possible to forcefully unlock the box if its owner disappears for long time
  • Box can be frozen to prevent any accidental modification
  • It is not possible to do absolutely anything with box when it is frozen
  • The only allowed operation is explicitly thawing the box
  • This action is similar to chattr +i in linux world.
  • Box can have some quota restrictions (cells and bits)
  • This prevents box users from inadequately using contract resources
  • When box is protected decreasing limits is not possible
  • The limit affects any future changes but not current data of the box
  • Good code base and extensibility
  • The code is well written and can be easily read and extended
  • Extending the code can provide more features, for example
  • Adding a dnsresolve function will turn this into hybrid DNS resolver
Applications (some examples)
Programmatic storage

Infrastructural storage

The contract can be used as a secure centralized storage of data, which can be provided by a user or a smart contract and can safely used by other contracts in the blockchain.

Templating message

Templating service

The contract can proxy (forward) a message and inject data into it at specified place, that allows possibility for customized interaction with any blockchain services.

Data access

Data server

Important pieces of data can be relaibly stored in the blockchain and can be accessed free of charge by any user (for example, hash tables, PKI trees or domain lists).

Hybrid DNS

Hybrid DNS resolver

By extending the contract with a little DNS resolving function it is possible to use the contract as a hybrid DNS service with per-domain owners and manual controlling.

How it works
 
More information
Contract

Contract

Quick start guide on how to use the contract can be found here. You can read some technical details about the contract on the dedicated page. The code is published in this GitHub repository.

Author

Author

You can find author on GitHub (Skydev0h) or contact on Telegram by handle @Skydev.

Another contract

CT SC

Please have a look at another smart contract made by the author for this contest: Conditional transfer smart contract, a decentralized financial SC.



/------------------------------------------------------------------------\
| Created for: Telegram (Open Network) Blockchain Contest #2 (Part #2)   |
| Author: @Skydev (Telegram) / Skydev0h (GitHub)                         |
>------------------------------------------------------------------------<
| March 2020, second half                                                |
\------------------------------------------------------------------------/