Git Product home page Git Product logo

hs-airdrop's People

Contributors

boymanjor avatar chjj avatar kibagateaux avatar kilpatty avatar phoe avatar pinheadmz avatar recolic avatar rootulp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hs-airdrop's Issues

More precise instructions

Hey thanks for considering FOSS developers!

It's actually very non-trivial to install NodeJS and NPM packages on an airgapped machine. Could you describe the cryptography in a bit more detail? Is it just a blinding factor that I should XOR into my normal (ed25519) secret key? And what should we use for the [addr] and [value] arguments?

Install in windows?

Hi, when I install it in windows, it gives me the error

图片

Is this because I'm using Python 3? is there any way I can fix the error?

Thanks!

Error: Unknown S2K function - Issue caused by exported to card gpg keys

I have my PGP key moved to my yubikey. However I have the backup of my secret key.

When I use that key to get the airdrop, hs-airdrop gave an error:

Error: Unknown S2K function.
    at S2K.read (/home/gaoyichuan/workspace/hs-airdrop/node_modules/bcrypto/lib/pgp.js:1557:15)
    at CipherParams.read (/home/gaoyichuan/workspace/hs-airdrop/node_modules/bcrypto/lib/pgp.js:1363:18)
    at PGPPrivateKey.read (/home/gaoyichuan/workspace/hs-airdrop/node_modules/bcrypto/lib/pgp.js:1126:17)
    at Function.read (/home/gaoyichuan/workspace/hs-airdrop/node_modules/bufio/lib/struct.js:139:23)
    at PGPPacket.read (/home/gaoyichuan/workspace/hs-airdrop/node_modules/bcrypto/lib/pgp.js:439:35)
    at Function.read (/home/gaoyichuan/workspace/hs-airdrop/node_modules/bufio/lib/struct.js:139:23)
    at PGPMessage.read (/home/gaoyichuan/workspace/hs-airdrop/node_modules/bcrypto/lib/pgp.js:278:29)
    at PGPMessage.decode (/home/gaoyichuan/workspace/hs-airdrop/node_modules/bufio/lib/struct.js:91:10)
    at Function.decode (/home/gaoyichuan/workspace/hs-airdrop/node_modules/bufio/lib/struct.js:143:23)
    at readKey (/home/gaoyichuan/workspace/hs-airdrop/bin/hs-airdrop:529:30)

After some quick search, I use cat secring.gpg | gpg --list-packets | grep S2K to check my key info, it gave:

        iter+salt S2K, algo: 7, SHA1 protection, hash: 2, salt: D658CFAB39FED1A0
        iter+salt S2K, algo: 7, SHA1 protection, hash: 2, salt: 97D1A2FFC1F66F34
        gnu-divert-to-card S2K, algo: 0, simple checksum, hash: 0
        gnu-divert-to-card S2K, algo: 0, simple checksum, hash: 0
        gnu-divert-to-card S2K, algo: 0, simple checksum, hash: 0
        gnu-divert-to-card S2K, algo: 0, simple checksum, hash: 0
        iter+salt S2K, algo: 7, SHA1 protection, hash: 2, salt: AE573B264082AC56

And after patching the code, I found out the S2K algo number is 101

Any help please?

Error: Could not locate the bindings file.

the following command:

$ ./bin/hs-airdrop ~/.ssh/id_rsa hs1qzznt6wfep5rr8exqyrr6qvl0dpska50lpjx4lc 0.01

is giving me:

/Users/herve76/Documents/GitHub/hs-airdrop/node_modules/loady/lib/loady.js:121
  throw err;
  ^

Error: Could not locate the bindings file. Tried:
 - /Users/herve76/Documents/GitHub/hs-airdrop/node_modules/bcrypto/build/bcrypto.node
 - /Users/herve76/Documents/GitHub/hs-airdrop/node_modules/bcrypto/build/Debug/bcrypto.node
 - /Users/herve76/Documents/GitHub/hs-airdrop/node_modules/bcrypto/build/Release/bcrypto.node

I am using node v10.16.0

Error: TypeError: stdin.setRawMode is not a function

Hi, when I run the command: ./bin/hs-airdrop <path to key> <address> <fee> ,it give me the error:

