1
0
Fork 0
forked from lthn/blockchain

very first draft for transaction in/outs for atomics

This commit is contained in:
cryptozoidberg 2020-12-28 23:45:16 +01:00
parent cb18279d57
commit 6bee7541d6
No known key found for this signature in database
GPG key ID: 22DEB97A54C6FDEC

View file

@ -223,6 +223,21 @@ namespace currency
END_SERIALIZE()
};
struct txin_to_htlc
{
crypto::hash hltc_origin;
txout_v key_offset;
crypto::key_image k_image; // double spending protection
std::vector<txin_etc_details_v> etc_details; //this flag used when TX_FLAG_SIGNATURE_MODE_SEPARATE flag is set, point to which amount of outputs(starting from zero) used in signature
BEGIN_SERIALIZE_OBJECT()
FIELD(hltc_origin)
FIELD(key_offset)
VARINT_FIELD(k_image)
FIELD(etc_details)
END_SERIALIZE()
};
struct txin_multisig
{
uint64_t amount;
@ -249,6 +264,21 @@ namespace currency
END_SERIALIZE()
};
struct txout_htlc
{
crypto::hash htlc_hash;
uint8_t flags; //select type of the hash, may be some extra info in future
uint64_t expiration;
crypto::public_key pkey;
BEGIN_SERIALIZE_OBJECT()
FIELD(htlc_hash)
FIELD(flags)
VARINT_FIELD(expiration)
FIELD(pkey)
END_SERIALIZE()
};
typedef boost::variant<txin_gen, txin_to_key, txin_multisig> txin_v;
typedef boost::variant<txout_to_key, txout_multisig> txout_target_v;