Skip to content

Conversation

guggero
Copy link
Contributor

@guggero guggero commented Feb 15, 2021

Judging from the comment
https://github.com/bitcoin/bitcoin/pull/18267/files#r491150895 in the
Signet PR all test networks should have the same bech32_hrp prefix (even
regtest). That's why tb was chosen for Signet as well.
This is not optimal for LN as invoices shouldn't be vague in
what network they were issued for.
Therefore we add the explicit prefix lntbs for Signet invoices.

This PR was motivated by this comment: lightningnetwork/lnd#5025 (comment)

The actual value (lntbs? lnbcsn? lnsn?) is open for discussion IMO.

For reference, CL already wrote some code to handle the current issue of testnet and signet using the same prefix: https://github.com/ElementsProject/lightning/blob/030a19a8af989db38d3c547a81faff5b1e11608d/common/bolt11.c#L613

Judging from the comment
https://github.com/bitcoin/bitcoin/pull/18267/files#r491150895 in the
Signet PR all test networks should have the same bech32_hrp prefix (even
regtest). That's why 'tb' was chosen for Signet as well.
This is not optimal for LN as invoices shouldn't be vague in
what network they were issued for.
Therefore we add the explicit prefix 'lntbs' for Signet invoices.
@t-bast
Copy link
Collaborator

t-bast commented Feb 15, 2021

That looks reasonable, I don't have a strong opinion on the naming, lntbs looks good to me.

@t-bast
Copy link
Collaborator

t-bast commented Mar 2, 2021

Merging as discussed during yesterday's spec meeting.

@t-bast t-bast merged commit 80c1ae1 into lightning:master Mar 2, 2021
@guggero guggero deleted the signet-invoice-prefix branch March 2, 2021 08:19
guggero added a commit to guggero/lnd that referenced this pull request May 18, 2021
The Core devs decided to us the same bech32 HRP for Signet as is used
for the current Testnet3. This might be okay for on-chain addresses
since they are compatible in theory. But for invoices we want to use a
distinct HRP to distinguish testnet from signet.
Also see spec PR
lightning/bolts#844 for more
information about the reasoning.
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.

2 participants