TypeError: stdin.setRawMode is not a function
at readLine (F:\hs-airdrop\lib\readline.js:17:9)
at readPassphrase (F:\hs-airdrop\lib\readline.js:92:10)
at readKey (F:\hs-airdrop\bin\hs-airdrop:535:32)

How to convert JSON "address" to bech32?

It'd be nice to be able to prove (to myself) that the JSON generated by hs-airdrop is really going to send the reward to the address I passed to hs-airdrop, and not some other address. But the formats aren't the same -- the one on the command line starts with hs and is 42 chars long and the one in the payload's address field is 40 chars long and doesn't match it. Is there a conversion function? Or is that field not where the target address goes..?

It seem that the service of 151.101.22.133:433 didn't work ?

When I run ' ./bin/hs-airdrop ~/.ssh/id_rsa address fee ' in my shell :

What 's the passphrase I should input ?

And then the log is :

Attempting to create proof.
This may take a bit.
Decrypting nonce...
Downloading: https://github.com/handshake-org/hs-tree-data/raw/master/nonces/093.bin...
Error: connect ECONNREFUSED 151.101.228.133:443
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14)

It seem that the service of 151.101.22.133:433 didn't work ? How to fix it?

Publish docker image for easier use

A simple signed Docker container could come preinstalled with the right version of node and the airdrop tool.

We could also provide instructions to run it in an interactive, non-networked way mounting the key on the host filesystem.

Possibly modify EC scheme to protect against related key attacks

The related key attacks described here may apply to our current EC scheme. This most likely isn't an actual issue for any of keys in the tree since SSH keys aren't typically used to sign arbitrary messages and the messages they do sign on the SSH protocol level include the public key itself (partially implementing the Morita et al. "improved" scheme). That said, it's probably better to be safe. I think we should disable the EC signing for now until we've thought about it a bit more.

Thanks to @kwantam for pointing all of this out.

Are we intended to wait for mainnet launch?

I assume we are meant to wait for mainnet launch before running the commands in this repo? Also, for those of use who used the web faucet, I assume we are only meant to claim by submitting our address from there and not to re-submit our keys?

Thanks.

Error: Hi bit unset in PGP packet header.

Hi,i use my PGP key but a error occur.

# node -v
v13.8.0
# npm -v
6.13.7

At first i export my private key like this.

C:\Users\yuangezhizao>gpg -K
C:/Users/yuangezhizao/AppData/Roaming/gnupg/pubring.kbx
-------------------------------------------------------
sec   rsa2048 2018-09-29 [SC] [expires: 2020-09-29]
      CDBEC3268512836F92AA92DCED075DCBF4BFFD51
uid           [ultimate] yuangezhizao <[email protected]>
ssb   rsa2048 2018-09-29 [E] [expires: 2020-09-29]
C:\Users\yuangezhizao>gpg -a -o secring.gpg  --export-secret-keys CDBEC3268512836F92AA92DCED075DCBF4BFFD51

Then,i use the hs-airdrop command tools.

# ./bin/hs-airdrop ../secring.gpg CDBEC3268512836F92AA92DCED075DCBF4BFFD51 <rm> 0.01  
Error: Hi bit unset in PGP packet header.
    at PGPPacket.read (/root/workspace/hs-airdrop/node_modules/bcrypto/lib/pgp.js:368:13)
    at Function.read (/root/workspace/hs-airdrop/node_modules/bufio/lib/struct.js:139:23)
    at PGPMessage.read (/root/workspace/hs-airdrop/node_modules/bcrypto/lib/pgp.js:278:29)
    at PGPMessage.decode (/root/workspace/hs-airdrop/node_modules/bufio/lib/struct.js:91:10)
    at Function.decode (/root/workspace/hs-airdrop/node_modules/bufio/lib/struct.js:143:23)
    at readKey (/root/workspace/hs-airdrop/bin/hs-airdrop:529:30)
    at async parseArgs (/root/workspace/hs-airdrop/bin/hs-airdrop:702:21)
    at async main (/root/workspace/hs-airdrop/bin/hs-airdrop:740:19)

So,how to fix it?
Thanks.

Unclear how to claim as a keybase user

How does claiming work as a keybase user? From what I can tell, you added the public pgp keys for keybase users who have verified their Hackernews accounts, but it's unclear how to actually claim and on what device.

read ECONNRESET

