시가총액: $2.1716T -2.69%
거래량(24시간): $68.119B 35.62%
  • 시가총액: $2.1716T -2.69%
  • 거래량(24시간): $68.119B 35.62%
  • 공포와 탐욕 지수:
  • 시가총액: $2.1716T -2.69%
암호화
주제
암호화
소식
cryptostopics
비디오
최고의 뉴스
암호화
주제
암호화
소식
cryptostopics
비디오
bitcoin
bitcoin

$87959.907984 USD

1.34%

ethereum
ethereum

$2920.497338 USD

3.04%

tether
tether

$0.999775 USD

0.00%

xrp
xrp

$2.237324 USD

8.12%

bnb
bnb

$860.243768 USD

0.90%

solana
solana

$138.089498 USD

5.43%

usd-coin
usd-coin

$0.999807 USD

0.01%

tron
tron

$0.272801 USD

-1.53%

dogecoin
dogecoin

$0.150904 USD

2.96%

cardano
cardano

$0.421635 USD

1.97%

hyperliquid
hyperliquid

$32.152445 USD

2.23%

bitcoin-cash
bitcoin-cash

$533.301069 USD

-1.94%

chainlink
chainlink

$12.953417 USD

2.68%

unus-sed-leo
unus-sed-leo

$9.535951 USD

0.73%

zcash
zcash

$521.483386 USD

-2.87%

암호화폐 뉴스 기사

OP_CAT을 사용하여 머클 트리 구성 및 검증

2024/06/25 13:00

시리즈 #1에 이어 OP_CAT을 사용하여 Merkle 트리를 구성하고 검증하는 방법을 보여줍니다. 비트코인에서는 머클 트리가 데이터 검증, 동기화, 블록체인의 트랜잭션과 블록을 효과적으로 연결하기 위한 데이터 구조로 활용됩니다.

OP_CAT을 사용하여 머클 트리 구성 및 검증

This post was first published on Medium.

이 게시물은 Medium에 처음 게시되었습니다.

Following our series #1, we demonstrate how to construct and verify Merkle trees using OP_CAT.

시리즈 #1에 이어 OP_CAT을 사용하여 Merkle 트리를 구성하고 검증하는 방법을 보여줍니다.

In Bitcoin, Merkle trees are used as the data structure for verifying data, synchronizing the blockchain, and efficiently linking transactions and blocks together. The OP_CAT opcode, which allows for the concatenation of two stack variables, can be used with SHA256 hashes of public keys to streamline the Merkle tree verification process within Bitcoin Script. OP_CAT uniquely allows for the creation and opening of entries in Merkle trees, as the fundamental operation for building and verifying Merkle trees involves concatenating two values and then hashing them.

비트코인에서는 데이터 검증, 블록체인 동기화, 트랜잭션과 블록을 효율적으로 연결하기 위한 데이터 구조로 머클트리가 사용됩니다. 두 스택 변수의 연결을 허용하는 OP_CAT opcode는 공개 키의 SHA256 해시와 함께 사용되어 비트코인 ​​스크립트 내에서 머클 트리 확인 프로세스를 간소화할 수 있습니다. OP_CAT는 머클 트리에서 항목을 생성하고 열 수 있도록 고유하게 허용합니다. 머클 트리를 구축하고 검증하기 위한 기본 작업에는 두 값을 연결한 다음 해싱하는 작업이 포함되기 때문입니다.

There are many applications for Merkle trees. Here are a few prominent examples:

머클 트리에는 다양한 응용 프로그램이 있습니다. 다음은 몇 가지 대표적인 예입니다.

Merkle proof

머클 증명

A Merkle proof is a cryptographic method used to verify that a particular transaction is included in a Merkle tree without having to download the entire blockchain. This is especially useful for lightweight clients and improving the efficiency of data verification.

머클 증명은 전체 블록체인을 다운로드하지 않고도 특정 거래가 머클 트리에 포함되어 있는지 확인하는 데 사용되는 암호화 방법입니다. 이는 특히 경량 클라이언트에 유용하며 데이터 확인 효율성을 향상시킵니다.

Tree signature

트리 사인

A tree signature is a cryptographic method that improves the security and efficiency of digital signatures using tree structures, especially Merkle trees. This approach is used to generate a more compact and private proof that a message or set of messages has been signed by a particular key, compared to regular Multisig.

