Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
bucanero committed Jan 24, 2025
1 parent eeab3f6 commit 3396540
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 34 deletions.
6 changes: 3 additions & 3 deletions docs/1.concepts/abstraction/chain-signatures.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ Controlling accounts and their assets on other blockchain platforms is made poss
2. [**Multichain Smart Contract**](#multichain-smart-contract) - Receives requests to sign a transaction for other blockchains
3. [**Multiparty Computation Service**](#multi-party-computation-service) - Third-party service providing signatures to the contract

![Chain Signatures](/docs/assets/chain-abstract-2.png)
_Chain signatures flow_

<hr class="subsection" />

### Derivation Paths: One Account, Multiple Chains
Expand Down Expand Up @@ -105,9 +108,6 @@ After a request is made, the `sign` method will [yield execution](/blog/yield-re

Once the signature is ready, the contract resumes computation and returns it to the user. This signature is a valid signed transaction that can be readily sent to the target blockchain to be executed.

![Chain Signatures](/docs/assets/chain-abstract-2.png)
_Chain signatures smart contract flow_

<hr class="subsection" />

### Multi-Party Computation Service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ There are five steps to create a Chain Signature:
1. [Deriving the Foreign Address](#1-deriving-the-foreign-address) - Construct the address that will be controlled on the target blockchain
2. [Creating a Transaction](#2-creating-the-transaction) - Create the transaction or message to be signed
3. [Requesting a Signature](#3-requesting-the-signature) - Call the NEAR `v1.signer` contract requesting it to sign the transaction
4. [Reconstructing the Signature](#4-reconstructing-the-signature) - Reconstruct the signature from the MPC service's response
4. [Formatting the Signature](#4-reconstructing-the-signature) - Reconstruct the signature from the MPC service's response
5. [Relaying the Signed Transaction](#5-relaying-the-signature) - Send the signed transaction to the destination chain for execution

![chain-signatures](/docs/assets/welcome-pages/chain-signatures-overview.png)
Expand Down Expand Up @@ -172,9 +172,9 @@ The contract will take some time to respond, as the `sign` method [yields execut

---

## 4. Reconstructing the Signature
## 4. Formatting the Signature

The MPC contract will not return the signature of the transaction itself, but the elements needed to reconstruct the signature.
The MPC contract will not return the signature of the transaction itself, but the elements needed to rebuild the signature matching the target blockchain's format.

This allows the contract to generalize the signing process for multiple blockchains.

Expand All @@ -184,7 +184,7 @@ This allows the contract to generalize the signing process for multiple blockcha
url="https://github.com/near-examples/near-multichain/blob/main/src/services/ethereum.js"
start="89" end="100" />

In Ethereum, the signature is reconstructed by concatenating the `r`, `s`, and `v` values returned by the contract.
In Ethereum, the signature is formatted by concatenating the `r`, `s`, and `v` values returned by the contract.

</TabItem>
<!-- https://github.com/near-examples/near-multichain/blob/1c07d9a3de7f1f2ee93206b77832838f2892144b/src/services/bitcoin.js -->
Expand All @@ -193,7 +193,7 @@ In Ethereum, the signature is reconstructed by concatenating the `r`, `s`, and `
url="https://github.com/near-examples/near-multichain/blob/main/src/services/bitcoin.js"
start="86" end="99" />

In Bitcoin, the signature is reconstructed by concatenating the `r` and `s` values returned by the contract.
In Bitcoin, the signature is formatted by concatenating the `r` and `s` values returned by the contract.

</TabItem>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ id: getting-started
title: Getting Started with Chain Signatures
---

Chain Signatures is a groundbreaking technology built on NEAR that enables all accounts, including smart contracts, to sign and execute transactions across multiple blockchains.
Chain Signatures is a groundbreaking technology built on NEAR that enables all accounts, including smart contracts, to sign and execute transactions across multiple blockchains.

![img](https://pages.near.org/wp-content/uploads/2024/02/acct-abstraction-blog-1.png)

This innovation leverages Multi-Party Computation (MPC) and a distributed network of node operators to create joint signatures from arbitrary payloads, allowing NEAR users to control external blockchain accounts.
This innovation leverages Multi-Party Computation (MPC) and a distributed network of node operators to create joint signatures from arbitrary payloads, allowing NEAR accounts to control external blockchain accounts.

Chain Signatures enhances blockchain interoperability, giving ownership of diverse assets, cross-chain accounts, and data to a single NEAR account.

Expand All @@ -17,6 +17,9 @@ Chain Signatures enhances blockchain interoperability, giving ownership of diver

When a NEAR account - could be a user or a **smart contract** - wants to interact with a foreign blockchain, it just need to follow four simple steps.

![Chain Signatures](/docs/assets/chain-abstract-2.png)
_Chain signatures flow_

#### 1. Deriving Foreign Addresses

Chain Signatures uses [derivation paths](../../../1.concepts/abstraction/chain-signatures.md#derivation-paths-one-account-multiple-chains) to represent accounts on foreign blockchains
Expand All @@ -38,11 +41,19 @@ Notice that, since the foreign address is derived from the NEAR account name, it

The client constructs the foreign transaction to be signed, which varies depending on the target blockchain

:::tip

Library to construct transactions for different chains inside Near contracts and Rust clients.

https://github.com/near/omni-transaction-rs

:::

#### 3. Requesting the Signature

A NEAR account or contract calls the sign method of the MPC smart contract ([v1.signer](https://nearblocks.io/address/v1.signer)) to sign the transaction and waits while our MPC service generates the signature

#### 4. Relaying the Signature
#### 4. Relaying the Signature

Once the signature is ready, the client reconstructs the signed transaction using the signature and broadcasts it to the destination blockchain

Expand All @@ -58,35 +69,35 @@ Using Chain Signatures, developers can build cross-chain DeFi applications with

Chain Signatures can be used to build a wide range of applications that leverage blockchain interoperability. Here are some examples:

1. **DeFi on Bitcoin (and other chain without smart contracts)**
* Chain signatures allow NEAR smart contract to program assets on Bitcoin
* Build lending, swaps, runes launchpads, passkey-based Bitcoin wallets, and more
2. **Chain agnostic applications**
* Since chain signatures can sign transactions for all blockchains, developers can support every single chain with just one smart contract
* Multichain DEXs, lending protocols, oracles, derivatives, and more
3. **Multichain account abstraction**
* Users can control assets on all chains with just their NEAR account, and can utilize account abstraction features on any chain including passkeys, key rotation, etc
* Using the multichain gas relayer, users can pay for gas fees on any chain using USDC
4. **Privacy**
* Chain signatures can be used to encrypt and decrypt information in a programmatic way
1. **DeFi on Bitcoin (and other chain without smart contracts)**
* Chain signatures allow NEAR smart contract to program assets on Bitcoin
* Build lending, swaps, runes launchpads, passkey-based Bitcoin wallets, and more
2. **Chain agnostic applications**
* Since chain signatures can sign transactions for all blockchains, developers can support every single chain with just one smart contract
* Multichain DEXs, lending protocols, oracles, derivatives, and more
3. **Multichain account abstraction**
* Users can control assets on all chains with just their NEAR account, and can utilize account abstraction features on any chain including passkeys, key rotation, etc
* Using the multichain gas relayer, users can pay for gas fees on any chain using USDC
4. **Privacy**
* Chain signatures can be used to encrypt and decrypt information in a programmatic way
* This enables privacy applications, and even decrypting information based on ownership of assets/NFTs

---

## How to Get Started?

1. **Familiarize Yourself with Chain Signatures:**
* Understand the [basics of Chain Signatures](https://docs.near.org/concepts/abstraction/chain-signatures) and how they simplify blockchain interactions.
* Review the technical [explainer](https://near.org/blog/unlocking-web3-usability-with-account-aggregation).
2. **Explore the Use Cases:**
* Review [examples of use cases for Chain Signatures](https://pages.near.org/blog/unlocking-multichain-web3-with-near-chain-signatures/), such as Multichain DAO, Multichain NFT Minter, and Bitcoin Runes Airdrop.
3. **Access Resources and Documentation:**
* Visit the [Chain Signatures documentation](https://docs.near.org/build/chain-abstraction/chain-signatures) for detailed technical information and code snippets.
* Check out the [Linktree for Chain Signatures](https://linktr.ee/chainsignatures) for various resources, including demos and tutorials.
4. **Try the Demos:**
* Use the [command-line-based demo](https://github.com/near-examples/chainsig-script) to derive accounts and send transactions on Bitcoin, Ethereum, Doge, and Ripple.
* Check out the [web app demo](https://github.com/near-examples/near-multichain/tree/main).
5. **Engage with the Community:**
1. **Familiarize Yourself with Chain Signatures:**
* Understand the [basics of Chain Signatures](https://docs.near.org/concepts/abstraction/chain-signatures) and how they simplify blockchain interactions.
* Review the technical [explainer](https://near.org/blog/unlocking-web3-usability-with-account-aggregation).
2. **Explore the Use Cases:**
* Review [examples of use cases for Chain Signatures](https://pages.near.org/blog/unlocking-multichain-web3-with-near-chain-signatures/), such as Multichain DAO, Multichain NFT Minter, and Bitcoin Runes Airdrop.
3. **Access Resources and Documentation:**
* Visit the [Chain Signatures documentation](https://docs.near.org/build/chain-abstraction/chain-signatures) for detailed technical information and code snippets.
* Check out the [Linktree for Chain Signatures](https://linktr.ee/chainsignatures) for various resources, including demos and tutorials.
4. **Try the Demos:**
* Use the [command-line-based demo](https://github.com/near-examples/chainsig-script) to derive accounts and send transactions on Bitcoin, Ethereum, Doge, and Ripple.
* Check out the [web app demo](https://github.com/near-examples/near-multichain/tree/main).
5. **Engage with the Community:**
* Join the [Chain Abstraction developers’ channel on Telegram](https://t.me/chain\_abstraction) to connect with other developers and get support.

---
Expand Down

0 comments on commit 3396540

Please sign in to comment.