Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create valid transaction function #8

Open
lancekrogers opened this issue Oct 31, 2017 · 1 comment
Open

Create valid transaction function #8

lancekrogers opened this issue Oct 31, 2017 · 1 comment
Assignees

Comments

@lancekrogers
Copy link
Member

Create a function that validates the transaction by confirming the below rules:

  1. The sender's public key is used to decrypt the signed_hash and the hash matches the transaction hash
  2. Each transaction in unspent_transactions is payable to the address hash derived from the sender's public key
  3. Each transaction in unspent_transactions has not been spent
  4. The total amount in unspent_transactions >= the total amount in outputs
@itsromiljain
Copy link

Thoughts -
In that case a transaction should have Input and Output. Multiple outputs can be created from a single Input or clubbing multiple Inputs.
These outputs should be updated in UTXO (unspent transactions)
Every transaction inputs must be checked with the outputs in UTXO and UTXO should be updated once transaction input/s is used to create another transactions output/s
Inputs used in the transaction must be greater than or equal to Outputs in that Transaction

@lancekrogers lancekrogers self-assigned this Nov 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants