-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: add skeleton for new silentpayments (BIP352) module
- Loading branch information
Showing
7 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#ifndef SECP256K1_SILENTPAYMENTS_H | ||
#define SECP256K1_SILENTPAYMENTS_H | ||
|
||
#include "secp256k1.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/* This module provides an implementation for Silent Payments, as specified in | ||
* BIP352. This particularly involves the creation of input tweak data by | ||
* summing up private or public keys and the derivation of a shared secret using | ||
* Elliptic Curve Diffie-Hellman. Combined are either: | ||
* - spender's private keys and recipient's public key (a * B, sender side) | ||
* - spender's public keys and recipient's private key (A * b, recipient side) | ||
* With this result, the necessary key material for ultimately creating/scanning | ||
* or spending Silent Payment outputs can be determined. | ||
* | ||
* Note that this module is _not_ a full implementation of BIP352, as it | ||
* inherently doesn't deal with higher-level concepts like addresses, output | ||
* script types or transactions. The intent is to provide a module for | ||
* abstracting away the elliptic-curve operations required for the protocol. For | ||
* any wallet software already using libsecp256k1, this API should provide all | ||
* the functions needed for a Silent Payments implementation without requiring | ||
* any further elliptic-curve operations from the wallet. | ||
*/ | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* SECP256K1_SILENTPAYMENTS_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
include_HEADERS += include/secp256k1_silentpayments.h | ||
noinst_HEADERS += src/modules/silentpayments/main_impl.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/*********************************************************************** | ||
* Distributed under the MIT software license, see the accompanying * | ||
* file COPYING or https://www.opensource.org/licenses/mit-license.php.* | ||
***********************************************************************/ | ||
|
||
#ifndef SECP256K1_MODULE_SILENTPAYMENTS_MAIN_H | ||
#define SECP256K1_MODULE_SILENTPAYMENTS_MAIN_H | ||
|
||
#include "../../../include/secp256k1.h" | ||
#include "../../../include/secp256k1_silentpayments.h" | ||
|
||
/* TODO: implement functions for sender side. */ | ||
|
||
/* TODO: implement functions for receiver side. */ | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters