You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/shared-libraries.md
+28-2Lines changed: 28 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,13 +11,14 @@ The interface is defined in the C header `bitcoinconsensus.h` located in `src/sc
11
11
12
12
#### Version
13
13
14
-
`bitcoinconsensus_version` returns an `unsigned int` with the API version *(currently `1`)*.
14
+
`bitcoinconsensus_version` returns an `unsigned int` with the API version *(currently `2`)*.
15
15
16
16
#### Script Validation
17
17
18
-
`bitcoinconsensus_verify_script` returns an `int` with the status of the verification. It will be `1` if the input script correctly spends the previous output `scriptPubKey`.
18
+
`bitcoinconsensus_verify_script`, `bitcoinconsensus_verify_script_with_amount` and `bitcoinconsensus_verify_script_with_spent_outputs` return an `int` with the status of the verification. It will be `1` if the input script correctly spends the previous output `scriptPubKey`.
19
19
20
20
##### Parameters
21
+
###### bitcoinconsensus_verify_script
21
22
-`const unsigned char *scriptPubKey` - The previous output script that encumbers spending.
22
23
-`unsigned int scriptPubKeyLen` - The number of bytes for the `scriptPubKey`.
23
24
-`const unsigned char *txTo` - The transaction with the input that is spending the previous output.
@@ -26,6 +27,28 @@ The interface is defined in the C header `bitcoinconsensus.h` located in `src/sc
26
27
-`unsigned int flags` - The script validation flags *(see below)*.
27
28
-`bitcoinconsensus_error* err` - Will have the error/success code for the operation *(see below)*.
28
29
30
+
###### bitcoinconsensus_verify_script_with_amount
31
+
-`const unsigned char *scriptPubKey` - The previous output script that encumbers spending.
32
+
-`unsigned int scriptPubKeyLen` - The number of bytes for the `scriptPubKey`.
33
+
-`int64_t amount` - The amount spent in the input
34
+
-`const unsigned char *txTo` - The transaction with the input that is spending the previous output.
35
+
-`unsigned int txToLen` - The number of bytes for the `txTo`.
36
+
-`unsigned int nIn` - The index of the input in `txTo` that spends the `scriptPubKey`.
37
+
-`unsigned int flags` - The script validation flags *(see below)*.
38
+
-`bitcoinconsensus_error* err` - Will have the error/success code for the operation *(see below)*.
-`const unsigned char *scriptPubKey` - The previous output script that encumbers spending.
42
+
-`unsigned int scriptPubKeyLen` - The number of bytes for the `scriptPubKey`.
43
+
-`int64_t amount` - The amount spent in the input
44
+
-`const unsigned char *txTo` - The transaction with the input that is spending the previous output.
45
+
-`unsigned int txToLen` - The number of bytes for the `txTo`.
46
+
-`UTXO *spentOutputs` - Previous outputs spent in the transaction. `UTXO` is a struct composed by `const unsigned char *scriptPubKey`, `unsigned int scriptPubKeySize` (the number of bytes for the `scriptPubKey`) and `unsigned int value`.
47
+
-`unsigned int spentOutputsLen` - The number of bytes for the `spentOutputs`.
48
+
-`unsigned int nIn` - The index of the input in `txTo` that spends the `scriptPubKey`.
49
+
-`unsigned int flags` - The script validation flags *(see below)*.
50
+
-`bitcoinconsensus_error* err` - Will have the error/success code for the operation *(see below)*.
0 commit comments