Inspiration
The inspiration for our project at the Aleph Zero hackathon comes from seeing big companies like Fidelity and BlackRock launching crypto ETFs. We thought, why not create something similar but in a decentralized world?
We developed this solution on Using Aleph Zero, we're developing a user-friendly way to invest in a mix of digital assets, similar to these big ETFs, but with a twist – it's all on the blockchain. This makes it more open and transparent.
Right now, we're using digital tokens that can be traded or represent a share in the investment. The exciting part is that, in the future, these tokens could even represent real things like property or art. This means you could own a piece of these real assets through digital tokens, making investing more accessible to everyone.
The logo of XTF is a multi-layered cake, symbolizes the integration of various assets into a unified investment, and offers investors a 'slice' of this diversity in the asset pool!

What it does
Our project on Aleph Zero introduces a decentralized Exchange-Traded Fund (ETF) that brings a new level of accessibility and transparency to digital asset investment. Here’s a snapshot of what our system does:
Creates a Diversified Investment Pool: We set up various 'vaults,' each containing a specific mix of digital assets. This structure allows investors to spread their risk across different types of assets, much like traditional ETFs.
Enables User Participation: Investors can contribute specific assets to these vaults. In return, they receive ETF share tokens, as soon as they deposit enough funds in a small vault, which represent their stake in the pooled investments. Dividing the pool into smaller vaults makes it easier for users to participate in the protocol
Facilitates Asset Redemption: Unlike traditional ETFs, our system allows investors to redeem their share tokens for the actual underlying assets in the vaults. This feature adds a layer of flexibility and control for the token holders.
Ensures Transparent Ownership: Each share token directly represents ownership in the pool of assets, making the investment process transparent and straightforward.
Users who own the required assets (like TokenA and TokenB) can deposit them into one of these vaults. In return, the ETF contract creates (or 'mints') a certain number of ETF share tokens – let's say 100 shares per vault. These share tokens represent a piece of ownership in the entire pool of investments. People can trade these ETF shares just like they would with any other token. And if someone gathers enough shares – say 100 – they can use these to 'unlock' a vault in the ETF and take out (redeem) the actual assets stored there. This is a key feature that sets our system apart from traditional ETFs. It reveals the real ownership of shares in the pool and gives users direct access to the underlying assets.
How we built it
The technical backbone of our Aleph Zero XTF project consists of three key contracts:
Fungible Token Contract (ERC20 like): Implements the ERC20 standard, creating simple, tradable tokens. These tokens are the basic units of ownership and transaction in our system.
Escrow Contract (Vault Asset): This contract acts as a secure storage for the various tokens or assets. It defines the conditions under which these assets can be accessed or redeemed.
ETF Contract (Vaults and ETF Shares tokens Manager ): An extension of the first two contracts, the ETF contract is the heart of the operation. It initializes the ETF by defining the number of vaults and the required asset mix for each vault. When users deposit the specified assets into a vault, the ETF contract mints ETF share tokens, correlating with the value of their contribution. These tokens can be traded or used to redeem the underlying assets in the vaults, providing a clear representation of ownership in the investment pool.
Through this structure, our system bridges the gap between traditional ETFs and the flexibility of blockchain technology, offering a novel way to invest in and manage digital assets.
Challenges we ran into
During the development of our project on Aleph Zero. I developed similar projects in other blockchain environments and here I encountered a range of challenges that tested me, particularly around the use of Rust and ink! for smart contract development:
Learning Curve with Rust and ink!: Getting started with Rust and ink! was a challenge in itself. The complexity increased when dealing with different versions of ink!, leading to compatibility issues. Rust, while powerful, presents a steep learning curve, especially for those accustomed to other programming languages commonly used in blockchain development.
Defining Common Traits and Interfaces: Crafting common traits and interfaces that could be used across different contracts proved to be a tough task, especially when exporting them. This process was made more intricate by the necessity to use selectors and other features of ink!, which at times felt like it was adding complexity rather than simplifying the development process.
Managing Nested Data Structures: One of the significant challenges was dealing with nested data structures, such as mappings of objects or mappings of mappings. Unlike other smart contract development environments, creating these structures in ink! often required deploying new contracts for each mapping value and passing references in terms of hashcodes and addresses, complicating our deployment strategy. This aspect demanded much more time and attention, despite its benefits in increasing security and performance. The requirement to deploy new contracts for complex data structures not only added layers of complexity but also made the deployment strategy more complicated.
Despite these challenges, some aspects greatly aided the development process:
Explorer Tool: The Explorer tool was a lifesaver, allowing us to test our smart contracts directly on the Testnet. This feature significantly streamlined our testing and debugging process.
ink! Hackathon Template Next.js: The ink! The Hackathon template was another invaluable resource. It enabled us to set up an application in less than an hour, even as a solo developer. This efficiency was crucial in maintaining momentum and focus throughout the development phase.
Accomplishments that we're proud of && What we learned
As a solo developer, my journey in the Aleph Zero hackathon has been exceptionally rewarding. In just a few days, I dove into a new programming language, tackled an unfamiliar blockchain, and harnessed a new framework. My ability to quickly grasp these elements, conceive an innovative idea, and then successfully deploy it on the testnet is an accomplishment I'm particularly proud of. The Aleph Zero platform, with its low costs and high performance, played a pivotal role in my project's success. Overcoming the challenges of learning and developing in a new environment alone, and seeing my concept come to life, underscores my dedication and passion for blockchain innovation. This experience has not only been a testament to my technical skills but also to my resilience and capability as an individual developer in the dynamic world of blockchain technology.
What's next for Alpeh-zero XTF
Looking ahead, there are several exciting avenues to explore for the Aleph Zero XTF project, each aiming to enhance its functionality and appeal:
Enhanced User Participation: Implement the ability for users to make partial contributions to vaults, increasing accessibility and flexibility for investors of all capacities.
Oracle Service Integration: Explore the use of Oracle services for real-time asset valuation, ensuring contributions are accurately assessed and fairly rewarded.
Interoperability Exploration: Investigate the potential for creating a cross-blockchain ETF, leveraging Aleph Zero's interoperability to include assets from various blockchain ecosystems.
Dynamic Asset Rebalancing: Enable ETF administrators to adjust the asset mix in response to market conditions, optimizing fund performance.
Generic Fund Model Development: Expand beyond a traditional ETF to a more versatile fund where users invest in a general pool, while administrators manage asset strategies. Investigate the use of privacy protocols to maintain privacy (zk-like) in investment strategies, adding an extra layer of security and intrigue.

