Taking a look...
This commit is contained in:
parent
cc6c59a427
commit
a154e248ae
@ -1,8 +1,10 @@
|
|||||||
package wallet
|
package wallet
|
||||||
|
|
||||||
import "github.com/btcsuite/btcd/wire"
|
import "github.com/btcsuite/btcd/wire"
|
||||||
|
import "fmt" //TODO(j) remove me later...
|
||||||
|
|
||||||
// TODO(roasbeef): port Rusty's hash-chain stuff
|
// TODO(roasbeef): port Rusty's hash-chain stuff
|
||||||
|
//http://ccodearchive.net/info/crypto/shachain.html
|
||||||
// * or just use HD chains based off of CodeShark's proposal?
|
// * or just use HD chains based off of CodeShark's proposal?
|
||||||
|
|
||||||
// chainFragment...
|
// chainFragment...
|
||||||
@ -18,9 +20,25 @@ type ShaChain struct {
|
|||||||
chainFragments []chainFragment
|
chainFragments []chainFragment
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Derive(from uint64, to uint64, fromHash wire.ShaHash, toHash wire.ShaHash) {
|
||||||
|
var branches uint64
|
||||||
|
branches = from ^ to
|
||||||
|
|
||||||
|
//TODO(j) remove me Dumb test
|
||||||
|
fmt.Println(branches)
|
||||||
|
fmt.Println(from)
|
||||||
|
fmt.Println(to)
|
||||||
|
}
|
||||||
|
|
||||||
|
//Generate a new ShaChain from a seed
|
||||||
|
func NewShaChainFromSeed(seed wire.ShaHash, index uint64, hash wire.ShaHash) {
|
||||||
|
Derive(0, ^uint64(0), seed, hash)
|
||||||
|
}
|
||||||
|
|
||||||
// NewShaChain...
|
// NewShaChain...
|
||||||
func NewShaChain(seed wire.ShaHash) *ShaChain {
|
func NewShaChain(seed wire.ShaHash) *ShaChain {
|
||||||
// TODO(roasbeef): from/to or static size?
|
// TODO(roasbeef): from/to or static size?
|
||||||
|
return new(ShaChain)
|
||||||
}
|
}
|
||||||
|
|
||||||
// NextHash...
|
// NextHash...
|
||||||
|
@ -1 +1,3 @@
|
|||||||
package wallet
|
package wallet
|
||||||
|
|
||||||
|
import "testing"
|
||||||
|
Loading…
Reference in New Issue
Block a user