Error: read ECONNRESET
at exports._errnoException (util.js:1024:11)
at TLSWrap.onread (net.js:610:25)

A better mechanism for finding interested and deserving open source developers.

My biggest issue with this air drop is that it will probably miss many if not most deserving open source contributors, and may capture many that are not open source friendly at all.

I haven't yet figured out a better solution, but will update this ticket with ideas once I've had opportunity to give it some more thought.

At a minimum we'd need to define what is meant by "open source", "developers" for a start and then use those definitions to select worthy projects whose contributors might like an opportunity to benefit from the airdrop.

Unclear documentation

I'm not familiar with Handshake. I found this repo through a mention elsewhere and was curious. The docs seem to be making some assumptions.

Just looking at the command reference in the readme, it seems any SSH key call wants and address and amount. Is there an assumption that I already have some handshake account/wallet setup? Should that address be mine? How can I find out how much I can even request from the initial airdrop (the docs mention the initial amount, but if I transfer out some lower amount, how do I find out the balance)?

Basically, some more background on what is actually going on with each command and links to obtaining things like a valid address and amount request should be added.

Key inside PGP WOT not working for airdrop

I'm holding a key in PGP WOT as of 2018, but still getting the NonceError: Could not find nonce in bucket 38. error. Can't post the exact key ID out due to possible personal information leak, but I can confirm at least 3 valid paths from 8b962943fc243f3c.

The tool claims that it has successfully decrypted the key but failed to find a corresponding nonce.

Any ideas?

Issue claiming

Hey everyone, I'm having an issue claiming the airdrop tokens and looking for some guidance. These are the steps that I've taken:

This is where the trouble happens. I reformatted my computer about 4 months ago, but backed up my ssh keys. I also reset my GH ssh to a new one upon reformatting. I've tried verifying myself with the backed up ssh keys along with my current one with no avail.

Is there a step that I'm missing or is there another way to verify? Thank you

Validate correct claim

Friends,

I was wondering if there is a way to verify that a claim has been made correctly, and if thats even possible with the two-weeks tx ban on mainnet. I've used my faucet address back then. I basically:

  • created the base64 string with hs-airdrop
  ],
  "subindex": 0,
  "subproof": [],
  "key": {
    "type": "ADDRESS",
    "version": 0,
    "address": ...
....
  • started a hsd full node
  • used hs-client to pass the prev. generated base64 key via hsd-rpc sendrawairdrop.

it returned a 64-character alphanumeric string. When I query my address on HNScan the balance is 0.

How to generate proof on air-gapped machines?

The README mentioned the possibility to do so without any further details. Where do I start?

Alternatively, I can run bin/hs-airdrop on air-gapped machines but it requires network access to download nonces from https://github.com/handshake-org/hs-tree-data/raw/master/nonces/ so it's not possible.

A simple fix is to provide a way to download all required nonces and copy to the air-gapped machine to run. Please fix this, as there're way too many external dependencies to individually verify before actually trusting this tool.

key was not found

when I execute

 ./bin/hs-airdrop ~/.ssh/id_rsa_github [addr] 0.010

I got follow error response

Attempting to create proof.
This may take a bit.
Decrypting nonce...
NonceError: Could not find nonce in bucket 58.
    at findNonces (/Users/Fei/AndroidStudioProjects/hs-airdrop/bin/hs-airdrop:275:17)
    at async createKeyProofs (/Users/Fei/AndroidStudioProjects/hs-airdrop/bin/hs-airdrop:328:17)
    at async main (/Users/Fei/AndroidStudioProjects/hs-airdrop/bin/hs-airdrop:746:8)

This means your key was not found in the airdrop tree.

My github ssh key was added at 3 April 2019. Have that been added to bucket or do I have any method to add it to bucket again? :-)

Can't decrypt ed25519 key with passphrase

Error: Failed to finalize cipher.
    at Decipher.final (/home/dos/git/hs-airdrop/node_modules/bcrypto/lib/native/cipher.js:48:21)
    at Object.decrypt (/home/dos/git/hs-airdrop/node_modules/bcrypto/lib/native/cipher.js:113:9)
    at decrypt (/home/dos/git/hs-airdrop/node_modules/bcrypto/lib/ssh.js:1110:17)
    at SSHPrivateKey.decodeSSH (/home/dos/git/hs-airdrop/node_modules/bcrypto/lib/ssh.js:462:17)
    at SSHPrivateKey.fromString (/home/dos/git/hs-airdrop/node_modules/bcrypto/lib/ssh.js:712:21)
    at Function.fromString (/home/dos/git/hs-airdrop/node_modules/bufio/lib/struct.js:155:23)
    at readKey (/home/dos/git/hs-airdrop/bin/hs-airdrop:412:33)
    at processTicksAndRejections (internal/process/task_queues.js:86:5)

