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

Added Reddcoin (RDD) support #251

Closed
wants to merge 4 commits into from
Closed

Conversation

greatwolf
Copy link
Contributor

This PR contains the changes necessary for adding Reddcoin support on the KeepKey hardware wallet.

Explanation of code changes:

  • Added appropriate definition for Reddcoin in coins.def.
  • Reddcoin rawtransactions has an extra timestamp(UNIX little-endian) field appended at the end during serialization. That field has been added to the relevant code parts and changes made to accommodate that.
  • This PR needs to be complimented by Added 'timestamp' field to 'SignTx' and 'TransactionType' for Reddcoin support. device-protocol#43 for timestamp field support in protobufs definition.
  • During the signing process for a rdd transaction, the [SignTx] and [PrevTxMeta] message needs to include a non-zero uint32 timestamp value from the host. Omitting this field(or 0 value) means timestamp won't be serialized as part of final rawtransaction. It's done this way to keep compatibility with other btc-style transactions like Bitcoin Cash, Dogecoin, Dash etc. since that field is always omitted.

Note about reddcoin transaction. The timestamp does not participate in the prehash that's being signed but it does participate in the final txid hash. This means for a reddcoin transaction, the timestamp could be modified without invalidating the signature but will change the txid.

Also note most of the changes involving timestamp are just backported from https://github.com/keepkey/trezor-firmware/blob/f4e6a4ed2a4f0bb7cf82b4e143f16a73e7845779/legacy/firmware/signing.c but adapted to work with reddcoin.

changes to work with Reddcoin. To create a valid Reddcoin transaction
the following changes were made to 'timestamp':

 - Moved from 'header' section into 'footer'
   ie. next to 'locktime' during serialization.
 - it's serialized into rawtransaction as 4-byte little endian
   field at the end.
 - it does *not* participate in the hash used for signing the
   transaction.
@greatwolf greatwolf requested a review from markrypto as a code owner March 4, 2021 00:35
@markrypt0
Copy link
Collaborator

Closed, not selected

@markrypt0 markrypt0 closed this May 27, 2022
@TechAdeptRDD
Copy link

Please advise why "Closed, not selected"?

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

Successfully merging this pull request may close these issues.

3 participants