hsjoberg / blixt-wallet

Bitcoin Lightning Wallet with focus on usability and user experience
https://blixtwallet.github.io
MIT License
381 stars 68 forks source link

Add camera text recognition (OCR) for scanning BOLT11 invoices/bitcoin addresses in text format #255

Open hsjoberg opened 3 years ago

hsjoberg commented 3 years ago

https://github.com/react-native-camera/react-native-camera/blob/master/docs/RNCamera.md#ontextrecognized

https://github.com/zsajjad/react-native-text-detector

sesam commented 3 years ago

Googled but didn't find any example of how bolt11 in text format would look. Most search hits talk about QR, and one about lnd using ~wrong~ different prefix for regtest invoices.

hsjoberg commented 3 years ago

bolt11 is bech32 encoded, just like native SegWit, but a lot longer (because of more data). Mainnet bolt11 It looks like this:

lnbc10n1p056jscpp58hwc0u8swnfctjhs8qnqjuyw8nee3y54f2nk9t7s6jpuwdak86asdqqcqzpgsp5cr4p88pdczts98v8xvn73ddpr8mzyamm99efkrsnmhyqd0nfttts9qy9qsq75hnvedvzdl2alk35qlpwygs22vdrrhej0kvwlyt65mt2skxkulp63qcvtae2fahhpaq0up80hyz9m8lk2hpl0593l4y08wgze8c66gqf8dkrt

Some small tests I did some time ago showed that it might be too difficult for an OCR to scan this.