Skip to content

Commit

Permalink
Correct sighash compute
Browse files Browse the repository at this point in the history
  • Loading branch information
AAweidai committed Dec 3, 2021
1 parent 6dd6625 commit 05599fc
Show file tree
Hide file tree
Showing 14 changed files with 42 additions and 42 deletions.
12 changes: 6 additions & 6 deletions Sources/Musig2Bitcoin.xcframework/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,29 @@
<array>
<dict>
<key>LibraryIdentifier</key>
<string>ios-x86_64-simulator</string>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>Musig2Bitcoin.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>x86_64</string>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<string>ios-x86_64-simulator</string>
<key>LibraryPath</key>
<string>Musig2Bitcoin.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
</array>
<key>CFBundlePackageType</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Musig2Bitcoin.h
// Musig2Bitcoin
//
// Created by daiwei on 2021/12/1.
// Created by daiwei on 2021/12/3.
//

#import <Foundation/Foundation.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ char *generate_threshold_pubkey(const char *pubkeys, uint8_t threshold);

char *generate_control_block(const char *pubkeys, uint8_t threshold, const char *agg_pubkey);

char *get_base_tx(const char *txid, uint32_t index);
char *get_base_tx(const char *prev_tx, const char *txid, uint32_t index);

char *add_input(const char *base_tx, const char *txid, uint32_t index);
char *add_input(const char *base_tx, const char *prev_tx, const char *txid, uint32_t index);

char *add_output(const char *base_tx, const char *address, uint64_t amount);