Decoding the key manually to not contain a passphrase allows hs-airdrop to proceed further.

I've also tested with a passphrase-protected rsa key and it worked.

What value should I enter to claim my entire airdrop?

I would like to claim all of the HNS airdropped to me, but I don't know how much I have received. What value should I pass to the hs-airdrop tool? The documentation is very unclear and makes no sense.

So should I just pass the value 4246.994314 to claim the whole airdrop? How are the transaction fees paid then? Please fix the README, even as a developer in the crypto space it makes zero sense.

How to get seed phrase for import?

Namebase has an import tab that says "If you went through the developer faucet on Handshake.org and received a seed phrase, you can paste that here to import your funds into your Namebase account."

Handshake.org links to this repo to claim HNS, but the docs here don't seem to show how to get the seed phrase. I want to avoid running a full node since I just want to buy domains. Ideally I would like to take the airdrop and transfer it directly to namebase. It seems the current example requires running a full hsd node to complete the claim.

The reason why I want to avoid running a full node is honestly because I don't want to wade through documentation to set it up so I can claim just so I can transfer it all out again. Currently trying to run hsd results in Mainnet genesis block must be generated., and if I can bypass this intermediate step that would make things much easier.

Edit: So I made some progress using these steps

  • The arch hsd-git pkgbuild builds hsd without --production, so I added that to the end of the npm install line, this seemed to fix the genesis block issue letting me run hsd as my normal user with hsd
  • I then cloned and built hs-airdrop and hs-client, and created the airdrop proof with ./bin/hs-airdrop ~/.ssh/id_rsa <wallet_address>. This gave me the error:
Downloading: https://github.com/handshake-org/hs-tree-data/raw/master/tree.bin...
Error: Response exceeded limit.
    at Request.handleResponse (/home/stephen/git/stephen304.com/hs-airdrop/node_modules/brq/lib/request.js:508:19)
    at ClientRequest.emit (events.js:321:20)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:602:27)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:116:17)
    at TLSSocket.socketOnData (_http_client.js:471:22)
    at TLSSocket.emit (events.js:321:20)
    at addChunk (_stream_readable.js:297:12)
    at readableAddChunk (_stream_readable.js:273:9)
    at TLSSocket.Readable.push (_stream_readable.js:214:10)
    at TLSWrap.onStreamRead (internal/stream_base_commons.js:186:23)
  • I resolved this error by manually downloading https://github.com/handshake-org/hs-tree-data/raw/master/tree.bin and placing it in the proper location mv ~/Downloads/tree.bin ~/.hs-tree-data
  • Running the airdrop command again successfully created the proof.
  • I am a little disappointed that I can't seem to find the amount that the proof is good for - which makes it hard to evaluate whether the default fee amount is a significant portion of the airdrop amount

New-format RSA Keys are unsupported

Your README and help text explicitly say that RSA keys are supported, but it doesn't work.

Here's an example on a fresh key:

mac:hs-airdrop kousu$ ssh-keygen -f test-key
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in test-key.
Your public key has been saved in test-key.pub.
The key fingerprint is:
SHA256:p3xNohZyN6uzOChq9wxTAsiwbDEdEoOxhTSLP3q2d7g kousu@mac
The key's randomart image is:
+---[RSA 2048]----+
|=@+..            |
|O+B.             |
|=*               |
|...              |
|  o. .. S = .    |
| . .o  + * *     |
|. oo o  = o .    |
| +.oB oo.o       |
|o.ooE=..oo       |
+----[SHA256]-----+
mac:hs-airdrop kousu$ ./bin/hs-airdrop test-key [addr] 0.5 --bare
Passphrase: 
Error: Invalid key pair.
    at RawPrivateKey.read (/Users/kousu/src/hs-airdrop/node_modules/bcrypto/lib/ssh.js:848:13)
    at RawPrivateKey.decode (/Users/kousu/src/hs-airdrop/node_modules/bufio/lib/struct.js:91:10)
    at Function.decode (/Users/kousu/src/hs-airdrop/node_modules/bufio/lib/struct.js:143:23)
    at SSHPrivateKey.decodeSSH (/Users/kousu/src/hs-airdrop/node_modules/bcrypto/lib/ssh.js:438:34)
    at SSHPrivateKey.fromString (/Users/kousu/src/hs-airdrop/node_modules/bcrypto/lib/ssh.js:634:21)
    at Function.fromString (/Users/kousu/src/hs-airdrop/node_modules/bufio/lib/struct.js:155:23)
    at readKey (/Users/kousu/src/hs-airdrop/bin/hs-airdrop:411:33)
    at processTicksAndRejections (internal/process/next_tick.js:81:5)

