Please describe your proposed solution.
Smart Beacons is a framework for routing transactions. It is essentially AdaHandles for Smart Contract addresses.
For example consider the following transaction:
A user, Bob, is sending 15 ADA to the Smart Beacon @ada-to-min. The wallet resolves the address of @ada-to-min (which is the address of the router smart contract) and builds the transaction sending a UTxO with 15 ADA to the router smart contract including Bob's address in the UTxO's datum. The UTxO that is locked at the router smart contract is then spent by a routing agent (anyone can be a routing agent) to a DEX as a swap request. The router script enforces that the datum of the swap request correctly specifies that the beneficiary of the swap is the correct party (in this case Bob). Once the swap request is submitted by the DEX's batchers, the user will receive the some number of MIN tokens (depends on the current balance of the pool). There is a 1 ADA fee awarded to the routing agent, so the amount of MIN token the sender would receive is equivalent to the amount they would get if they swapped 14 ADA directly on the DEX UI.
It doesn’t need to be a swap, this can be done for any arbitrary smart contract interaction
For instance sending funds to @offer-spacebudz (which resolves to a router smart contract for SpaceBudz collection offers) could create a collection offer for SpaceBudz on some NFT marketplace. Each smart handle requires a custom routing smart contract. As a proof of concept, we have only implemented the routing script for @ada-to-min that was described above.
How does your proposed solution address the challenge and what benefits will this bring to the Cardano ecosystem?
Right now, most interaction with smart contract protocols is done through centralized front-end services where the transactions are built and submitted through centralized backend infrastructure. In addition to the negative impact this has on decentralization, it is also really hampers adoption through the restrictions it imposes. For instance, users with mobile wallets have severely limited options when it comes to interacting with DApps. Also, regular users will be unable to interact with most DApps if the DApp front-end were to become unavailable for any reason or if the backend was down.
There are a few attempts to address this problem, such as DApp Schemas or Smart Contract Blueprints; however, all of these solutions rely on offchain infrastructure to specify how to interpret a DApp's datums, redeemers, and other onchain data in order to build transactions. Smart Beacons differs from these other approaches in that it is a fully onchain solution that does not rely on offchain infrastructure.
A Smart Beacon is an NFT that lives at a UTxO locked in a spending validator; the datum of the UTxO specifies how to interact with the spending validator that locks it. The datum is in essence an onchain Schema describing how to interact with the associated DApp (or at-least with the spending validator that locks the associated UTxO).
How do you intend to measure the success of your project?
The most important metric for measuring the success of this framework is the feedback of developers who use it, and the wallets that adopt it. We will also track the number of wallets that integrate with this standard. Finally, the number of stars, forks and closed issues on the Github repo is a great naïve indicator for the success of this project. The entire process of development is easily trackable by viewing the Github commits and issues.
Please describe your plans to share the outputs and results of your project?
The resulting code and framework will be entirely open-sourced. A large amount of effort will go towards helping wallets integrate with Smart Beacons, including creating PRs to assist with integration on behalf of open-source wallets.
The router script framework will be shared with developers throughout the ecosystem including:
- Emurgo Academy Lectures
- IOHK Developer Experience Working Group
- Developer Twitter Spaces
We will attempt to add the documentation to use and integrate with this framework to all the open-source documentation sources in the ecosystem (cardano developer portal, plutonomicon, working group discord)