2 using System.Collections.Generic;
5 using System.Threading.Tasks;
8 using SQLite.Net.Attributes;
9 using SQLite.Net.Interop;
10 using SQLite.Net.Platform.Generic;
11 using SQLiteNetExtensions.Attributes;
12 using System.Diagnostics.Contracts;
17 /// Block headers table
19 public interface IBlockStorageItem
22 /// Item ID in the database
24 long ItemID { get; set; }
27 /// PBKDF2+Salsa20 of block hash
29 byte[] Hash { get; set; }
32 /// Version of block schema
34 uint nVersion { get; set; }
37 /// Previous block hash.
39 byte[] prevHash { get; set; }
44 byte[] merkleRoot { get; set; }
49 uint nTime { get; set; }
52 /// Compressed difficulty representation.
54 uint nBits { get; set; }
59 uint nNonce { get; set; }
64 byte[] nextHash { get; set; }
69 BlockType BlockTypeFlag { get; set; }
74 long nStakeModifier { get; set; }
77 /// Proof-of-Stake hash
79 byte[] hashProofOfStake { get; set; }
82 /// Stake generation outpoint.
84 byte[] prevoutStake { get; set; }
87 /// Stake generation time.
89 uint nStakeTime { get; set; }
94 uint nHeight { get; set; }
97 /// Block position in file
99 byte[] BlockPos { get; set; }
102 /// Block size in bytes
104 byte[] BlockSize { get; set; }
107 public interface IMerkleNode
112 long nMerkleNodeID { get; set; }
115 /// Reference to parent block database item.
117 long nParentBlockID { get; set; }
120 /// Transaction type flag
122 TxFlags TransactionFlags { get; set; }
127 byte[] TransactionHash { get; set; }
130 /// Transaction offset from the beginning of block header, encoded in VarInt format.
132 byte[] TxOffset { get; set; }
135 /// Transaction size, encoded in VarInt format.
137 byte[] TxSize { get; set; }
140 public interface ITxOutItem
143 /// Reference to transaction item.
145 long nMerkleNodeID { get; set; }
150 OutputFlags outputFlags { get; set; }
153 /// Output number in VarInt format.
155 byte[] OutputNumber { get; set; }
158 /// Output value in VarInt format.
160 byte[] OutputValue { get; set; }
163 /// Second half of script which contains spending instructions.
165 byte[] scriptPubKey { get; set; }
168 /// Getter for output number.
173 /// Getter for output value.
175 ulong nValue { get; }
178 /// Getter ans setter for IsSpent flag.
180 bool IsSpent { get; set; }