Skip to content

Commit

Permalink
New welcome page + What is SUAVE (#31)
Browse files Browse the repository at this point in the history
* New welcome page + What is SUAVE

* fix build
  • Loading branch information
andytudhope authored Nov 3, 2023
1 parent e96784c commit 36a48bb
Show file tree
Hide file tree
Showing 8 changed files with 249 additions and 77 deletions.
10 changes: 5 additions & 5 deletions docs/how-to/create-contracts/ofa.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ Suave.Bid memory bid = Suave.newBid(
bidAllowedStores,
"mevshare:v0:unmatchedBundles"
);
Suave.confidentialStoreStore(bid.id, "mevshare:v0:ethBundles", bundleData);
Suave.confidentialStoreStore(bid.id, "mevshare:v0:ethBundleSimResults", abi.encode(egp));
Suave.confidentialStore(bid.id, "mevshare:v0:ethBundles", bundleData);
Suave.confidentialStore(bid.id, "mevshare:v0:ethBundleSimResults", abi.encode(egp));
```

The term "bid" is an artefact of earlier versions of suave-geth. Here, it is a general data identifier used when operating on confidential data.
Expand All @@ -56,19 +56,19 @@ Any searcher can listen for these events and use them to try and match backrun t
When the confidential compute request comes from a searcher looking to backrun a transaction (using the `newMatch` function), the MEV-Share SUAPP also merges the bids involved and stores those merged bids:

```solidity
Suave.confidentialStoreStore(bid.id, "mevshare:v0:mergedBids", abi.encode(bids));
Suave.confidentialStore(bid.id, "mevshare:v0:mergedBids", abi.encode(bids));
```

It is the `mergedBids` values in the mevshare keyspace that the block building SUAPP (i.e. the `EthBlockBidContract`) then fetches data from when looking to create a block and send it to an offchain relay. This happens with the `confidentialRetrieve` precompile:

```solidity
Suave.confidentialStoreRetrieve(allShareMatchBids[j].id, "mevshare:v0:mergedBids"), (Suave.BidId[])
Suave.confidentialRetrieve(allShareMatchBids[j].id, "mevshare:v0:mergedBids"), (Suave.BidId[])
```

or when it orders the merged bids by their effective gas price:

```solidity
Suave.confidentialStoreRetrieve(allBids[i].id, "mevshare:v0:ethBundleSimResults")
Suave.confidentialRetrieve(allBids[i].id, "mevshare:v0:ethBundleSimResults")
```

[All the code is here](https://github.com/flashbots/suave-geth/blob/main/suave/sol/standard_peekers/bids.sol#L65) if you want to run it yourself and develop your own picture of the total data flow in SUAVE.
Expand Down
2 changes: 1 addition & 1 deletion docs/how-to/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ SUAVE is focused on delivering credible, confidential computation that enables y
## What can I do with SUAVE?

1. **Deploy more expressive smart contracts.**
- Contracts on SUAVE follow the same rules as on Ethereum, with the added advantage of being able to access additional precompiles available to serve any MEV application. We call this [builder solidity](/builder-solidity).
- Contracts on SUAVE follow the same rules as on Ethereum, with the added advantage of being able to access additional precompiles available to serve any MEV application. We call this "builder solidity".

2. **Compute confidentially**.
- Builder solidity lets you request confidential computation, where your transaction data is encrypted to specific actors. Public contracts with verifiable logic, combined with confidential data, means that SUAVE can be seen as an open marketplace for mechanisms we can all inspect, collaborate on, and compete with to produce the most efficient MEV applications, while nevertheless protecting everyone's privacy.
Expand Down
35 changes: 34 additions & 1 deletion docs/how-to/run-suave/build-yourself.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,37 @@ If you try:
web3.eth.blockNumber
```

It should tell you the block height of your local network.
It should tell you the block height of your local network.

### Troubleshooting

<details>
<summary>1. Go permission errors</summary>
<div>
<div>
<div>
If you are seeing:<br/>
<code>
"cp: cannot create regular file '/bin/suave': Permission denied"
</code><br/><br/>
it is most likely because you have not set your GOPATH correctly. You can do so by running:<br/><br/>
<code>
export GOPATH=$HOME/go
</code>
</div>
</div>
</div>
</details>
<details>
<summary>2. Missing packages</summary>
<div>
<div>
<div>
If you have set up a new machine to run through this, you'll also need to install Make and Go:<br/>
<code>
sudo apt install make golang-go
</code>
</div>
</div>
</div>
</details>
32 changes: 1 addition & 31 deletions docs/how-to/run-suave/with-docker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -81,36 +81,6 @@ make devnet-down

### Troubleshooting

<details>
<summary>1. Go permission errors</summary>
<div>
<div>
<div>
If you are seeing:<br/>
<code>
"cp: cannot create regular file '/bin/suave': Permission denied"
</code><br/><br/>
it is most likely because you have not set your GOPATH correctly. You can do so by running:<br/><br/>
<code>
export GOPATH=$HOME/go
</code>
</div>
</div>
</div>
</details>
<details>
<summary>2. Missing packages</summary>
<div>
<div>
<div>
If you have set up a new machine to run through this, you'll also need to install Make and Go:<br/>
<code>
sudo apt install make golang-go
</code>
</div>
</div>
</div>
</details>
<details>
<summary>2. Docker not running</summary>
<div>
Expand All @@ -124,7 +94,7 @@ make devnet-down
<code>
sudo systemctl status docker
</code><br/><br/>
If you installed Docker and still run into issues wit docker-compose, you can try:<br/>
If you installed Docker and still run into issues with docker-compose, you can try:<br/>
<code>
sudo apt install docker-compose
</code>
Expand Down
130 changes: 107 additions & 23 deletions docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,117 @@ keywords:

# Start Building on SUAVE

Welcome to our first internal SUAVE hackathon. Let's start building better mechanisms.
<div class="warning">

There are two broad categories of work you can get involved with: creating precompiles and/or designing and implementing contracts for specific SUAPPs.
SUAVE is in alpha. We are currently on our first testnet, called Rigil. All software is liable to change often. There are no guarantees that your data will persist, or that it is fully confidential, or that it is secure. Proceed with caution.

It's likely that you will want to start by [runnning SUAVE locally](/how-to/run-suave) for both of these.
</div>

Alternatively, you can [transact or deploy a contract directly on the Rigil Testnet](/how-to/send-transactions#3-use-rigil-testnet-rpc).
## Explore

If you're not sure what to hack on, please read through our [ideas about what to build](/novel-use-cases) to get some inspiration.
Welcome. Let's start building better mechanisms.

## Important Terms
<div class="introGrid">
<a href="/how-to/run-suave" class="introLink">
<div class="introBlock">
<div class="introImage">
<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40" fill="none"><path d="M6.25 22.5L23.75 3.75L20 17.5H33.75L16.25 36.25L20 22.5H6.25Z" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg>
</div>
<div class="introText">
<div class="introHeading">
Run SUAVE locally
</div>
<div class="introDesc">
Start learning about what SUAVE can do by running it
</div>
</div>
</div>
</a>
<a href="/novel-use-cases" class="introLink">
<div class="introBlock">
<div class="introImage">
<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40" fill="none"><path d="M19.0333 25.2833L28.75 35C29.5833 35.8067 30.7003 36.2535 31.8601 36.2441C33.0199 36.2347 34.1295 35.7698 34.9497 34.9497C35.7698 34.1295 36.2347 33.0199 36.2441 31.8601C36.2535 30.7003 35.8067 29.5833 35 28.75L25.205 18.955M19.0333 25.2833L23.1933 20.2333C23.7217 19.5933 24.4267 19.19 25.2067 18.9567C26.1233 18.6833 27.145 18.6433 28.1117 18.7233C29.4147 18.8352 30.7244 18.6044 31.9107 18.0539C33.097 17.5033 34.1187 16.6521 34.8744 15.5847C35.6301 14.5173 36.0936 13.2708 36.2189 11.969C36.3441 10.6672 36.1267 9.35521 35.5883 8.16333L30.1283 13.625C29.2148 13.4138 28.379 12.9503 27.716 12.2873C27.0531 11.6243 26.5896 10.7885 26.3783 9.875L31.8383 4.415C30.6464 3.87661 29.3345 3.65924 28.0327 3.78447C26.7308 3.90971 25.4844 4.37318 24.417 5.12891C23.3496 5.88465 22.4984 6.90636 21.9478 8.09266C21.3972 9.27896 21.1664 10.5886 21.2783 11.8917C21.43 13.685 21.16 15.665 19.7717 16.8083L19.6017 16.95M19.0333 25.2833L11.275 34.705C10.899 35.1633 10.4312 35.5379 9.90166 35.8045C9.37215 36.0711 8.79268 36.2239 8.20055 36.2531C7.60842 36.2822 7.01674 36.1871 6.46361 35.9737C5.91048 35.7604 5.40814 35.4336 4.98894 35.0144C4.56973 34.5952 4.24294 34.0928 4.0296 33.5397C3.81627 32.9866 3.72111 32.3949 3.75025 31.8028C3.7794 31.2107 3.9322 30.6312 4.19882 30.1017C4.46544 29.5722 4.83998 29.1043 5.29833 28.7283L16.6933 19.345L9.84833 12.5H7.5L3.75 6.25L6.25 3.75L12.5 7.5V9.84833L19.6 16.9483L16.6917 19.3433M30.625 30.625L26.25 26.25M8.11166 31.875H8.125V31.8883H8.11166V31.875Z" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg>
</div>
<div class="introText">
<div class="introHeading">
Novel Use Cases
</div>
<div class="introDesc">
Get inspiration for what to build
</div>
</div>
</div>
</a>
</div>

Here are all the key terms you'll find in these docs. The names and descriptions will evolve as the software does.
Once you have SUAVE running, there are two broad categories of work you can get involved with:

| Term | Description |
| --- | --- |
| SUAPP | SUAVE application. For now, a smart contract that uses SUAVE precompiles. Frontend optional. |
| Rigil Testnet | The current test network. Naming convention follows the stars in the Alpha Centauri system. |
| SUVE Chain | a fork of Ethereum designed to facilitate credible, confidential execution in MEV use cases. |
| Kettle | The main logical actor in the SUAVE protocol. We don't call it a "node" because it's at least two nodes (and some other services) in a trenchcoat. |
| MEVM | Modified EVM, where the modifications enable credible, confidential computation. |
| Precompile | A convenient way to enable direct execution of predefined functions in the EVM, meant to enable more interesting SUAPPs. |
| Confidential Compute Request (CCR) | A user request to Suave that contains (1) information such as `to` address and `calldata`, (2) confidential inputs, and (3) a list of SUAPPs and Kettles allowed to operate on confidential inputs. |
| SUAVE transaction | The transaction object that is broadcast on the SUAVE Chain. Contains the result of a CCR in its calldata + the signature of the Kettle(s) which computed said result. |
| SUAVE Chain | A fork of Ethereum, currently running Clique PoA consensus for rapid iteration. Main purpose is to reach (and maintain) consensus about smart contract code. |
| Confidential Data Store | A privacy-centric networked storage system specifically tailored to enable programmable privacy in SUAPPs. |
| Bid | An artefact from early development, which is now just a Data Identifier used when operating on confidential data. For instance, a SUAVE transaction can emit logs on chain which reference the `bidId` from a CCR without revealing the confidential inputs to that CCR. |
| Peekers | Contracts with the correct permissions - granted by users in CCRs - to get and put data in the Confidential Data Store |
| Builder solidity | solidity with access to precompiles that help facilitate the processing of transactions and intents. |
| RPC | Remote Procedure Call which, in Rigil, receives user transactions, moves confidential inputs to the Confidential Data Store, and passes CCRs to MEVM. |
<div class="introGrid">
<a href="/how-to/create-contracts/deploy-custom" class="introLink">
<div class="introBlock">
<div class="introImage">
<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40" fill="none"><path d="M10.1916 8.65L10.7233 11.8383C11.0658 13.8947 12.0425 15.7926 13.5166 17.2667L16.25 20L15.605 21.2917C15.2433 22.0133 15.385 22.885 15.955 23.455L18.2016 25.7017C18.5516 26.0517 18.75 26.53 18.75 27.0267V28.8417C18.75 29.5517 19.15 30.2 19.7866 30.5183L20.0416 30.645C20.7633 31.0067 21.635 30.865 22.205 30.295L23.41 29.09C25.2681 27.2315 26.5862 24.903 27.2233 22.3533C27.3062 22.0228 27.2942 21.6756 27.1886 21.3516C27.0831 21.0276 26.8883 20.74 26.6266 20.5217L24.41 18.675C23.9916 18.325 23.44 18.1767 22.9016 18.2667L20.9516 18.5917C20.6574 18.6407 20.3557 18.6187 20.0716 18.5277C19.7876 18.4367 19.5293 18.2792 19.3183 18.0683L18.8266 17.5767C18.6525 17.4026 18.5144 17.1959 18.4202 16.9684C18.326 16.7409 18.2775 16.4971 18.2775 16.2508C18.2775 16.0046 18.326 15.7608 18.4202 15.5333C18.5144 15.3058 18.6525 15.0991 18.8266 14.925L19.0433 14.705C19.3219 14.4264 19.6812 14.2427 20.0701 14.1799C20.459 14.117 20.8578 14.1783 21.21 14.355L22.215 14.8583C22.4682 14.9855 22.7551 15.0296 23.0349 14.9845C23.3146 14.9393 23.5731 14.8072 23.7734 14.6068C23.9738 14.4064 24.106 14.148 24.1511 13.8682C24.1963 13.5885 24.1521 13.3016 24.025 13.0483L23.75 12.5L25.8433 11.105C26.9289 10.3807 27.8067 9.38573 28.39 8.21834L28.6333 7.73167M10.1916 8.65C7.8285 10.6922 6.16176 13.421 5.42394 16.4559C4.68613 19.4908 4.91405 22.6803 6.07591 25.5794C7.23777 28.4785 9.27561 30.9426 11.9051 32.628C14.5346 34.3134 17.6247 35.1359 20.7441 34.9809C23.8635 34.8258 26.8567 33.7009 29.3061 31.7631C31.7555 29.8252 33.539 27.1712 34.4076 24.1711C35.2762 21.1711 35.1867 17.9747 34.1516 15.028C33.1165 12.0812 31.1873 9.52941 28.6333 7.73167M10.1916 8.65C12.9142 6.29069 16.3974 4.99445 20 5C23.215 5 26.1933 6.01 28.6333 7.73167" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg>
</div>
<div class="introText">
<div class="introHeading">
Design and deploy SUAPPs
</div>
<div class="introDesc">
Begin building better mechanisms
</div>
</div>
</div>
</a>
<a href="/how-to/run-suave" class="introLink">
<div class="introBlock">
<div class="introImage">
<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40" fill="none"><path d="M35 12.5L20 3.75L5 12.5M35 12.5L20 21.25M35 12.5V27.5L20 36.25M5 12.5L20 21.25M5 12.5V27.5L20 36.25M20 21.25V36.25" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg>
</div>
<div class="introText">
<div class="introHeading">
Create precompiles
</div>
<div class="introDesc">
Write novel things
</div>
</div>
</div>
</a>
</div>

## Community

If you'd like to discuss ideas for SUAVE or begin contributing, you can find us in our forum or our repos:

<div class="introGrid">
<a href="https://collective.flashbots.net/c/suave/27" class="introLink">
<div class="introBlock">
<div class="introImage">
<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40" fill="none"><path d="M20 10.07C17.2527 7.60561 13.6907 6.24492 10 6.25002C8.24667 6.25002 6.56333 6.55002 5 7.10335V30.8533C6.60603 30.2867 8.29694 29.9981 10 30C13.8417 30 17.3467 31.445 20 33.82M20 10.07C22.7472 7.60547 26.3093 6.24476 30 6.25002C31.7533 6.25002 33.4367 6.55002 35 7.10335V30.8533C33.394 30.2867 31.7031 29.9981 30 30C26.3093 29.9949 22.7473 31.3556 20 33.82M20 10.07V33.82" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg>
</div>
<div class="introText">
<div class="introHeading">
Discuss on our forum
</div>
<div class="introDesc">
Get feedback on your ideas before diving deeper
</div>
</div>
</div>
</a>
<a href="https://github.com/flashbots/suave-geth/blob/main/CONTRIBUTING.md" class="introLink">
<div class="introBlock">
<div class="introImage">
<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40" fill="none"><path d="M13.75 11.25H33.75M13.75 20H33.75M13.75 28.75H33.75M6.25 11.25H6.26167V11.2633H6.25V11.25ZM6.875 11.25C6.875 11.4158 6.80915 11.5747 6.69194 11.6919C6.57473 11.8092 6.41576 11.875 6.25 11.875C6.08424 11.875 5.92527 11.8092 5.80806 11.6919C5.69085 11.5747 5.625 11.4158 5.625 11.25C5.625 11.0842 5.69085 10.9253 5.80806 10.8081C5.92527 10.6908 6.08424 10.625 6.25 10.625C6.41576 10.625 6.57473 10.6908 6.69194 10.8081C6.80915 10.9253 6.875 11.0842 6.875 11.25ZM6.25 20H6.26167V20.0133H6.25V20ZM6.875 20C6.875 20.1658 6.80915 20.3247 6.69194 20.4419C6.57473 20.5592 6.41576 20.625 6.25 20.625C6.08424 20.625 5.92527 20.5592 5.80806 20.4419C5.69085 20.3247 5.625 20.1658 5.625 20C5.625 19.8342 5.69085 19.6753 5.80806 19.5581C5.92527 19.4408 6.08424 19.375 6.25 19.375C6.41576 19.375 6.57473 19.4408 6.69194 19.5581C6.80915 19.6753 6.875 19.8342 6.875 20ZM6.25 28.75H6.26167V28.7633H6.25V28.75ZM6.875 28.75C6.875 28.9158 6.80915 29.0747 6.69194 29.1919C6.57473 29.3092 6.41576 29.375 6.25 29.375C6.08424 29.375 5.92527 29.3092 5.80806 29.1919C5.69085 29.0747 5.625 28.9158 5.625 28.75C5.625 28.5842 5.69085 28.4253 5.80806 28.3081C5.92527 28.1908 6.08424 28.125 6.25 28.125C6.41576 28.125 6.57473 28.1908 6.69194 28.3081C6.80915 28.4253 6.875 28.5842 6.875 28.75Z" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg>
</div>
<div class="introText">
<div class="introHeading">
Start contributing
</div>
<div class="introDesc">
See the code and understand how we work together
</div>
</div>
</div>
</a>
</div>
4 changes: 2 additions & 2 deletions docs/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = {
collapsed: false,
link: { type: 'doc', id: 'index' },
items: [
'novel-use-cases',
'what-is-suave', 'novel-use-cases',
],
},
{
Expand Down Expand Up @@ -74,7 +74,7 @@ module.exports = {
{
type: 'link',
label: 'Forum',
href: 'https://collective.flashbots.net/',
href: 'https://collective.flashbots.net/c/suave/27',
},
{
type: 'link',
Expand Down
Loading

0 comments on commit 36a48bb

Please sign in to comment.