services icon indicating copy to clipboard operation
services copied to clipboard

New Project: Hardware Wallet

Open skycoin-manager opened this issue 8 years ago • 6 comments

https://godoc.org/github.com/skycoin/skycoin/src/cipher

  • Create a new folder called hardware-wallet for the project files
  • Use the trezor cryptography implementation
  • Create a readme.md explaining installation and how to run

Port the following functions

  • func GenerateDeterministicKeyPairs(seed []byte, n int) []SecKey
  • func ECDH(pub PubKey, sec SecKey) []byte
  • PubKey, PubKeyFromSecKey(seckey SecKey) PubKey
  • AddressFromPubKey(pubKey PubKey) Address
  • func VerifySignature(pubkey PubKey, sig Sig, hash SHA256) error
  • func ChkSig(address Address, hash SHA256, sig Sig) error

There must be tests

  • take list of 10 values /seeds and the private keys they should generate. Verify that the golang and trezor outputs the same values for the 10 inputs. Automated testing.
  • do the same for SHA256
  • do the same for ECDH

Then do test scripts that generate an input/output pair in golang at random and tests what the hardware outputs for the input pair.

  • log all outputs that differ to an error file (including the function tested, the input and the output and what it should be)

skycoin-manager avatar Feb 11 '18 17:02 skycoin-manager

working on this

AlexSugak avatar Feb 11 '18 21:02 AlexSugak

Talked with Brandon in wechat and clarified that other developers are working in hardware wallet so I should take another task

AlexSugak avatar Feb 12 '18 14:02 AlexSugak

Pull request #43

  • func GenerateDeterministicKeyPairs(seed []byte, n int) []SecKey
  • func ECDH(pub PubKey, sec SecKey) []byte
  • PubKey, PubKeyFromSecKey(seckey SecKey) PubKey
  • AddressFromPubKey(pubKey PubKey) Address

mpsido avatar Feb 26 '18 07:02 mpsido

@skycoin-manager this issue asks to make a code to "VerifySignature" but do not ask me to do signature: do you confirm we don't need it ?

Second question: for address generation do you want the generation for both bitcoin and skycoin or only skycoin

mpsido avatar Mar 01 '18 02:03 mpsido

pushed code to generate bitcoin public and private address

mpsido avatar Mar 01 '18 08:03 mpsido

Quoting wechat conversation precising what's in scope

  • address generation: bitcoin + skycoin
  • Sign verification: skycoin only
  • Signature: out of scope (but can do if have time)

mpsido avatar Mar 01 '18 08:03 mpsido