트리 서명은 트리 구조, 특히 머클 트리를 사용하여 디지털 서명의 보안과 효율성을 향상시키는 암호화 방법입니다. 이 접근 방식은 일반 다중 서명과 비교하여 메시지 또는 메시지 집합이 특정 키로 서명되었다는 보다 간결하고 개인 증명을 생성하는 데 사용됩니다.

Zero-Knowledge Proof

영지식 증명

STARK (Succinct Transparent Arguments of Knowledge) is a type of zero-knowledge proof system. STARKs are designed to allow a prover to prove the validity of a computation to a verifier without revealing any sensitive information about the computation itself. If OP_CAT were to be added to Bitcoin, it could potentially enable the implementation of a STARK verifier in Bitcoin Script, with work already underway on this. This would allow for secure and private transactions on the Bitcoin network. Compared to pairing-based proof systems like SNARK, STARK is considered to be more Bitcoin-friendly.

STARK(Succinct Transparent Arguments of Knowledge)는 일종의 영지식 증명 시스템입니다. STARK는 증명자가 계산 자체에 대한 민감한 정보를 공개하지 않고도 검증자에게 계산의 유효성을 증명할 수 있도록 설계되었습니다. OP_CAT이 비트코인에 추가된다면 잠재적으로 비트코인 ​​스크립트에서 STARK 검증 도구를 구현할 수 있으며 이에 대한 작업이 이미 진행 중입니다. 이를 통해 비트코인 ​​네트워크에서 안전하고 개인적인 거래가 가능해집니다. SNARK와 같은 페어링 기반 증명 시스템과 비교할 때 STARK는 비트코인 ​​친화적인 것으로 간주됩니다.

Implementation

구현

The implementation of the Merkle tree using sCrypt is straightforward. The following code calculates the root hash of a merkle tree, given a leaf and its merkle path, typically used in verifying a merkle proof.

sCrypt를 사용한 Merkle 트리 구현은 간단합니다. 다음 코드는 일반적으로 머클 증명을 확인하는 데 사용되는 리프와 해당 머클 경로가 주어지면 머클 트리의 루트 해시를 계산합니다.

Full code is at https://github.com/sCrypt-Inc/scrypt-btc-merkle.

전체 코드는 https://github.com/sCrypt-Inc/scrypt-btc-merkle에 있습니다.

A single run results in the following transactions:

단일 실행으로 인해 다음 트랜잭션이 발생합니다.

Check the transaction on Mempool

Mempool에서 거래를 확인하세요.

Check the transaction on Mempool

Mempool에서 거래를 확인하세요.

Script versions

스크립트 버전

There are alternative implementations in bare scripts, like the one below. One major benefit of using sCrypt for implementing merkle trees is its readability and maintainability. Scripts are often very difficult to read and work on.

아래와 같이 베어 스크립트에는 대체 구현이 있습니다. 머클 트리 구현을 위해 sCrypt를 사용하는 주요 이점 중 하나는 가독성과 유지 관리 용이성입니다. 스크립트는 읽고 작업하기가 매우 어려운 경우가 많습니다.

OP_EXISTS

OP_EXISTS

Plz tell me you had a compiler to generate that

그것을 생성할 컴파일러가 있다고 말해 주세요.

— Jerry – Bitcoin Bay (@Lightswarm) March 1, 2024

— Jerry – Bitcoin Bay(@Lightswarm) 2024년 3월 1일

Stay tuned for more OP_CAT use cases.

더 많은 OP_CAT 사용 사례를 기대해 주세요.

Watch: sCrypt Hackathon students realize there’s more to blockchain

보기: sCrypt Hackathon 학생들은 블록체인에 더 많은 것이 있다는 것을 깨달았습니다.

New to blockchain? Visit CoinGeek’s Blockchain for Beginners section, the ultimate resource guide to learn more about blockchain technology.

블록체인이 처음이신가요? 블록체인 기술에 대해 자세히 알아보려면 최고의 리소스 가이드인 CoinGeek의 초보자를 위한 블록체인 섹션을 방문하세요.

부인 성명:info@kdj.com

제공된 정보는 거래 조언이 아닙니다. kdj.com은 이 기사에 제공된 정보를 기반으로 이루어진 투자에 대해 어떠한 책임도 지지 않습니다. 암호화폐는 변동성이 매우 높으므로 철저한 조사 후 신중하게 투자하는 것이 좋습니다!

본 웹사이트에 사용된 내용이 귀하의 저작권을 침해한다고 판단되는 경우, 즉시 당사(info@kdj.com)로 연락주시면 즉시 삭제하도록 하겠습니다.

2026年07月29日 에 게재된 다른 기사