> For the complete documentation index, see [llms.txt](https://docs.decentraland.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.decentraland.org/creator/content-creator-ko/sdk7/blockchain/second-layer.md).

# 2계층

씬에서 Polygon의 사이드체인을 사용해 훨씬 더 빠르고 저렴한 블록체인 트랜잭션을 활성화하세요.

## 2계층 솔루션 소개

블록체인에 영향을 미치는 모든 거래는 완료되는 데 시간이 걸리고 가스 비용이 듭니다. 이 두 가지는 블록체인 게임을 대중화하는 데 장애물이 됩니다. 플레이어들은 보통 자신의 행동이 반영되기까지 그렇게 오래 기다릴 인내심이 없고, 플레이하면서 많은 거래에 돈을 쓰려 하지 않기 때문입니다.

일반적인 해결책은 대부분의 게임 플레이를 오프체인으로 두고, 게임 아이템 획득이나 높은 점수 등록 같은 핵심 이벤트에 대해서만 블록체인 거래를 수행하는 것입니다.

하지만 이러한 한계와 블록체인에 본질적으로 내재한 다른 확장성 문제를 극복하는 또 다른 방법은 *2계층* 블록체인, 즉 *사이드체인*.

2계층은 탈중앙화 앱과 메인 체인 사이에 중개자 역할을 하는 또 다른 블록체인입니다. 이 계층은 더 가벼워서 더 빠른 응답과 훨씬 더 낮은 가스 비용을 제공할 수 있습니다.

거래를 메인 체인에 직접 기록하는 대신, 거래는 사이드체인에서 처리되고, 이후 변경 사항을 메인 체인과 최종적으로 동기화하는 것은 사이드체인의 역할입니다.

사이드체인은 노드 수가 더 적은 작은 네트워크이기 때문에 더 빠른 응답을 제공할 수 있습니다. 2계층에서 수행되는 거래는 처음에는 보안성이 더 낮지만, 결국 묶음으로 메인 체인에 커밋되며, 메인 체인의 모든 보안 검사를 그곳에서 적용할 수 있습니다.

사이드체인은 메인 체인과 동기화할 때 많은 거래를 하나로 묶기 때문에 개별 거래 비용도 크게 낮출 수 있습니다. 따라서 메인 체인에서 한 번의 거래에 지불해야 할 가스 비용을 수천 건의 거래에 나눠 부담할 수 있습니다.

또한 메인 체인과 동기화할 때 여러 중복 거래를 완전히 피할 수 있어 거래 비용을 더욱 줄일 수 있습니다. 예를 들어 Alice가 Bob에게 1 ETH를 전송한 뒤 Bob이 Carol에게 1 ETH를 전송한다면, Alice가 Carol에게 직접 전송한 것으로 기록하여 이 두 거래를 하나로 단순화할 수 있습니다.

디센트럴랜드는 [폴리곤](https://polygon.technology/)과 파트너십을 맺고 있으며, 이들은 이더리움에서 자체 사이드체인을 제공합니다. 이들의 사이드체인은 씬에서 사용되어 빠르고 매우 저렴한 거래를 지원할 수 있습니다.

## 폴리곤 테스트넷을 사용해 보기

폴리곤의 Matic 테스트넷을 사용하려면 먼저 다음이 필요합니다:

* Sepolia 네트워크의 Ether. 다음과 같은 여러 외부 faucet에서 무료로 받을 수 있습니다. [이것](https://www.alchemy.com/faucets/ethereum-sepolia).

그다음 Metamask 계정에 Matic 테스트넷을 포함하도록 설정해야 합니다.

방법은 다음과 같습니다:

1. 현재 네트워크 이름을 클릭하고 *Custom RPC* 를 선택하여 Metamask에서 네트워크를 전환합니다.
2. 'Polygon Amoy Testnet'을 *네트워크 이름*, [**https://rpc-amoy.polygon.technology**](https://rpc-amoy.polygon.technology) 로 *새 RPC URL* 및 [**https://amoy.polygonscan.com**](https://amoy.polygonscan.com) 로 *블록 탐색기 URL*. *심볼* 을 **POL**
3. ‘저장’을 클릭하여 이 새 네트워크를 Metamask에 추가합니다.

{% hint style="warning" %}
**📔 참고**: Polygon 설정 방법에 대해 더 알아보려면 해당 [문서 페이지](https://docs.polygon.technology/)
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.decentraland.org/creator/content-creator-ko/sdk7/blockchain/second-layer.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
