Skip to content

Commit

Permalink
Add Single-Writer Apps list to Learn, update Glossary to match
Browse files Browse the repository at this point in the history
  • Loading branch information
Clay-Mysten authored and kchalkias committed Jul 20, 2022
1 parent e39ef78 commit 69cea16
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 5 deletions.
4 changes: 3 additions & 1 deletion doc/src/learn/how-sui-works.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ But contrary to a blockchain, Sui does not stop the flow of transactions in orde

## Simple transactions

[Many transactions](https://eprint.iacr.org/2019/611.pdf) do not have complex interdependencies with other, arbitrary parts of the blockchain state. Often financial users just want to send an asset to a recipient, and the only data required to gauge whether this simple transaction is admissible is a fresh view of the sender's account. This observation allows Sui to forgo [consensus](https://pmg.csail.mit.edu/papers/osdi99.pdf) and instead use simpler algorithms based on [Byzantine Consistent Broadcast](https://link.springer.com/book/10.1007/978-3-642-15260-3). These protocols are based on the [FastPay](https://arxiv.org/abs/2003.11506) design that comes with peer-reviewed security guarantees. In a nutshell, Sui takes the approach of taking a lock (or "stopping the world") only for the relevant piece of data rather than the whole chain. In this case, the only information needed is the sender account, which can then send only one transaction at a time.
[Many transactions](https://eprint.iacr.org/2019/611.pdf) do not have complex interdependencies with other, arbitrary parts of the blockchain state. Often financial users just want to send an asset to a recipient, and the only data required to gauge whether this simple transaction is admissible is a fresh view of the sender's account. This observation allows Sui to forgo [consensus](https://pmg.csail.mit.edu/papers/osdi99.pdf) and instead use simpler algorithms based on [Byzantine Consistent Broadcast](https://link.springer.com/book/10.1007/978-3-642-15260-3). See our list of potential [single-writer apps](single-writer-apps.md) for examples of real-world simple transactions.

These protocols are based on the [FastPay](https://arxiv.org/abs/2003.11506) design that comes with peer-reviewed security guarantees. In a nutshell, Sui takes the approach of taking a lock (or "stopping the world") only for the relevant piece of data rather than the whole chain. In this case, the only information needed is the sender account, which can then send only one transaction at a time.

Sui further expands this approach to more involved transactions that may explicitly depend on multiple elements under their sender's control, using Move’s object model and leveraging Move's strong ownership model. By requiring that dependencies be explicit, Sui applies a _multi-lane_ approach to transaction validation, making sure those independent transaction flows can progress without impediment from the others.

Expand Down
30 changes: 30 additions & 0 deletions doc/src/learn/single-writer-apps.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

---
title: Sui Single-Writer-Friendly (SWF) apps
---

This page lists applications that can work in the single-writer model defined as [simple transactions](how-sui-works.md#simple-transactions) in Sui. Some proposals that typically require shared objects have been transformed to variants that require only a shared object as a final step and not for every action, such as voting and lotteries, DeFi Oracle price quotes, etc.

1. Regular peer-to-peer (p2p) transactions ([see how to create a new Coin with just 7 lines of Sui Move code](https://www.linkedin.com/posts/chalkiaskostas_startup-smartcontract-cryptocurrency-activity-6946006856528003072-CvI0)).
1. Confidential p2p Txs: same as FastPay but with pedersen commitments to hide amounts transferred; this still ensures input amount = output amount - we can set amount limits, i.e., N transfers up to $1,000 can be confidential.
1. Public bulletin board; users store only publicly accessed data, files, links, metadata.
1. Proof of existence: the above with time-stamped documents - it can be extended to support commitment proof of existence (publish your hash then reveal).
1. Private decentralized repository (users store private files, encrypted under their pub keys); the pubKeys can be NFTs.
1. Extend the above for selected disclosure CV (resume) repository, Uni degrees repository.
1. Decentralized or conventional Certificate Authority. Authorities publish their signatures over certs, they can revoke any time (easier revocation).
1. Messaging service: apps, Oracles and Internet of things (IoTs) exchanging messages. Sui is probably the best platform for any messaging protocol, as typically each response and message can be encoded with a single writer NFT.
1. Extend the above to social networks (Suitter) - note that each post is a single-writer NFT. See a [smart contract implementation of a fully functional decentralized Twitter with just 50 lines of Sui Move code](https://github.com/MystenLabs/sui/blob/main/sui_programmability/examples/nfts/sources/chat.move).
1. Extend the above to private messaging (Suignal).
1. Extend the above for any website / blog / rating platform (ie Yelp, Tripadvisor).
1. Personal GitHub, Overleaf LaTex editor, wish/shopping lists, etc.
1. Personal password manager.
1. Non-interactive games (i.e., advertise/evolve your SimCity, FarmVille state, etc.).
1. Coupons and Tickets. See a [full dApp demo and installation instructions on how to build a mass-minting coupon platform with Sui](https://github.com/MystenLabs/sui/blob/sui-coupon-v0/examples/coupons/README.md).
1. Mass minting of game assets.
1. Optimistic Decentralized Lottery: a new variant which needs only shared objects to declare winner but not to buy tickets; thus only one out of the million flows needs consensus.
1. Same for voting (each vote is an NFT) - only the aggregation part at the end needs to support fraud proofs with shared objects or have this happen at the application layer.
1. Same for most auction types (each bid is an NFT) - declaring a winner can be challenged by fraud proofs; thus, it’s the only step that requires a shared object.
1. Timed-release encrypted messages / gift cards, etc. (Send encrypted messages to the future.)
1. Posting price quotes (i.e., from Oracles, Pyth, etc.) can be *single writer*, and a DEX trade can utilize shared objects. So Oracles can 100% work on the single-writer model.
1. Job Listing + applications (i.e., a decentralized Workable).
1. Real estate contract repository: for tracking purposes only - payment is offline, otherwise it would be an atomic swap.
6 changes: 3 additions & 3 deletions doc/src/learn/sui-glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ For more information, see [Sui Objects](../build/objects.md).
A [smart contract](https://en.wikipedia.org/wiki/Smart_contract) is an agreement based upon the protocol for conducting transactions in a blockchain. In Sui, smart contracts are written in the [Move](https://github.com/MystenLabs/awesome-move) programming language.


### Single-owner objects
### Single-writer objects

Single-owner objects are owned by one account. In Sui, transactions affecting only single-owner objects owned by the same address may proceed with only a verification of the sender’s address, greatly speeding transaction times. We refer to these as *simple transactions*.
Single-writer objects are owned by one account. In Sui, transactions affecting only single-writer objects owned by the same address may proceed with only a verification of the sender’s address, greatly speeding transaction times. We refer to these as *simple transactions*. See [Single-Writer Apps](single-writer-apps.md) for example applications of this simple transaction model.

### Sui/SUI

Expand All @@ -123,7 +123,7 @@ For more information, see [Causal order vs total order](sui-compared#causal-orde

### Transaction

A transaction in Sui is a change to the blockchain. This may be a *simple transaction* affecting only single-owner, single-address objects, such as minting an NFT or transferring it or another token. These transactions may bypass the consensus protocol in Sui.
A transaction in Sui is a change to the blockchain. This may be a *simple transaction* affecting only single-writer, single-address objects, such as minting an NFT or transferring it or another token. These transactions may bypass the consensus protocol in Sui.

More *complex transactions* affecting objects that are shared or owned by multiple addresses, such as asset management and other DeFi use cases, go through the [Narwhal and Tusk](https://github.com/MystenLabs/narwhal) DAG-based mempool and efficient Byzantine Fault Tolerant (BFT) consensus.

Expand Down
6 changes: 5 additions & 1 deletion doc/src/navconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,16 @@
"label": "Conduct Transactions",
"fileName": "build/transactions"
},
{
"label": "Create Single-Writer Apps",
"fileName": "learn/single-writer-apps"
},
{
"label": "Understand Validators",
"fileName": "learn/architecture/validators"
},
{
"label": "Sui Consensus Engine",
"label": "Employ Consensus Engine",
"fileName": "learn/architecture/consensus"
}
]
Expand Down

0 comments on commit 69cea16

Please sign in to comment.