Contracts Addresses in Testnet
TokenA {5DZhRhAjLpmHEKckhmrcdkwWwGdq1153uyQGWoZHUseh8BND}: An ERC20 token used in the asset mix of etf
TokenB {5E6t8xbqZdsFTJLb8HsgiTzQgsDwwAsc35GM2yZv6gNugVnm}: A ERC20-like token used in the asset mix of ETF.
ETF {5E5VP5Dd6ep9PT4ZJcr4vwPwv4Fy3QsmCZ8JfbsrSwwTkjXF}: A escrow that can secure in vaults the required asset mix of (token A:100, token B: 200) and give in exchange ETF pool shares tokens (another ERC20 token representing ownership in the pool). Those tokens can be traded and also used to redeem the vault assets.
XTF encoded storage key: 0x4342193e496fab7ec59d615ed0dc553008362995834169885de7f4fd67196e675911b7104d10db0d29f8607dfc16c3c8a3b2c7c23611919881b58318ac5bff2d
Useful links
Initial Contract repo:https://github.com/GaetanoMondelli/alephXtf
Webapp + contract repo: https://github.com/GaetanoMondelli/xrf-inkathon-degen
Youtube: https://youtu.be/Ue_6Jay-0_I
Slide deck: https://docs.google.com/presentation/d/1rYJAzBxdS95zvmRpr6Fdi7vF69RjlsulfH6TQydihIc/edit#slide=id.p
Vercel App: http://xrf-inkathon-degen.vercel.app


Log in or sign up for Devpost to join the conversation.