File tree 1 file changed +10
-1
lines changed
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -47,10 +47,19 @@ mod(x,y) | `[X] [Y] DIV64 <1> EQUALVERIFY DROP`
47
47
bitand(x,y) | ` [X] [Y] AND `
48
48
bitor(x,y) | ` [X] [Y] OR (cannot fail) `
49
49
bitxor(x,y) | ` [X] [Y] XOR (cannot fail) `
50
-
50
+ price_oracle_1(K,T) | ` 2DUP TOALTSTACK <T> OP_GREATERTHANEQ VERIFY CAT SHA256 <K> CHECKSIGFROMSTACKVERIFY OP_FROMATLSTACK `
51
51
52
52
- The division operation pushes the quotient(a//b) such that the remainder a%b (must be non-negative and less than |b|).
53
53
- neg(a) returns -a, whereas bitinv(a) returns ~ a.
54
+ - ` price_oracle_1(K,T) ` pushes a 64 bit LE integer(price) of signed with key K. It checks whether the price is signed
55
+ with at a timestamp greater than T. Roughly spea
56
+ - K can be any ` KEY ` expression in descriptor format, but it not allowed to be uncompressed key.
57
+ - T is a 64 byte LE UXIX timestamp.
58
+ - ` _1 ` is the version of the oracle. There can be multiple versions of the
59
+ oracle with different fragments. ` price_oracle_1 ` creates a schnorr signature with given key ` K ` on a message that is
60
+ computed as: ` sha256(T1||K) `
61
+ - The fragment consumes three inputs from stack top: [ ` signature ` , ` timestamp ` , ` price ` ] where ` price ` is the
62
+ stack top.
54
63
55
64
## Comparison extensions
56
65
You can’t perform that action at this time.
0 commit comments