char *get_sighash(const char *prev_tx,
const char *tx,
char *get_sighash(const char *base_tx,
const char *txid,
uint32_t input_index,
const char *agg_pubkey,
uint32_t sigversion);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ public func generateThresholdPubkey(pubkeys: [Swift.String], threshold: Swift.UI
public func generateControlBlock(pubkeys: [Swift.String], threshold: Swift.UInt8, agg_pubkey: Swift.String) -> Swift.String
public func generateSchnorrSignature(message: Swift.String, privkey: Swift.String) -> Swift.String
public func getScriptPubkey(addr: Swift.String) -> Swift.String
public func generateRawTx(txids: [Swift.String], input_indexs: [Swift.UInt32], addresses: [Swift.String], amounts: [Swift.UInt64]) -> Swift.String
public func getSighash(prev_tx: Swift.String, tx: Swift.String, input_index: Swift.UInt32, agg_pubkey: Swift.String, sigversion: Swift.UInt32) -> Swift.String
public func generateRawTx(pre_txs: [Swift.String], txids: [Swift.String], input_indexs: [Swift.UInt32], addresses: [Swift.String], amounts: [Swift.UInt64]) -> Swift.String
public func getSighash(base_tx: Swift.String, txid: Swift.String, input_index: Swift.UInt32, agg_pubkey: Swift.String, sigversion: Swift.UInt32) -> Swift.String
public func buildThresholdTx(tx: Swift.String, agg_signature: Swift.String, agg_pubkey: Swift.String, control: Swift.String, txid: Swift.String, input_index: Swift.UInt32) -> Swift.String
public func buildTaprootTx(tx: Swift.String, signature: Swift.String, txid: Swift.String, input_index: Swift.UInt32) -> Swift.String
public func generateSpentOutputs(prev_txs: [Swift.String], input_indexs: [Swift.UInt32]) -> Swift.String
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ public func generateThresholdPubkey(pubkeys: [Swift.String], threshold: Swift.UI
public func generateControlBlock(pubkeys: [Swift.String], threshold: Swift.UInt8, agg_pubkey: Swift.String) -> Swift.String
public func generateSchnorrSignature(message: Swift.String, privkey: Swift.String) -> Swift.String
public func getScriptPubkey(addr: Swift.String) -> Swift.String
public func generateRawTx(txids: [Swift.String], input_indexs: [Swift.UInt32], addresses: [Swift.String], amounts: [Swift.UInt64]) -> Swift.String
public func getSighash(prev_tx: Swift.String, tx: Swift.String, input_index: Swift.UInt32, agg_pubkey: Swift.String, sigversion: Swift.UInt32) -> Swift.String
public func generateRawTx(pre_txs: [Swift.String], txids: [Swift.String], input_indexs: [Swift.UInt32], addresses: [Swift.String], amounts: [Swift.UInt64]) -> Swift.String
public func getSighash(base_tx: Swift.String, txid: Swift.String, input_index: Swift.UInt32, agg_pubkey: Swift.String, sigversion: Swift.UInt32) -> Swift.String
public func buildThresholdTx(tx: Swift.String, agg_signature: Swift.String, agg_pubkey: Swift.String, control: Swift.String, txid: Swift.String, input_index: Swift.UInt32) -> Swift.String
public func buildTaprootTx(tx: Swift.String, signature: Swift.String, txid: Swift.String, input_index: Swift.UInt32) -> Swift.String
public func generateSpentOutputs(prev_txs: [Swift.String], input_indexs: [Swift.UInt32]) -> Swift.String
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Musig2Bitcoin.h
// Musig2Bitcoin
//
// Created by daiwei on 2021/12/1.
// Created by daiwei on 2021/12/3.
//

#import <Foundation/Foundation.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ char *generate_threshold_pubkey(const char *pubkeys, uint8_t threshold);

char *generate_control_block(const char *pubkeys, uint8_t threshold, const char *agg_pubkey);

char *get_base_tx(const char *txid, uint32_t index);
char *get_base_tx(const char *prev_tx, const char *txid, uint32_t index);

char *add_input(const char *base_tx, const char *txid, uint32_t index);
char *add_input(const char *base_tx, const char *prev_tx, const char *txid, uint32_t index);

char *add_output(const char *base_tx, const char *address, uint64_t amount);

char *get_sighash(const char *prev_tx,
const char *tx,
char *get_sighash(const char *base_tx,
const char *txid,
uint32_t input_index,
const char *agg_pubkey,
uint32_t sigversion);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ public func generateThresholdPubkey(pubkeys: [Swift.String], threshold: Swift.UI
public func generateControlBlock(pubkeys: [Swift.String], threshold: Swift.UInt8, agg_pubkey: Swift.String) -> Swift.String
public func generateSchnorrSignature(message: Swift.String, privkey: Swift.String) -> Swift.String
public func getScriptPubkey(addr: Swift.String) -> Swift.String
public func generateRawTx(txids: [Swift.String], input_indexs: [Swift.UInt32], addresses: [Swift.String], amounts: [Swift.UInt64]) -> Swift.String
public func getSighash(prev_tx: Swift.String, tx: Swift.String, input_index: Swift.UInt32, agg_pubkey: Swift.String, sigversion: Swift.UInt32) -> Swift.String
public func generateRawTx(pre_txs: [Swift.String], txids: [Swift.String], input_indexs: [Swift.UInt32], addresses: [Swift.String], amounts: [Swift.UInt64]) -> Swift.String
public func getSighash(base_tx: Swift.String, txid: Swift.String, input_index: Swift.UInt32, agg_pubkey: Swift.String, sigversion: Swift.UInt32) -> Swift.String
public func buildThresholdTx(tx: Swift.String, agg_signature: Swift.String, agg_pubkey: Swift.String, control: Swift.String, txid: Swift.String, input_index: Swift.UInt32) -> Swift.String
public func buildTaprootTx(tx: Swift.String, signature: Swift.String, txid: Swift.String, input_index: Swift.UInt32) -> Swift.String
public func generateSpentOutputs(prev_txs: [Swift.String], input_indexs: [Swift.UInt32]) -> Swift.String
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ public func generateThresholdPubkey(pubkeys: [Swift.String], threshold: Swift.UI
public func generateControlBlock(pubkeys: [Swift.String], threshold: Swift.UInt8, agg_pubkey: Swift.String) -> Swift.String
public func generateSchnorrSignature(message: Swift.String, privkey: Swift.String) -> Swift.String
public func getScriptPubkey(addr: Swift.String) -> Swift.String
public func generateRawTx(txids: [Swift.String], input_indexs: [Swift.UInt32], addresses: [Swift.String], amounts: [Swift.UInt64]) -> Swift.String
public func getSighash(prev_tx: Swift.String, tx: Swift.String, input_index: Swift.UInt32, agg_pubkey: Swift.String, sigversion: Swift.UInt32) -> Swift.String
public func generateRawTx(pre_txs: [Swift.String], txids: [Swift.String], input_indexs: [Swift.UInt32], addresses: [Swift.String], amounts: [Swift.UInt64]) -> Swift.String
public func getSighash(base_tx: Swift.String, txid: Swift.String, input_index: Swift.UInt32, agg_pubkey: Swift.String, sigversion: Swift.UInt32) -> Swift.String
public func buildThresholdTx(tx: Swift.String, agg_signature: Swift.String, agg_pubkey: Swift.String, control: Swift.String, txid: Swift.String, input_index: Swift.UInt32) -> Swift.String
public func buildTaprootTx(tx: Swift.String, signature: Swift.String, txid: Swift.String, input_index: Swift.UInt32) -> Swift.String
public func generateSpentOutputs(prev_txs: [Swift.String], input_indexs: [Swift.UInt32]) -> Swift.String
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
</data>
<key>Headers/Musig2Bitcoin.h</key>
<data>
f91lR9prUZ6H0iqsuuoYEDtK/nM=
0S9tW5+zSOdngOFZoKklKy+pbjI=
</data>
<key>Headers/Musig2Header.h</key>
<data>
bYhiFc42gXQ31Rtlmn561aIugN0=
UVQIS1uIr4woGvF4z1g7y6G9+hY=
</data>
<key>Info.plist</key>
<data>
Expand All @@ -26,23 +26,23 @@
</data>
<key>Modules/Musig2Bitcoin.swiftmodule/x86_64-apple-ios-simulator.swiftinterface</key>
<data>
Pn1iy8YmFkeQiGatvATWruwgkjQ=
876PlavO3QXYU4I1i1aeogIYSdo=
</data>
<key>Modules/Musig2Bitcoin.swiftmodule/x86_64-apple-ios-simulator.swiftmodule</key>
<data>
dSNjpYmnuLi9p6IDHAfdSKDIya0=
DDFZHrfNDGKVCeDzKk4x/ipJaCY=
</data>
<key>Modules/Musig2Bitcoin.swiftmodule/x86_64.swiftdoc</key>
<data>
hOwgxW/WXWPiNHr4/kP4uBefR9o=
</data>
<key>Modules/Musig2Bitcoin.swiftmodule/x86_64.swiftinterface</key>
<data>
Pn1iy8YmFkeQiGatvATWruwgkjQ=
876PlavO3QXYU4I1i1aeogIYSdo=
</data>
<key>Modules/Musig2Bitcoin.swiftmodule/x86_64.swiftmodule</key>
<data>
dSNjpYmnuLi9p6IDHAfdSKDIya0=
DDFZHrfNDGKVCeDzKk4x/ipJaCY=
</data>
<key>Modules/module.modulemap</key>
<data>
Expand All @@ -66,22 +66,22 @@
<dict>
<key>hash</key>
<data>
f91lR9prUZ6H0iqsuuoYEDtK/nM=
0S9tW5+zSOdngOFZoKklKy+pbjI=
</data>
<key>hash2</key>
<data>
fg5dt4tP60n6lWfy7bspV+MlO1B7xZ1HszTgM42sgcQ=
3r5QVUw3FXcfLpr2VbrrlQ2/tESpCf91/hYBtojdJ2Y=
</data>
</dict>
<key>Headers/Musig2Header.h</key>
<dict>
<key>hash</key>
<data>
bYhiFc42gXQ31Rtlmn561aIugN0=
UVQIS1uIr4woGvF4z1g7y6G9+hY=
</data>
<key>hash2</key>
<data>
V8QfwJOTrjBTw0wicyhIycVjlECkVeB0HD/qsq2na5U=
cezVUAtB450M+YxrlJ5iDiYYlUMfWkl0QOiK9oQTqfQ=
</data>
</dict>
<key>Modules/Musig2Bitcoin.swiftmodule/x86_64-apple-ios-simulator.swiftdoc</key>
Expand All @@ -99,22 +99,22 @@
<dict>
<key>hash</key>
<data>
Pn1iy8YmFkeQiGatvATWruwgkjQ=
876PlavO3QXYU4I1i1aeogIYSdo=
</data>
<key>hash2</key>
<data>
5FZVGLoAeLuJuC8LpAhK+CxeqjP7WiO4eV/q90ijmjs=
b1H2e4pn01UWjrphItuuxz51Lt3bjSE1NINzwP36zFM=
</data>
</dict>
<key>Modules/Musig2Bitcoin.swiftmodule/x86_64-apple-ios-simulator.swiftmodule</key>
<dict>
<key>hash</key>
<data>
dSNjpYmnuLi9p6IDHAfdSKDIya0=
DDFZHrfNDGKVCeDzKk4x/ipJaCY=
</data>
<key>hash2</key>
<data>
7TTTUzJkAnvkvUbAsX7Ehh0kf42csNER7u0Yvk8XX1o=
CSRY4iOTQAhFuQbJrMGl9KkY3wyBdOQ0ON8PGovSuZ8=
</data>
</dict>
<key>Modules/Musig2Bitcoin.swiftmodule/x86_64.swiftdoc</key>
Expand All @@ -132,22 +132,22 @@
<dict>
<key>hash</key>
<data>
Pn1iy8YmFkeQiGatvATWruwgkjQ=
876PlavO3QXYU4I1i1aeogIYSdo=
</data>
<key>hash2</key>
<data>
5FZVGLoAeLuJuC8LpAhK+CxeqjP7WiO4eV/q90ijmjs=
b1H2e4pn01UWjrphItuuxz51Lt3bjSE1NINzwP36zFM=
</data>
</dict>
<key>Modules/Musig2Bitcoin.swiftmodule/x86_64.swiftmodule</key>
<dict>
<key>hash</key>
<data>
dSNjpYmnuLi9p6IDHAfdSKDIya0=
DDFZHrfNDGKVCeDzKk4x/ipJaCY=
</data>
<key>hash2</key>
<data>
7TTTUzJkAnvkvUbAsX7Ehh0kf42csNER7u0Yvk8XX1o=
CSRY4iOTQAhFuQbJrMGl9KkY3wyBdOQ0ON8PGovSuZ8=
</data>
</dict>
<key>Modules/module.modulemap</key>
Expand Down

0 comments on commit 05599fc

Please sign in to comment.