Reserved IP Address°C
01-22-2025
BSV
$52.47
Vol 35.71m
1.96%
BTC
$105143
Vol 74697.84m
3.07%
BCH
$446.51
Vol 207.17m
4.25%
LTC
$116.01
Vol 859.65m
-0.06%
DOGE
$0.36
Vol 8054.22m
6.37%
Getting your Trinity Audio player ready...

This post was first published on Medium. Read Part 2 here.

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.

two hands transfering a thing

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).

Watch: CoinGeek New York presentation, The Path to BitCoin Adoption: How to Turn the Entire Web into Bitcoin Apps

Recommended for you

Arkansas prohibits BTC miner’s operation near military facility
A military facility, as per the bill, includes a base, a hospital or clinic, or an arsenal; it seems to...
January 21, 2025
BTC miner Bit Digital acquires Montreal site, new client announced
Bit Digital has spent $23 million on the Montreal site, which it will customize to host a 5MW data center...
January 10, 2025
Advertisement
Advertisement
Advertisement