2.89°C
Hilliard
11-21-2024
BSV
$77.03
Vol 110.72m
12.33%
BTC
$97378
Vol 102566.05m
5.03%
BCH
$523.25
Vol 1241.57m
18.86%
LTC
$88.35
Vol 1039.2m
2.97%
DOGE
$0.38
Vol 10482.12m
-1.45%
Getting your Trinity Audio player ready...

Blockchain scripting and contract firm sCrypt has won the 2024 Bitcoin Olympics Hackathon (Litecoin Track) by showing how it’s possible to make a payment on one blockchain and receive an asset on another. The two-man team of software engineers Mihael Šinkec and Yusuf Idi Maina leveraged SPV and the opcode OP_CAT on the BTC Signet, demonstrating a transaction where a buyer used Litecoin to purchase BTC Ordinal tokens.

sCrypt said the demonstration expands the potential for DeFi applications, exchanging one type of digital asset for another directly between transacting parties. There’s no need for coordination between the two parties and no need to trust third-party intermediaries like exchanges.

Šinkec said constructing such a transaction using raw BTC ASM (assembly code used to create custom scripts) would be complicated, so the pair used sCrypt’s SDK. The SDK lets developers work in more familiar TypeScript to focus instead on the contract logic. Šinkec and Maina verified transaction preimages on the stack and verified them with “a straightforward function call” in a BTC covenant.

This process also uses Simplified Payment Verification (SPV) on Litecoin, reconstructing a transaction’s Merkle Root by using its data and Merkle Path and then comparing it to the transaction’s Block Header. Using SPV, the client checks the Block Header’s validity without requiring a full download of the blockchain.

Explaining the process on Medium, Šinkec wrote that it was a challenge to verify a Litecoin transaction proof using BTC script since the two blockchains use different PoW algorithms. The team used an oracle that could attest to the validity of Litecoin transactions and Lamport signatures that could be verified in BTC script.

The Litecoin SPV proof was then used to unlock a BTC Ordinal token placed in a BTC covenant and transfer the asset to the receiver’s BTC address. A “covenant” allows a programmer to impose constraints on how specific coins may be spent in future transactions.

Why OP_CAT is necessary

Explaining the covenant transaction, Šinkec said:

“Enabling OP_CAT on BTC opens up many possibilities such as covenants and validation of Merkle Proofs. We leveraged both these mechanisms to implement an Ordinal sales listing as a covenant on BTC. It accepts Litecoin as a payment option without going through an intermediary, such as an exchange.”

OP_CAT is an opcode that existed in the original 2009 Bitcoin protocol, allowing programmers to concatenate two items on the stack. This enables the potential for more sophisticated transaction scripts and thus expands Bitcoin’s range of applications and potential use cases.

However, in a move similar to the one that imposed BTC’s “temporary” 1MB block size limit, OP_CAT and other original opcodes were disabled very early in Bitcoin’s existence due to fears bad-faith actors could use them to “spam” or overwhelm the network before it had the resources to combat such actions. The BSV blockchain re-enabled OP_CAT along with other original opcodes in 2019/2020, one of many moves that expanded BSV’s functionality and restored Satoshi Nakamoto’s original vision for Bitcoin.

There are also moves to re-enable OP_CAT on the BTC main network, but at the time of writing that hasn’t happened yet. For now, sCrypt’s cross-chain transaction works only on the BTC Signet, a more closed-off alternate testnet for blockchain apps, and experiments with new transaction types. OP_CAT has been re-enabled on the BTC Signet.

Since sCrypt’s prize-winning project connects the Litecoin and BTC Signet blockchains, it’s more theoretical than immediately usable as things currently exist. However, OP_CAT works on BSV and has done so for five years now, meaning developers could use the process to enable cross-chain payments. BSV has shown time and time again that more creative uses for blockchain technology are available for creative developers looking for new opportunities.

Watch: sCrypt wants to bring hackathon initiative to more people

Recommended for you

Sch. Post test

Lorem ipsum odor amet, consectetuer adipiscing elit. Elit torquent maximus natoque viverra cursus maximus felis. Auctor commodo aliquet himenaeos fermentum

November 7, 2024
Post with chaching

Lorem ipsum odor amet, consectetuer adipiscing elit. Accumsan mi at at semper libero pretium justo. Dictum parturient conubia turpis interdum

November 4, 2024
Advertisement