Here is that keypair so you can verify for yourselves:

< test-key >
-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAACmFlczI1Ni1jdHIAAAAGYmNyeXB0AAAAGAAAABAFqCssG5
4D92mbdpIPcx2DAAAAEAAAAAEAAAEXAAAAB3NzaC1yc2EAAAADAQABAAABAQDsQPGtT6Vb
VepP2TYLQ6cZKxipTsjL/bI7z793oT4zhE1gG9Nc4FqC6jsZoe9eSh3+HGLmRwiCkS6wcG
G23VCEkMatDQPWIee1kezeHr0JqHGX6+dFCU53VoavLaBTr4yzafNfPqaQGhmF4EgrNsRG
mYwp1JsB6osMMR9MFJbgUF8LPmeQ0q1qut3dJE8eZULbJnBn0O+W5VlYqumq9lNRcBHAxv
T/sDDMzNFpMn78CtFQGVGN6M+ln9ZrkoIYBgYIn9PSckd0kF2hyarYf6TehA8tC98N1gFJ
pd+OiQOi7VYMvstpoFkPCAUCEqX7DR5iN0ZNfgJSXcB6/B2vtY7DAAAD4H232V0kYeC/J8
hUaVGDxKYBz8fr4WpihAl0EwESWDsnd7kES/lXlRH/aUR1u9Xy1NQ6QpKpPPDn2TzpjA0X
y9LF7jLcH19Hs15wbpPN+2M/rrHqYRUn22/lQkoVgov6ju7a4Vsoi5fHtmx+Bv/7yBEEt6
Zv1BadyvRPLHODI7L+ofkPn0ZCerF5+4WB90gsc0ucljtKExqq3Qc1aXm0ITLGhCAvxrUl
ZIJU0B4kDa/ncUyoMiu3wN8Dvr+ppixwI4XVfbDlwDedHSyA8i1HLwLOy1WPKIZDlOA9HJ
PZrjscLYqh/6FDfEp1UFAAyOxSFCAkhDLg04TRBf8SjNRPDYS/17cvCfSZCLfw7uazpXUK
G7aKlp02uniM4WE/txxwtVYzLsqf7LHkYzo7zxULEh+l2+ltw+BGYB/M1NB8MXNsQP2iDE
zI7td2lDyLKPlxzb8gvPJGUo1g7KeUgGL5p2k8L8bIQRDSpBmlYKNVjv4LYSlhQpagBPTm
jN0Gsto41gpWMF+7RbEV//PL4okh9Z/pHFRJXFzJybvdLnGT65eenCptTP9ivCDsZFUjdl
EzgnabREQAEsQn5U7yEL97GOEGdOezrGi5LzUlrsbS0cbOaKTbKWJJEoXejaX1wyao5bzK
NR74BDa1XiczPnRvlCeleIxOzV5hjKYxVjP5cw0Ipdc54ax2nYmaK99YBkFpX9F5/ZS4jp
CFNUd0Trye+6F0caUVKvjvFHLxeT4GjrhdhpLZDpxgGDiAkFsqMgoJsi+vdUzQ5L+Vfnhv
zx4ws37SzJr+ns/ZEgc4aZ/kF9OJ+Ak/hpKV97paPcBsTgCYKcIeUe/gNcl9IJPwgYvADC
qPV6o/cBr3MtVf05j7KdfylwdKkRi1imaLvpamgloNuKewTDkfU51PxmIp8IpJP4s6UypX
M56Dqn8UxeL9sqTc+uo9ZIdcUoTnpoIlDxXPA0s7PZtTapvCimiaP64VT1ZwJCgmFYq/pC
ODkqZ93NrP+6Xd3L2mtrqxazzldtfssXLFUpA4Z3uJJ5GULXM06Dx1KkuqHbbjNob7bYmL
u9ZMxKGXkjf1fI41CPC7/40g/PvdxPRp+EAkCZvDP9bPzxZzHVu0VjZG8HiS4pFV8tyiI5
T5E1MUCgm2PkaOqhBJc3Pr8/9XbCxUE86Y4ruxoy8xAQzHSIDNVJ5oJCeQdnQfx1v4VV2r
G2jXcVVdFLP/KHp34syASKn33T1BP1Sb+2qlmcGgoNwze67uzP6mGBBFd66+RnBOjj0fGR
lnDrYVWpDpkYDpZnu5bVZZCCrGgMk/dLL8TIuoFvaldYT4hehO
-----END OPENSSH PRIVATE KEY-----
< test-key.pub >
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDsQPGtT6VbVepP2TYLQ6cZKxipTsjL/bI7z793oT4zhE1gG9Nc4FqC6jsZoe9eSh3+HGLmRwiCkS6wcGG23VCEkMatDQPWIee1kezeHr0JqHGX6+dFCU53VoavLaBTr4yzafNfPqaQGhmF4EgrNsRGmYwp1JsB6osMMR9MFJbgUF8LPmeQ0q1qut3dJE8eZULbJnBn0O+W5VlYqumq9lNRcBHAxvT/sDDMzNFpMn78CtFQGVGN6M+ln9ZrkoIYBgYIn9PSckd0kF2hyarYf6TehA8tC98N1gFJpd+OiQOi7VYMvstpoFkPCAUCEqX7DR5iN0ZNfgJSXcB6/B2vtY7D kousu@mac

