Giter Club home page Giter Club logo

bech32-buffer's People

Contributors

dependabot[bot] avatar oldremez avatar slowli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

bech32-buffer's Issues

Bech32m

Can you add new demo pages for the new Bech32m format which gets introduced with the Taproot upgrade? (BIP 0350)

Invalid behavior with uppercase prefix

If you encode something with prefix LNURL, it's not possible to decode.

The bech32 npm package converts the prefix to lowercase (lnurl) before encoding it. I think that's the way to go.

Check prefix case in encode

Check that the prefix is not mixed-case (?) and convert to lower case before encoding. Otherwise, the encoded string may be deemed invalid by decode.

Request for Google Sheets

Hello sir!
I was wondering if it would be possible if I could use this tool in Google Sheet?

I am having to convert hex identifiers to their bech32 prefix to match validators properly within our chain.

Would it be possible to make it so I could use it in a format like:(example)

https://slowli.github.io/bech32-buffer/data/?tag=vdlvalcons&encoding=bech32&data=4C1438CDA672B766D7BA69A79DC462DD389875BE

and then be returned:

vdlvalcons1fs2r3ndxw2mkd4a6dxnem3rzm5ufsad7058gmw

Lightning Network invoice compatability

I initially made this PR -> #10 because I originally thought the solve would be a simple length check fix, however it seems there are a few more considerations required to ensure lightning network invoice compatibility.

The most important to mention is the removable of the following constraints:

  1. mandatory prefixes
  2. mandatory length if interpreted version bytes is 0 (0 by default)

And the addition of the following features:

  1. HRP (Human readable part) field in the encoding window
  2. Nullification of "Network" and "Script ver." if HRP isn't bc or tb

Rationale:

  1. mandatory prefixes

Enforcing mandatory prefixes effectively enforces an only bitcoin address input, since lightning invoices do not have static hrp. For example, whereas for a testnet bitcoin segwit address you would see tb in the hrp, in testnet bitcoin lightning you'd see the network + the amount requested in the hrp - for example: tb20m representing 20 mbtc.

  1. mandatory length if interpreted version bytes is 0 (0 by default)

This is more an implementation nit, if 0 is default then non bitcoin addresses are applied to this enforcement. This should be optional, not default.

  1. HRP (Human readable part) field in the encoding window

The hrp represents important information that can't always be expected to fall into a prefix. Even though lightning has a standard, predictable template I think for a bech32 encode/decoder this should be more free in case other usecases for bech32 arise.

  1. Nullification of "Network" and "Script ver." if HRP isn't bc or tb

Another implementation nit. If the network isn't bitcoin layer 1, these fields should be greyed out (nullified).

Remove 90 char limit

Yes, BIP-0173 specifies a max 90 char limit for addresses, however bech32 encoding is used outside of bitcoin, specifically in Lightning Network's Bolt11 where the majority of payment requests are encoded in bech32, and whose size is significantly larger than 90 chars most of the time.

Enforcing the limit makes this tool unusable for anything Lightning Network related, I request that the limitation is removed. I can supply the simply PR removing the relevant code

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.