forked from amjuarez/bytecoin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Antonio Juarez
committed
Jul 30, 2015
1 parent
b3a91f6
commit 50cdbfa
Showing
573 changed files
with
30,695 additions
and
21,213 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,114 @@ | ||
// Copyright (c) 2012-2015, The CryptoNote developers, The Bytecoin developers | ||
// | ||
// This file is part of Bytecoin. | ||
// | ||
// Bytecoin is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU Lesser General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// Bytecoin is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU Lesser General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Lesser General Public License | ||
// along with Bytecoin. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
#pragma once | ||
|
||
#include <vector> | ||
#include <boost/variant.hpp> | ||
#include "CryptoTypes.h" | ||
|
||
namespace CryptoNote { | ||
|
||
struct BaseInput { | ||
uint32_t blockIndex; | ||
}; | ||
|
||
struct KeyInput { | ||
uint64_t amount; | ||
std::vector<uint32_t> outputIndexes; | ||
Crypto::KeyImage keyImage; | ||
}; | ||
|
||
struct MultisignatureInput { | ||
uint64_t amount; | ||
uint8_t signatureCount; | ||
uint32_t outputIndex; | ||
}; | ||
|
||
struct KeyOutput { | ||
Crypto::PublicKey key; | ||
}; | ||
|
||
struct MultisignatureOutput { | ||
std::vector<Crypto::PublicKey> keys; | ||
uint8_t requiredSignatureCount; | ||
}; | ||
|
||
typedef boost::variant<BaseInput, KeyInput, MultisignatureInput> TransactionInput; | ||
|
||
typedef boost::variant<KeyOutput, MultisignatureOutput> TransactionOutputTarget; | ||
|
||
struct TransactionOutput { | ||
uint64_t amount; | ||
TransactionOutputTarget target; | ||
}; | ||
|
||
struct TransactionPrefix { | ||
uint8_t version; | ||
uint64_t unlockTime; | ||
std::vector<TransactionInput> inputs; | ||
std::vector<TransactionOutput> outputs; | ||
std::vector<uint8_t> extra; | ||
}; | ||
|
||
struct Transaction : public TransactionPrefix { | ||
std::vector<std::vector<Crypto::Signature>> signatures; | ||
}; | ||
|
||
struct ParentBlock { | ||
uint8_t majorVersion; | ||
uint8_t minorVersion; | ||
Crypto::Hash previousBlockHash; | ||
uint16_t transactionCount; | ||
std::vector<Crypto::Hash> baseTransactionBranch; | ||
Transaction baseTransaction; | ||
std::vector<Crypto::Hash> blockchainBranch; | ||
}; | ||
|
||
struct BlockHeader { | ||
uint8_t majorVersion; | ||
uint8_t minorVersion; | ||
uint32_t nonce; | ||
uint64_t timestamp; | ||
Crypto::Hash previousBlockHash; | ||
}; | ||
|
||
struct Block : public BlockHeader { | ||
ParentBlock parentBlock; | ||
Transaction baseTransaction; | ||
std::vector<Crypto::Hash> transactionHashes; | ||
}; | ||
|
||
struct AccountPublicAddress { | ||
Crypto::PublicKey spendPublicKey; | ||
Crypto::PublicKey viewPublicKey; | ||
}; | ||
|
||
struct AccountKeys { | ||
AccountPublicAddress address; | ||
Crypto::SecretKey spendSecretKey; | ||
Crypto::SecretKey viewSecretKey; | ||
}; | ||
|
||
struct KeyPair { | ||
Crypto::PublicKey publicKey; | ||
Crypto::SecretKey secretKey; | ||
}; | ||
|
||
using BinaryArray = std::vector<uint8_t>; | ||
|
||
} |
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
Oops, something went wrong.