plebble
p2pkh.h
Go to the documentation of this file.
1 /*
2 -------------------------------------------------------------------------------
3  PLEBBLE
4 -------------------------------------------------------------------------------
5  Copyright (C) 2019-2020 KATLAS Technology. (http://katlastechnology.com)
6  Copyright (C) 2017-2020 Marcos Mayorga. (mm@mm-studios.com)
7 
8  This file is part of our Plebble(R) Platform.
9 
10  The code below cannot be copied, used for any purpose other than the one
11  agreed and/or distributed without the express permission of
12  KATLAS Technology.
13 -------------------------------------------------------------------------------
14 
15 
16 */
17 #ifndef USGOV_a19083e9bc17d9b21b0e176de704d07cf9a659bc3bbe63f95d79e1696df47467
18 #define USGOV_a19083e9bc17d9b21b0e176de704d07cf9a659bc3bbe63f95d79e1696df47467
19 
20 #include <us/gov/cash/app.h>
21 #include <us/gov/cash/tx.h>
22 #include <us/gov/cash/map_tx.h>
23 #include <us/gov/cash/file_tx.h>
24 #include <us/gov/cash/ttx.h>
25 
26 namespace us { namespace gov {
27 namespace cash {
28 
29  struct p2pkh final {
34 
35  static bool check_input(const hash_t& addreess, const tx&, const string& locking_program_input);
36  static string create_input(const tx& t, const tx::sigcode_t&, const privkey_t&);
38 
39  static string create_input(const ec::sigmsg_hasher_t::value_type& h, const privkey_t&);
40  static bool check_input(const hash_t& addreess, const map_tx&);
41  static string create_input(const map_tx& t, const privkey_t&);
42 
43  static bool check_input(const hash_t& addreess, const file_tx&);
44  static string create_input(const file_tx& t, const privkey_t&);
45 
46  static bool check_input(const hash_t& addreess, const ttx&);
47  static string create_input(const ttx& t, const privkey_t&);
48  };
49 
50 }
51 }}
52 
53 #endif
54 
us::gov::cash::p2pkh::locking_program_hash
static hash_t locking_program_hash
Definition: p2pkh.h:33
us::gov::cash::ttx::get_hash
ec::sigmsg_hasher_t::value_type get_hash() const
us::is_ko
static bool is_ko(const std::string &s)
Definition: ko.h:30
us::gov::cash::tx::sigcode_t::from_stream
static bool from_stream(sigcode_t &, istream &is)
p2pkh.h
us::gov::cash::p2pkh::create_input
static string create_input(const map_tx &t, const privkey_t &)
us::gov::cash::p2pkh::check_input
static bool check_input(const hash_t &addreess, const map_tx &)
us.ko
Definition: ko.java:20
us
Definition: daemon.h:22
us::gov::cash::p2pkh
Definition: p2pkh.h:29
us::gov::crypto::ripemd160::value_type
Definition: ripemd160.h:38
us::gov::cash::tx::get_hash
ec::sigmsg_hasher_t::value_type get_hash(const sigcode_t &) const
unlikely
#define unlikely(x)
Definition: likely.h:30
us::gov::cash::p2pkh::create_input
static string create_input(const tx &t, const tx::sigcode_t &, const privkey_t &)
us::gov::crypto::sha256::value_type
Definition: sha256.h:38
us::gov::cash
Definition: app.h:43
app.h
us::gov::cash::tx::sigcode_t
Definition: tx.h:64
map_tx.h
us::gov::cash::p2pkh::keys
crypto::ec::keys keys
Definition: p2pkh.h:30
us::gov::cash::ttx
Definition: ttx.h:46
us::gov::crypto::ec::keys::pub_t
Definition: ec.h:44
us::gov::crypto::ec::keys::get_pubkey
static pub_t get_pubkey(const priv_t &privkey)
us::gov::cash::map_tx
Definition: map_tx.h:46
us::gov::crypto::ec::instance
static ec instance
Definition: ec.h:143
us::gov::cash::p2pkh::create_input
static string create_input(const ec::sigmsg_hasher_t::value_type &, const tx::sigcode_t &, const privkey_t &)
us::gov::cash::p2pkh::pubkey_t
keys::pub_t pubkey_t
Definition: p2pkh.h:31
us::gov::cash::map_tx::locking_program_input
string locking_program_input
Definition: map_tx.h:64
us::gov::cash::p2pkh::create_input
static string create_input(const ttx &t, const privkey_t &)
c
us::gov::cash::p2pkh c
Definition: p2pkh.cpp:24
us::gov::crypto::b58::decode
std::vector< unsigned char > decode(const std::string &s)
Definition: base58.cpp:54
us::gov::cash::file_tx
Definition: file_tx.h:46
us::gov::cash::p2pkh::create_input
static string create_input(const ec::sigmsg_hasher_t::value_type &h, const privkey_t &)
file_tx.h
us::gov::crypto::ec::keys::priv_t
Definition: ec.h:77
ttx.h
us::gov
Definition: daemon.h:22
us::gov::cash::ttx::locking_program_input
string locking_program_input
Definition: ttx.h:66
us::gov::cash::p2pkh::check_input
static bool check_input(const hash_t &addreess, const file_tx &)
us::gov::cash::p2pkh::check_input
static bool check_input(const hash_t &addreess, const ttx &)
std
Definition: app.h:380
us::gov::crypto::b58::encode
std::string encode(const std::string &s)
Definition: base58.cpp:62
us::gov::cash::tx
Definition: tx.h:45
us::gov::crypto::ec::sign
ko sign(const keys::priv_t &pk, const string &text, sig_t &signature) const
us::gov::crypto::ec::keys
Definition: ec.h:43
us::gov::cash::map_tx::get_hash
ec::sigmsg_hasher_t::value_type get_hash() const
us::gov::cash::file_tx::get_hash
ec::sigmsg_hasher_t::value_type get_hash() const
us::gov::cash::file_tx::locking_program_input
string locking_program_input
Definition: file_tx.h:64
crypto.h
gov.h
us::gov::cash::tx::sigcode_t::to_stream
void to_stream(ostream &os) const
us::gov::cash::p2pkh::create_input
static string create_input(const file_tx &t, const privkey_t &)
us::gov::cash::p2pkh::privkey_t
keys::priv_t privkey_t
Definition: p2pkh.h:32
us::gov::cash::p2pkh::check_input
static bool check_input(const hash_t &addreess, const tx &, const string &locking_program_input)
tx.h