Delegation in Bitcoin: Part 3

Previously, we have introduced two ways to delegate the right to spend one’s bitcoin: one at Script level, the other at transaction level.

We generalize the former to delegate to any script/smart contract, instead of a public key only. It allows one to authorize arbitrary smart contract to spend one’s bitcoin.

The full code is shown below:

Contract DelegateToScript

Line 9 checks the delegated script is signed and thus authorized by the owner. Line 12 and 13 ensure the delegated script goes into the spending transaction’s output as the new locking script using OP_PUSH_TX, similar to the emulation of Pay to Script Hash (P2SH).

--

--

--

sCrypt Inc (https://scrypt.io) is a company with a mission to provide integrated on-chain smart contracting solutions using the original BitCoin Protocol on BSV

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

TOP 5 Undervalued Altcoins In MAY!

Ethereum Classic is to face the third 51% attack this month

How Cashaa Stands Way Out from Its Crypto Competitors

Image result for cashaa

Kaiko Announces the Acquisition of Napoleon Indices and Reveals the Launch of “Kaiko Indices.”

O-MEE x OIG

Regarding the Wault Finance Incident

MATRIXETF TOKEN

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
sCrypt

sCrypt

sCrypt Inc (https://scrypt.io) is a company with a mission to provide integrated on-chain smart contracting solutions using the original BitCoin Protocol on BSV

More from Medium

Blockchain 102: Cryptocurrencies, Wallets and DApps

5P;1R — Bitcoin’s Elliptic Curve Cryptography

Algofi’s response to the Tinyman Exploit

On replacing hardware wallets