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

reward transaction not signed? #42

Closed
ilcasinistareloaded opened this issue May 1, 2021 · 2 comments
Closed

reward transaction not signed? #42

ilcasinistareloaded opened this issue May 1, 2021 · 2 comments

Comments

@ilcasinistareloaded
Copy link

Hello, the transaction rewardTx is not signed, so Transaction.signature is not set for it; this is in minePendingTransactions in blockchain.js.
Is that deliberate? Incidentally in class Transaction there is no constructor signature.

@Savjee
Copy link
Owner

Savjee commented May 2, 2021

Mining rewards aren't normal transactions, they create a new supply of coins. In this implementation, they're sent from a zero address to your wallet. And since you don't have the key for the zero address, you can't properly sign that transaction. But that should not be a problem. It would be up to the network to validate that you have given yourself the correct amount of coins as a reward for mining a block.

I'm not sure what you mean with your second question. The Transaction class has a method "signTransaction", which accepts a wallet key for signing. It then stores that signature in the object itself.

@ilcasinistareloaded
Copy link
Author

OK, that makes sense. I think this issue can be closed; it might be useful to copy and paste part of your reply in the code as a comment. Thanks for the clarification and great videos!

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