Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .zed/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[
{
"label": "Docs Dev Server",
"command": "nix run .#docs-dev-server -L",
"use_new_terminal": true
},
{
"label": "Build Docs",
"command": "nix build .#docs -L",
"use_new_terminal": true
},
{
"label": "Build App",
"command": "nix build .#app -L",
"use_new_terminal": true
}
]
8 changes: 8 additions & 0 deletions docs/astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,14 @@ export default defineConfig({
{
label: "Connect",
items: [
{
label: "Existing Implementations",
link: "/connect/implementations",
},
{
label: "Integration Requirements",
link: "/connect/integration-requirements",
},
{
label: "New Chain",
items: [
Expand Down
4 changes: 3 additions & 1 deletion docs/docs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ _: {
runHook preBuild
export PUPPETEER_SKIP_DOWNLOAD=1
export ASTRO_TELEMETRY_DISABLED=1
export NODE_OPTIONS="--no-warnings"
export NODE_OPTIONS="--no-warnings --max-old-space-size=8192"
mkdir docs/src/content/docs/reference/@unionlabs
cp -r ${self'.packages.ts-sdk-docs}/modules docs/src/content/docs/reference/@unionlabs/sdk
cp -r ${self'.packages.ts-sdk-evm-docs}/modules docs/src/content/docs/reference/@unionlabs/sdk-evm
Expand All @@ -49,7 +49,9 @@ _: {
pnpm --filter=docs build
runHook postBuild
'';
NODE_OPTIONS = "--no-warnings --max-old-space-size=8192";
installPhase = ''
export NODE_OPTIONS="--no-warnings --max-old-space-size=8192"
mkdir -p $out
cp -r ./docs/dist/* $out
'';
Expand Down
43 changes: 43 additions & 0 deletions docs/src/content/docs/connect/implementations.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
title: Union Protocol Implementations
---

There are several existing implementations of the Union protocol for different execution environments.

## CosmWasm

The CosmWasm implementation of the Union Protocol supports any chain that supports at least CosmWasm 2.0. This is also the implementation that runs on the Union chain.

The implementation can be found here: https://github.com/unionlabs/union/tree/main/cosmwasm/ibc-union

## EVM

The EVM implementation of the Union Protocol supports any EVM implementation that supports at least the [Byzantium fork]. {/* TODO: Confirm minimum EVM capabilities */}

The implementation can be found here: https://github.com/unionlabs/union/tree/main/evm

## Aptos Move

The Aptos Move implementation of the Union Protocol supports the [Move version used by Aptos][aptos-move].

The implementation can be found here: https://github.com/unionlabs/union/tree/main/aptos

## Sui Move

The Sui Move implementation of the Union Protocol supports the [Move version used by Sui][sui-move].

The implementation can be found here: https://github.com/unionlabs/union/tree/main/sui

## Cairo

The Cairo implementation of the Union Protocol supports [Cairo], the smart contract language used on [Starknet].

The implementation can be found here: https://github.com/unionlabs/union/tree/main/cairo

Note that this is still in active development.

[aptos-move]: https://aptos.dev/network/blockchain/move
[byzantium fork]: https://ethereum.org/ethereum-forks/#byzantium
[sui-move]: https://sui.io/move
[cairo]: https://www.cairo-lang.org
[starknet]: https://www.starknet.io
31 changes: 31 additions & 0 deletions docs/src/content/docs/connect/integration-requirements.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
title: Union Protocol Integration Requirements
---

The Union protocol is agnostic to the underlying abstract machine it is running on. Many integrations already exist, as described in [../implementations]. If a new implementation is required, there are several requirements for building a new integration, as defined below.

## Verifiable Consensus and Finality

The chain must have some sort of consensus that can be verified in an on-chain light client. This typically entails a validator set that signs on the state of the chain, eventually reaching a state of finality. Note that for L2s, this is typically a verification of the settlement in the finalized state of the L1.

## Verifiable Transaction Outputs

Included in the finalized state verified by the light client there must be some sort of "root" (block hash, storage root, transaction root) against which transaction outputs can be verified. This could be a merkle root of the chain storage or receipts/logs, a flat hash of transaction effects, or anything else that enables verifying arbitrary transaction outputs in a block. Additionally, if this method of verification is through proofs that are derived from chain state, they must be queryable from an endpoint (i.e. [`eth_getProof`]) or reconstructable from a standard node interface; for example querying all data required for building a block hash.

## Execution Environment (Smart Contracts)

The Union protocol is implemented fully virtualized in a smart contract environment. Almost any VM can be supported, as long as it has the required capabilities.

Required capabilities:

- `BN254` *OR* `BLS12-381` precompiles: ecAdd, ecMul, ecPairing
- Alternatively, these signatures can be verified directly in the smart contract, however this is typically not desirable due to the cost of these operations.
- Cross-contract calls (either natively, or a way to emulate it; for example [Sui's PTBs][ptb])

Not required, but ideal to have for a fully featured implementation:

- Deterministic and predictable contract address derivation
- Existing token standard with capabilities to do escrow/unescrow (either through lock/unlock or burn/mint)

[ptb]: https://docs.sui.io/concepts/transactions/prog-txn-blocks
[`eth_getProof`]: https://eips.ethereum.org/EIPS/eip-1186
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const program = Effect.gen(function*() {
})
```

### 4. zkgm Request
### 4. ZKGM Request

Finally, with the `Call` ready - you can construct a `ZkgmClientRequest`.

Expand All @@ -106,9 +106,9 @@ const program = Effect.gen(function*() {
ucs03 addresses can be found on the [Deployments page](/protocol/deployments/)
:::

### 5. zkgm Execution and Response
### 5. ZKGM Execution and Response

Now that you’ve created a full zkgm request, you can execute it and wait on the response to close out the program.
Now that you’ve created a full ZKGM request, you can execute it and wait on the response to close out the program.

```ts
import { Call, Ucs05, ZkgmClientRequest, ZkgmClientResponse } from "@unionlabs/sdk"
Expand Down
Loading