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

config: cleanup; params #19

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

config: cleanup; params #19

wants to merge 3 commits into from

Conversation

tuxcanfly
Copy link
Collaborator

Fixes #7

@tuxcanfly tuxcanfly marked this pull request as ready for review March 4, 2023 21:59
@tuxcanfly
Copy link
Collaborator Author

Caller needs to pass:

	Network             string
	RevealSatAmount     int64
        RevealSatFee        int64
	RevealPrivateKeyWIF string

Defaults are:

Network: "regtest"
RevealSatAmount: 1000
RevealSatFee: 200
RevealPrivateKeyWIF: "5JoQtsKQuH8hC9MyvfJAqo6qmKLm8ePYNucs7tPu2YxG12trzBt"

Copy link

@rach-id rach-id left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This stuff is so cool 🚀 🚀

No blocking feedback, just a passing by review to understand more :D

@@ -17,14 +17,15 @@ import (
// PROTOCOL_ID allows data identification by looking at the first few bytes
var PROTOCOL_ID = []byte{0x72, 0x6f, 0x6c, 0x6c}

const (
DEFAULT_SAT_AMOUNT = 1000
DEFAULT_SAT_FEE = 200
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Question]
Shouldn't this be configurable? Because, if I understand right, the whole block data will be posted, not just a commitment to it. Thus, its size can change. Wouldn't it be better to have the fee specified as vBytes so that it changes according to the amount of data being posted?

Comment on lines +101 to +102
revealSatAmount btcutil.Amount
revealSatFee btcutil.Amount
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Proposal]
If these are used also for the commit transaction, proposal to rename to txAmount and txFee as they would be used for the commit and also the reveal

network *chaincfg.Params
revealSatAmount btcutil.Amount
revealSatFee btcutil.Amount
revealPrivateKeyWIF *btcutil.WIF
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Proposal]
Similar, if the same key will be used for the commit tx, proposal to rename to privateKeyWIF

const (
DEFAULT_SAT_AMOUNT = 1000
DEFAULT_SAT_FEE = 200
DEFAULT_PRIVATE_KEY = "5JoQtsKQuH8hC9MyvfJAqo6qmKLm8ePYNucs7tPu2YxG12trzBt"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like this. Private keys should be provided and not hardcoded.

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.

config: cleanup
4 participants