Represents a single transaction on the Ixian blockchain. More...
Classes | |
struct | MultisigAddrAdd |
Another allowed signer is being added to a Wallet. If the target wallet is not yet a 'Multi-Signature' wallet, it will be converted into one and the number of required signatures will be set to 1. More... | |
struct | MultisigAddrDel |
An allowed signer is being removed from a Wallet. If the target wallet is not a 'Multi-Signature' wallet, such a transaction is considered invalid. The original Wallet's owner cannot be removed. More... | |
struct | MultisigChSig |
Change the number of required signatures for a 'Multi-Signature' wallet. More... | |
struct | MultisigTxData |
Additional signature for an existing MultisigTX transaction that is waiting in the pool. More... | |
Public Types | |
enum | Type : int { Type.Normal = 0, Type.PoWSolution = 1, Type.StakingReward = 2, Type.Genesis = 3, Type.MultisigTX = 4, Type.ChangeMultisigWallet = 5, Type.MultisigAddTxSignature = 6 } |
Type of the transaction. More... | |
enum | MultisigWalletChangeType : byte { MultisigWalletChangeType.AddSigner = 1, MultisigWalletChangeType.DelSigner = 2, MultisigWalletChangeType.ChangeReqSigs = 3 } |
Type of change being performed on a 'Multi-Signature' wallet. More... | |
Public Member Functions | |
Transaction (int tx_type) | |
Creates an empty transaction of the specified type. More... | |
Transaction (int tx_type, IxiNumber tx_amount, IxiNumber tx_feePerKb, byte[] tx_to, byte[] tx_from, byte[] tx_data, byte[] tx_pubKey, ulong tx_blockHeight, int tx_nonce=-1, long tx_timestamp=0) | |
Generates a new transaction from the provided data. This variant widthdraws from and deposits to a single address. More... | |
Transaction (int tx_type, IxiNumber tx_feePerKb, SortedDictionary< byte[], IxiNumber > tx_toList, byte[] tx_from, byte[] tx_data, byte[] tx_pubKey, ulong tx_blockHeight, int tx_nonce=-1, long tx_timestamp=0) | |
Generates a new transaction from the provided data. This variant can deposit to a multiple addresses. More... | |
Transaction (int tx_type, IxiNumber tx_feePerKb, SortedDictionary< byte[], IxiNumber > tx_toList, SortedDictionary< byte[], IxiNumber > tx_fromList, byte[] tx_data, byte[] tx_pubKey, ulong tx_blockHeight, int tx_nonce=-1, bool sign_transaction=true) | |
Generates a new transaction from the provided data. This variant can withdraw from and deposit to a multiple addresses. More... | |
Transaction (Transaction tx_transaction) | |
Copy constructor. More... | |
Transaction (byte[] bytes, bool include_applied=false) | |
Constructs a transaction object from the serialized transaction data. See also getBytes() . More... | |
byte [] | getBytes (bool include_applied=false) |
Serializes the transaction object for transmission and returns a byte-field. See also the constructor Transaction(byte[]) . More... | |
bool | equals (Transaction tx) |
Checks if the two transactions are exactly equal. More... | |
bool | verifySignature (byte[] pubkey, byte[] nonce) |
Checks the transaction's signature against the given public key and address nonce. More... | |
string | generateID () |
Generates the Transaction ID from the transaction data. More... | |
byte [] | getSignature (byte[] checksum, byte[] private_key=null) |
Calculates the signature for the transaction. More... | |
IxiNumber | calculateTotalAmount () |
Calculates the total transaction amount, without fee. More... | |
void | generateChecksums () |
Calculates the transaction checksum and stores it in the transaction. More... | |
IxiNumber | calculateMinimumFee (IxiNumber pricePerKb) |
Calculates the lowest possible transaction fee based on the size of the transaction. More... | |
object | GetMultisigData () |
Wrapper function to attempt and parse the transaction's optional data field as some kind of Multisig object. More... | |
Dictionary< string, object > | toDictionary () |
Encodes all transaction data fields into a Dictionary for easier conversion to JSON via the REST API server. More... | |
Static Public Member Functions | |
static byte [] | calculateChecksum (Transaction transaction) |
Calculates the transaction's checksum. More... | |
static AddressData | findMyMultisigAddressData (byte[] multisig_address) |
Checks owned addresses and returns the first one which is allowed to sign transactions for multisig_address . More... | |
static Transaction | multisigTransaction (IxiNumber tx_amount, IxiNumber tx_fee, byte[] tx_to, byte[] tx_from, ulong tx_blockHeight) |
Generates a multisig transaction. More... | |
static Transaction | multisigTransaction (IxiNumber tx_fee, SortedDictionary< byte[], IxiNumber > tx_to_list, byte[] tx_from, ulong tx_blockHeight) |
Generates a multisig transaction with multiple destination addresses. More... | |
static Transaction | multisigAddTxSignature (string orig_txid, IxiNumber tx_fee, byte[] tx_from, ulong tx_blockHeight) |
Adds a signature to the specified multisig transaction, if possible. This function generates a transaction which adds the signature for orig_txid . More... | |
static Transaction | multisigAddKeyTransaction (byte[] allowed_address, IxiNumber tx_fee, byte[] tx_from, ulong tx_blockHeight) |
Adds a signature to the specified multisig wallet. This function generates a transaction which adds the specified allowed_address to the multisig wallet tx_from . More... | |
static Transaction | multisigDelKeyTransaction (byte[] disallowed_address, IxiNumber tx_fee, byte[] tx_from, ulong tx_blockHeight) |
Deletes a signature from the specified multisig wallet. This function generates a transaction which deletes the specified disallowed_address from the multisig wallet tx_from . More... | |
static Transaction | multisigChangeReqSigs (byte sigs, IxiNumber tx_fee, byte[] tx_from, ulong tx_blockHeight) |
Changes the multisig wallet minimum required signatures value. This function generates a transaction which changes the specified multisig wallet tx_from with a new minimum required signatures value.. More... | |
Public Attributes | |
int | version |
Transaction version. More... | |
string | id |
Transaction ID. More... | |
int | type |
Transaction type. See also Transaction.Type . More... | |
IxiNumber | amount = new IxiNumber("0") |
Total amount of Ixi being transferred. More... | |
IxiNumber | fee = new IxiNumber("0") |
Transaction fee - based on the serialized size of the transaction. More... | |
SortedDictionary< byte[], IxiNumber > | fromList = new SortedDictionary<byte[], IxiNumber>(new ByteArrayComparer()) |
Source wallets where the funds are withdrawn. Each address specifies the amount of Ixi being widthrawn from it. More... | |
SortedDictionary< byte[], IxiNumber > | toList = new SortedDictionary<byte[], IxiNumber>(new ByteArrayComparer()) |
Destination wallets where the funds will be deposited. Each address specifies the amount of Ixi being deposited to it. More... | |
byte [] | data |
Optional data included with the transaction. This can be any byte-field. The transaction fee will increase with the amount of data. More... | |
ulong | blockHeight |
Block number when the transaction was generated. More... | |
int | nonce |
Unique 'nonce' value which prevents certain classes of transaction replay attacks. More... | |
long | timeStamp |
Timestam of when the transaction was created as a unix epoch (seconds since 1970-01-01). More... | |
byte [] | checksum |
Checksum of all transaction data to ensure it hasn't been tampered with or corrupted during transmission. More... | |
byte [] | signature |
Signature by the originating wallets' primary key. See fromList . More... | |
byte [] | pubKey |
Publick key which performed the signature and owns the source wallets in fromList . More... | |
ulong | applied |
Block height at which the transaction was applied. More... | |
bool | fromLocalStorage = false |
Indicator if the transaction was loaded from cold storage. More... | |
bool | powVerified = false |
Helper flag that determines whether PoW solution was already verified (used locally) More... | |
Static Public Attributes | |
static int | maxVersion = 3 |
Currently latest transaction version. More... | |
Represents a single transaction on the Ixian blockchain.
A transaction is an atomic change which manipulates the Ixian WalletState
. Each transaction processed by the DLT must be validated in some way:
Definition at line 25 of file Transaction.cs.
|
strong |
Type of change being performed on a 'Multi-Signature' wallet.
Definition at line 69 of file Transaction.cs.
|
strong |
Type of the transaction.
Enumerator | |
---|---|
Normal | Regular transaction which sends balance from a set of |
PoWSolution | Transaction sends a PoW (Proof of Work) solution for a specific block and awards the signer a certain amount of Ixi as a reward. |
StakingReward | Transaction awards the Master Nodes which participate in the consensus algorithm a certain reward of Ixi. |
Genesis | Genesis transaction which created initial Ixi currency from nothing and deposited it into the seed nodes' wallets. This type of transaction should never again appear after the first block. |
MultisigTX | Similar to |
ChangeMultisigWallet | Special transaction which alows modifying the list of allowed signers on a 'Multi-Signature' wallet. |
MultisigAddTxSignature | When a transaction involving a 'Multi-Signature' is first posted, it only has one signature, so this stub transaction is used to add signatures so that private key sharing is not required among signers. |
Definition at line 30 of file Transaction.cs.
IXICore.Transaction.Transaction | ( | int | tx_type | ) |
Creates an empty transaction of the specified type.
tx_type | Transaction type. See Transaction.Type . |
Definition at line 312 of file Transaction.cs.
IXICore.Transaction.Transaction | ( | int | tx_type, |
IxiNumber | tx_amount, | ||
IxiNumber | tx_feePerKb, | ||
byte [] | tx_to, | ||
byte [] | tx_from, | ||
byte [] | tx_data, | ||
byte [] | tx_pubKey, | ||
ulong | tx_blockHeight, | ||
int | tx_nonce = -1 , |
||
long | tx_timestamp = 0 |
||
) |
Generates a new transaction from the provided data. This variant widthdraws from and deposits to a single address.
The Fee can be higher than the minimum network fee, which will cause the transaction to be included faster in the event of congestion.
tx_type | Type of the transaction. See Transaction.Type . |
tx_amount | Total Ixi amount being transferred. |
tx_feePerKb | Transaction fee per kilobyte of data. |
tx_to | Destination address or nonce. |
tx_from | Source address or nonce. |
tx_data | Optional extra data. |
tx_pubKey | Public key used to sign the transaction, if neccessary. |
tx_blockHeight | Block height when the transaction was generated. |
tx_nonce | Unique transaction nonce value. |
tx_timestamp | Timestamp (unix epoch) when the transaction was generated. |
Definition at line 346 of file Transaction.cs.
IXICore.Transaction.Transaction | ( | int | tx_type, |
IxiNumber | tx_feePerKb, | ||
SortedDictionary< byte[], IxiNumber > | tx_toList, | ||
byte [] | tx_from, | ||
byte [] | tx_data, | ||
byte [] | tx_pubKey, | ||
ulong | tx_blockHeight, | ||
int | tx_nonce = -1 , |
||
long | tx_timestamp = 0 |
||
) |
Generates a new transaction from the provided data. This variant can deposit to a multiple addresses.
The Fee can be higher than the minimum network fee, which will cause the transaction to be included faster in the event of congestion. The sum if all amounts in the tx_toList
is equal to amount
.
tx_type | Type of the transaction. See Transaction.Type . |
tx_feePerKb | Transaction fee per kilobyte of data. |
tx_toList | List of deposit addresses and their amounts. |
tx_from | Withdrawal address. |
tx_data | Optional extra data. |
tx_pubKey | Signer public key, if neccessary. |
tx_blockHeight | Block number when the transaction was generated. |
tx_nonce | Unique nonce value for the transaction. |
tx_timestamp | Timestamp (unich epoch) when the transaction was generated. |
Definition at line 415 of file Transaction.cs.
IXICore.Transaction.Transaction | ( | int | tx_type, |
IxiNumber | tx_feePerKb, | ||
SortedDictionary< byte[], IxiNumber > | tx_toList, | ||
SortedDictionary< byte[], IxiNumber > | tx_fromList, | ||
byte [] | tx_data, | ||
byte [] | tx_pubKey, | ||
ulong | tx_blockHeight, | ||
int | tx_nonce = -1 , |
||
bool | sign_transaction = true |
||
) |
Generates a new transaction from the provided data. This variant can withdraw from and deposit to a multiple addresses.
The Fee can be higher than the minimum network fee, which will cause the transaction to be included faster in the event of congestion. All addresses in the tx_fromList
must belong to the same signing keypair. The sum if all amounts in the tx_toList
is equal to amount
. The sum of all amounts in the tx_fromList
must be equal to amount
+ fee
.
tx_type | Type of the transaction. See Transaction.Type . |
tx_feePerKb | Transaction fee per kilobyte of data. |
tx_toList | List of deposit addresses and their amounts. |
tx_fromList | List of withdrawal addresses and their amounts. |
tx_data | Optional extra data. |
tx_pubKey | Pubkey which can sign all the addresses in tx_fromList , if not already known. |
tx_blockHeight | Block number when the transaction was generated. |
tx_nonce | Unique nonce value for the transaction. |
sign_transaction | True if the signature should be calculated, false if the signature will be calculated later |
Definition at line 491 of file Transaction.cs.
IXICore.Transaction.Transaction | ( | Transaction | tx_transaction | ) |
Copy constructor.
In some places the Ixian software requires a full copy of the transaction and not a shared reference, so this constructor is provided to achieve that.
tx_transaction | Source transaction to copy. |
Definition at line 547 of file Transaction.cs.
IXICore.Transaction.Transaction | ( | byte [] | bytes, |
bool | include_applied = false |
||
) |
Constructs a transaction object from the serialized transaction data. See also getBytes()
.
bytes | Byte-field with the serialized transaction |
include_applied | Whether to include the 'applied' flag when reading the transaction data. |
Definition at line 614 of file Transaction.cs.
|
static |
Calculates the transaction's checksum.
transaction | Transaction to calculate the checksum from. |
Definition at line 962 of file Transaction.cs.
Calculates the lowest possible transaction fee based on the size of the transaction.
pricePerKb | Price per kilobyte of data. |
Definition at line 1069 of file Transaction.cs.
IxiNumber IXICore.Transaction.calculateTotalAmount | ( | ) |
Calculates the total transaction amount, without fee.
toList
.Definition at line 1045 of file Transaction.cs.
bool IXICore.Transaction.equals | ( | Transaction | tx | ) |
Checks if the two transactions are exactly equal.
tx | Other transaction. |
Definition at line 825 of file Transaction.cs.
|
static |
Checks owned addresses and returns the first one which is allowed to sign transactions for multisig_address
.
multisig_address | Multisig address to check. |
multisig_address
, or null, if no such local address.Definition at line 1455 of file Transaction.cs.
void IXICore.Transaction.generateChecksums | ( | ) |
Calculates the transaction checksum and stores it in the transaction.
Definition at line 1058 of file Transaction.cs.
string IXICore.Transaction.generateID | ( | ) |
Generates the Transaction ID from the transaction data.
Definition at line 889 of file Transaction.cs.
byte [] IXICore.Transaction.getBytes | ( | bool | include_applied = false | ) |
Serializes the transaction object for transmission and returns a byte-field. See also the constructor Transaction(byte[])
.
Definition at line 724 of file Transaction.cs.
object IXICore.Transaction.GetMultisigData | ( | ) |
Wrapper function to attempt and parse the transaction's optional data field as some kind of Multisig object.
Definition at line 1433 of file Transaction.cs.
byte [] IXICore.Transaction.getSignature | ( | byte [] | checksum, |
byte [] | private_key = null |
||
) |
Calculates the signature for the transaction.
checksum | Transaction checksum. |
private_key | Private key with which to sign the transaction, or null if the primary key should be used. |
Definition at line 1024 of file Transaction.cs.
|
static |
Adds a signature to the specified multisig wallet. This function generates a transaction which adds the specified allowed_address
to the multisig wallet tx_from
.
The transaction fee is paid by tx_from
- the multisig wallet.
allowed_address | Address which will be added to tx_from . |
tx_fee | Fee per kilobyte of data. |
tx_from | Multisig address where the allowed_address will be added. |
tx_blockHeight | Block height at which to generate the new transaction/ |
Definition at line 1599 of file Transaction.cs.
|
static |
Adds a signature to the specified multisig transaction, if possible. This function generates a transaction which adds the signature for orig_txid
.
orig_txid | Multisig transaction which is waiting to accumulate signatures. |
tx_fee | Fee per kilobyte of data. |
tx_from | Own address which may be allowed to sign orig_txid . |
tx_blockHeight | Block height at which to generate the new transaction/ |
Definition at line 1564 of file Transaction.cs.
|
static |
Changes the multisig wallet minimum required signatures value. This function generates a transaction which changes the specified multisig wallet tx_from
with a new minimum required signatures value..
The transaction fee is paid by tx_from
- the multisig wallet.
sigs | New minimum required signatures value for tx_from . |
tx_fee | Fee per kilobyte of data. |
tx_from | Multisig address where the allowed_address will be added. |
tx_blockHeight | Block height at which to generate the new transaction/ |
Definition at line 1670 of file Transaction.cs.
|
static |
Deletes a signature from the specified multisig wallet. This function generates a transaction which deletes the specified disallowed_address
from the multisig wallet tx_from
.
The transaction fee is paid by tx_from
- the multisig wallet.
disallowed_address | Address which will be removed from tx_from . |
tx_fee | Fee per kilobyte of data. |
tx_from | Multisig address where the allowed_address will be added. |
tx_blockHeight | Block height at which to generate the new transaction/ |
Definition at line 1634 of file Transaction.cs.
|
static |
Generates a multisig transaction.
tx_amount | Amount of Ixi to widthraw and deposit. |
tx_fee | Transaction fee |
tx_to | Destination address where the funds should be deposited. |
tx_from | Multisig wallet where the funds should be withdrawn. |
tx_blockHeight | Blockheight at which the transaction is generated. |
Definition at line 1499 of file Transaction.cs.
|
static |
Generates a multisig transaction with multiple destination addresses.
tx_fee | Transaction fee |
tx_to_list | Destination addresses where the funds should be deposited. |
tx_from | Multisig wallet where the funds should be withdrawn. |
tx_blockHeight | Blockheight at which the transaction is generated. |
Definition at line 1531 of file Transaction.cs.
Dictionary<string, object> IXICore.Transaction.toDictionary | ( | ) |
Encodes all transaction data fields into a Dictionary for easier conversion to JSON via the REST API server.
Definition at line 1698 of file Transaction.cs.
bool IXICore.Transaction.verifySignature | ( | byte [] | pubkey, |
byte [] | nonce | ||
) |
Checks the transaction's signature against the given public key and address nonce.
pubkey | Public key which signed the transaction |
nonce | Nonce value of the originating wallet. |
Definition at line 839 of file Transaction.cs.
Total amount of Ixi being transferred.
Definition at line 204 of file Transaction.cs.
ulong IXICore.Transaction.applied |
Block height at which the transaction was applied.
Definition at line 260 of file Transaction.cs.
ulong IXICore.Transaction.blockHeight |
Block number when the transaction was generated.
Definition at line 236 of file Transaction.cs.
byte [] IXICore.Transaction.checksum |
Checksum of all transaction data to ensure it hasn't been tampered with or corrupted during transmission.
Definition at line 248 of file Transaction.cs.
byte [] IXICore.Transaction.data |
Optional data included with the transaction. This can be any byte-field. The transaction fee will increase with the amount of data.
Definition at line 232 of file Transaction.cs.
Transaction fee - based on the serialized size of the transaction.
Definition at line 208 of file Transaction.cs.
SortedDictionary<byte[], IxiNumber> IXICore.Transaction.fromList = new SortedDictionary<byte[], IxiNumber>(new ByteArrayComparer()) |
Source wallets where the funds are withdrawn. Each address specifies the amount of Ixi being widthrawn from it.
The sum of all amounts must be equal to amount
+ fee
, otherwise the transaction is invalid. All source wallets must belong to the same primary signing key. The address can either be a wallet address or a nonce value which was used to generate the address. If the value is a nonce value, then the public key, pubKey
, for the transaction must be specified.
Definition at line 219 of file Transaction.cs.
bool IXICore.Transaction.fromLocalStorage = false |
Indicator if the transaction was loaded from cold storage.
If false, the transaction was generated by the current executable or received through the network.
Definition at line 267 of file Transaction.cs.
string IXICore.Transaction.id |
Transaction ID.
The transaction ID is not transferred over the network, because it can be recalculated from the transaction data.
Definition at line 196 of file Transaction.cs.
|
static |
Currently latest transaction version.
Definition at line 282 of file Transaction.cs.
int IXICore.Transaction.nonce |
Unique 'nonce' value which prevents certain classes of transaction replay attacks.
Definition at line 240 of file Transaction.cs.
bool IXICore.Transaction.powVerified = false |
Helper flag that determines whether PoW solution was already verified (used locally)
Definition at line 277 of file Transaction.cs.
byte [] IXICore.Transaction.pubKey |
Publick key which performed the signature and owns the source wallets in fromList
.
Definition at line 256 of file Transaction.cs.
byte [] IXICore.Transaction.signature |
Signature by the originating wallets' primary key. See fromList
.
Definition at line 252 of file Transaction.cs.
long IXICore.Transaction.timeStamp |
Timestam of when the transaction was created as a unix epoch (seconds since 1970-01-01).
Definition at line 244 of file Transaction.cs.
SortedDictionary<byte[], IxiNumber> IXICore.Transaction.toList = new SortedDictionary<byte[], IxiNumber>(new ByteArrayComparer()) |
Destination wallets where the funds will be deposited. Each address specifies the amount of Ixi being deposited to it.
The sum of all amounts must be equal to amount
, otherwise the transaction is invalid. Destination wallets can belong to different signing keys.
Definition at line 227 of file Transaction.cs.
int IXICore.Transaction.type |
Transaction type. See also Transaction.Type
.
Definition at line 200 of file Transaction.cs.
int IXICore.Transaction.version |
Transaction version.
Later versions enable new features which were introduced later in development.
Definition at line 189 of file Transaction.cs.