These lines in the ssh codebase you're using

https://github.com/bcoin-org/bcrypto/blob/934f5ea45a0bc0926b9e7916f68bfeb2ea4881e3/lib/ssh.js#L348-L350

https://github.com/bcoin-org/bcrypto/blob/934f5ea45a0bc0926b9e7916f68bfeb2ea4881e3/lib/ssh.js#L422-L424

imply that it only works with ED25519 keys. Indeed, the error seems to be that in bcrypto

https://github.com/bcoin-org/bcrypto/blob/934f5ea45a0bc0926b9e7916f68bfeb2ea4881e3/lib/ssh.js#L813-L819

i.e. it's expecting to read exactly a 32 byte private key, followed by a second copy of a 32 byte public key, which makes no sense for RSA keys.

new snapshot

could you please create a new snapshot, please

Use Public Key to Determine Inclusion for Github Airdrop

Is it possible to do this? It would be really bad for privacy, but some users want to be certain that they are included in the airdrop before they are willing to share their private key with the software.

Is it possible that a user could sign a piece of data to determine if they are in the airdrop?

If we had the exact day that the tree data was collected, it would be a lot easier to explain to people

Fails if PGP .asc contains both public and private key blocks

Trying to do PGP key airdrop claim

hs-airdrop git:(master) ✗ bin/hs-airdrop ~/temp/xxxxx.asc 0xxxxxxxx hs1xxxx 0.01
Attempting to create proof.
This may take a bit.
Decrypting nonce...
AssertionError [ERR_ASSERTION]: Assertion failed.
    at findNonces (/Users/andreas/Repos/hs-airdrop/bin/hs-airdrop:256:3)
    at createKeyProofs (/Users/andreas/Repos/hs-airdrop/bin/hs-airdrop:328:23)
    at main (/Users/andreas/Repos/hs-airdrop/bin/hs-airdrop:746:14)

Why?

When a PGP key is exported from GPG (macOS) with the secret included, it looks like:

-----BEGIN PGP PUBLIC KEY BLOCK-----
...
-----END PGP PUBLIC KEY BLOCK-----
-----BEGIN PGP PRIVATE KEY BLOCK-----
...
-----END PGP PRIVATE KEY BLOCK-----

This tool cannot process the file.

Workaround

Remove the public key block and re-run command

Could not find nonce in bucket xxx

  1. i am sure i have had >=15 followers on GitHub on Feb 4, 2019
  2. i am sure i have three SSH public keys associated with my account and never changed.

