forked from fuji-money/tapscripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprime-safe-redeem.tapscript
More file actions
45 lines (44 loc) · 1020 Bytes
/
Copy pathprime-safe-redeem.tapscript
File metadata and controls
45 lines (44 loc) · 1020 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Private Redemption: Only Owner can Unlock all collateral
// with Key when Burning Fuji
//
// constructorInputs:
// borrowAsset: asset
// borrowAmount: value
// borrowerPk: xonlypubkey
// take out 0 asset
<0>
OP_INSPECTOUTPUTASSET
// make sure that asset is not confidential
<1>
OP_EQUALVERIFY
// check that the asset is equal to $borrowAsset
<$borrowAsset>
OP_EQUALVERIFY
// take out 0 value
<0>
OP_INSPECTOUTPUTVALUE
// make sure that value is not confidential
<1>
OP_EQUALVERIFY
// check that the value is equal to $borrowAmount
<$borrowAmount>
OP_EQUALVERIFY
// take out 0 scriptpubkey
<0>
OP_INSPECTOUTPUTSCRIPTPUBKEY
// OP_RETURN is not a witness scriptPubKey, so its version will be -1
// check that the version is -1
<-1>
OP_EQUALVERIFY
// check that the out 0 scriptpubkey is really just OP_RETURN
<0x6a> // DATA(OP_RETURN)
OP_SHA256
OP_EQUALVERIFY
// Check that the nonce on out 0 is empty
<0>
OP_INSPECTOUTPUTNONCE
<0>
OP_EQUALVERIFY
// Require Owner authorization
<$borrowerPk>
OP_CHECKSIG