# Vapor Technologies
Vapor Technologies offers an innovative approach to distributing software packages on the Urbit network by leveraging the Ethereum blockchain to manage ownership through non-fungible tokens (NFTs). Utilizing the ERC721 and ERC1155 standards, Vapor introduces a new payment rail for open-source software on Urbit, enabling a secure and decentralized method for software distribution and ownership management. When a user acquires an NFT representing a specific software package, the associated software is automatically transferred to and installed on the user-owned Urbit node(s). This seamless integration of blockchain technology and the Urbit network unlocks new possibilities for software monetization and distribution in the digital ecosystem.
This document serves as an introduction to the Vapor technology stack. It will also draw to light some incidental benefits of VaporWares over classical NFT implementations.
## The Humors
VaporWares come in 4 kinds, or humors. In all but the 4th humor, VaporWares are "0 hoon solutions", meaning the provider of a VaporWare need not learn Hoon (the unique and sometimes challenging programming language of Urbit) to participate. Classical Web technologies are sufficient (JavaScript, HTML, CSS). The four kinds of Humors follow:
* First Humor - Singular Experience
* A software product with minimal "networking" (shared state discretely between Urbits owned by an Ethereum address).
* Designed using Classical Web technologies.
* Second Humor - Communal Computing
* A software product with basic networking functionality between owners of the same software product.
* Effectively, Second Humor VaporWares have both an "owner state" and a "global state", on Urbit. The transition functions of the "global state" are defined in the software itself.
* Designed using Classical Web technologies.
* Third Humor - The ERC995 of Urbit
* A software product with self-specified "networking" (shared as specified, between various Urbits that own compatible VaporWares).
* Vapor Ware (the Gall agent, contrast "VaporWare", the software) interprets and provides the API for this Humor of VaporWare to intercommunicate.
* Designed using Classical Web technologies.
* May be utilized by other Urbit software distributed through other means (including VaporWares of the Fourth Humor).
* Fourth Humor - The Fourth Kind
* A full Urbit software product, written in Hoon, transferred to an Urbit on purchase of a corresponding Vapor token.
* There are no limits as to the functionality of a Fourth Humor VaporWare, outside of those imposed by the underlying platform (Urbit).
* Written in Hoon, preferably by Quartus.
## Ethereum Ownership
Vapor employs the widely-used NFT ERC standards ([ERC-721](https://eips.ethereum.org/EIPS/eip-721) and [ERC-1155](https://eips.ethereum.org/EIPS/eip-1155)) to control ownership of Vapor Software (hereafter VaporWares). While Vapor can technically support both semi-fungible and non-fungible tokens, it is designed to work exclusively with non-fractional tokens, ensuring discrete ownership for each token tied to an Ethereum address. Consequently, Vapor disregards ERC20 and does not consider meta-contracts that may attempt to fractionalize Vapor tokens. Although meta-contract fractionalizations are feasible and would not disrupt the system, they are not the focus of this document.
### Added Value: URI Storage
VaporWares are based on the ERC standards used for NFT and semi-fungible tokens. Such tokens commonly include URI data. An additional benefit of VaporWares over classical NFT/semi-fungible token technology is that the URI data of a given Vapor token is replicated to private, local storage on the owner's Urbit after purchase.
### Method: Transfer of Ownership
Vapor relies on the following functions, per standard:
- ERC721:
- Transfer
- ERC1155:
- TransferSingle
- TransferBatch
While the Mint function in ERC721 and ERC1155 is not defined by the standard, best practices dictate that implementations should emit Transfer or TransferSingle/TransferBatch events to the log when called (hereafter Transfer events). Adhering to this best practice is mandatory for Vapor.
Vapor utilizes the Transfer events emitted by ERC721 and ERC1155 contracts to determine changes in software ownership. When a Vapor token is transferred to an Ethereum address that also owns one or more Urbits, the software associated with that token is automatically transferred to and installed on the Urbits associated with that address.
Aside from recording ownership transfers on the Ethereum blockchain, all Vapor-related computations take place within Urbit(s). Vapor leverages both existing and novel Urbit programs (hereafter Gall agents) to facilitate these computations.
## Gall Agent Interactions
The Gall agents utilized by Vapor are as follows:
* %vapor-make - A toolkit for creators of VaporWare.
* %eth-watcher - An Ethereum event log collector.
* %treaty - A manager of access permissions for Urbit software.
* %vapor-ware - A studio and launcher for viewing and accessing owned VaporWares.
* %fourth-humor - A Gall agent that will be distributed by Vapor (optional).
The rest of this document will discuss in further detail the interoperation of these agents. A reference diagram follows:

### %vapor-make
Vapor Make allows a producer of some software to specify a contract and, on a per token basis, upload or attach a software to that token. From there, Vapor Make automatically watches the blockchain for transfers of ownership and transmits offers to install software to any Urbit ship owned by an Ethereum address that buys or is transferred the corresponding token.
Vapor Make also manages global state for Vapor tokens, where applicable.
### %eth-watcher
Eth Watcher is part of the core Urbit stack. It is maintained as core infrastructure for the PKI of Urbit. Thankfully, it is configurable for Vapor's purposes as well. Eth Watcher is used to aggregate events from the event log on the Ethereum Blockchain, using log filters. Vapor uses Eth Watcher to watch for transfers of Vapor tokens.
### %treaty
For Fourth Humor vapors, Vapor Make uses Treaty to manage permissions for the distribution of the Fourth Humor hoon agent.
### %vapor-ware
Vapor Ware (the Gall agent) is the "client" agent for VaporWares (hence the name). When an Urbit pilot purchases a Vapor token, the producer's Vapor Make agent will reach out to the purchaser's Vapor Ware agent and queue a download. The Urbit pilot/purchaser can then download and back up the URI data of the NFT they purchased, and, additionally, download and install the VaporWare software corresponding to that token.
Vapor Ware also manages state transitions for VaporWares, where applicable.
### %fourth-humor
This is a speculative hoon agent that could do _anything_.
## Example: Alan Bolton, Visionary NFT Artist
Our first client is the visionary artist, Alan Bolton, celebrated for his mesmerizing 3D rendered videos and images that have captured the imagination of the NFT community. In the past, Alan's artwork faced limitations due to the constraints of URI storage, which is generally public, static, and dependent on a serving platform (such as IPFS) for enduring persistence.
Vapor Technologies revolutionizes the experience for Alan's collectors by offering:
1. **Exclusive private ownership**: Vapor empowers collectors with the replication of public URI data to their personal Urbit nodes, ensuring unparalleled private ownership of the treasured artwork.
2. **Immersive and enriched experiences**: Harnessing the power of basic Classical Web technology, Alan can now deliver a deeply engaging experience that transcends traditional artwork presentation. This includes, but is not limited to:
- Interactive environments that transport collectors into the captivating world of Alan's art
- Additional views, re-renderings, and conceptions, unveiling new dimensions of the original artwork
- Behind-the-scenes access to creator commentary, unlocking the mysteries behind the creative process
3. **Direct collector feedback**: Vapor fosters a unique connection between the artist and collectors, providing an opportunity for collectors to share their invaluable feedback directly with the visionary creator.
This groundbreaking collaboration with Alan Bolton exemplifies the potential of a First Humor implementation of VaporWares, setting the stage for an extraordinary journey of growth and innovation within the platform. With this foundation, we invite you to embark on a voyage of discovery as we explore the boundless possibilities for future developments.