Untested sapling consolidation plus sietch outputs to reduce metadata leakage
This commit is contained in:
@@ -24,6 +24,7 @@
|
|||||||
#include "komodo_defs.h"
|
#include "komodo_defs.h"
|
||||||
#include "script/standard.h"
|
#include "script/standard.h"
|
||||||
#include "cc/CCinclude.h"
|
#include "cc/CCinclude.h"
|
||||||
|
#include "sietch.h"
|
||||||
|
|
||||||
int32_t komodo_notaries(uint8_t pubkeys[64][33],int32_t height,uint32_t timestamp);
|
int32_t komodo_notaries(uint8_t pubkeys[64][33],int32_t height,uint32_t timestamp);
|
||||||
int32_t komodo_electednotary(int32_t *numnotariesp,uint8_t *pubkey33,int32_t height,uint32_t timestamp);
|
int32_t komodo_electednotary(int32_t *numnotariesp,uint8_t *pubkey33,int32_t height,uint32_t timestamp);
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
// Copyright (c) 2020 The Hush developers
|
||||||
|
// TODO: Forge should add his preferred copyright line here
|
||||||
|
// Distributed under the MIT software license, see the accompanying
|
||||||
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
#include "assert.h"
|
#include "assert.h"
|
||||||
#include "boost/variant/static_visitor.hpp"
|
#include "boost/variant/static_visitor.hpp"
|
||||||
#include "asyncrpcoperation_saplingconsolidation.h"
|
#include "asyncrpcoperation_saplingconsolidation.h"
|
||||||
@@ -11,11 +16,13 @@
|
|||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "utilmoneystr.h"
|
#include "utilmoneystr.h"
|
||||||
#include "wallet.h"
|
#include "wallet.h"
|
||||||
|
//#include "sietch.h"
|
||||||
|
|
||||||
CAmount fConsolidationTxFee = DEFAULT_CONSOLIDATION_FEE;
|
CAmount fConsolidationTxFee = DEFAULT_CONSOLIDATION_FEE;
|
||||||
bool fConsolidationMapUsed = false;
|
bool fConsolidationMapUsed = false;
|
||||||
const int CONSOLIDATION_EXPIRY_DELTA = 15;
|
const int CONSOLIDATION_EXPIRY_DELTA = 15;
|
||||||
|
|
||||||
|
extern string randomSietchZaddr();
|
||||||
|
|
||||||
AsyncRPCOperation_saplingconsolidation::AsyncRPCOperation_saplingconsolidation(int targetHeight) : targetHeight_(targetHeight) {}
|
AsyncRPCOperation_saplingconsolidation::AsyncRPCOperation_saplingconsolidation(int targetHeight) : targetHeight_(targetHeight) {}
|
||||||
|
|
||||||
@@ -168,10 +175,22 @@ bool AsyncRPCOperation_saplingconsolidation::main_impl() {
|
|||||||
|
|
||||||
builder.SetFee(fConsolidationTxFee);
|
builder.SetFee(fConsolidationTxFee);
|
||||||
|
|
||||||
//TODO: we want at least 2 zouts and potentially Sietch
|
// Add the actual consolidation tx
|
||||||
// We could split funds into 2 parts and send as 2 zouts
|
|
||||||
// or add amount=0 sietch zaddrs
|
|
||||||
builder.AddSaplingOutput(extsk.expsk.ovk, addr, amountToSend - fConsolidationTxFee);
|
builder.AddSaplingOutput(extsk.expsk.ovk, addr, amountToSend - fConsolidationTxFee);
|
||||||
|
|
||||||
|
// Add sietch zouts
|
||||||
|
int MIN_ZOUTS = 7;
|
||||||
|
for(size_t i = 0; i < MIN_ZOUTS; i++) {
|
||||||
|
// In Privacy Zdust We Trust -- Duke
|
||||||
|
string zdust = randomSietchZaddr();
|
||||||
|
LogPrint("zrpcunsafe", "%s: Adding sietch output", getId(), zdust);
|
||||||
|
auto zaddr = DecodePaymentAddress(zdust);
|
||||||
|
if (IsValidPaymentAddress(zaddr)) {
|
||||||
|
auto sietchZoutput = boost::get<libzcash::SaplingPaymentAddress>(zaddr);
|
||||||
|
int amount=0;
|
||||||
|
builder.AddSaplingOutput(extsk.expsk.ovk, sietchZoutput, amount);
|
||||||
|
}
|
||||||
|
}
|
||||||
//CTransaction tx = builder.Build();
|
//CTransaction tx = builder.Build();
|
||||||
|
|
||||||
auto maybe_tx = builder.Build();
|
auto maybe_tx = builder.Build();
|
||||||
|
|||||||
@@ -62,7 +62,7 @@
|
|||||||
|
|
||||||
#include "komodo_defs.h"
|
#include "komodo_defs.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "sietch.h"
|
//#include "sietch.h"
|
||||||
#include "rpchushwallet.h"
|
#include "rpchushwallet.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
@@ -79,6 +79,7 @@ uint32_t komodo_segid32(char *coinaddr);
|
|||||||
int32_t komodo_dpowconfs(int32_t height,int32_t numconfs);
|
int32_t komodo_dpowconfs(int32_t height,int32_t numconfs);
|
||||||
int32_t komodo_isnotaryvout(char *coinaddr,uint32_t tiptime); // from ac_private chains only
|
int32_t komodo_isnotaryvout(char *coinaddr,uint32_t tiptime); // from ac_private chains only
|
||||||
CBlockIndex *komodo_getblockindex(uint256 hash);
|
CBlockIndex *komodo_getblockindex(uint256 hash);
|
||||||
|
extern string randomSietchZaddr();
|
||||||
|
|
||||||
int64_t nWalletUnlockTime;
|
int64_t nWalletUnlockTime;
|
||||||
static CCriticalSection cs_nWalletUnlockTime;
|
static CCriticalSection cs_nWalletUnlockTime;
|
||||||
|
|||||||
@@ -42,6 +42,7 @@
|
|||||||
#include "zcash/Address.hpp"
|
#include "zcash/Address.hpp"
|
||||||
#include "zcash/zip32.h"
|
#include "zcash/zip32.h"
|
||||||
#include "base58.h"
|
#include "base58.h"
|
||||||
|
//#include "sietch.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|||||||
Reference in New Issue
Block a user