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

Secure Minting #98

Open
1 task done
davebryson opened this issue May 4, 2022 · 4 comments
Open
1 task done

Secure Minting #98

davebryson opened this issue May 4, 2022 · 4 comments
Assignees
Labels
enhancement/feature Adds new functionality feedback/proposal A proposed solution to a specific problem topic/hardening-security

Comments

@davebryson
Copy link
Contributor

Question

How can the system support secure minting of currency?

Benefit

A secure minting solution will ensure that only pre-authorized, designated, wallets can mint new currency

Proposed Solution

For an initial solution we will add the ability for sentinels to recognize and validate mint transactions. This will require:

  • Adding configuration information to include a list of public keys authorized to sign mint transaction outputs
  • Changing the validation logic. Instead of rejecting a transaction with zero inputs. This will signal the logic to use the configured (mint) public keys to validate signatures
  • Update the wallet as needed to support the above. For example, the wallet will need to identify and use the pre-authorized public key to sign mint transactions

Possible Difficulties

The proposed solution is a starting point - it may not be the final (best) solution. More research will be needed to ensure minting is as secure as possible.

Prior Work

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@davebryson davebryson added the feedback/proposal A proposed solution to a specific problem label May 4, 2022
@HalosGhost HalosGhost removed their assignment May 4, 2022
@davebryson
Copy link
Contributor Author

@HalosGhost You can assign this to me. I've started working on it.

@davebryson
Copy link
Contributor Author

davebryson commented May 13, 2022

@HalosGhost Working through an implementation of secure minting, I've ran into an issue with the Atomizer sentinel. Minting transactions do not have Tx inputs. However, the Atomizer sentinel expects Tx inputs in order to forward the transaction: https://github.com/mit-dci/opencbdc-tx/blob/trunk/src/uhs/atomizer/sentinel/controller.cpp#L97. It appears the atomizer sentinel uses Tx inputs to validate a shard id.

The logic I've added for secure minting performs specific minting validation if a transaction has no inputs. Otherwise a non-mint transaction, with no inputs, will be rejected. So technically valid non-mint transactions will work with the current sentinel logic.

However, if I adjust the logic to support a mint transaction (no inputs), what's the best way to determine which pid ( https://github.com/mit-dci/opencbdc-tx/blob/trunk/src/uhs/atomizer/sentinel/controller.cpp#L116 ) the transaction should be sent to? Are there any other potential issues with a compact transaction having no inputs in the Atomizer?

UPDATE: On further investigation, it appears the shard also checks for inputs: https://github.com/mit-dci/opencbdc-tx/blob/trunk/src/uhs/atomizer/shard/shard.cpp#L123

@HalosGhost
Copy link
Collaborator

@davebryson I just want to double-check, it sounds like you managed to find an answer to the primary question you had; is there anything else tripping you up or blocking you?

@davebryson
Copy link
Contributor Author

@HalosGhost I don't think so. The only issue I see is I need to remove checking for no inputs in the atomizer architecture: https://github.com/mit-dci/opencbdc-tx/blob/trunk/src/uhs/atomizer/shard/shard.cpp#L123. But this should be ok as the transaction would never get this far if it didn't pass validation.

Right now I'm merging conflicts from latest trunk. So I hope to have the initial pull request very soon. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement/feature Adds new functionality feedback/proposal A proposed solution to a specific problem topic/hardening-security
Projects
None yet
Development

No branches or pull requests

2 participants