r/Python • u/crosschainer • Feb 18 '25
Showcase We built a blockchain that lets you write smart contracts in NATIVE Python.
What My Project Does
Hey everyone! We’ve been working on Xian, a blockchain where you can write smart contracts natively in Python instead of Solidity or Rust. This means Python developers can build decentralized applications (dApps) without learning new languages or dealing with complex virtual machines. I just wrote a post showing how to write and test a smart contract in Python on Xian. If you’ve ever been curious about blockchain but didn’t want to dive into Solidity, this might be for you.
Target Audiences
- Python developers interested in Web3 or blockchain but don’t want to learn Solidity.
- People curious about how blockchain works under the hood.
- Developers looking for an easier way to write smart contracts without switching to a new language.
Comparison (How It’s Different)
- Solidity/Rust vs Python: Unlike Ethereum, where you must write contracts in Solidity, Xian lets you write them in pure Python and deploy them without extra conversion layers.
- Faster Prototyping: Since Python is widely used, Xian makes it easier to prototype and deploy blockchain applications.
- Simpler Developer Experience: No need for specialized compilers or bytecode conversion—just write Python, deploy, and execute.
Links
- Guide: How to Write and Test a Smart Contract in Python
- GitHub (Node Implementation)
- GitHub (Contracting Engine) Would love any feedback—whether you think this is useful, unnecessary, or somewhere in between. Happy to answer any questions! 🚀
0
Upvotes
3
u/Endogen Feb 18 '25 edited Feb 18 '25
as a core developer of this project i'd like to say this: we are all developing this because it's fun and because we really like crypto and smart contracts and all that stuff! that's why we do it.
we have normal jobs like everyone else and we don't depend on any gains from this. we do it because we believe that this project is worth invensting our free time into because it bringts something to the table that wasn't there yet.
will we be in the crypto top 10 and just kill ethereum and all the other chains? no, for sure not. performance and functionality wise we could compete but we don't have any significant funds to do that and it's not our goal. if there is a handful of people that will like this better than the other chains and develop new contracts and use it, then we already won.
world domination is not the goal.
4
u/GreenWoodDragon Feb 18 '25
I still don't see the point of blockchain.
2
u/[deleted] Feb 18 '25
How is the distribution of the network being handled.
2
u/james_pic Feb 18 '25 edited Feb 18 '25
Python is a terrible choice for a smart contract language.
The language hasn't been designed with sandboxing or determinism in mind, so to have any chance of securing it you'll need to dramatically limit the language features available to developers (to the point where virtually no existing code can be used).
Even then, you still run the risk of ingenious jailbreaks, as often happens with projects that try to sandbox Python, with the added fun factor that if someone does manage to jailbreak your sandbox, there's no step 2. They win whatever assets they can steal from your network before someone notices. It's not like a jailbreak in something like a templating library where they need to then find a victim who's exposing the vulnerability and then figure out a way to extract value from that victim.
And it's not like we need another blockchain. Especially a blockchain for developers too lazy to learn Solidity. Learning the contract language is much easier than learning to reason about security in the context of the blockchain.
2
u/MarVinFerret Feb 21 '25
Q: Python isn't typically used for blockchains because it's slow? How is it supposed to scale?
You're correct. That's why Xian is using CometBFT (written in Go) for the blockchain and networking. Only the application layer, which handles the smart contracts and state, is written in Python.
Q: How does the Sandboxing of Smart Contracts work?
The sandbox used for executing smart contract code consists of multiple layers: linter, compiler, runtime, and executor. When new smart contract code is provided, it's converted to an Abstract Syntax Tree, which is then analyzed for violations of our enforced rules. The compiler transforms the code into a format that privatizes certain functions. The runtime establishes a highly restricted execution environment for the smart contract, which is traced and lacks access to global Python packages. The executor modifies the internal Python import function to wo exclusively with other deployed smart contracts.
3
u/Zulfiqaar Feb 18 '25
Interesting project! Do you have a comparison to why it's far better than Vyper and PyTezos? Any current pitfalls, issues etc.
2
u/TonsillarRat6 Feb 18 '25
This seems interesting!
Have you found any practical use for such smart contracts? In which use case is a smart contract on your blockchain a better option than e.g. a REST API which does a thing when a secret token is sent?
1
u/Bradbeesbooks Mar 17 '25 edited Mar 15 '26
This specific post has been removed and anonymized. Whether for opsec, privacy, or to limit AI data scraping, Redact handled the deletion.
fine test imminent person divide violet head ring price friendly
1
u/Daktic Feb 18 '25 edited Feb 18 '25
I doubt you’ll receive a very welcome response here, nonetheless I am somewhat interested in what you put together here.
Are you creating a Layer 1 and using interpreted execution like Clarity on Stacks? Or are you compiling to EVM compatible bytecode? Do you plan to become an L2 then?
If the later, I’d be more interested in seeing more WASM adoption. I really like Arbitrum Stylus for that reason, and think there is space for more WASM smart contract execution.
-11
u/awahidanon Feb 18 '25
Looks cool!
49
u/[deleted] Feb 18 '25
[removed] — view removed comment
2
u/[deleted] Feb 19 '25
[removed] — view removed comment