i tried three of my keys, but still got the same error.

image

Could not find nonce in bucket - key was not found in the airdrop tree

I tried this tool to claim the airdrop with my github gpg key, which has been associated with my account for years.

NonceError: Could not find nonce in bucket [number].
    at findNonces (/home/daniel/hs-airdrop/bin/hs-airdrop:275:17)
    at async createKeyProofs (/home/daniel/hs-airdrop/bin/hs-airdrop:328:17)
    at async main (/home/daniel/hs-airdrop/bin/hs-airdrop:746:8)

This means your key was not found in the airdrop tree.

At 23 followers I'm over the 15 follower minimum, so I'd expect it to be included, although it's possible I was below 15 followers at the time the merkle tree was built. Is there anyway to tell for sure whether this is a bug or I'm doing something wrong vs that I'm just not in the airdrop?

HSM instructions

Not everyone keeps their SSH and PGP keys on their laptop. In the event that your key is not accessible by the signing tool, the signing tool can present you with the raw data needed to be signed.

I can't derive how to do this from any of the examples given or the instructions. Can someone explain how this is done?

Error: error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt

mac os, when I run

./bin/hs-airdrop ...

got this:

Error: error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt
at Decipheriv.final (internal/crypto/cipher.js:172:29)
at CipherBase.final (/Users/fire/Downloads/hs-airdrop/node_modules/bcrypto/lib/native/cipher.js:59:21)
at Decipher.final (/Users/fire/Downloads/hs-airdrop/node_modules/bcrypto/lib/native/cipher.js:114:21)
at Object.decrypt (/Users/fire/Downloads/hs-airdrop/node_modules/bcrypto/lib/native/cipher.js:187:9)
at Object.decrypt (/Users/fire/Downloads/hs-airdrop/node_modules/bcrypto/lib/encoding/pemcrypt.js:68:23)
at SSHPrivateKey.fromString (/Users/fire/Downloads/hs-airdrop/node_modules/bcrypto/lib/ssh.js:644:16)
at Function.fromString (/Users/fire/Downloads/hs-airdrop/node_modules/bufio/lib/struct.js:155:23)
at readKey (/Users/fire/Downloads/hs-airdrop/bin/hs-airdrop:536:33)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async parseArgs (/Users/fire/Downloads/hs-airdrop/bin/hs-airdrop:714:21)

Multiple duplicate addresses in faucet tree, only first instance will be returned by findProofEntry()

I noticed a few addresses were duplicated in https://github.com/handshake-org/hs-tree-data/blob/master/proof.json and wrote a quick script to find them all (output below). One address is in the tree 62 times!

I'm not sure what caused this, if it's intended or not. Either way, the hs-airdrop <addr> script will only return a proof for the first occurrence of a given address:

hs-airdrop/bin/hs-airdrop

Lines 241 to 246 in e92f14d

for (const [address, value, sponsor] of items) {
const {hash} = parseAddress(address);
if (hash.equals(target.hash))
return [value, sponsor];
}

So I'm sure with a little modification, that script could output proofs for EVERY instance of an address in the tree., but I'm not sure that's intended behavior. @chjj mentioned the tree will likely be rebuilt once more before mainnet so maybe these dupes could be fixed during that process.

