tinychainorg / tinychain

The tiniest blockchain implementation in the world
https://www.tinycha.in/
MIT License
52 stars 3 forks source link

Smart contracts runtime #3

Closed liamzebedee closed 2 months ago

liamzebedee commented 8 months ago

Smart contract runtime model

Approaches:

Someone implemented a syscall interrupt opcode in brainfuck - https://github.com/ajyoon/systemf

liamzebedee commented 8 months ago

https://github.com/ajyoon/systemf/tree/master/examples/http

https://github.com/mzattera/FuckBench/tree/master

https://github.com/bf-enterprise-solutions/os.bf !!!

https://github.com/bf-enterprise-solutions

https://github.com/bf-enterprise-solutions/bfosix

liamzebedee commented 8 months ago

JESUS FUCKING CHRIST

https://github.com/f-prime/arcanevm

liamzebedee commented 8 months ago

This is from the Cairo whitepaper:

Screen Shot 2023-12-30 at 11 48 38 am

I like the idea of memory-mapped IO. Instead of defining a new brainfuck opcode for a "syscall interrupt", it should be possible to hook the builtin I/O operators of Brainfuck (. and ,) and build a simple IO interface.

Here's how it could work. All we want is a contract runtime. What does that entail? Programs, with persistent storage, that is permissioned only to them, and the ability to call programs within other programs.