bitpay/bitauth — pull request #7 by ryanxcharles (2014-07-02 02:13:42+00:00)
Title: Hierarchical Sin

A proof-of-concept of hierarchical SINs. Here's an example of how to use it to derive any SIN in the hierarchy:

```
> bitauth.genHSin();
{ hsinpriv: 'xprv9s21ZrQH143K332MPKhvhEjP6iUYrti43U2BynKh6K4K46sFMao6G9k82wU5WavyBS8fKaf7PeVu7NE4mRh3jMboVkqs1HYhMYQxks15dSc',
SIN: 'Tf2srhJaGJx9xD1zTCeC1HMjbEB1X4WLsc4' }
> bitauth.hSin('xprv9s21ZrQH143K332MPKhvhEjP6iUYrti43U2BynKh6K4K46sFMao6G9k82wU5WavyBS8fKaf7PeVu7NE4mRh3jMboVkqs1HYhMYQxks15dSc', 'm/0');
{ hsinpriv: 'xprv9uL6Q3TQx28SqbhBFB8vBcreHxzSD2QP5X8scYdrjjvJGDBp9PtKde6pL1kvLZhNcDPZFswyYcG8rRpaqdjGT2nSWyoqRPMNTNVe8QJATQd',
SIN: 'Tf2srhJaGJx9xD1zTCeC1HMjbEB1X4WLsc4' }
> bitauth.hSin('xprv9s21ZrQH143K332MPKhvhEjP6iUYrti43U2BynKh6K4K46sFMao6G9k82wU5WavyBS8fKaf7PeVu7NE4mRh3jMboVkqs1HYhMYQxks15dSc', 'm/1');
{ hsinpriv: 'xprv9uL6Q3TQx28SvTDFxJ46bNLKzU4yu4eZBzsLwCVxeeUQiy9VC7qUGJdUW6CxgrbfQz1TzCJcRFJuv9MwaXJzfuBqgAdAZYYHn3jGKQW3CCw',
SIN: 'Tf2srhJaGJx9xD1zTCeC1HMjbEB1X4WLsc4' }
> bitauth.hSin('xprv9s21ZrQH143K332MPKhvhEjP6iUYrti43U2BynKh6K4K46sFMao6G9k82wU5WavyBS8fKaf7PeVu7NE4mRh3jMboVkqs1HYhMYQxks15dSc', 'm/2');
{ hsinpriv: 'xprv9uL6Q3TQx28Sx2k3B4sfaD74136tX8Q6XKDB3oQ4Bv9Bz4VS1uXbtsKcpcDK46M4Lch4dy3e5mDHnJ7j2kSTX4h7s8y7vikmfvxpG3oTTQ3',
SIN: 'Tf2srhJaGJx9xD1zTCeC1HMjbEB1X4WLsc4' }
> bitauth.hSin('xprv9s21ZrQH143K332MPKhvhEjP6iUYrti43U2BynKh6K4K46sFMao6G9k82wU5WavyBS8fKaf7PeVu7NE4mRh3jMboVkqs1HYhMYQxks15dSc', 'm/3/4/1/4034');
{ hsinpriv: 'xprv9zmAB9HyjEXFBBKJVzrkKyk5yqwhMw5PtmfppfxhFfAeMc17UiPgWZko1FjoyKFz4b7MHFgyqVwcZgpNzzat6vtFW6D1pq3h1XvgLL8tsBR',
SIN: 'Tf2srhJaGJx9xD1zTCeC1HMjbEB1X4WLsc4' }
```