
doing stuff @PrtclMediaLabs | @autoscale_ @blindzdotfun @SpaceKitWeb3 @SollpayHQ | prev. @MultiversX
Joined February 2022
- Tweets7.1K
- Following217
- Followers2.5K
- Likes3.9K
Pinned Tweet
Announcing SpaceKit: The First-Ever Swift Smart Contract Framework 🙌
After 10 months of development, I’m excited to introduce SpaceKit, the first smart contract framework built for Swift 🔥
This marks a major milestone for @MultiversX and every Lightspeed Chain, making it the first blockchain ecosystem where Swift developers can build decentralized applications
What I’ll cover in this post
1) SpaceKit’s Vision: A framework designed with developers in mind
2) Current Features: What’s available today
3) The SwiftVM: A Swift-based replica of SpaceVM for testing
4) Documentation & AI Assistance: Interactive tutorials and a GPT-trained assistant
5) The Future of SpaceKit: What’s next for the framework
A TL;DR is included at the end, but let’s go through the details
1) SpaceKit’s Vision: A Developer-First Smart Contract Framework
SpaceKit is designed to provide a smooth developer experience, leveraging Swift’s powerful and intuitive syntax while abstracting away unnecessary complexity
- Cross-platform support: Works on macOS, Linux, and Windows (via WSL)
- Flexible development environment: Use Xcode or VSCode
- Fully compatible with MultiversX and all future Lightspeed Chains
- A Unified Development Stack
The long-term goal of SpaceKit is to enable developers to build smart contracts, backends, and frontends within the same Swift-based ecosystem:
- Define contract endpoints
- Automatically generate interaction functions
- Develop entire decentralized applications using a single codebase
Currently, SpaceKit is in beta and focused on smart contract development, supporting the most important opcodes. You can already build anything from NFT collections to DeFi protocols, with more capabilities coming soon.
2) Current Features: What’s available today
SpaceKit is already packed with useful tools. Here’s a look at what’s possible:
- High-Level Type System: Work with Buffer, Vector, BigUint, and more instead of raw byte operations
- Intuitive Storage Management: Use @Storage annotations or custom storage mappers like WhitelistMapper, VecMapper, and SetMapper
- Blockchain & Transaction Data Access: Retrieve timestamps, payments, caller addresses, and other contextual information
- Flexible Coding Style: Write contracts using global functions, OOP-style structs, or simple @Codable annotated structs
- Simplified Contract Interactions: Deploy, upgrade, and call other contracts with minimal effort thanks to the @Proxy annotation
- No low-level complexity: SpaceKit abstracts away low-level intricacies, automatically determining whether the code is being compiled for the SpaceVM or SwiftVM. This eliminates the need for Self::Api and other generic constraints, allowing you to focus on building business logic without dealing with pointers or WebAssembly-specific details
- Async Calls with Callbacks: Mark functions with @Callback to handle asynchronous contract interactions
- Full ESDT Support: Issue, mint, burn, and manage fungible, non-fungible, and semi-fungible tokens
- Secure Randomness – Generate random numbers using SpaceVM’s built-in random features
- Event Emission: Use @Event to automatically generate event methods
- Command Line Interface: Initialize projects, compile to WebAssembly, and generate ABIs
- Rust Compatibility: Swift smart contracts can interact seamlessly with Rust contracts
- Cross-Platform Support: Fully functional on macOS, Linux, and Windows
- Code Editor Support: Full autocompletion and syntax highlighting, even for generated code
- Compatible with Any SpaceVM-Powered Blockchain
These features enable developers to build almost any type of smart contract
3) The SwiftVM: A Swift-Based Testing Environment
Testing is a critical part of smart contract development, and SpaceKit simplifies it with SwiftVM, a Swift-based replica of SpaceVM. This allows developers to:
- Run contract endpoints and check results
- Simulate failures and analyze error reasons
- Set up wallet balances and simulate transactions
- Define which address is calling the contract
- Test contract-to-contract interactions, both synchronous and asynchronous
- Ensure callbacks are working, even when the asynchronous call fails
- Issue and manage ESDT tokens within tests through a replica of the GoVM’s ESDT System smart contract
- Use Swift’s built-in debugger and breakpoints for in-depth testing
- This eliminates the need for external testing tools, allowing developers to test their contracts natively in Swift
4) Documentation & AI Assistance
To make onboarding easy, SpaceKit includes:
- An 11-Chapter Interactive Tutorial: Covers installation, contract development, ESDT management, and more
- 22+ Example Smart Contracts: Ranging from simple adders to fully functional multisigs
- A Repository with 568+ Tests: Demonstrates real-world testing scenarios
- Custom GPT Assistant: Provides instant answers to development questions
More documentation and learning resources will be added over time
5) The Future of SpaceKit
The roadmap includes several key milestones:
Short-Term: Incorporate developer feedback, refine documentation, and expand learning resources
Mid-Term: Improve the CLI and SwiftVM, reducing reliance on external tools
Long-Term: Develop a Swift-based backend framework, similar to NovaX, for seamless contract interactions
The ultimate vision is a fully integrated Swift ecosystem where developers can build smart contracts, backends, and even iOS/macOS frontends from the same codebase
TL;DR
- SpaceKit: The first Swift smart contract framework
- Developer-Focused: Works across platforms, with an intuitive API and minimal complexity
- Comprehensive Feature Set: Easy storage, event emission, async calls, and more
- SwiftVM: Test contracts directly in Swift with real debugging tools
- Extensive Documentation & AI Support: Tutorials, example contracts, and an AI assistant
- Future Plans: A full backend + frontend Swift ecosystem for dApp development
SpaceKit is here. Ready to start building? 🔥
- SpaceKit repository: github.com/gfusee/SpaceKit
- Interactive tutorials: gfusee.github.io/SpaceKit/tu…
- GPT assistant: chatgpt.com/g/g-6793b3de291c…
I updated my @SuiNetwork + Walrus + Seal localnet docker images to use the latest version 1.81.0 of Sui
They are mainly for my own purposes, I put the setup open-source in case of someone needs it as well
It has a few e2e tests ensuring the 3 components act well together
The update is represented by the tag 0.0.23: github.com/gfusee/sui-localn…
we forget how much of a game changer better ai tooling can be
sometimes even more than upgrading the models themselves
dots is a great example
Announcing dots. Dots work 24/7 for you, learn from your feedback, have their own computer, browser and can be connected to over 4k apps in our ecosystem.
They’re powered by Astra our best model yet. Included in your Pro plan, without drawing down on any of your usage. You can even call a dot while it’s working.
We’re getting you started with your primary dot today and soon you’ll be able to create entire teams of them.
almost every component needed to abstract blockchain away from users already exists on @SuiNetwork
but there’s still one missing piece
think of the sui ecosystem as a decentralized cloud stack
→ sui to secure and orchestrate apps and assets
→ walrus to store data
→ seal to keep that data private to authorized users
→ nautilus to handle complex computations
→ deepbook to provide liquidity infrastructure
→ zklogin to remove the need for users to manage private keys
put all of this together, and you can build applications where users barely need to know a blockchain is involved...
...almost
there’s still one thing missing, can you guess what it is?
let me give you a few hints, imagine you’re building a product backed by a web3 infrastructure and want the blockchain to be 100% invisible to your users
this is our goal at @PrtclMediaLabs
there’s still one thing standing in your way:
→ almost every web2 product has one
→ when you hear “SaaS”, it’s probably one of the first things that comes to mind
you got it: web2-native billing
subscriptions and one-shot payments through credit and debit cards, not crypto
for a builder, the real problem isn’t just accepting a payment
it’s being able to charge users automatically when the next payment is due
because a subscription where users have to manually come back and pay every month isn’t really a subscription
every extra action is another opportunity for the user to drop
and that friction is enough to kill a business built on recurring revenue
but building the payment infrastructure yourself isn’t really an option either
because payments are an entire business of their own: compliance, refunds, disputes, claims, fraud, payment methods, currencies
none of this is what a builder creating an app on sui should have to spend time on
and this is not something other blockchain ecosystems have made a first-class part of their stack either
they’ve built ways to move tokens, some have even built ways to automate recurring token payments
but that’s not the same as giving builders web2-native billing
-> a user should be able to enter their card once and forget about it
-> the builder should be able to charge them once or every month
and neither side should have to care about wallets, tokens, on-ramps or what happens underneath
this is where sui has a card to play
it already has most of the infrastructure needed to make blockchain invisible
web2-native billing could be one of the last pieces needed to make the stack feel complete
if we really want blockchain to disappear from the user experience, payments have to disappear with it
a case study of why @SuiNetwork’s object model is so powerful
when building @PrtclMediaLabs we ran into a simple problem:
writers care about writing, not blockchain
we needed a system where they could configure everything on-chain and remain fully self-custodial
while still allowing us to update their settings on their behalf
this enables features that are essential for a web2-like experience: automatic royalty off-ramps, managed encryption key rotation, …
the problem?
the value of web3 is transparency and censorship resistance
giving one entity (us) these superpowers goes against the vision we have
at first it seemed contradictory
we wanted a system where we couldn’t control the database, while still being able to act on behalf of users when needed
so we took advantage of sui’s object model to make both possible
that took 3 steps:
1) building a fine-grained permission system
the solution is based on something standard in the web2 industry
each exposed Move function has an associated permission
they are listed in an enum called MemberPermission, with permissions such as:
- UpdatePublicationPricing
- ClaimRevenues
- ArchiveArticle
2) defining publication members
the owner of a publication automatically has every permission in MemberPermission
but a publication can have multiple writers
to invite one, the owner mints a Sui object called Member, assigns it a set of permissions and sends it to the writer’s wallet
holding this object gives the writer access to exactly the actions they were granted
3) allowing Protocol to mint Members transparently
let’s say a publication owner isn’t tech savvy and wants to delegate the management of article encryption keys to Protocol
they can optionally give Protocol the ability to mint special Member objects, called ProtocolMember
but these objects are:
-> scoped to only the permissions authorized by the owner
-> valid for only a few minutes
think of it as an on-chain agreement
the owner tells Protocol: “I trust you to give wallets you control these exact permissions on my behalf”
and Protocol answers:
“we built the infrastructure so it’s technically impossible for us to use that power without you knowing”
now let’s get back to encryption key rotation
rotating a key requires decrypting the articles, encrypting them again and publishing the new keys
the first action happens off-chain through Seal, and anyone authorized on-chain by the owner can do it
but remember:
the owner didn’t give Protocol permission to decrypt articles
they gave Protocol permission to give one of its wallets permission to decrypt articles, through ProtocolMember objects
that distinction is important
for Protocol to decrypt an article, it first has to mint a ProtocolMember object:
-> for a specific publication
-> with a specific permission
-> for a specific amount of time
in other words, Protocol can decrypt articles when the owner has authorized it to do so
but it cannot exercise that power without first saying publicly, on-chain and in a fully auditable way:
“hey, I’m using my superpower for the next 5 minutes”
this is where Sui’s object model shines
because permissions themselves are objects, auditing this becomes extremely natural
a researcher can look through the blockchain history for ProtocolMember objects and see when delegated access was created, what it allowed and how long it was valid for
on an account-based model, the same information can be spread across contract state, events and transactions
with Sui, the capability itself is a first-class object
the permission system becomes the audit trail
after updating and monitoring everything I confirm that bumping your @SuiNetwork deps to 1.80.0 works
I highly recommend you to update as soon as possible, as even if mysten mitigates this, there are still risks that your critical on-chain components stop working suddenly
this is especially true for services parsing on-chain transaction data
yesterday my testnet monitoring systems i built at @PrtclMediaLabs started showing unusual errors
the kind of errors that, after years of engineering, you know probably aren’t coming from your code
soon after, my @SuiNetwork CLI started failing on commands that worked perfectly fine before
something was definitely wrong
after investigating, i realized this could break many Sui clients and SDKs once it reaches mainnet
indexers, backends, DeFi oracles, or basically any client decoding the affected gRPC response could suddenly fail to process data
here’s what happened:
the error was about an invalid index while decoding BCS data returned by Sui gRPC
an index is simply the position of a case in an enum
if an enum Vehicle has the cases Bike, Car and Motorcycle, their indexes are respectively 0, 1 and 2
in our case, our systems received the index “3” for an enum called TransactionExpiration that only knew about 0, 1 and 2
my first intuition was a breaking change introduced by a Sui upgrade
and that matched the timing perfectly: Sui v1.80.0 had just been released on testnet
i prompted my AI agent with:
“I suspect a breaking change in the gRPC interface through an enum. List me all the recent PRs on MystenLabs/sui that could have introduced such a change”
from the PRs it found, the issue became obvious:
- Sui v1.79.0 added a new case to an enum used in a gRPC response
- Sui v1.80.0 enabled the feature flag making this new case effective
- this new case is returned by default in some scenarios
the problem is that clients/SDKs built against the previous version don’t know this new enum case exists
so when they receive it, decoding fails
and when decoding fails, the client can no longer process that data
for an indexer, backend, DeFi oracle or any other system relying on that response, that can mean failing to process blockchain data and, depending on the system, transactions
after discovering this, I took the following action:
- report this to Mysten, which was incredibly fast to answer and investigate. they confirmed the issue and will ensure to mitigate it to remove the "default" behavior before it hits mainnet
- update my open-source Seal Rust SDK to version 0.0.14, this new version bumps the Sui dependencies to the version 1.80.0 which is aligned with that new enum case
- update all the our internal systems at Protocol to use the latest Sui SDK, it is being deployed on testnet at time of writing
PS: removing the "default" behavior mitigates the issue, but if you are decoding manually BCS data from gRPC, your infrastructure is still at risk
the only and simple way to permanently remove the fix is to update all your Sui SDKs and CLIs in the latest version (1.80.0)
PS 2: always monitor your testnet, to catch issues before they land on mainnet and cost you money
yesterday my testnet monitoring systems i built at @PrtclMediaLabs started showing unusual errors
the kind of errors that, after years of engineering, you know probably aren’t coming from your code
soon after, my @SuiNetwork CLI started failing on commands that worked perfectly fine before
something was definitely wrong
after investigating, i realized this could break many Sui clients and SDKs once it reaches mainnet
indexers, backends, DeFi oracles, or basically any client decoding the affected gRPC response could suddenly fail to process data
here’s what happened:
the error was about an invalid index while decoding BCS data returned by Sui gRPC
an index is simply the position of a case in an enum
if an enum Vehicle has the cases Bike, Car and Motorcycle, their indexes are respectively 0, 1 and 2
in our case, our systems received the index “3” for an enum called TransactionExpiration that only knew about 0, 1 and 2
my first intuition was a breaking change introduced by a Sui upgrade
and that matched the timing perfectly: Sui v1.80.0 had just been released on testnet
i prompted my AI agent with:
“I suspect a breaking change in the gRPC interface through an enum. List me all the recent PRs on MystenLabs/sui that could have introduced such a change”
from the PRs it found, the issue became obvious:
- Sui v1.79.0 added a new case to an enum used in a gRPC response
- Sui v1.80.0 enabled the feature flag making this new case effective
- this new case is returned by default in some scenarios
the problem is that clients/SDKs built against the previous version don’t know this new enum case exists
so when they receive it, decoding fails
and when decoding fails, the client can no longer process that data
for an indexer, backend, DeFi oracle or any other system relying on that response, that can mean failing to process blockchain data and, depending on the system, transactions
after discovering this, I took the following action:
- report this to Mysten, which was incredibly fast to answer and investigate. they confirmed the issue and will ensure to mitigate it to remove the "default" behavior before it hits mainnet
- update my open-source Seal Rust SDK to version 0.0.14, this new version bumps the Sui dependencies to the version 1.80.0 which is aligned with that new enum case
- update all the our internal systems at Protocol to use the latest Sui SDK, it is being deployed on testnet at time of writing
PS: removing the "default" behavior mitigates the issue, but if you are decoding manually BCS data from gRPC, your infrastructure is still at risk
the only and simple way to permanently remove the fix is to update all your Sui SDKs and CLIs in the latest version (1.80.0)
PS 2: always monitor your testnet, to catch issues before they land on mainnet and cost you money
btw, my Seal Rust SDK can be found here: github.com/gfusee/seal-sdk-r…
it is well tested, flexible, and used seamlessly in testnet and mainnet in Protocol
a journalism platform's job is to give its customers the best possible access to truthful, transparent, and independent information
if blockchain helps you do that, use it
protecting the way you’ve always done things is a terrible reason to give customers less than what’s possible
building in the @SuiNetwork ecosystem is fantastic, until you need to test
we don’t have anything close to what the EVM ecosystem has with Hardhat, and many of the simulation tools we need simply don’t exist yet
the problem gets even worse for projects like @PrtclMediaLabs that use the entire Sui stack: Walrus, Seal, DeepBook, zkLogin, and more
so early in our building process, we made a decision: treat our testing environment as more valuable than the code it tests
to make that possible, we built our own Sui stack simulator in-house
-> an entire program embedding the MoveVM and Sui execution layer, extracted from the Sui repo and rewired around our internal needs
there’s no consensus layer, and we have admin-level access to inject objects and packages from scratch, letting us recreate real-world scenarios in no time
what does this mean? real PTBs. real transaction execution. full control:
- time can be controlled
- checkpoints can be advanced at will
- transactions can be executed without having the sender’s private key
- Walrus uploads can be delayed to simulate real-world latency
simulated Seal servers connect in-process directly to the Sui simulator, so integration tests run quickly
and a complete environment takes just 20-30ms to set up
there is literally nothing on-chain we cannot test or replicate
the simulator also exposes replicas of the real gRPC endpoints used by the official Sui SDKs, making them believe they’re communicating with an actual Sui network
even better: the same simulator is used for local manual testing
with one command, devs can spin up a fresh environment on their own machine
the past few months made me realize again something about @SuiNetwork:
it has never been that easier to build an app that barely feels like web3
at @PrtclMediaLabs we put together Sui, Seal, Walrus, DeepBook and zkLogin to build and deploy on mainnet an entire and decentralized journalism platform
that journey went through many highs, a few lows, and hundreds of technical things I want to share about what we created
I’ve never been more convinced that blockchains, as infrastructure, can change the world
Hellooooooo all, at @PrtclMediaLabs, we're in the final stages of building and we're looking for fiat ↔ crypto payment providers that:
- are compatible with @SuiNetwork
- support subscriptions and recurring payments
If you have any contacts, my DMs are wide open! 🙏
ran multiple build at the same time on a macbook pro m5 max, it made the computer crash lmao
hello @Mysten_Labs could you please make the sui custom indexing framework to not depend on the sui rust codebase
I'm going crazy of waiting hours to build my rust apps 😭