Map {
  'hs1qng3mfk23uuqynl8s287h6nul8pye2rajdvz2gu' => 2,
  'hs1qfnfj7p2qw3u2hgtl8mgg5whjcu3235yvqc4l47' => 62,
  'hs1q9drsmaqkpp7ewv4wedufw6rjgdcp9zv4e6c8le' => 2,
  'hs1qvvnv5h7tx96eg7pud3r3uzzwycyfsqmr5mm579' => 2,
  'hs1qnvkypvp5uchnujj8awl8th0lm998m0c7c3pf5y' => 2,
  'hs1qdj2xqy3rykp0n2kywzt8x77dr3fw0evmyrkz0j' => 2,
  'hs1qhsmch5g5dy9774ek46zmwk0pmj3z5ahrgsu0ep' => 2,
  'hs1qp99ll9m9rqk39w6lexh06mvevf9gnkm0tpt04f' => 2,
  'hs1qcjdr858rupg6lsfwenvg29d5mu3u967kywscg4' => 2,
  'hs1qhzvr94u7yanswn6et25nrje3fsucgsd5nhmqfg' => 2,
  'hs1qv7cndn4zttf2cyzw5dr330xnzylp5dz9dzh56x' => 2,
  'hs1qjk8ys3n3l7ct9lmpqsszxr34dn5h8efexfxf2j' => 2,
  'hs1q3lkysn74p39xfxc2pzf8ewmvaezwagsvehdd7t' => 2,
  'hs1qgfzuxpg05t4zs323ly3dtnuwpc9tt94glvkvxm' => 2,
  'hs1q58r3mr3lrxhzlrdyyvamyffg37a2vkasjlk9f8' => 2,
  'hs1qfnn556v4f5vcrvmmahh6ugt394k08wr22dnkxx' => 2,
  'hs1qymue45suswzt3ynkjl6vkutrafgfqr6g3dwzuc' => 2,
  'hs1qwrrlczge2vt0xa3ktwvfwdpchhftzc0zhwyvr3' => 2,
  'hs1qeh4q4el90mklmdjxxrd5rfk9j72c755gq69w8f' => 2,
  'hs1qylgr5j47v0slddupewgn0kgajm09qm9xpxxsc8' => 2,
  'hs1qxgwd3t6kzw72m4ywx4fj9rqx5fqqsa6fm2sltc' => 2,
  'hs1qygj6y7jcjam9s6nr3ds82ksg9wd7jqtu4csf3d' => 2 }

Doubt regarding airdrop

What if i did not have 15 followers during the said week.

If you had 15 or more followers on github during the week of 2018-08-27, your github SSH & PGP keys are included in the merkle tree

Is this airdrop still on for users more than 15 followers?

Usage examples depict testnet addresses, but all faucet addresses are mainnet.

https://github.com/handshake-org/hs-airdrop#usage

I was trying to help an airdrop recipient on IRC manage the faucet-tool and generate an address. They were confused because they thought they would need to import their faucet-tool mnemonic seed into an hsd testnet full node wallet.

I tried to test airdrops on testnet with my own faucet address, but wasn't able to succeed. (Started by converting my mainnet faucet address to testnet, and commenting-out assertions until a proof was generated). Would be nice to be able to test faucet airdrop proofs on testnet, even after mainnet launches.

Client network socket disconnected before secure TLS connection was established

When I exec ./bin/hs-airdrop ~/.ssh/id_rsa < address> I got the error like this:

Passphrase:
Attempting to create proof.
This may take a bit.
Decrypting nonce...
Downloading: https://github.com/handshake-org/hs-tree-data/raw/master/nonces/111.bin...
Error: Client network socket disconnected before secure TLS connection was established
at TLSSocket.onConnectEnd (_tls_wrap.js:1084:19)
at Object.onceWrapper (events.js:273:13)
at TLSSocket.emit (events.js:187:15)
at endReadableNT (_stream_readable.js:1085:12)
at process._tickCallback (internal/process/next_tick.js:63:19)

Proving non-inflation

Since we now have a magic merkle tree which conjures coins, we need to prove that the supply is finite.

Two ways to do this:

  1. Make the entire tree a merkle sum tree. We will know that it can never conjure more value than the value attached to the root node.
  2. Add a consensus rule that only X amount of value can ever exit the tree.

The second method doesn't prove the amount of value in the tree, it only guarantees non-inflation. They're both kind of annoying. The first one requires a bunch of new merkle code and makes the proofs bigger. The second requires some extra bookkeeping on-chain.

Any plan to support ECDSA?

I do have had 16 followers on GitHub on Feb 4, 2019 and have multiple SSH public keys linked to my account, but unfortunately they are all in ecdsa-sha2-nistp521 type. I got the following error:

Error: Unsupported algorithm.
at AirdropKey.fromSSH (/Volumes/development/github/hs-airdrop/lib/key.js:768:15)
at Function.fromSSH (/Volumes/development/github/hs-airdrop/lib/key.js:882:23)
at readKey (/Volumes/development/github/hs-airdrop/bin/hs-airdrop:539:25)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async parseArgs (/Volumes/development/github/hs-airdrop/bin/hs-airdrop:714:21)
at async main (/Volumes/development/github/hs-airdrop/bin/hs-airdrop:740:19)

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.