Hey everyone! Bayge here. I’m trying a new format to keep things nice and concise for this week. Something a bit more digestible! Super excited this week to feature the following:
🕹️ Introducing OrderbookKit: OrderbookKit is a one click deployment of an orderbook to any Arbitrum chain, powered by Stylus.
🧢 Introducing Stylusup: https://stylusup.sh is a one liner creation and setup script for Arbitrum Stylus, including a new website for more info on the ecosystem.
🍲 Interview with Dragoș, super powerful freelance software engineer.
Read on, and if you have any feedback about the newletter, I’d love to have you fill out a form sharing your thoughts. It would mean a lot to me if you filled this out:
To recap, Stylus is a Arbitrum technology for building smart contracts in Rust, Zig, C, and Go. Stylus lets you build smart contracts that are 10-50x more gas effective than Solidity smart contracts, with a much broader range of expressiveness from these other languages! Contracts can be written with no loss of interopability with Solidity!
Click here to learn more: https://arbitrum.io/stylus
1) Introducing OrderbookKit
I’m super excited to announce OrderbookKit, the second dApp funded by the Arbitrum DAO. OrderbookKit will be a one click orderbook deployment onto any chain powered by Arbitrum, implemented in Rust Stylus. The newsletter will cover the development practices of this project as it comes along! For now, you can sign up via the newsletter waitlist on the page to learn more as it approaches completion.
We’ll be publicly developing OrderbookKit! This will include sharing design decisions, how to write hooks, how to extend the code, and more. The source code will be fully audited. There will be a way to embed hooks/tools into the orderbook, and hopefully I’ll figure out a way to get liquidity and marketmaking sourced alongside the deployment of the orderbook as a service somewhere. If I don’t figure out an approach for this, maybe a simple deployment for posterity that’s a reusable tool for others is enough. The best kind of plan for something like this is to build it and to see how people react!
I’m in the process of experimenting with a custom interpreter for a special OrderbookKit S-expression-like stack-based programming language. I don’t know to what extent this will be existing in the final product, but this sort of thing excites me, so I’d love to breathe fresh air and experiment wherever possible. The few programs relevant natively to the orderbook itself built into the interpreter vehicle will be a simple AVL tree derivative, maybe adjusted to amortise the accesses somehow (a la DYDX I gather, if I can find an approach that makes sense?) on-chain.
What especially interests me is the concept of evolutionary agents that have the capacity to edit their code as they exist and trade on-chain in response to trade and liquidity depth titled “market signals”. What excites me is the possibility to open the social case for this and to allow agents to edit each others code as well, and to react to “user signals” that can be created and propogated by other agents, or by EOAs trading on the market. I hope to use this orderbook vehicle to, develop something like this! The task to build this is building these operations for this programming language additional to the orderbook itself:
An operation for a program to breed with a specific program with its identifier stored on a stack, to produce a randomly combined derivative.
The ability to introspect the orderbook and the recipients of the last received market signal or user signal.
Branching and basic math operations.
The ability to make a ask or a bid, and to be aware of the balance of the token held by the program.
The ability to send another program or EOA some tokens.
The ability to inject code after the program counter into another program or empty program “slot” (we’ll have to cap the amount of programs trading in a market at a given time given the constraints of our runtime).
The amount of steps that each program can take per tick before needing to return, or being exited prematurely. This should be interesting to see as a primitive that the programs themselves are aware of, so I’ll also support this as a operation for them to branch on.
Random copying of the surviving programs after a iteration of a market has been concluded back up to a specific quota. The random copying will of course include randomly inserted permutations at this stage.
It’s worth noting that since this is a Stylus program written in Rust, anyone could run the orderbook locally or in a distributed environment without touching what’s on-chain, then seed a deployment. So this OrderbookKit program is a sort of program generator in a sense (in it’s completed future vision form).
Maybe before beginning to have this exist I’ll simulate some programs locally on examples of wash trading for a fun quantitative finance example to show off Stylus. Maybe a simple game of trying to accumulate as much token as possible in a hundred thousand generations in games of 10,000. I’m very curious how it would be to have a game where only the top 30% of traders in a fake market left alone with a fake asset are allowed to survive. I’m curious how the interaction of the problem of a number of upper ticks that can be run interplay with program copying, whether programs running with a very high amount of steps have little NOP sleds inside their programs with a diluted stack to possibly interfere with sending (it could be implemented with a loop around buffer). In an environment where there are less steps for trading programs to run, it might be better for them to survive purely on a only functional basis. Who knows?
Any issue of doing this on-chain is the economics of transaction sending, as you must pay to simulate on-chain the trading environment and its agents and its onerous storage accesses (which are poorly equipped for the EVM’s tree approach to storage). There is also the power of a EOA to speculate and trade the behaviour of the agents themselves, which will have trading capabilities. Weird counterpoint to this: this isn’t a bad thing. The agents themselves are tools for consensus using a market format, and the burden of convincing a program could be on the EOA to cough up a fact that the program has learned is relevant to a trade it must make.
Imagine a wild situation where two EOAs are trading adversarily on the orderbook against each other and they must play the game of convincing the programs using signals to do things for them! You might say that the social signaling feature makes it possible to easily cheat, but I’m interested in seeing whether the programs will adopt a defensive mechanism of outsiders where they pair it with liquidity information, or, if they’re left alone (and don’t have so many iterations to learn and grow, which is more likely since who’s going to do this themselves), be abused.
To do all this, the business case must be married to the concept, which is to build a successful orderbook primitive on-chain, with an easy deployment on-ramp for any Orbit chain. Regardless of how this turns out, it’s my hope this is useful to the Stylus ecosystem.
2) Introducing Stylusup
I’m super pleased to share a new website to help people on-ramp into Stylus (https://stylusup.sh) and a simple to use script that sets you up with Stylus on your computer instantly:
curl -s https://stylusup.sh/install.sh | sh
Which lives at https://github.com/af-afk/stylusup.sh. It will collect information on the language used by the local system, the processor architecture, and the operating system, which will be reported at https://popcon.stylusup.sh (in the same vein as the Debian popularity contest). Users can fully opt out by interrupting at the stage where it asks you if you’re comfortable with the analytics collection if it can read a line from stdin, or with STYLUS_POPCON_OFF
with no arguments.
It’ll do the following (currently it only reports the info of the host, :
Install Rust using Rustup if it’s not installed.
Install
wasm32-unknown-unknown
using Rustup if it’s not installed.Install the Cargo Stylus subcommand.
Ask the user if they’d like to create the example repo, giving an example of how to do so.
My hope is this will simplify the journey of users trying Stylus! I’ve tested it on Debian, Ubuntu, and MacOS with a friend. Extra coverage is needed so far for better testing so far! If you have any issues, please direct them in the repo.
3) Interview with Dragoș
Who are you, and what do you do?
I'm Dragoș Horodnic [ˈdraɡoʃ hoˈrodnik], a software engineer, a FOSS and web3 enthusiast.
My story starts with my first hello world written in Pascal when I was 10, coupled with early internet access during the golden era of forums and IRC where I've spent countless hours learning new things, teaming up with diverse people from across the globe, working together on projects for fun. I witnessed what everyone back then hyped as web 2.0, people actively participating and interacting on platforms, the nascent of social media, and online shopping.
I was too young and naive to understand that in the end a handful of powerful entities will essentially exploit our time and attention for profit and I should probably stop before I make everything sound like a dystopian rant, but from my point of view the state of the web has been in a decline ever since. It no longer incentivizes its users to do their own research or come up with meaningful contributions but merely to consume content trapping them in doomscrolling timesinks and walled gardens. For me, web3 is a glimmer of hope that we can restore that brighter side of the internet and treat its users with respect, not like a commodity, by giving them the freedom to express and interact without bounds hidden in uncomprehensible T&Cs that they are coerced to accept. Self-governed communities through DAOs, interoperability through open standards, availability and censorship resistance through decentralization, are just a few examples of solutions towards the goal of a free space that web3 brings to the table.
For the most part I've developed web and mobile applications for startups including my own initiatives, 2020 marking the beginning of my web3 journey at Nexus Mutual which was definitely the most exciting project I've worked on. Besides freelancing, I am currently developing a permissionless web3 alternative to gig economy platforms that will offer transparent fees and competitive pricing for its users. Even though it's in a very early phase, I am exploring available layer 2 solutions which I ignored for long enough.
What web3 ecosystems have you worked in?
I've mainly worked on Ethereum but I had brief encounters with other chains, mostly EVM-based while working at Nexus Mutual to allow users to attach a proof of loss on other chains when submitting claims. I have experimented with Cardano's Plutus but the community traction of Ethereum and the plethora of available resources make me feel at ease.
For certain usecases like my own, frequent smaller transactions on Ethereum are not really feasible due to gas fees and I've postponed looking into layer 2s for a long while because of the sheer number of them, hoping that one day I'll just pick the winning one when needed, but the decisive day could be far ahead.
So for the past month I've started diving into Arbitrum after attending a hackathon at ETHBucharest where a particular track immediately drew my attention: a gas optimisation problem brought up by Alex from Superposition, designed similarily as a CTF challenge.
Not only that I've been triggered when I heard the two words put together, gas optimisation, but the contract was written in Rust using Arbitrum's Stylus SDK. All these were new to me and I thought it would be a good opportunity to try Stylus out and later use it in my projects. I had a lot of fun and the contract itself highlighted the advantages of using stylus over Solidity really well.
What are your impressions of working with Stylus, good and bad?
Stylus is very promising but like every new piece of tech, there are areas worth improving. I've started sketching an on-chain MMO RPG that I want to write using Stylus. I thought it would be an enjoyable and thorough first project for learning. I'd be more than willing to share additional insights after I am happy with the end result, but so far I've noticed few things.
The good:
The development tools such as LSPs for Rust are much better than what's available out there for Solidity where certain errors are only brought up at compile time.
It opens up new possibilities for expensive checks or loops that otherwise would have been implemented as offchain workers and merkle proofs.
You can mix solidity in your codebase and call Solidity contracts from stylus.
The would be good to have:
A CLI scaffolding tool to quickly setup multiple contracts in a monorepo.
More examples of advanced usecases in the documentation and project structure best practices.
What software do you use?
I use Arch Linux (btw), OpenBSD and occasionally macOS. I prefer free and open source software and I like using everything in a keyboard-centric fashion because it helps me stay focused and interact faster:
Since everyone around me can't abstain from mentioning LLMs or AI code editors every minute, I recommend avante.nvim for neovim users that feel the FOMO. I'm not a big fan of AI coding but your mileage may vary.
I also use Proxmox to self-host services at home such as VPN, CalDAV server, DNS, OMV etc.
What hardware do you use?
My main driver is a Framework laptop (AMD Ryzen 5 7640U, 32GB RAM, 2TB) running Arch.
How can we get in touch with you?
I'm always open to chat with people sharing similar interests, from dotfiles to web3.
LinkedIn: https://www.linkedin.com/in/dragos-horodnic/
Github: https://github.com/horodnicdragos
What's a piece of advice you'd give someone new to web3?
I highly recommend being able to understand what smart contracts do.
It offers you a huge advantage when interacting with web3 apps. Don't interact with unverified and unaudited smart contracts. If you want to build dapps, start playing around on a testnet and start small such as integrating with an existing contract avilable on that testnet. I also recommend going through OpenZeppelin's libraries and understanding their purpose. Don't be afraid to dive deep into how things work. Be wary of scammers and stay safe.
Stylus Saturdays is brought to you by… the Arbitrum DAO! With a grant from the Fund the Stylus Sprint program. You can learn more about Arbitrum grants here: https://arbitrum.foundation/grants
Follow me on X: @baygeeth
Side note: I develop Superposition, a defi-first chain that pays you to use it. You can check our ecosystem of dapps out at https://superposition.so!