BlockchainCommons / GordianSeedTool-iOS

Cryptographic Seed Manager for iOS
Other
38 stars 9 forks source link

Can't import UR from bc-seedtool #4

Closed ChristopherA closed 3 years ago

ChristopherA commented 3 years ago

From Mac Big Sur 11.1, using https://github.com/blockchaincommons.com/bc-seedtool:

% seedtool --ur | tr '[:lower:]' '[:upper:]' | tee /dev/tty | qrencode -o seedqrcode.png -l L
UR:CRYPTO-SEED/OYADGDFNLDDNPEHFSBTYTTKNIYTLDSSSDYFGLEIOBDRLGH
% open seedqrcode.png 
image

On iPhone 11 Max Pro using iOS 14.2:

Add seed from UR

iPhone has no problem focusing, but nothing happens. I do get one "pulse" from haptic, but no import. Done remains disabled. Only choice is to Cancel.

ChristopherA commented 3 years ago

I will note that UR:CRYPTO-SEED/OYADGDFNLDDNPEHFSBTYTTKNIYTLDSSSDYFGLEIOBDRLGH does import into Fehu using text import.

ChristopherA commented 3 years ago

Just for reference, as this is a good text vector:

Green Slime Public Test

Short Fingerprint

104f529

Long Fingerprint

?

Copy as Hex:

3c892baf56cbd4d17a66d526c430468a

UR Cryptoseed (simple)

UR:CRYPTO-SEED/OYADGDFNLDDNPEHFSBTYTTKNIYTLDSSSDYFGLEIOBDRLGH

QR UR Cryptoseed (simple):

seedqrcode

UR Cryptoseed (complex, with Name & Notes)

ur:crypto-seed/otadgdfnlddnpehfsbtyttkniytldsssdyfgleaxktfljpihihjtcxgujzinjnihcxgdkpidjziniacxghihjkjyaakscpgdkpidjziniacxjkihihiecxkpjkihiecxhsjkcxhscxjyihjkjycxkoihiajyjljpdmvocegukb

BIP39

develop enable type pulse run hamster trumpet survey chat canoe balance before

SSKR (1:1 Bytewords)

tuna acid epic gyro skew even able able able fern loud down pose half stub tiny tent kiln inky toil days sets duty frog love cusp race brew rust

SSKR (3:8 Bytewords)

3 of 8 shares in this group must be met.

tuna acid epic gyro saga veto able also able runs epic user bulb pose drum miss tomb wolf gems zest real tied mild film gray jolt rust cook barn

tuna acid epic gyro saga veto able also acid gala claw legs wolf puff figs play code skew yawn guru many drop navy race help gala redo paid whiz

tuna acid epic gyro saga veto able also also cash lava yank yoga poem lion part epic wave lung runs view need acid peck very rust what waxy jazz

tuna acid epic gyro saga veto able also apex very pool part cost purr mild mild zoom trip exam blue unit idle beta curl warm void logo hard memo

tuna acid epic gyro saga veto able also aqua menu swan yank echo help jade vows numb aqua help iced need skew redo hope luck lava half kept gyro

tuna acid epic gyro saga veto able also arch inch vial part tiny foxy keys tiny item each very swan omit eyes real tiny lion owls drum safe play

tuna acid epic gyro saga veto able also atom fair keys user user hawk scar tomb flux city navy curl solo many draw stub fern drum inky list epic

tuna acid epic gyro saga veto able also aunt swan half legs exit frog taxi wand loud dull crux main when judo cyan fizz even axis cook each stub

SSKR (3:8 ur:crypto-sskr)

3 of 8 shares in this group must be met.
ur:crypto-sskr/taadecgopeswaeaoaewtctctsalbecinpmwlidaxnstojeutcecxdicply
ur:crypto-sskr/taadecgopeswaeaoaddtaoemisehhncldndilkhhrdyaeowkvykomogrbk
ur:crypto-sskr/taadecgopeswaeaoaoievlmnztlehgsfadlbsostkprlrohnsorpdwdrmh
ur:crypto-sskr/taadecgopeswaeaoaxryzeolhfssaolrltpadimkgulyvtgaeevtnlfxcw
ur:crypto-sskr/taadecgopeswaeaoaaemsobshsehztwpeenylriaylisfpdpkifycwclwn
ur:crypto-sskr/taadecgopeswaeaoahwytydisblbptoxprghimfntthycfaalabgplfdkn
ur:crypto-sskr/taadecgopeswaeaoamotecnnhessnngamkbndlosckbymomhpdtdbedtvt
ur:crypto-sskr/taadecgopeswaeaoatknderpyklesbadcksaseyaetdisgrhgolronfzje
wolfmcnally commented 3 years ago

This issue was not an error in Fehu, but an error in how the QR code was generated. The instructions I gave in the seedtool documentation is the source of the error, and I have submitted a PR that fixes the docs.

seedtool outputs a newline character (\n) at the end of its output. This is normal for a command-line tool so the next command prompt or following output appears on the next line. However if this is piped directly into qrencode, then the resulting QR code will also encode the newline. This causes the QR code to not use the more efficient alphanumeric encoding mode, and also causes Fehu to fail to read the code because the newline at the end is not valid ur:crypto-seed syntax. The corrected command to generate the QR code is:

seedtool --ur | tr '[:lower:]' '[:upper:]' | tee /dev/tty | tr -d '\n' | qrencode -o seedqrcode.png -l L

Notice that after the output is piped to the terminal via tee, it is then run through tr again to delete the newline before being piped to qrencode. This fixes the problem.