Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit 977149d

Browse files
authored
chore: initialize docs for btc support (#158)
* initialize text for btc support * fix broken links in add new networks section * add high level overview of btc cross-chain * add example btc transaction + example btc asset * dictionary * update landing page * update github repos. update landing page bullets * added badges to sygma-sdk landing page * update sdk blurb
1 parent 7e6fe9c commit 977149d

File tree

9 files changed

+116
-18
lines changed

9 files changed

+116
-18
lines changed

dictionary.txt

+10-1
Original file line numberDiff line numberDiff line change
@@ -480,4 +480,13 @@ MAINNET
480480
sygma-props
481481
SygmaProtocolReactWidget
482482
setState
483-
Paseo
483+
UTXO-based
484+
stateful
485+
UTXO
486+
BTC
487+
tBTC
488+
LGPL-3.0
489+
sygma-docs
490+
sygma-shared-configuration
491+
IPFS
492+
Paseo

docs/01-introduction/01-index.md

+17-4
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,33 @@ title: Introduction
55
description: The following describes an introduction of Sygma.
66
---
77

8-
# Welcome to Sygma Docs
8+
# Home
9+
10+
![](https://blog.buildwithsygma.com/content/images/2023/06/full-logo-3.png)
11+
12+
## Welcome To The Sygma Docs
913

1014
> _Sygma, like the Greek letter sigma (Σ), alludes to summation, the adding up of many things._
1115
12-
Sygma is a fully open source ([Lesser General Public License version 3.0 (LGPL-3.0)](https://www.gnu.org/licenses/lgpl-3.0.html)) multi-purpose interoperability layer that supports developers in building cross-chain dApps. A key part in this is removing complexity from the equation. Sygma empowers builders to create streamlined experiences by abstracting the complexities of bridging away and enabling smooth, web2-like user experiences.
16+
Sygma is an open-source interoperability layer licensed under [LGPL-3.0](https://www.gnu.org/licenses/lgpl-3.0.html), designed to support the development of cross-chain decentralized applications (dApps). It abstracts the underlying complexities of blockchain bridging, enabling developers to create dApps that facilitate cross-chain token transfers and generic message passing. Sygma integrates with multiple blockchain environments, providing tools for efficient cross-chain communication. This documentation covers technical and non-technical aspects of the protocol, aiming to equip both novice and experienced developers with the knowledge to leverage Sygma effectively in their projects.
1317

1418
## What's Next
1519

16-
- Get started with our [Quick Start Guide](../03-sygma-sdk/01-index.md)
20+
- Get started with the Sygma SDK [Quick Start Guide](../03-sygma-sdk/01-index.md)
1721
- Run your first [cross-chain token transfer](../03-sygma-sdk/04-Examples/01-Basic-ERC-20-Token-Transfers/01-EVM-EVM-example.md)
1822
- Pass your first [generic message cross-chain](../03-sygma-sdk/04-Examples/02-GMP-Examples/01-GMP-Example-With-A-Simple-Storage-Contract.md)
1923
- See the [environments](../08-resources/01-environments/01-index.md) Sygma is deployed in
2024
- Look under the hood at the [architecture](../02-sygma-protocol/01-index.md)
25+
- Find out how Sygma's [Tailored Security](../02-sygma-protocol/02-Tailored-Security/01-index.md) works
2126
- Integrate the [Sygma Widget](https://docs.buildwithsygma.com/sygma-widget/playground/) into your dApp
2227
- Read more on the [Sygma Vision](02-origins.md)
2328

24-
For the complete source code, please check out [Sygma's GitHub Repositories](../08-resources/04-github-repositories.md).
29+
For the complete source code, please check out [Sygma's GitHub Repositories](../08-resources/04-github-repositories.md).
30+
31+
## About These Docs
32+
33+
This documentation is open source and can be found at [sygma-docs](https://github.com/sygma-protocol/docs). For more on contributing, please see [Contribute](../10-contribute.md).
34+
35+
## Need Assistance?
36+
37+
First, make sure to check out the [FAQs](../09-faq.md). If you have questions about the protocol, the code, the docs, or have a business inquiry, please reach out to us on [Discord](https://discord.gg/Qdf6GyNB5J) or by filling out [this form](https://share.hsforms.com/1K4-T_yaKSp6F06FGk4wsSgnmy2x).

docs/02-sygma-protocol/04-Supported-Ecosystems/01-evm.md

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ description: The following details EVM support on Sygma.
99
The following section details Sygma's compatibility with EVM chains via its ecosystem of smart contracts.
1010
:::
1111

12+
# Introduction To EVM Support
13+
1214
Sygma uses Solidity smart contracts to enable transfers to and from Ethereum Virtual machine (EVM) compatible chains. These contracts consist of a core bridge contract (`Bridge.sol`), and a set of handler contracts (e.g. `ERC20Handler.sol`, `ERC721Handler.sol`, `PermissionlessGenericHandler.sol`, `FeeHandlerRouter.sol`, `BasicFeeHandler.sol`). [Different verification systems](../02-Tailored-Security/01-index.md) also require separate sets of smart contracts. These onchain components establish a relationship with the offchain actors via generation and detection of onchain contract events.
1315

1416
## Sygma's Smart Contracts

docs/02-sygma-protocol/04-Supported-Ecosystems/02-substrate.md

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ description: The following details Substrate support on Sygma.
99
The following section details Sygma's compatibility with Polkadot and Kusama parachains via its Substrate pallet support.
1010
:::
1111

12+
# Introduction To Substrate Support
13+
1214
A unique feature of the Sygma protocol is its ability to provide interoperability between EVM-based and Substrate-based blockchains. This includes those [parachains](https://wiki.polkadot.network/docs/learn-parachains) deployed under Polkadot and Kusama's [shared security model](https://wiki.polkadot.network/docs/learn-architecture).
1315

1416
Similar to how Sygma enables EVM support by invoking various smart contracts, Sygma provides Substrate support via interactions with [custom Sygma pallets](https://github.com/sygmaprotocol/sygma-substrate-pallets).

docs/02-sygma-protocol/04-Supported-Ecosystems/03-btc.md

+53-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,56 @@ id: protocol-btc
44
title: Bitcoin Support
55
description: The following details Bitcoin support on Sygma.
66
draft: true
7-
---
7+
---
8+
9+
:::info
10+
The following section details Sygma's compatibility with Bitcoin and its constituent layer-2's.
11+
:::
12+
13+
# Introduction To Bitcoin Support
14+
15+
The Sygma protocol extends its support to Bitcoin and its associated layer-2 networks. A notable characteristic of chains built on EVM and Substrate is their capability to generate event logs from transactions and contract interactions. These event logs are particularly useful for tracking onchain interactions *externally*, and therefore are essential to Sygma's relayer network. The relayer network listens for these events, interprets the logs, parses the messages within them, verifies the authenticity of these computations, and posts them to the destination chains. However, Bitcoin and other UTXO-based chains generally do not produce event logs, as they do not have a concept of "state" in the same way stateful chains do.
16+
17+
To get around this limitation, Sygma configures its MPC relayers to monitor specific deposit addresses on Bitcoin. When a transaction, or UTXO in Bitcoin-terms, is made to these deposit addresses, the protocol treats it similarly to an event on EVM. During the transaction where this deposit occurs, relayers look for an additional UTXO called `OP_RETURN`, which encodes 80-bytes of arbitrary information (i.e. metadata) within the transaction. This is how the relayer network obtains details of the cross-chain transaction including EVM addresses and other metadata.
18+
19+
## How Does Sygma Handle Bitcoin Cross-Chain?
20+
21+
Sygma facilitates the transfer of Bitcoin to Ethereum by setting up specific Bitcoin deposit addresses and employing a series of event listeners and handlers to monitor, process, and relay transactions. This process involves several steps to ensure secure and accurate cross-chain communication. The following sections detail the technical components and workflow involved in this process, illustrating how Bitcoin transactions are detected, processed, and converted into equivalent assets on the Ethereum blockchain.
22+
23+
1. Configuration:
24+
- Deposit addresses are specified in [`config.go`](https://github.com/sygmaprotocol/sygma-relayer/blob/main/chains/btc/config/config.go) under the `Resources` field.
25+
26+
2. Listening and Detection:
27+
- `BtcListener` in [`listener.go`](https://github.com/sygmaprotocol/sygma-relayer/blob/main/chains/btc/listener/listener.go) scans Bitcoin blocks for transactions to these addresses.
28+
- `DecodeDepositEvent` in [`util.go`](https://github.com/sygmaprotocol/sygma-relayer/blob/main/chains/btc/listener/util.go) processes transactions and extracts metadata from `OP_RETURN`.
29+
30+
3. Handling Deposits:
31+
- `BtcDepositHandler` in [`deposit-handler.go`](https://github.com/sygmaprotocol/sygma-relayer/blob/main/chains/btc/listener/deposit-handler.go) processes detected deposits and creates cross-chain messages.
32+
- The message includes the recipient's Ethereum address and other details.
33+
34+
4. Event Handling:
35+
- `FungibleTransferEventHandler` in [`event-handlers.go`](https://github.com/sygmaprotocol/sygma-relayer/blob/main/chains/btc/listener/event-handlers.go) fetches events and processes deposits, sending messages to Ethereum.
36+
37+
5. Message Handling:
38+
- `BtcMessageHandler` in [`message-handler.go`](https://github.com/sygmaprotocol/sygma-relayer/blob/main/chains/btc/executor/message-handler.go) processes cross-chain messages and converts them into proposals.
39+
40+
6. Execution:
41+
- `Executor` in [`executor.go`](https://github.com/sygmaprotocol/sygma-relayer/blob/main/chains/btc/executor/executor.go) signs and sends transactions.
42+
- Constructs and sends the raw transaction to the Bitcoin network.
43+
- Upon confirmation, the equivalent amount of wrapped BTC is minted on Ethereum.
44+
45+
## An Example
46+
47+
For an example of a cross-chain transaction on Bitcoin using the Sygma protocol, see [this transaction hash](https://blockstream.info/testnet/tx/7341772580155039004345fe17c3619f777eb5b144cde9baf040c3ac422bb74e).
48+
49+
**Anatomy**:
50+
- Output Index 0: `OP_RETURN`
51+
- Desc: Includes `OP_RETURN` data containing the metadata (`0x703265c472F169b20E8E03c842B9B374Cb842Cb8_2`). The metadata indicates the address the funds should be bridged to as well as the domain ID (`2`), which represents Ethereum Sepolia.
52+
- Output Index 1: UTXO #1
53+
- Desc: Contains 0.01000000 tBTC, which is the fixed fee amount for bridging with the Sygma protocol.
54+
- Output Address: [tb1p0r2w3ugreaggd7nakw2wd04up6rl8k0cce8eetxwmhnrelgqx87s4zdkd7](https://blockstream.info/testnet/address/tb1p0r2w3ugreaggd7nakw2wd04up6rl8k0cce8eetxwmhnrelgqx87s4zdkd7)
55+
- Output Index 2: UTXO #2
56+
- Desc: Contains 2.48957356 tBTC, representing the amount of BTC being bridged to the EVM.
57+
- Output Address: [tb1p72xwajwdxdfhmu5dp39sh8jdc6msnez0a7rq4gk5jeep0kvccnsqkgcj7e](https://blockstream.info/testnet/address/tb1p72xwajwdxdfhmu5dp39sh8jdc6msnez0a7rq4gk5jeep0kvccnsqkgcj7e)
58+
59+
![](../../../static/assets/op_return_example.png)

docs/03-sygma-sdk/01-index.md

+19-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,24 @@ description: The following section introduces the Sygma SDK.
66
sidebar_position: 1
77
---
88

9-
**Sygma SDK** is an open source library (under [GNU Lesser General Public License v3.0](https://www.gnu.org/licenses/lgpl-3.0.en.html)) for developers to work within the Sygma ecosystem. The SDK consist of methods that enable bridging capabilities between EVM and Substrate-based networks.
9+
<p align="center">
10+
<a href="https://github.com/sygmaprotocol/sygma-sdk/actions/workflows/ci.yaml">
11+
<img src="https://github.com/sygmaprotocol/sygma-sdk/actions/workflows/ci.yaml/badge.svg" alt="Build Status" />
12+
</a>
13+
<a href="https://www.npmjs.com/package/@buildwithsygma/sygma-sdk-core">
14+
<img alt="npm" src="https://img.shields.io/npm/v/@buildwithsygma/sygma-sdk-core" />
15+
</a>
16+
<a href="https://www.npmjs.com/package/@buildwithsygma/sygma-sdk-core">
17+
<img alt="npm downloads" src="https://img.shields.io/npm/dm/@buildwithsygma/sygma-sdk-core" />
18+
</a>
19+
<img alt="GitHub last commit" src="https://img.shields.io/github/last-commit/sygmaprotocol/sygma-sdk" />
20+
<br/>
21+
<img alt="GitHub" src="https://img.shields.io/github/license/sygmaprotocol/sygma-sdk" />
22+
<a href="https://discord.gg/Qdf6GyNB5J">
23+
<img alt="discord" src="https://img.shields.io/discord/999966147644493824?label=Discord&logo=discord&style=flat" />
24+
</a>
25+
</p>
26+
27+
**Sygma SDK** is an open source library (under [GNU Lesser General Public License v3.0](https://www.gnu.org/licenses/lgpl-3.0.en.html)) for developers to work within the Sygma ecosystem. The SDK consist of methods that enable bridging capabilities between networks built on EVM, Substrate, Bitcoin, and beyond.
1028

1129
**NOTE:** the SDK is under active development. We encourage developers that discover any bugs or are interested in extending SDK functionality to [submit issues](https://github.com/sygmaprotocol/sygma-sdk/issues) to our GitHub.

docs/04-integrating-with-sygma/04-new-network.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ The following section details how to request support for a new network. The Sygm
1313

1414
Sygma currently supports EVM and Substrate-based networks natively, with support for Bitcoin and Cosmos-based ecosystems coming soon. The currently supported networks can be found in the links below. The linked pages also contain information on supported resource types, contract addresses, and available fee schemas:
1515

16-
- [Testnet Network Support](https://docs.buildwithsygma.com/environments/testnet/#contract-addresses)
17-
- [Mainnet Network Support](https://docs.buildwithsygma.com/environments/mainnet#contract-addresses)
16+
- [Testnet Network Support](../08-resources/01-environments/03-testnet/index.md)
17+
- [Mainnet Network Support](../08-resources/01-environments/04-mainnet.md)
1818

1919
If there is a network that is not yet supported and you would like Sygma to add support, please contact us on [Discord](https://discord.gg/Qdf6GyNB5J) or fill out [this form](https://share.hsforms.com/1K4-T_yaKSp6F06FGk4wsSgnmy2x).
2020

docs/08-resources/04-github-repositories.md

+11-9
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,19 @@ The following details a list of relevant Sygma repositories.
99

1010
| Repository | Description | Status |
1111
| ---- |-------------| ------ |
12-
| [**sygma-core**](https://github.com/sygmaprotocol/sygma-core) | Contains core Sygma logic implemented in Go | Public repository, [audited](audits/); beta. |
12+
| [**sygma-core**](https://github.com/sygmaprotocol/sygma-core) | Contains core Sygma logic implemented in Go | Public repository, [audited](audits/); production. |
1313
| [**sygma-sdk**](https://github.com/sygmaprotocol/sygma-sdk) | Tools to easily integrate any JS application with protocol Sygma | Public repository; production.|
14-
| [**sygma-solidity**](https://github.com/sygmaprotocol/sygma-solidity) | Smart contracts used by protocol Sygma | Public repository, [audited](audits/); beta. |
14+
| [**sygma-solidity**](https://github.com/sygmaprotocol/sygma-solidity) | Smart contracts used by protocol Sygma | Public repository, [audited](audits/); production. |
1515
| [**sygma-x-solidity**](https://github.com/sygmaprotocol/sygma-x-solidity) | Contains the zk verification contracts used by Sygma Spectre | Public repository, [audited](audits/); beta. |
16-
| [**sygma-substrate-pallets**](https://github.com/sygmaprotocol/sygma-substrate-pallets) | This repo contains several substrate pallet implementation for Sygma protocol | Public repository, [audited](audits/); beta. |
17-
| [**sygma-relayer**](https://github.com/sygmaprotocol/sygma-relayer) | Go-implemented relayer service | Public repository, [audited](audits/); beta. |
16+
| [**sygma-substrate-pallets**](https://github.com/sygmaprotocol/sygma-substrate-pallets) | This repo contains several substrate pallet implementation for Sygma protocol | Public repository, [audited](audits/); production. |
17+
| [**sygma-relayer**](https://github.com/sygmaprotocol/sygma-relayer) | Go-implemented relayer service | Public repository, [audited](audits/); production. |
1818
| [**spectre-node**](https://github.com/sygmaprotocol/spectre-node) | Go-implemented zk relayer node | Public repository; beta. |
1919
| [**sygma-inclusion-prover**](https://github.com/sygmaprotocol/sygma-inclusion-prover) | Sygma inclusion prover for zk verification | Public repository; beta. |
20-
| [**sygma-widget**](https://github.com/sygmaprotocol/sygma-widget) | Customizable widget for public integration of protocol Sygma | Public repository; beta. |
21-
| [**sygma-ui**](https://github.com/sygmaprotocol/sygma-ui) | Application TransferUI that uses sygma-sdk to interact with Sygma smart contracts and blockchains | Public repository; beta. |
22-
| [**explorer-ui**](https://github.com/sygmaprotocol/sygma-substrate-pallets) | ExplorerUI is used to track and navigate Sygma ecosystem | Public repository; beta. |
23-
| [**sygma-explorer-indexer**](https://github.com/sygmaprotocol/sygma-explorer-indexer) | Indexer used by the Sygma Explorer | Public repository; beta. |
24-
| [**fee-oracle**](https://github.com/sygmaprotocol/sygma-fee-oracle) | Go-implemented service that provides endpoints to Sygma UI for all necessary data related to bridging fees. | Private repository, audit underway (publicly available upon completion); beta. |
20+
| [**sygma-widget**](https://github.com/sygmaprotocol/sygma-widget) | Customizable widget for public integration of protocol Sygma | Public repository; production. |
21+
| [**sygma-ui**](https://github.com/sygmaprotocol/sygma-ui) | Application TransferUI that uses sygma-sdk to interact with Sygma smart contracts and blockchains | Public repository; production. |
22+
| [**explorer-ui**](https://github.com/sygmaprotocol/sygma-substrate-pallets) | ExplorerUI is used to track and navigate Sygma ecosystem | Public repository; production. |
23+
| [**sygma-explorer-indexer**](https://github.com/sygmaprotocol/sygma-explorer-indexer) | Indexer used by the Sygma Explorer | Public repository; production. |
24+
| [**sygma-shared-configuration**](https://github.com/sygmaprotocol/sygma-shared-configuration) | This repository uploads shared domains configuration to IPFS (CS Storage) for each Sygma environment. | Public repository; production. |
25+
26+
<!-- | [**fee-oracle**](https://github.com/sygmaprotocol/sygma-fee-oracle) | Go-implemented service that provides endpoints to Sygma UI for all necessary data related to bridging fees. | Private repository, audit underway (publicly available upon completion); beta. | -->
2527

static/assets/op_return_example.png

286 KB
Loading

0 commit comments

Comments
 (0)