mirror of
https://github.com/muun/recovery.git
synced 2025-11-11 22:40:16 -05:00
Update project structure and build process
This commit is contained in:
11
vendor/github.com/btcsuite/btcutil/go.mod
generated
vendored
11
vendor/github.com/btcsuite/btcutil/go.mod
generated
vendored
@@ -1,11 +0,0 @@
|
||||
module github.com/btcsuite/btcutil
|
||||
|
||||
go 1.13
|
||||
|
||||
require (
|
||||
github.com/aead/siphash v1.0.1
|
||||
github.com/btcsuite/btcd v0.20.1-beta
|
||||
github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495
|
||||
github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23
|
||||
golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d
|
||||
)
|
||||
54
vendor/github.com/btcsuite/btcutil/go.sum
generated
vendored
54
vendor/github.com/btcsuite/btcutil/go.sum
generated
vendored
@@ -1,54 +0,0 @@
|
||||
github.com/aead/siphash v1.0.1 h1:FwHfE/T45KPKYuuSAKyyvE+oPWcaQ+CUmFW0bPlM+kg=
|
||||
github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII=
|
||||
github.com/btcsuite/btcd v0.20.1-beta h1:Ik4hyJqN8Jfyv3S4AGBOmyouMsYE3EdYODkMbQjwPGw=
|
||||
github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ=
|
||||
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f h1:bAs4lUbRJpnnkd9VhRV3jjAVU7DJVjMaK+IsvSeZvFo=
|
||||
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA=
|
||||
github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg=
|
||||
github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg=
|
||||
github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd h1:qdGvebPBDuYDPGi1WCPjy1tGyMpmDK8IEapSsszn7HE=
|
||||
github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY=
|
||||
github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723 h1:ZA/jbKoGcVAnER6pCHPEkGdZOV7U1oLUedErBHCUMs0=
|
||||
github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc=
|
||||
github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY=
|
||||
github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs=
|
||||
github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495 h1:6IyqGr3fnd0tM3YxipK27TUskaOVUjU2nG45yzwcQKY=
|
||||
github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
|
||||
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
||||
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
|
||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
|
||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||
github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
|
||||
github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ=
|
||||
github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23 h1:FOOIBWrEkLgmlgGfMuZT83xIwfPDxEI2OHu6xUmJMFE=
|
||||
github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4=
|
||||
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/ginkgo v1.7.0 h1:WSHQ+IS43OoUrWtD1/bbclrwK8TTH5hzp+umCiuxHgs=
|
||||
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/gomega v1.4.3 h1:RE1xgDvH7imwFD45h+u2SgIfERHlS2yNG4DObb5BSKU=
|
||||
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
|
||||
golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d h1:2+ZP7EfsZV7Vvmx3TIqSlSzATMkTAKqM14YGFPoSKjI=
|
||||
golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 h1:0GoQqolDA55aaLxZyTzK/Y2ePZzZTUrRacwib7cNsYQ=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d h1:+R4KGOnez64A81RvjARKc4UT5/tI9ujCIVX+P5KiHuI=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=
|
||||
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
|
||||
gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE=
|
||||
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
9
vendor/github.com/btcsuite/btcutil/psbt/go.mod
generated
vendored
9
vendor/github.com/btcsuite/btcutil/psbt/go.mod
generated
vendored
@@ -1,9 +0,0 @@
|
||||
module github.com/btcsuite/btcutil/psbt
|
||||
|
||||
go 1.13
|
||||
|
||||
require (
|
||||
github.com/btcsuite/btcd v0.20.1-beta
|
||||
github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d
|
||||
github.com/davecgh/go-spew v1.1.1
|
||||
)
|
||||
36
vendor/github.com/btcsuite/btcutil/psbt/go.sum
generated
vendored
36
vendor/github.com/btcsuite/btcutil/psbt/go.sum
generated
vendored
@@ -1,36 +0,0 @@
|
||||
github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII=
|
||||
github.com/btcsuite/btcd v0.20.1-beta h1:Ik4hyJqN8Jfyv3S4AGBOmyouMsYE3EdYODkMbQjwPGw=
|
||||
github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ=
|
||||
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f h1:bAs4lUbRJpnnkd9VhRV3jjAVU7DJVjMaK+IsvSeZvFo=
|
||||
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA=
|
||||
github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d h1:yJzD/yFppdVCf6ApMkVy8cUxV0XrxdP9rVf6D87/Mng=
|
||||
github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg=
|
||||
github.com/btcsuite/btcutil v0.0.0-20191219182022-e17c9730c422 h1:EqnrgSSg0SFWRlEZLExgjtuUR/IPnuQ6qw6nwRda4Uk=
|
||||
github.com/btcsuite/btcutil v0.0.0-20191219182022-e17c9730c422/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg=
|
||||
github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg=
|
||||
github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY=
|
||||
github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc=
|
||||
github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY=
|
||||
github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs=
|
||||
github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||
github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
|
||||
github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ=
|
||||
github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4=
|
||||
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
|
||||
golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44 h1:9lP3x0pW80sDI6t1UMSLA4to18W7R7imwAI/sWS9S8Q=
|
||||
golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
|
||||
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
14
vendor/github.com/btcsuite/btcwallet/wallet/txauthor/go.mod
generated
vendored
14
vendor/github.com/btcsuite/btcwallet/wallet/txauthor/go.mod
generated
vendored
@@ -1,14 +0,0 @@
|
||||
module github.com/btcsuite/btcwallet/wallet/txauthor
|
||||
|
||||
go 1.12
|
||||
|
||||
require (
|
||||
github.com/btcsuite/btcd v0.0.0-20190824003749-130ea5bddde3
|
||||
github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d
|
||||
github.com/btcsuite/btcwallet/wallet/txrules v1.0.0
|
||||
github.com/btcsuite/btcwallet/wallet/txsizes v1.0.0
|
||||
)
|
||||
|
||||
replace github.com/btcsuite/btcwallet/wallet/txrules => ../txrules
|
||||
|
||||
replace github.com/btcsuite/btcwallet/wallet/txsizes => ../txsizes
|
||||
66
vendor/github.com/btcsuite/btcwallet/wallet/txauthor/go.sum
generated
vendored
66
vendor/github.com/btcsuite/btcwallet/wallet/txauthor/go.sum
generated
vendored
@@ -1,66 +0,0 @@
|
||||
github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII=
|
||||
github.com/btcsuite/btcd v0.0.0-20190824003749-130ea5bddde3 h1:A/EVblehb75cUgXA5njHPn0kLAsykn6mJGz7rnmW5W0=
|
||||
github.com/btcsuite/btcd v0.0.0-20190824003749-130ea5bddde3/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI=
|
||||
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f h1:bAs4lUbRJpnnkd9VhRV3jjAVU7DJVjMaK+IsvSeZvFo=
|
||||
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA=
|
||||
github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d h1:yJzD/yFppdVCf6ApMkVy8cUxV0XrxdP9rVf6D87/Mng=
|
||||
github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg=
|
||||
github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg=
|
||||
github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY=
|
||||
github.com/btcsuite/goleveldb v1.0.0 h1:Tvd0BfvqX9o823q1j2UZ/epQo09eJh6dTcRp79ilIN4=
|
||||
github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I=
|
||||
github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc=
|
||||
github.com/btcsuite/snappy-go v1.0.0 h1:ZxaA6lo2EpxGddsA8JwWOcxlzRybb444sgmeJQMJGQE=
|
||||
github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc=
|
||||
github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY=
|
||||
github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs=
|
||||
github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
|
||||
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
||||
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
|
||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
|
||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||
github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
|
||||
github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ=
|
||||
github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4=
|
||||
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/ginkgo v1.7.0 h1:WSHQ+IS43OoUrWtD1/bbclrwK8TTH5hzp+umCiuxHgs=
|
||||
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
|
||||
github.com/onsi/gomega v1.4.3 h1:RE1xgDvH7imwFD45h+u2SgIfERHlS2yNG4DObb5BSKU=
|
||||
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
|
||||
golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44 h1:9lP3x0pW80sDI6t1UMSLA4to18W7R7imwAI/sWS9S8Q=
|
||||
golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67 h1:ng3VDlRp5/DHpSWl02R4rM9I+8M2rhmsuLwAMmkLQWE=
|
||||
golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190206173232-65e2d4e15006 h1:bfLnR+k0tq5Lqt6dflRLcZiz6UaXCMt3vhYJ1l4FQ80=
|
||||
golang.org/x/net v0.0.0-20190206173232-65e2d4e15006/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw=
|
||||
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190904154756-749cb33beabd h1:DBH9mDw0zluJT/R+nGuV3jWFWLFaHyYZWD4tOT+cjn0=
|
||||
golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2 h1:z99zHgr7hKfrUcX/KsoJk5FJfjTceCKIp96+biqP4To=
|
||||
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=
|
||||
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
|
||||
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
8
vendor/github.com/btcsuite/btcwallet/wallet/txrules/go.mod
generated
vendored
8
vendor/github.com/btcsuite/btcwallet/wallet/txrules/go.mod
generated
vendored
@@ -1,8 +0,0 @@
|
||||
module github.com/btcsuite/btcwallet/wallet/txrules
|
||||
|
||||
go 1.12
|
||||
|
||||
require (
|
||||
github.com/btcsuite/btcd v0.0.0-20190824003749-130ea5bddde3
|
||||
github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d
|
||||
)
|
||||
33
vendor/github.com/btcsuite/btcwallet/wallet/txrules/go.sum
generated
vendored
33
vendor/github.com/btcsuite/btcwallet/wallet/txrules/go.sum
generated
vendored
@@ -1,33 +0,0 @@
|
||||
github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII=
|
||||
github.com/btcsuite/btcd v0.0.0-20190824003749-130ea5bddde3 h1:A/EVblehb75cUgXA5njHPn0kLAsykn6mJGz7rnmW5W0=
|
||||
github.com/btcsuite/btcd v0.0.0-20190824003749-130ea5bddde3/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI=
|
||||
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f h1:bAs4lUbRJpnnkd9VhRV3jjAVU7DJVjMaK+IsvSeZvFo=
|
||||
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA=
|
||||
github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d h1:yJzD/yFppdVCf6ApMkVy8cUxV0XrxdP9rVf6D87/Mng=
|
||||
github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg=
|
||||
github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg=
|
||||
github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY=
|
||||
github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc=
|
||||
github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY=
|
||||
github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs=
|
||||
github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495 h1:6IyqGr3fnd0tM3YxipK27TUskaOVUjU2nG45yzwcQKY=
|
||||
github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||
github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
|
||||
github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ=
|
||||
github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4=
|
||||
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
|
||||
golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44 h1:9lP3x0pW80sDI6t1UMSLA4to18W7R7imwAI/sWS9S8Q=
|
||||
golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
|
||||
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
17
vendor/github.com/btcsuite/btcwallet/wallet/txsizes/go.mod
generated
vendored
17
vendor/github.com/btcsuite/btcwallet/wallet/txsizes/go.mod
generated
vendored
@@ -1,17 +0,0 @@
|
||||
module github.com/btcsuite/btcwallet/wallet/txsizes
|
||||
|
||||
go 1.12
|
||||
|
||||
require (
|
||||
github.com/btcsuite/btcd v0.0.0-20190824003749-130ea5bddde3
|
||||
github.com/btcsuite/goleveldb v1.0.0 // indirect
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/kr/pretty v0.1.0 // indirect
|
||||
golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67 // indirect
|
||||
golang.org/x/net v0.0.0-20190206173232-65e2d4e15006 // indirect
|
||||
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 // indirect
|
||||
golang.org/x/sys v0.0.0-20190904154756-749cb33beabd // indirect
|
||||
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2 // indirect
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
|
||||
gopkg.in/yaml.v2 v2.2.2 // indirect
|
||||
)
|
||||
65
vendor/github.com/btcsuite/btcwallet/wallet/txsizes/go.sum
generated
vendored
65
vendor/github.com/btcsuite/btcwallet/wallet/txsizes/go.sum
generated
vendored
@@ -1,65 +0,0 @@
|
||||
github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII=
|
||||
github.com/btcsuite/btcd v0.0.0-20190824003749-130ea5bddde3 h1:A/EVblehb75cUgXA5njHPn0kLAsykn6mJGz7rnmW5W0=
|
||||
github.com/btcsuite/btcd v0.0.0-20190824003749-130ea5bddde3/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI=
|
||||
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f h1:bAs4lUbRJpnnkd9VhRV3jjAVU7DJVjMaK+IsvSeZvFo=
|
||||
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA=
|
||||
github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d h1:yJzD/yFppdVCf6ApMkVy8cUxV0XrxdP9rVf6D87/Mng=
|
||||
github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg=
|
||||
github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg=
|
||||
github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY=
|
||||
github.com/btcsuite/goleveldb v1.0.0 h1:Tvd0BfvqX9o823q1j2UZ/epQo09eJh6dTcRp79ilIN4=
|
||||
github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I=
|
||||
github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc=
|
||||
github.com/btcsuite/snappy-go v1.0.0 h1:ZxaA6lo2EpxGddsA8JwWOcxlzRybb444sgmeJQMJGQE=
|
||||
github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc=
|
||||
github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY=
|
||||
github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs=
|
||||
github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
|
||||
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
||||
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
|
||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
|
||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||
github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
|
||||
github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ=
|
||||
github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4=
|
||||
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/ginkgo v1.7.0 h1:WSHQ+IS43OoUrWtD1/bbclrwK8TTH5hzp+umCiuxHgs=
|
||||
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
|
||||
github.com/onsi/gomega v1.4.3 h1:RE1xgDvH7imwFD45h+u2SgIfERHlS2yNG4DObb5BSKU=
|
||||
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
|
||||
golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67 h1:ng3VDlRp5/DHpSWl02R4rM9I+8M2rhmsuLwAMmkLQWE=
|
||||
golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190206173232-65e2d4e15006 h1:bfLnR+k0tq5Lqt6dflRLcZiz6UaXCMt3vhYJ1l4FQ80=
|
||||
golang.org/x/net v0.0.0-20190206173232-65e2d4e15006/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw=
|
||||
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190904154756-749cb33beabd h1:DBH9mDw0zluJT/R+nGuV3jWFWLFaHyYZWD4tOT+cjn0=
|
||||
golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2 h1:z99zHgr7hKfrUcX/KsoJk5FJfjTceCKIp96+biqP4To=
|
||||
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=
|
||||
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
|
||||
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
9
vendor/github.com/btcsuite/btcwallet/walletdb/go.mod
generated
vendored
9
vendor/github.com/btcsuite/btcwallet/walletdb/go.mod
generated
vendored
@@ -1,9 +0,0 @@
|
||||
module github.com/btcsuite/btcwallet/walletdb
|
||||
|
||||
go 1.12
|
||||
|
||||
require (
|
||||
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f
|
||||
github.com/davecgh/go-spew v1.1.1
|
||||
go.etcd.io/bbolt v1.3.5-0.20200615073812-232d8fc87f50
|
||||
)
|
||||
8
vendor/github.com/btcsuite/btcwallet/walletdb/go.sum
generated
vendored
8
vendor/github.com/btcsuite/btcwallet/walletdb/go.sum
generated
vendored
@@ -1,8 +0,0 @@
|
||||
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f h1:bAs4lUbRJpnnkd9VhRV3jjAVU7DJVjMaK+IsvSeZvFo=
|
||||
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
go.etcd.io/bbolt v1.3.5-0.20200615073812-232d8fc87f50 h1:ASw9n1EHMftwnP3Az4XW6e308+gNsrHzmdhd0Olz9Hs=
|
||||
go.etcd.io/bbolt v1.3.5-0.20200615073812-232d8fc87f50/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
|
||||
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5 h1:LfCXLvNmTYH9kEmVgqbnsWfruoXZIrh4YBgqVHtDvw0=
|
||||
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
12
vendor/github.com/btcsuite/btcwallet/wtxmgr/go.mod
generated
vendored
12
vendor/github.com/btcsuite/btcwallet/wtxmgr/go.mod
generated
vendored
@@ -1,12 +0,0 @@
|
||||
module github.com/btcsuite/btcwallet/wtxmgr
|
||||
|
||||
go 1.12
|
||||
|
||||
require (
|
||||
github.com/btcsuite/btcd v0.0.0-20190824003749-130ea5bddde3
|
||||
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f
|
||||
github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d
|
||||
github.com/btcsuite/btcwallet/walletdb v1.3.2
|
||||
github.com/lightningnetwork/lnd/clock v1.0.1
|
||||
github.com/stretchr/testify v1.5.1 // indirect
|
||||
)
|
||||
66
vendor/github.com/btcsuite/btcwallet/wtxmgr/go.sum
generated
vendored
66
vendor/github.com/btcsuite/btcwallet/wtxmgr/go.sum
generated
vendored
@@ -1,66 +0,0 @@
|
||||
github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII=
|
||||
github.com/btcsuite/btcd v0.0.0-20190824003749-130ea5bddde3 h1:A/EVblehb75cUgXA5njHPn0kLAsykn6mJGz7rnmW5W0=
|
||||
github.com/btcsuite/btcd v0.0.0-20190824003749-130ea5bddde3/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI=
|
||||
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f h1:bAs4lUbRJpnnkd9VhRV3jjAVU7DJVjMaK+IsvSeZvFo=
|
||||
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA=
|
||||
github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d h1:yJzD/yFppdVCf6ApMkVy8cUxV0XrxdP9rVf6D87/Mng=
|
||||
github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg=
|
||||
github.com/btcsuite/btcwallet/walletdb v1.3.2 h1:nFnMBVgkqoVOx08Z756oDwNc9sdVgYR52T1ONSXs90w=
|
||||
github.com/btcsuite/btcwallet/walletdb v1.3.2/go.mod h1:GZCMPNpUu5KE3ASoVd+k06p/1OW8OwNGCCaNWRto2cQ=
|
||||
github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg=
|
||||
github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd h1:qdGvebPBDuYDPGi1WCPjy1tGyMpmDK8IEapSsszn7HE=
|
||||
github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY=
|
||||
github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723 h1:ZA/jbKoGcVAnER6pCHPEkGdZOV7U1oLUedErBHCUMs0=
|
||||
github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc=
|
||||
github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY=
|
||||
github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs=
|
||||
github.com/coreos/bbolt v1.3.3 h1:n6AiVyVRKQFNb6mJlwESEvvLoDyiTzXX7ORAUlkeBdY=
|
||||
github.com/coreos/bbolt v1.3.3/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
|
||||
github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
|
||||
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
||||
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
|
||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
|
||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||
github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
|
||||
github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ=
|
||||
github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4=
|
||||
github.com/lightningnetwork/lnd/clock v1.0.1 h1:QQod8+m3KgqHdvVMV+2DRNNZS1GRFir8mHZYA+Z2hFo=
|
||||
github.com/lightningnetwork/lnd/clock v1.0.1/go.mod h1:KnQudQ6w0IAMZi1SgvecLZQZ43ra2vpDNj7H/aasemg=
|
||||
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/ginkgo v1.7.0 h1:WSHQ+IS43OoUrWtD1/bbclrwK8TTH5hzp+umCiuxHgs=
|
||||
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/gomega v1.4.3 h1:RE1xgDvH7imwFD45h+u2SgIfERHlS2yNG4DObb5BSKU=
|
||||
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=
|
||||
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
||||
go.etcd.io/bbolt v1.3.5-0.20200615073812-232d8fc87f50 h1:ASw9n1EHMftwnP3Az4XW6e308+gNsrHzmdhd0Olz9Hs=
|
||||
go.etcd.io/bbolt v1.3.5-0.20200615073812-232d8fc87f50/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
|
||||
golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44 h1:9lP3x0pW80sDI6t1UMSLA4to18W7R7imwAI/sWS9S8Q=
|
||||
golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd h1:nTDtHvHSdCn1m6ITfMRqtOd/9+7a3s8RBNOZ3eYZzJA=
|
||||
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5 h1:LfCXLvNmTYH9kEmVgqbnsWfruoXZIrh4YBgqVHtDvw0=
|
||||
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=
|
||||
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
|
||||
gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE=
|
||||
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
3
vendor/github.com/decred/dcrd/lru/go.mod
generated
vendored
3
vendor/github.com/decred/dcrd/lru/go.mod
generated
vendored
@@ -1,3 +0,0 @@
|
||||
module github.com/decred/dcrd/lru
|
||||
|
||||
go 1.11
|
||||
8
vendor/github.com/fiatjaf/go-lnurl/go.mod
generated
vendored
8
vendor/github.com/fiatjaf/go-lnurl/go.mod
generated
vendored
@@ -1,8 +0,0 @@
|
||||
module github.com/fiatjaf/go-lnurl
|
||||
|
||||
go 1.14
|
||||
|
||||
require (
|
||||
github.com/btcsuite/btcd v0.20.1-beta
|
||||
github.com/tidwall/gjson v1.6.0
|
||||
)
|
||||
35
vendor/github.com/fiatjaf/go-lnurl/go.sum
generated
vendored
35
vendor/github.com/fiatjaf/go-lnurl/go.sum
generated
vendored
@@ -1,35 +0,0 @@
|
||||
github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII=
|
||||
github.com/btcsuite/btcd v0.20.1-beta h1:Ik4hyJqN8Jfyv3S4AGBOmyouMsYE3EdYODkMbQjwPGw=
|
||||
github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ=
|
||||
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA=
|
||||
github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg=
|
||||
github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg=
|
||||
github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY=
|
||||
github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc=
|
||||
github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY=
|
||||
github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs=
|
||||
github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||
github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
|
||||
github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ=
|
||||
github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4=
|
||||
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
|
||||
github.com/tidwall/gjson v1.6.0 h1:9VEQWz6LLMUsUl6PueE49ir4Ka6CzLymOAZDxpFsTDc=
|
||||
github.com/tidwall/gjson v1.6.0/go.mod h1:P256ACg0Mn+j1RXIDXoss50DeIABTYK1PULOJHhxOls=
|
||||
github.com/tidwall/match v1.0.1 h1:PnKP62LPNxHKTwvHHZZzdOAOCtsJTjo6dZLCwpKm5xc=
|
||||
github.com/tidwall/match v1.0.1/go.mod h1:LujAq0jyVjBy028G1WhWfIzbpQfMO8bBZ6Tyb0+pL9E=
|
||||
github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4=
|
||||
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
|
||||
golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
|
||||
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
9
vendor/github.com/gookit/color/go.mod
generated
vendored
9
vendor/github.com/gookit/color/go.mod
generated
vendored
@@ -1,9 +0,0 @@
|
||||
module github.com/gookit/color
|
||||
|
||||
go 1.12
|
||||
|
||||
require (
|
||||
github.com/stretchr/testify v1.6.1
|
||||
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778
|
||||
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44
|
||||
)
|
||||
15
vendor/github.com/gookit/color/go.sum
generated
vendored
15
vendor/github.com/gookit/color/go.sum
generated
vendored
@@ -1,15 +0,0 @@
|
||||
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
|
||||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 h1:QldyIu/L63oPpyvQmHgvgickp1Yw510KJOqX7H24mg8=
|
||||
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs=
|
||||
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44 h1:Bli41pIlzTzf3KEY06n+xnzK/BESIg2ze4Pgfh/aI8c=
|
||||
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
3
vendor/github.com/hhrutter/lzw/go.mod
generated
vendored
3
vendor/github.com/hhrutter/lzw/go.mod
generated
vendored
@@ -1,3 +0,0 @@
|
||||
module github.com/hhrutter/lzw
|
||||
|
||||
go 1.12
|
||||
8
vendor/github.com/hhrutter/tiff/go.mod
generated
vendored
8
vendor/github.com/hhrutter/tiff/go.mod
generated
vendored
@@ -1,8 +0,0 @@
|
||||
module github.com/hhrutter/tiff
|
||||
|
||||
go 1.12
|
||||
|
||||
require (
|
||||
github.com/hhrutter/lzw v0.0.0-20190827003112-58b82c5a41cc
|
||||
golang.org/x/image v0.0.0-20190823064033-3a9bac650e44
|
||||
)
|
||||
6
vendor/github.com/hhrutter/tiff/go.sum
generated
vendored
6
vendor/github.com/hhrutter/tiff/go.sum
generated
vendored
@@ -1,6 +0,0 @@
|
||||
github.com/hhrutter/lzw v0.0.0-20190826233241-e4e67a6cc9b8 h1:U1DNFAgO5OSS70hFTvB7PN/Ex0mhqC7cZZ4FUaNJ8F0=
|
||||
github.com/hhrutter/lzw v0.0.0-20190827003112-58b82c5a41cc h1:crd+cScoxEqSOqClzjkNMNQNdMCF3SGXhPdDWBQfNZE=
|
||||
github.com/hhrutter/lzw v0.0.0-20190827003112-58b82c5a41cc/go.mod h1:yJBvOcu1wLQ9q9XZmfiPfur+3dQJuIhYQsMGLYcItZk=
|
||||
golang.org/x/image v0.0.0-20190823064033-3a9bac650e44 h1:1/e6LjNi7iqpDTz8tCLSKoR5dqrX4C3ub4H31JJZM4U=
|
||||
golang.org/x/image v0.0.0-20190823064033-3a9bac650e44/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
14
vendor/github.com/jinzhu/gorm/go.mod
generated
vendored
14
vendor/github.com/jinzhu/gorm/go.mod
generated
vendored
@@ -1,14 +0,0 @@
|
||||
module github.com/jinzhu/gorm
|
||||
|
||||
go 1.12
|
||||
|
||||
require (
|
||||
github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd
|
||||
github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5
|
||||
github.com/go-sql-driver/mysql v1.5.0
|
||||
github.com/jinzhu/inflection v1.0.0
|
||||
github.com/jinzhu/now v1.0.1
|
||||
github.com/lib/pq v1.1.1
|
||||
github.com/mattn/go-sqlite3 v1.14.0
|
||||
golang.org/x/crypto v0.0.0-20191205180655-e7c4368fe9dd // indirect
|
||||
)
|
||||
33
vendor/github.com/jinzhu/gorm/go.sum
generated
vendored
33
vendor/github.com/jinzhu/gorm/go.sum
generated
vendored
@@ -1,33 +0,0 @@
|
||||
github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc=
|
||||
github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y=
|
||||
github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd h1:83Wprp6ROGeiHFAP8WJdI2RoxALQYgdllERc3N5N2DM=
|
||||
github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU=
|
||||
github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 h1:Yzb9+7DPaBjB8zlTR87/ElzFsnQfuHnVUVqpZZIcV5Y=
|
||||
github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0=
|
||||
github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs=
|
||||
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
|
||||
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY=
|
||||
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0=
|
||||
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
|
||||
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
|
||||
github.com/jinzhu/now v1.0.1 h1:HjfetcXq097iXP0uoPCdnM4Efp5/9MsM0/M+XOTeR3M=
|
||||
github.com/jinzhu/now v1.0.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
|
||||
github.com/lib/pq v1.1.1 h1:sJZmqHoEaY7f+NPP8pgLB/WxulyR3fewgCM2qaSlBb4=
|
||||
github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
||||
github.com/mattn/go-sqlite3 v1.14.0 h1:mLyGNKR8+Vv9CAU7PphKa2hkEqxxhn8i32J6FPj1/QA=
|
||||
github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus=
|
||||
github.com/mattn/go-sqlite3 v2.0.1+incompatible h1:xQ15muvnzGBHpIpdrNi1DA5x0+TcBZzsIDwmw9uTHzw=
|
||||
github.com/mattn/go-sqlite3 v2.0.1+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c h1:Vj5n4GlwjmQteupaxJ9+0FNOmBrHfq7vN4btdGoDZgI=
|
||||
golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20191205180655-e7c4368fe9dd h1:GGJVjV8waZKRHrgwvtH66z9ZGVurTD1MT0n1Bb+q4aM=
|
||||
golang.org/x/crypto v0.0.0-20191205180655-e7c4368fe9dd/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
1
vendor/github.com/jinzhu/inflection/go.mod
generated
vendored
1
vendor/github.com/jinzhu/inflection/go.mod
generated
vendored
@@ -1 +0,0 @@
|
||||
module github.com/jinzhu/inflection
|
||||
3
vendor/github.com/lightninglabs/gozmq/go.mod
generated
vendored
3
vendor/github.com/lightninglabs/gozmq/go.mod
generated
vendored
@@ -1,3 +0,0 @@
|
||||
module github.com/lightninglabs/gozmq
|
||||
|
||||
go 1.12
|
||||
14
vendor/github.com/lightninglabs/neutrino/go.mod
generated
vendored
14
vendor/github.com/lightninglabs/neutrino/go.mod
generated
vendored
@@ -1,14 +0,0 @@
|
||||
module github.com/lightninglabs/neutrino
|
||||
|
||||
require (
|
||||
github.com/btcsuite/btcd v0.0.0-20190824003749-130ea5bddde3
|
||||
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f
|
||||
github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d
|
||||
github.com/btcsuite/btcwallet/wallet/txauthor v1.0.0
|
||||
github.com/btcsuite/btcwallet/walletdb v1.0.0
|
||||
github.com/btcsuite/btcwallet/wtxmgr v1.0.0
|
||||
github.com/davecgh/go-spew v1.1.1
|
||||
github.com/lightningnetwork/lnd/queue v1.0.1
|
||||
)
|
||||
|
||||
go 1.13
|
||||
94
vendor/github.com/lightninglabs/neutrino/go.sum
generated
vendored
94
vendor/github.com/lightninglabs/neutrino/go.sum
generated
vendored
@@ -1,94 +0,0 @@
|
||||
github.com/aead/siphash v1.0.1 h1:FwHfE/T45KPKYuuSAKyyvE+oPWcaQ+CUmFW0bPlM+kg=
|
||||
github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII=
|
||||
github.com/btcsuite/btcd v0.0.0-20190824003749-130ea5bddde3 h1:A/EVblehb75cUgXA5njHPn0kLAsykn6mJGz7rnmW5W0=
|
||||
github.com/btcsuite/btcd v0.0.0-20190824003749-130ea5bddde3/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI=
|
||||
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f h1:bAs4lUbRJpnnkd9VhRV3jjAVU7DJVjMaK+IsvSeZvFo=
|
||||
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA=
|
||||
github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d h1:yJzD/yFppdVCf6ApMkVy8cUxV0XrxdP9rVf6D87/Mng=
|
||||
github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg=
|
||||
github.com/btcsuite/btcwallet/wallet/txauthor v1.0.0 h1:KGHMW5sd7yDdDMkCZ/JpP0KltolFsQcB973brBnfj4c=
|
||||
github.com/btcsuite/btcwallet/wallet/txauthor v1.0.0/go.mod h1:VufDts7bd/zs3GV13f/lXc/0lXrPnvxD/NvmpG/FEKU=
|
||||
github.com/btcsuite/btcwallet/wallet/txrules v1.0.0 h1:2VsfS0sBedcM5KmDzRMT3+b6xobqWveZGvjb+jFez5w=
|
||||
github.com/btcsuite/btcwallet/wallet/txrules v1.0.0/go.mod h1:UwQE78yCerZ313EXZwEiu3jNAtfXj2n2+c8RWiE/WNA=
|
||||
github.com/btcsuite/btcwallet/wallet/txsizes v1.0.0 h1:6DxkcoMnCPY4E9cUDPB5tbuuf40SmmMkSQkoE8vCT+s=
|
||||
github.com/btcsuite/btcwallet/wallet/txsizes v1.0.0/go.mod h1:pauEU8UuMFiThe5PB3EO+gO5kx87Me5NvdQDsTuq6cs=
|
||||
github.com/btcsuite/btcwallet/walletdb v1.0.0 h1:mheT7vCWK5EP6rZzhxsQ7ms9+yX4VE8bwiJctECBeNw=
|
||||
github.com/btcsuite/btcwallet/walletdb v1.0.0/go.mod h1:bZTy9RyYZh9fLnSua+/CD48TJtYJSHjjYcSaszuxCCk=
|
||||
github.com/btcsuite/btcwallet/wtxmgr v1.0.0 h1:aIHgViEmZmZfe0tQQqF1xyd2qBqFWxX5vZXkkbjtbeA=
|
||||
github.com/btcsuite/btcwallet/wtxmgr v1.0.0/go.mod h1:vc4gBprll6BP0UJ+AIGDaySoc7MdAmZf8kelfNb8CFY=
|
||||
github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd h1:R/opQEbFEy9JGkIguV40SvRY1uliPX8ifOvi6ICsFCw=
|
||||
github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg=
|
||||
github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd h1:qdGvebPBDuYDPGi1WCPjy1tGyMpmDK8IEapSsszn7HE=
|
||||
github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY=
|
||||
github.com/btcsuite/goleveldb v1.0.0 h1:Tvd0BfvqX9o823q1j2UZ/epQo09eJh6dTcRp79ilIN4=
|
||||
github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I=
|
||||
github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723 h1:ZA/jbKoGcVAnER6pCHPEkGdZOV7U1oLUedErBHCUMs0=
|
||||
github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc=
|
||||
github.com/btcsuite/snappy-go v1.0.0 h1:ZxaA6lo2EpxGddsA8JwWOcxlzRybb444sgmeJQMJGQE=
|
||||
github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc=
|
||||
github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792 h1:R8vQdOQdZ9Y3SkEwmHoWBmX1DNXhXZqlTpq6s4tyJGc=
|
||||
github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY=
|
||||
github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs=
|
||||
github.com/coreos/bbolt v1.3.3 h1:n6AiVyVRKQFNb6mJlwESEvvLoDyiTzXX7ORAUlkeBdY=
|
||||
github.com/coreos/bbolt v1.3.3/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
|
||||
github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
|
||||
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
||||
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
|
||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
|
||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||
github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
|
||||
github.com/jrick/logrotate v1.0.0 h1:lQ1bL/n9mBNeIXoTUoYRlK4dHuNJVofX9oWqBtPnSzI=
|
||||
github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ=
|
||||
github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23 h1:FOOIBWrEkLgmlgGfMuZT83xIwfPDxEI2OHu6xUmJMFE=
|
||||
github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4=
|
||||
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/lightningnetwork/lnd/queue v1.0.1 h1:jzJKcTy3Nj5lQrooJ3aaw9Lau3I0IwvQR5sqtjdv2R0=
|
||||
github.com/lightningnetwork/lnd/queue v1.0.1/go.mod h1:vaQwexir73flPW43Mrm7JOgJHmcEFBWWSl9HlyASoms=
|
||||
github.com/lightningnetwork/lnd/ticker v1.0.0 h1:S1b60TEGoTtCe2A0yeB+ecoj/kkS4qpwh6l+AkQEZwU=
|
||||
github.com/lightningnetwork/lnd/ticker v1.0.0/go.mod h1:iaLXJiVgI1sPANIF2qYYUJXjoksPNvGNYowB8aRbpX0=
|
||||
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/ginkgo v1.7.0 h1:WSHQ+IS43OoUrWtD1/bbclrwK8TTH5hzp+umCiuxHgs=
|
||||
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
|
||||
github.com/onsi/gomega v1.4.3 h1:RE1xgDvH7imwFD45h+u2SgIfERHlS2yNG4DObb5BSKU=
|
||||
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
|
||||
go.etcd.io/bbolt v1.3.3 h1:MUGmc65QhB3pIlaQ5bB4LwqSj6GIonVJXpZiaKNyaKk=
|
||||
go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
|
||||
golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44 h1:9lP3x0pW80sDI6t1UMSLA4to18W7R7imwAI/sWS9S8Q=
|
||||
golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67 h1:ng3VDlRp5/DHpSWl02R4rM9I+8M2rhmsuLwAMmkLQWE=
|
||||
golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190206173232-65e2d4e15006 h1:bfLnR+k0tq5Lqt6dflRLcZiz6UaXCMt3vhYJ1l4FQ80=
|
||||
golang.org/x/net v0.0.0-20190206173232-65e2d4e15006/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw=
|
||||
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190904154756-749cb33beabd h1:DBH9mDw0zluJT/R+nGuV3jWFWLFaHyYZWD4tOT+cjn0=
|
||||
golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2 h1:z99zHgr7hKfrUcX/KsoJk5FJfjTceCKIp96+biqP4To=
|
||||
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=
|
||||
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
|
||||
gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE=
|
||||
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
13
vendor/github.com/lightningnetwork/lightning-onion/go.mod
generated
vendored
13
vendor/github.com/lightningnetwork/lightning-onion/go.mod
generated
vendored
@@ -1,13 +0,0 @@
|
||||
module github.com/lightningnetwork/lightning-onion
|
||||
|
||||
require (
|
||||
github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da
|
||||
github.com/btcsuite/btcd v0.0.0-20190629003639-c26ffa870fd8
|
||||
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f
|
||||
github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d
|
||||
github.com/davecgh/go-spew v1.1.1
|
||||
golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67
|
||||
golang.org/x/sys v0.0.0-20190209173611-3b5209105503 // indirect
|
||||
)
|
||||
|
||||
go 1.13
|
||||
42
vendor/github.com/lightningnetwork/lightning-onion/go.sum
generated
vendored
42
vendor/github.com/lightningnetwork/lightning-onion/go.sum
generated
vendored
@@ -1,42 +0,0 @@
|
||||
github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da h1:KjTM2ks9d14ZYCvmHS9iAKVt9AyzRSqNU1qabPih5BY=
|
||||
github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da/go.mod h1:eHEWzANqSiWQsof+nXEI9bUVUyV6F53Fp89EuCh2EAA=
|
||||
github.com/aead/siphash v1.0.1 h1:FwHfE/T45KPKYuuSAKyyvE+oPWcaQ+CUmFW0bPlM+kg=
|
||||
github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII=
|
||||
github.com/btcsuite/btcd v0.0.0-20190629003639-c26ffa870fd8 h1:mOg8/RgDSHTQ1R0IR+LMDuW4TDShPv+JzYHuR4GLoNA=
|
||||
github.com/btcsuite/btcd v0.0.0-20190629003639-c26ffa870fd8/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI=
|
||||
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f h1:bAs4lUbRJpnnkd9VhRV3jjAVU7DJVjMaK+IsvSeZvFo=
|
||||
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA=
|
||||
github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d h1:yJzD/yFppdVCf6ApMkVy8cUxV0XrxdP9rVf6D87/Mng=
|
||||
github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg=
|
||||
github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd h1:R/opQEbFEy9JGkIguV40SvRY1uliPX8ifOvi6ICsFCw=
|
||||
github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg=
|
||||
github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY=
|
||||
github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc=
|
||||
github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792 h1:R8vQdOQdZ9Y3SkEwmHoWBmX1DNXhXZqlTpq6s4tyJGc=
|
||||
github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY=
|
||||
github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs=
|
||||
github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||
github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
|
||||
github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ=
|
||||
github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4=
|
||||
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
|
||||
golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67 h1:ng3VDlRp5/DHpSWl02R4rM9I+8M2rhmsuLwAMmkLQWE=
|
||||
golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190209173611-3b5209105503 h1:5SvYFrOM3W8Mexn9/oA44Ji7vhXAZQ9hiP+1Q/DMrWg=
|
||||
golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
|
||||
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
3
vendor/github.com/lightningnetwork/lnd/clock/go.mod
generated
vendored
3
vendor/github.com/lightningnetwork/lnd/clock/go.mod
generated
vendored
@@ -1,3 +0,0 @@
|
||||
module github.com/lightningnetwork/lnd/clock
|
||||
|
||||
go 1.13
|
||||
7
vendor/github.com/lightningnetwork/lnd/queue/go.mod
generated
vendored
7
vendor/github.com/lightningnetwork/lnd/queue/go.mod
generated
vendored
@@ -1,7 +0,0 @@
|
||||
module github.com/lightningnetwork/lnd/queue
|
||||
|
||||
require github.com/lightningnetwork/lnd/ticker v1.0.0
|
||||
|
||||
replace github.com/lightningnetwork/lnd/ticker v1.0.0 => ../ticker
|
||||
|
||||
go 1.12
|
||||
0
vendor/github.com/lightningnetwork/lnd/queue/go.sum
generated
vendored
0
vendor/github.com/lightningnetwork/lnd/queue/go.sum
generated
vendored
1
vendor/github.com/lightningnetwork/lnd/ticker/go.mod
generated
vendored
1
vendor/github.com/lightningnetwork/lnd/ticker/go.mod
generated
vendored
@@ -1 +0,0 @@
|
||||
module github.com/lightningnetwork/lnd/ticker
|
||||
8
vendor/github.com/mattn/go-sqlite3/go.mod
generated
vendored
8
vendor/github.com/mattn/go-sqlite3/go.mod
generated
vendored
@@ -1,8 +0,0 @@
|
||||
module github.com/mattn/go-sqlite3
|
||||
|
||||
go 1.10
|
||||
|
||||
require (
|
||||
github.com/PuerkitoBio/goquery v1.5.1
|
||||
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e // indirect
|
||||
)
|
||||
13
vendor/github.com/mattn/go-sqlite3/go.sum
generated
vendored
13
vendor/github.com/mattn/go-sqlite3/go.sum
generated
vendored
@@ -1,13 +0,0 @@
|
||||
github.com/PuerkitoBio/goquery v1.5.1 h1:PSPBGne8NIUWw+/7vFBV+kG2J/5MOjbzc7154OaKCSE=
|
||||
github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc=
|
||||
github.com/andybalholm/cascadia v1.1.0 h1:BuuO6sSfQNFRu1LppgbD25Hr2vLYW25JvxHs5zzsLTo=
|
||||
github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20200202094626-16171245cfb2 h1:CCH4IOTTfewWjGOlSp+zGcjutRKlBEZQ6wTn8ozI/nI=
|
||||
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e h1:3G+cUijn7XD+S4eJFddp53Pv7+slrESplyjG25HgL+k=
|
||||
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
11
vendor/github.com/miekg/dns/go.mod
generated
vendored
11
vendor/github.com/miekg/dns/go.mod
generated
vendored
@@ -1,11 +0,0 @@
|
||||
module github.com/miekg/dns
|
||||
|
||||
go 1.12
|
||||
|
||||
require (
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550
|
||||
golang.org/x/net v0.0.0-20190923162816-aa69164e4478
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58
|
||||
golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe
|
||||
golang.org/x/tools v0.0.0-20191216052735-49a3e744a425 // indirect
|
||||
)
|
||||
39
vendor/github.com/miekg/dns/go.sum
generated
vendored
39
vendor/github.com/miekg/dns/go.sum
generated
vendored
@@ -1,39 +0,0 @@
|
||||
golang.org/x/crypto v0.0.0-20181001203147-e3636079e1a4 h1:Vk3wNqEZwyGyei9yq5ekj7frek2u7HUfffJ1/opblzc=
|
||||
golang.org/x/crypto v0.0.0-20181001203147-e3636079e1a4/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20190829043050-9756ffdc2472 h1:Gv7RPwsi3eZ2Fgewe3CBsuOebPwO27PoXzRpJPsvSSM=
|
||||
golang.org/x/crypto v0.0.0-20190829043050-9756ffdc2472/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392 h1:ACG4HJsFiNMf47Y4PeRoebLNy/2lXT9EtprMuTFWt1M=
|
||||
golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 h1:ObdrDkeb4kJdCP557AjRjq69pTHfNouLtWZG7j9rPN8=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
||||
golang.org/x/net v0.0.0-20180926154720-4dfa2610cdf3 h1:dgd4x4kJt7G4k4m93AYLzM8Ni6h2qLTfh9n9vXJT3/0=
|
||||
golang.org/x/net v0.0.0-20180926154720-4dfa2610cdf3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 h1:k7pJ2yAPLPgbskkFdhRCsA77k2fySZ1zf2zCjvQCiIM=
|
||||
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20190923162816-aa69164e4478 h1:l5EDrHhldLYb3ZRHDUhXF7Om7MvYXnkV9/iQNo1lX6g=
|
||||
golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20180928133829-e4b3c5e90611 h1:O33LKL7WyJgjN9CvxfTIomjIClbd/Kq86/iipowHQU0=
|
||||
golang.org/x/sys v0.0.0-20180928133829-e4b3c5e90611/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190904154756-749cb33beabd h1:DBH9mDw0zluJT/R+nGuV3jWFWLFaHyYZWD4tOT+cjn0=
|
||||
golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe h1:6fAMxZRR6sl1Uq8U61gxU+kPTs2tR8uOySCbBP7BN/M=
|
||||
golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191216052735-49a3e744a425 h1:VvQyQJN0tSuecqgcIxMWnnfG5kSmgy9KZR9sW3W5QeA=
|
||||
golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
7
vendor/github.com/muun/libwallet/.gitignore
generated
vendored
7
vendor/github.com/muun/libwallet/.gitignore
generated
vendored
@@ -1,7 +0,0 @@
|
||||
libwallet/.gitignore# binary
|
||||
libwallet
|
||||
.build
|
||||
.idea
|
||||
.vscode
|
||||
.DS_Store
|
||||
|
||||
21
vendor/github.com/muun/libwallet/LICENSE
generated
vendored
21
vendor/github.com/muun/libwallet/LICENSE
generated
vendored
@@ -1,21 +0,0 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2021 Muun Wallet, Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
16
vendor/github.com/muun/libwallet/README.md
generated
vendored
16
vendor/github.com/muun/libwallet/README.md
generated
vendored
@@ -1,16 +0,0 @@
|
||||

|
||||
|
||||
## About
|
||||
|
||||
This is the source code repository for muun's wallet core library. Muun is a non-custodial 2-of-2 multisig wallet with a special focus on security and ease of use.
|
||||
|
||||
This library is used by our mobile wallets with [gomobile](https://godoc.org/golang.org/x/mobile/cmd/gomobile).
|
||||
|
||||
## Responsible Disclosure
|
||||
|
||||
Send us an email to report any security related bugs or vulnerabilities at [security@muun.com](mailto:security@muun.com).
|
||||
|
||||
You can encrypt your email message using our public PGP key.
|
||||
|
||||
Public key fingerprint: `1299 28C1 E79F E011 6DA4 C80F 8DB7 FD0F 61E6 ED76`
|
||||
|
||||
81
vendor/github.com/muun/libwallet/V1.go
generated
vendored
81
vendor/github.com/muun/libwallet/V1.go
generated
vendored
@@ -1,81 +0,0 @@
|
||||
package libwallet
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/btcsuite/btcd/chaincfg"
|
||||
"github.com/btcsuite/btcd/txscript"
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/btcsuite/btcutil"
|
||||
"github.com/muun/libwallet/addresses"
|
||||
"github.com/muun/libwallet/btcsuitew/txscriptw"
|
||||
)
|
||||
|
||||
// CreateAddressV1 returns a P2PKH MuunAddress from a publicKey for use in TransactionSchemeV1
|
||||
func CreateAddressV1(publicKey *HDPublicKey) (MuunAddress, error) {
|
||||
return addresses.CreateAddressV1(&publicKey.key, publicKey.Path, publicKey.Network.network)
|
||||
}
|
||||
|
||||
type coinV1 struct {
|
||||
Network *chaincfg.Params
|
||||
OutPoint wire.OutPoint
|
||||
KeyPath string
|
||||
}
|
||||
|
||||
func (c *coinV1) SignInput(index int, tx *wire.MsgTx, userKey *HDPrivateKey, _ *HDPublicKey) error {
|
||||
userKey, err := userKey.DeriveTo(c.KeyPath)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to derive user key: %w", err)
|
||||
}
|
||||
|
||||
sig, err := c.signature(index, tx, userKey)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to sign V1 input: %w", err)
|
||||
}
|
||||
|
||||
builder := txscript.NewScriptBuilder()
|
||||
builder.AddData(sig)
|
||||
builder.AddData(userKey.PublicKey().Raw())
|
||||
script, err := builder.Script()
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to generate signing script: %w", err)
|
||||
}
|
||||
|
||||
txInput := tx.TxIn[index]
|
||||
txInput.SignatureScript = script
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *coinV1) FullySignInput(index int, tx *wire.MsgTx, userKey, muunKey *HDPrivateKey) error {
|
||||
return c.SignInput(index, tx, userKey, nil)
|
||||
}
|
||||
|
||||
func (c *coinV1) createRedeemScript(publicKey *HDPublicKey) ([]byte, error) {
|
||||
|
||||
userAddress, err := btcutil.NewAddressPubKey(publicKey.Raw(), c.Network)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to generate address for user: %w", err)
|
||||
}
|
||||
|
||||
return txscriptw.PayToAddrScript(userAddress.AddressPubKeyHash())
|
||||
}
|
||||
|
||||
func (c *coinV1) signature(index int, tx *wire.MsgTx, userKey *HDPrivateKey) ([]byte, error) {
|
||||
|
||||
redeemScript, err := c.createRedeemScript(userKey.PublicKey())
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to build reedem script for signing: %w", err)
|
||||
}
|
||||
|
||||
privKey, err := userKey.key.ECPrivKey()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to produce EC priv key for signing: %w", err)
|
||||
}
|
||||
|
||||
sig, err := txscript.RawTxInSignature(tx, index, redeemScript, txscript.SigHashAll, privKey)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to sign V1 input: %w", err)
|
||||
}
|
||||
|
||||
return sig, nil
|
||||
}
|
||||
115
vendor/github.com/muun/libwallet/V2.go
generated
vendored
115
vendor/github.com/muun/libwallet/V2.go
generated
vendored
@@ -1,115 +0,0 @@
|
||||
package libwallet
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/btcsuite/btcd/chaincfg"
|
||||
"github.com/btcsuite/btcd/txscript"
|
||||
"github.com/muun/libwallet/addresses"
|
||||
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
)
|
||||
|
||||
func CreateAddressV2(userKey, muunKey *HDPublicKey) (MuunAddress, error) {
|
||||
// TODO: check both paths match?
|
||||
return addresses.CreateAddressV2(&userKey.key, &muunKey.key, userKey.Path, userKey.Network.network)
|
||||
}
|
||||
|
||||
type coinV2 struct {
|
||||
Network *chaincfg.Params
|
||||
OutPoint wire.OutPoint
|
||||
KeyPath string
|
||||
MuunSignature []byte
|
||||
}
|
||||
|
||||
func (c *coinV2) SignInput(index int, tx *wire.MsgTx, userKey *HDPrivateKey, muunKey *HDPublicKey) error {
|
||||
userKey, err := userKey.DeriveTo(c.KeyPath)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to derive user key: %w", err)
|
||||
}
|
||||
|
||||
muunKey, err = muunKey.DeriveTo(c.KeyPath)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to derive muun key: %w", err)
|
||||
}
|
||||
|
||||
if len(c.MuunSignature) == 0 {
|
||||
return errors.New("muun signature must be present")
|
||||
}
|
||||
|
||||
txInput := tx.TxIn[index]
|
||||
|
||||
redeemScript, err := createRedeemScriptV2(userKey.PublicKey(), muunKey)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to build reedem script for signing: %w", err)
|
||||
}
|
||||
|
||||
sig, err := c.signature(index, tx, userKey.PublicKey(), muunKey, userKey)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// This is a standard 2 of 2 multisig script
|
||||
// 0 because of a bug in bitcoind
|
||||
// Then the 2 sigs: first the users and then muuns
|
||||
// Last, the script that contains the two pub keys and OP_CHECKMULTISIG
|
||||
builder := txscript.NewScriptBuilder()
|
||||
builder.AddInt64(0)
|
||||
builder.AddData(sig)
|
||||
builder.AddData(c.MuunSignature)
|
||||
builder.AddData(redeemScript)
|
||||
script, err := builder.Script()
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to generate signing script: %w", err)
|
||||
}
|
||||
|
||||
txInput.SignatureScript = script
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *coinV2) FullySignInput(index int, tx *wire.MsgTx, userKey, muunKey *HDPrivateKey) error {
|
||||
|
||||
derivedUserKey, err := userKey.DeriveTo(c.KeyPath)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to derive user key: %w", err)
|
||||
}
|
||||
|
||||
derivedMuunKey, err := muunKey.DeriveTo(c.KeyPath)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to derive muun key: %w", err)
|
||||
}
|
||||
|
||||
muunSignature, err := c.signature(index, tx, derivedUserKey.PublicKey(), derivedMuunKey.PublicKey(), derivedMuunKey)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
c.MuunSignature = muunSignature
|
||||
return c.SignInput(index, tx, userKey, muunKey.PublicKey())
|
||||
}
|
||||
|
||||
func (c *coinV2) signature(index int, tx *wire.MsgTx, userKey, muunKey *HDPublicKey,
|
||||
signingKey *HDPrivateKey) ([]byte, error) {
|
||||
|
||||
redeemScript, err := createRedeemScriptV2(userKey, muunKey)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to build reedem script for signing: %w", err)
|
||||
}
|
||||
|
||||
privKey, err := signingKey.key.ECPrivKey()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to produce EC priv key for signing: %w", err)
|
||||
}
|
||||
|
||||
sig, err := txscript.RawTxInSignature(tx, index, redeemScript, txscript.SigHashAll, privKey)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to sign V2 output: %w", err)
|
||||
}
|
||||
|
||||
return sig, nil
|
||||
}
|
||||
|
||||
func createRedeemScriptV2(userKey, muunKey *HDPublicKey) ([]byte, error) {
|
||||
return addresses.CreateRedeemScriptV2(&userKey.key, &muunKey.key, userKey.Network.network)
|
||||
}
|
||||
103
vendor/github.com/muun/libwallet/V3.go
generated
vendored
103
vendor/github.com/muun/libwallet/V3.go
generated
vendored
@@ -1,103 +0,0 @@
|
||||
package libwallet
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/btcsuite/btcutil"
|
||||
"github.com/muun/libwallet/addresses"
|
||||
|
||||
"github.com/btcsuite/btcd/chaincfg"
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
)
|
||||
|
||||
func CreateAddressV3(userKey, muunKey *HDPublicKey) (MuunAddress, error) {
|
||||
return addresses.CreateAddressV3(&userKey.key, &muunKey.key, userKey.Path, userKey.Network.network)
|
||||
}
|
||||
|
||||
type coinV3 struct {
|
||||
Network *chaincfg.Params
|
||||
OutPoint wire.OutPoint
|
||||
KeyPath string
|
||||
Amount btcutil.Amount
|
||||
MuunSignature []byte
|
||||
}
|
||||
|
||||
func (c *coinV3) SignInput(index int, tx *wire.MsgTx, userKey *HDPrivateKey, muunKey *HDPublicKey) error {
|
||||
|
||||
userKey, err := userKey.DeriveTo(c.KeyPath)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to derive user key: %w", err)
|
||||
}
|
||||
|
||||
muunKey, err = muunKey.DeriveTo(c.KeyPath)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to derive muun key: %w", err)
|
||||
}
|
||||
|
||||
if len(c.MuunSignature) == 0 {
|
||||
return errors.New("muun signature must be present")
|
||||
}
|
||||
|
||||
witnessScript, err := createWitnessScriptV3(userKey.PublicKey(), muunKey)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
sig, err := c.signature(index, tx, userKey.PublicKey(), muunKey, userKey)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
zeroByteArray := []byte{}
|
||||
|
||||
txInput := tx.TxIn[index]
|
||||
txInput.Witness = wire.TxWitness{zeroByteArray, sig, c.MuunSignature, witnessScript}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *coinV3) FullySignInput(index int, tx *wire.MsgTx, userKey, muunKey *HDPrivateKey) error {
|
||||
|
||||
derivedUserKey, err := userKey.DeriveTo(c.KeyPath)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to derive user key: %w", err)
|
||||
}
|
||||
|
||||
derivedMuunKey, err := muunKey.DeriveTo(c.KeyPath)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to derive muun key: %w", err)
|
||||
}
|
||||
|
||||
muunSignature, err := c.signature(index, tx, derivedUserKey.PublicKey(), derivedMuunKey.PublicKey(), derivedMuunKey)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
c.MuunSignature = muunSignature
|
||||
return c.SignInput(index, tx, userKey, muunKey.PublicKey())
|
||||
}
|
||||
|
||||
func createRedeemScriptV3(userKey, muunKey *HDPublicKey) ([]byte, error) {
|
||||
return addresses.CreateRedeemScriptV3(&userKey.key, &muunKey.key, userKey.Network.network)
|
||||
}
|
||||
|
||||
func createWitnessScriptV3(userKey, muunKey *HDPublicKey) ([]byte, error) {
|
||||
return addresses.CreateWitnessScriptV3(&userKey.key, &muunKey.key, userKey.Network.network)
|
||||
}
|
||||
|
||||
func (c *coinV3) signature(index int, tx *wire.MsgTx, userKey *HDPublicKey, muunKey *HDPublicKey,
|
||||
signingKey *HDPrivateKey) ([]byte, error) {
|
||||
|
||||
witnessScript, err := createWitnessScriptV3(userKey, muunKey)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
redeemScript, err := createRedeemScriptV3(userKey, muunKey)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to build reedem script for signing: %w", err)
|
||||
}
|
||||
|
||||
return signNonNativeSegwitInput(
|
||||
index, tx, signingKey, redeemScript, witnessScript, c.Amount)
|
||||
}
|
||||
94
vendor/github.com/muun/libwallet/V4.go
generated
vendored
94
vendor/github.com/muun/libwallet/V4.go
generated
vendored
@@ -1,94 +0,0 @@
|
||||
package libwallet
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/btcsuite/btcutil"
|
||||
"github.com/muun/libwallet/addresses"
|
||||
|
||||
"github.com/btcsuite/btcd/chaincfg"
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
)
|
||||
|
||||
// CreateAddressV4 returns a P2WSH MuunAddress from a user HD-pubkey and a Muun co-signing HD-pubkey.
|
||||
func CreateAddressV4(userKey, muunKey *HDPublicKey) (MuunAddress, error) {
|
||||
return addresses.CreateAddressV4(&userKey.key, &muunKey.key, userKey.Path, userKey.Network.network)
|
||||
}
|
||||
|
||||
type coinV4 struct {
|
||||
Network *chaincfg.Params
|
||||
OutPoint wire.OutPoint
|
||||
KeyPath string
|
||||
Amount btcutil.Amount
|
||||
MuunSignature []byte
|
||||
}
|
||||
|
||||
func (c *coinV4) SignInput(index int, tx *wire.MsgTx, userKey *HDPrivateKey, muunKey *HDPublicKey) error {
|
||||
|
||||
userKey, err := userKey.DeriveTo(c.KeyPath)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to derive user key: %w", err)
|
||||
}
|
||||
|
||||
muunKey, err = muunKey.DeriveTo(c.KeyPath)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to derive muun key: %w", err)
|
||||
}
|
||||
|
||||
if len(c.MuunSignature) == 0 {
|
||||
return fmt.Errorf("muun signature must be present: %w", err)
|
||||
}
|
||||
|
||||
witnessScript, err := createWitnessScriptV4(userKey.PublicKey(), muunKey)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
sig, err := c.signature(index, tx, userKey.PublicKey(), muunKey, userKey)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
zeroByteArray := []byte{}
|
||||
|
||||
txInput := tx.TxIn[index]
|
||||
txInput.Witness = wire.TxWitness{zeroByteArray, sig, c.MuunSignature, witnessScript}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *coinV4) FullySignInput(index int, tx *wire.MsgTx, userKey, muunKey *HDPrivateKey) error {
|
||||
|
||||
derivedUserKey, err := userKey.DeriveTo(c.KeyPath)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to derive user key: %w", err)
|
||||
}
|
||||
|
||||
derivedMuunKey, err := muunKey.DeriveTo(c.KeyPath)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to derive muun key: %w", err)
|
||||
}
|
||||
|
||||
muunSignature, err := c.signature(index, tx, derivedUserKey.PublicKey(), derivedMuunKey.PublicKey(), derivedMuunKey)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
c.MuunSignature = muunSignature
|
||||
return c.SignInput(index, tx, userKey, muunKey.PublicKey())
|
||||
}
|
||||
|
||||
func (c *coinV4) signature(index int, tx *wire.MsgTx, userKey *HDPublicKey, muunKey *HDPublicKey,
|
||||
signingKey *HDPrivateKey) ([]byte, error) {
|
||||
|
||||
witnessScript, err := createWitnessScriptV4(userKey, muunKey)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return signNativeSegwitInput(
|
||||
index, tx, signingKey, witnessScript, c.Amount)
|
||||
}
|
||||
|
||||
func createWitnessScriptV4(userKey, muunKey *HDPublicKey) ([]byte, error) {
|
||||
return addresses.CreateWitnessScriptV4(&userKey.key, &muunKey.key, userKey.Network.network)
|
||||
}
|
||||
187
vendor/github.com/muun/libwallet/V5.go
generated
vendored
187
vendor/github.com/muun/libwallet/V5.go
generated
vendored
@@ -1,187 +0,0 @@
|
||||
package libwallet
|
||||
|
||||
import (
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
|
||||
"github.com/muun/libwallet/addresses"
|
||||
"github.com/muun/libwallet/btcsuitew/txscriptw"
|
||||
"github.com/muun/libwallet/musig"
|
||||
|
||||
"github.com/btcsuite/btcd/btcec"
|
||||
"github.com/btcsuite/btcd/chaincfg"
|
||||
"github.com/btcsuite/btcd/txscript"
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/btcsuite/btcutil"
|
||||
)
|
||||
|
||||
// CreateAddressV5 returns a P2TR MuunAddress using Musig with the signing and cosigning keys.
|
||||
func CreateAddressV5(userKey, muunKey *HDPublicKey) (MuunAddress, error) {
|
||||
return addresses.CreateAddressV5(&userKey.key, &muunKey.key, userKey.Path, userKey.Network.network)
|
||||
}
|
||||
|
||||
type coinV5 struct {
|
||||
Network *chaincfg.Params
|
||||
OutPoint wire.OutPoint
|
||||
KeyPath string
|
||||
Amount btcutil.Amount
|
||||
UserSessionId [32]byte
|
||||
MuunPubNonce [66]byte
|
||||
MuunPartialSig [32]byte
|
||||
SigHashes *txscriptw.TaprootSigHashes
|
||||
}
|
||||
|
||||
func (c *coinV5) SignInput(index int, tx *wire.MsgTx, userKey *HDPrivateKey, muunKey *HDPublicKey) error {
|
||||
derivedUserKey, err := userKey.DeriveTo(c.KeyPath)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to derive user private key: %w", err)
|
||||
}
|
||||
|
||||
derivedMuunKey, err := muunKey.DeriveTo(c.KeyPath)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to derive muun public key: %w", err)
|
||||
}
|
||||
|
||||
userEcPriv, err := derivedUserKey.key.ECPrivKey()
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to obtain ECPrivKey from derivedUserKey") // TODO: necessary handling?
|
||||
}
|
||||
|
||||
muunEcPub, err := derivedMuunKey.key.ECPubKey()
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to obtain ECPubKey from derivedMuunKey") // TODO: necessary handling?
|
||||
}
|
||||
|
||||
sigHash, err := txscriptw.CalcTaprootSigHash(tx, c.SigHashes, index, txscript.SigHashAll)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to create sigHash: %w", err)
|
||||
}
|
||||
var toSign [32]byte
|
||||
copy(toSign[:], sigHash)
|
||||
|
||||
return c.signSecondWith(index, tx, userEcPriv, muunEcPub, c.UserSessionId, toSign)
|
||||
}
|
||||
|
||||
func (c *coinV5) FullySignInput(index int, tx *wire.MsgTx, userKey, muunKey *HDPrivateKey) error {
|
||||
derivedUserKey, err := userKey.DeriveTo(c.KeyPath)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to derive user private key: %w", err)
|
||||
}
|
||||
|
||||
derivedMuunKey, err := muunKey.DeriveTo(c.KeyPath)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to derive muun private key: %w", err)
|
||||
}
|
||||
|
||||
userEcPriv, err := derivedUserKey.key.ECPrivKey()
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to obtain ECPrivKey from derivedUserKey") // TODO: necessary handling?
|
||||
}
|
||||
|
||||
muunEcPriv, err := derivedMuunKey.key.ECPrivKey()
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to obtain ECPrivKey from derivedMuunKey") // TODO: necessary handling?
|
||||
}
|
||||
|
||||
sigHash, err := txscriptw.CalcTaprootSigHash(tx, c.SigHashes, index, txscript.SigHashAll)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to create sigHash: %w", err)
|
||||
}
|
||||
var toSign [32]byte
|
||||
copy(toSign[:], sigHash)
|
||||
|
||||
userPubNonce := musig.GeneratePubNonce(c.UserSessionId)
|
||||
|
||||
err = c.signFirstWith(index, tx, userEcPriv.PubKey(), muunEcPriv, userPubNonce, toSign)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return c.signSecondWith(index, tx, userEcPriv, muunEcPriv.PubKey(), c.UserSessionId, toSign)
|
||||
}
|
||||
|
||||
func (c *coinV5) signFirstWith(
|
||||
index int,
|
||||
tx *wire.MsgTx,
|
||||
userPub *btcec.PublicKey,
|
||||
muunPriv *btcec.PrivateKey,
|
||||
userPubNonce [66]byte,
|
||||
toSign [32]byte,
|
||||
) error {
|
||||
|
||||
// NOTE:
|
||||
// This will only be called in a recovery context, where both private keys are provided by the
|
||||
// user. We call the variables below "muunSessionId" and "muunPubNonce" to follow convention,
|
||||
// but Muun servers play no role in this code path and both are locally generated.
|
||||
muunSessionId := musig.RandomSessionId()
|
||||
muunPubNonce := musig.GeneratePubNonce(muunSessionId)
|
||||
|
||||
muunPartialSig, err := musig.ComputeMuunPartialSignature(
|
||||
toSign,
|
||||
userPub,
|
||||
muunPriv,
|
||||
userPubNonce,
|
||||
muunSessionId,
|
||||
nil,
|
||||
)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to add first signature: %w", err)
|
||||
}
|
||||
|
||||
c.MuunPubNonce = muunPubNonce
|
||||
c.MuunPartialSig = muunPartialSig
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *coinV5) signSecondWith(
|
||||
index int,
|
||||
tx *wire.MsgTx,
|
||||
userPriv *btcec.PrivateKey,
|
||||
muunPub *btcec.PublicKey,
|
||||
userSessionId [32]byte,
|
||||
toSign [32]byte,
|
||||
) error {
|
||||
|
||||
rawCombinedSig, err := musig.AddUserSignatureAndCombine(
|
||||
toSign,
|
||||
userPriv,
|
||||
muunPub,
|
||||
c.MuunPartialSig,
|
||||
c.MuunPubNonce,
|
||||
userSessionId,
|
||||
nil,
|
||||
)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to add second signature and combine: %w", err)
|
||||
}
|
||||
|
||||
sig := append(rawCombinedSig[:], byte(txscript.SigHashAll))
|
||||
|
||||
tx.TxIn[index].Witness = wire.TxWitness{sig}
|
||||
return nil
|
||||
}
|
||||
|
||||
type MusigNonces struct {
|
||||
sessionIds [][32]byte
|
||||
publicNonces [][66]byte
|
||||
}
|
||||
|
||||
func (m *MusigNonces) GetPubnonceHex(index int) string {
|
||||
return hex.EncodeToString(m.publicNonces[index][:])
|
||||
}
|
||||
|
||||
func GenerateMusigNonces(count int) *MusigNonces {
|
||||
sessionIds := make([][32]byte, 0)
|
||||
publicNonces := make([][66]byte, 0)
|
||||
|
||||
for i := 0; i < count; i += 1 {
|
||||
sessionIds = append(sessionIds, musig.RandomSessionId())
|
||||
publicNonces = append(publicNonces, musig.GeneratePubNonce(sessionIds[i]))
|
||||
}
|
||||
|
||||
return &MusigNonces{
|
||||
sessionIds,
|
||||
publicNonces,
|
||||
}
|
||||
}
|
||||
226
vendor/github.com/muun/libwallet/address.go
generated
vendored
226
vendor/github.com/muun/libwallet/address.go
generated
vendored
@@ -1,226 +0,0 @@
|
||||
package libwallet
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/muun/libwallet/addresses"
|
||||
"github.com/muun/libwallet/btcsuitew/btcutilw"
|
||||
"github.com/muun/libwallet/errors"
|
||||
|
||||
"github.com/btcsuite/btcd/txscript"
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
// These constants are here for clients usage.
|
||||
const (
|
||||
AddressVersionV1 = addresses.V1
|
||||
AddressVersionV2 = addresses.V2
|
||||
AddressVersionV3 = addresses.V3
|
||||
AddressVersionV4 = addresses.V4
|
||||
AddressVersionV5 = addresses.V5
|
||||
AddressVersionSwapsV1 = addresses.SubmarineSwapV1
|
||||
AddressVersionSwapsV2 = addresses.SubmarineSwapV2
|
||||
)
|
||||
|
||||
// MuunPaymentURI is muun's uri struct
|
||||
type MuunPaymentURI struct {
|
||||
Address string
|
||||
Label string
|
||||
Message string
|
||||
Amount string
|
||||
Uri string
|
||||
Bip70Url string
|
||||
CreationTime string
|
||||
ExpiresTime string
|
||||
Invoice *Invoice
|
||||
}
|
||||
|
||||
const (
|
||||
bitcoinScheme = "bitcoin:"
|
||||
muunScheme = "muun:"
|
||||
)
|
||||
|
||||
// GetPaymentURI builds a MuunPaymentURI from text (Bitcoin Uri, Muun Uri or address) and a network
|
||||
func GetPaymentURI(rawInput string, network *Network) (*MuunPaymentURI, error) {
|
||||
|
||||
bitcoinUri, components := buildUriFromString(rawInput, bitcoinScheme)
|
||||
if components == nil {
|
||||
return nil, errors.Errorf(ErrInvalidURI, "failed to parse uri %v", rawInput)
|
||||
}
|
||||
|
||||
if components.Scheme != "bitcoin" {
|
||||
return nil, errors.New(ErrInvalidURI, "Invalid scheme")
|
||||
}
|
||||
|
||||
address := components.Opaque
|
||||
|
||||
// When URIs are bitcoin:// the address comes in host
|
||||
// this happens in iOS that mostly ignores bitcoin: format
|
||||
if len(address) == 0 {
|
||||
address = components.Host
|
||||
}
|
||||
|
||||
queryValues, err := url.ParseQuery(components.RawQuery)
|
||||
if err != nil {
|
||||
return nil, errors.Errorf(ErrInvalidURI, "Couldn't parse query: %v", err)
|
||||
}
|
||||
|
||||
var label, message, amount string
|
||||
|
||||
if len(queryValues["label"]) != 0 {
|
||||
label = queryValues["label"][0]
|
||||
}
|
||||
|
||||
if len(queryValues["message"]) != 0 {
|
||||
message = queryValues["message"][0]
|
||||
}
|
||||
|
||||
if len(queryValues["amount"]) != 0 {
|
||||
amount = queryValues["amount"][0]
|
||||
}
|
||||
|
||||
if len(queryValues["lightning"]) != 0 {
|
||||
invoice, err := ParseInvoice(queryValues["lightning"][0], network)
|
||||
|
||||
if err == nil {
|
||||
return &MuunPaymentURI{Invoice: invoice}, nil
|
||||
}
|
||||
}
|
||||
|
||||
// legacy Apollo P2P/contacts check
|
||||
if (strings.Contains(rawInput, "contacts/")) {
|
||||
return &MuunPaymentURI{
|
||||
Label: label,
|
||||
Message: message,
|
||||
Amount: amount,
|
||||
Uri: bitcoinUri,
|
||||
}, nil
|
||||
}
|
||||
|
||||
//BIP70 check
|
||||
if len(queryValues["r"]) != 0 {
|
||||
if len(address) > 0 {
|
||||
return &MuunPaymentURI{
|
||||
Address: address,
|
||||
Label: label,
|
||||
Message: message,
|
||||
Amount: amount,
|
||||
Uri: bitcoinUri,
|
||||
Bip70Url: queryValues["r"][0],
|
||||
}, nil
|
||||
}
|
||||
|
||||
return &MuunPaymentURI{
|
||||
Label: label,
|
||||
Message: message,
|
||||
Amount: amount,
|
||||
Uri: bitcoinUri,
|
||||
Bip70Url: queryValues["r"][0],
|
||||
}, nil
|
||||
}
|
||||
|
||||
// Bech32 check
|
||||
decodedAddress, err := btcutilw.DecodeAddress(address, network.network)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("invalid address: %w", err)
|
||||
}
|
||||
|
||||
if !decodedAddress.IsForNet(network.network) {
|
||||
return nil, errors.New(ErrInvalidURI, "Network mismatch")
|
||||
}
|
||||
|
||||
return &MuunPaymentURI{
|
||||
Address: decodedAddress.String(),
|
||||
Label: label,
|
||||
Message: message,
|
||||
Amount: amount,
|
||||
Uri: bitcoinUri,
|
||||
}, nil
|
||||
|
||||
}
|
||||
|
||||
// DoPaymentRequestCall builds a MuunPaymentUri from a url and a network. Handling BIP70 to 72
|
||||
func DoPaymentRequestCall(url string, network *Network) (*MuunPaymentURI, error) {
|
||||
req, err := http.NewRequest("GET", url, nil)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to create request to: %s", url)
|
||||
}
|
||||
|
||||
req.Header.Set("Accept", "application/bitcoin-paymentrequest")
|
||||
|
||||
client := &http.Client{}
|
||||
resp, err := client.Do(req)
|
||||
if err != nil {
|
||||
return nil, errors.Errorf(ErrNetwork, "failed to make request to: %s", url)
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
body, err := ioutil.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
return nil, errors.Errorf(ErrNetwork, "Failed to read body response: %w", err)
|
||||
}
|
||||
|
||||
payReq := &PaymentRequest{}
|
||||
err = proto.Unmarshal(body, payReq)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to unmarshal payment request: %w", err)
|
||||
}
|
||||
|
||||
payDetails := &PaymentDetails{}
|
||||
|
||||
err = proto.Unmarshal(payReq.SerializedPaymentDetails, payDetails)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to unmarshall payment details: %w", err)
|
||||
}
|
||||
|
||||
if len(payDetails.Outputs) == 0 {
|
||||
return nil, fmt.Errorf("no outputs provided")
|
||||
}
|
||||
|
||||
address, err := getAddressFromScript(payDetails.Outputs[0].Script, network)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to get address: %w", err)
|
||||
}
|
||||
|
||||
amount := float64(payDetails.Outputs[0].Amount) / 100_000_000
|
||||
|
||||
return &MuunPaymentURI{
|
||||
Address: address,
|
||||
Message: payDetails.Memo,
|
||||
Amount: strconv.FormatFloat(amount, 'f', -1, 64),
|
||||
Bip70Url: url,
|
||||
CreationTime: strconv.FormatUint(payDetails.Time, 10),
|
||||
ExpiresTime: strconv.FormatUint(payDetails.Expires, 10),
|
||||
}, nil
|
||||
}
|
||||
|
||||
func getAddressFromScript(script []byte, network *Network) (string, error) {
|
||||
pkScript, err := txscript.ParsePkScript(script)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
address, err := pkScript.Address(network.network)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return address.String(), nil
|
||||
}
|
||||
|
||||
func buildUriFromString(rawInput string, targetScheme string) (string, *url.URL) {
|
||||
newUri := strings.Replace(rawInput, muunScheme, targetScheme, 1)
|
||||
if !strings.HasPrefix(strings.ToLower(newUri), targetScheme) {
|
||||
newUri = targetScheme + rawInput
|
||||
}
|
||||
|
||||
components, err := url.Parse(newUri)
|
||||
if err != nil {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
return newUri, components
|
||||
}
|
||||
62
vendor/github.com/muun/libwallet/addresses/addresses.go
generated
vendored
62
vendor/github.com/muun/libwallet/addresses/addresses.go
generated
vendored
@@ -1,62 +0,0 @@
|
||||
package addresses
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/btcsuite/btcd/chaincfg"
|
||||
"github.com/btcsuite/btcutil/hdkeychain"
|
||||
)
|
||||
|
||||
const (
|
||||
V1 = 1
|
||||
V2 = 2
|
||||
V3 = 3
|
||||
V4 = 4
|
||||
V5 = 5
|
||||
SubmarineSwapV1 = 101
|
||||
SubmarineSwapV2 = 102
|
||||
IncomingSwap = 201
|
||||
)
|
||||
|
||||
type WalletAddress struct {
|
||||
version int
|
||||
derivationPath string
|
||||
address string
|
||||
}
|
||||
|
||||
func New(version int, derivationPath string, address string) *WalletAddress {
|
||||
return &WalletAddress{
|
||||
version: version,
|
||||
derivationPath: derivationPath,
|
||||
address: address,
|
||||
}
|
||||
}
|
||||
|
||||
func Create(version int, userKey, muunKey *hdkeychain.ExtendedKey, path string, network *chaincfg.Params) (*WalletAddress, error) {
|
||||
switch version {
|
||||
case V1:
|
||||
return CreateAddressV1(userKey, path, network)
|
||||
case V2:
|
||||
return CreateAddressV2(userKey, muunKey, path, network)
|
||||
case V3:
|
||||
return CreateAddressV3(userKey, muunKey, path, network)
|
||||
case V4:
|
||||
return CreateAddressV4(userKey, muunKey, path, network)
|
||||
case V5:
|
||||
return CreateAddressV5(userKey, muunKey, path, network)
|
||||
default:
|
||||
return nil, fmt.Errorf("unknown or unsupported version %v", version)
|
||||
}
|
||||
}
|
||||
|
||||
func (a *WalletAddress) Version() int {
|
||||
return a.version
|
||||
}
|
||||
|
||||
func (a *WalletAddress) DerivationPath() string {
|
||||
return a.derivationPath
|
||||
}
|
||||
|
||||
func (a *WalletAddress) Address() string {
|
||||
return a.address
|
||||
}
|
||||
24
vendor/github.com/muun/libwallet/addresses/v1.go
generated
vendored
24
vendor/github.com/muun/libwallet/addresses/v1.go
generated
vendored
@@ -1,24 +0,0 @@
|
||||
package addresses
|
||||
|
||||
import (
|
||||
"github.com/btcsuite/btcd/chaincfg"
|
||||
"github.com/btcsuite/btcutil"
|
||||
"github.com/btcsuite/btcutil/hdkeychain"
|
||||
)
|
||||
|
||||
// CreateAddressV1 returns a P2PKH WalletAddress from a publicKey for use in TransactionSchemeV1
|
||||
func CreateAddressV1(userKey *hdkeychain.ExtendedKey, path string, network *chaincfg.Params) (*WalletAddress, error) {
|
||||
pubKey, err := userKey.ECPubKey()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
address, err := btcutil.NewAddressPubKey(pubKey.SerializeCompressed(), network)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &WalletAddress{
|
||||
address: address.EncodeAddress(),
|
||||
version: V1,
|
||||
derivationPath: path,
|
||||
}, nil
|
||||
}
|
||||
59
vendor/github.com/muun/libwallet/addresses/v2.go
generated
vendored
59
vendor/github.com/muun/libwallet/addresses/v2.go
generated
vendored
@@ -1,59 +0,0 @@
|
||||
package addresses
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/btcsuite/btcd/chaincfg"
|
||||
"github.com/btcsuite/btcd/txscript"
|
||||
"github.com/btcsuite/btcutil"
|
||||
"github.com/btcsuite/btcutil/hdkeychain"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
func CreateAddressV2(userKey, muunKey *hdkeychain.ExtendedKey, path string, network *chaincfg.Params) (*WalletAddress, error) {
|
||||
|
||||
script, err := CreateRedeemScriptV2(userKey, muunKey, network)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to generate redeem script v2: %w", err)
|
||||
}
|
||||
|
||||
address, err := btcutil.NewAddressScriptHash(script, network)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to generate multisig address: %w", err)
|
||||
}
|
||||
|
||||
return &WalletAddress{
|
||||
address: address.EncodeAddress(),
|
||||
version: V2,
|
||||
derivationPath: path,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func CreateRedeemScriptV2(userKey, muunKey *hdkeychain.ExtendedKey, network *chaincfg.Params) ([]byte, error) {
|
||||
return createMultisigRedeemScript(userKey, muunKey, network)
|
||||
}
|
||||
|
||||
func createMultisigRedeemScript(userKey, muunKey *hdkeychain.ExtendedKey, network *chaincfg.Params) ([]byte, error) {
|
||||
userPublicKey, err := userKey.ECPubKey()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
userAddress, err := btcutil.NewAddressPubKey(userPublicKey.SerializeCompressed(), network)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "failed to generate address for user")
|
||||
}
|
||||
|
||||
muunPublicKey, err := muunKey.ECPubKey()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
WalletAddress, err := btcutil.NewAddressPubKey(muunPublicKey.SerializeCompressed(), network)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "failed to generate address for muun")
|
||||
}
|
||||
|
||||
return txscript.MultiSigScript([]*btcutil.AddressPubKey{
|
||||
userAddress,
|
||||
WalletAddress,
|
||||
}, 2)
|
||||
}
|
||||
55
vendor/github.com/muun/libwallet/addresses/v3.go
generated
vendored
55
vendor/github.com/muun/libwallet/addresses/v3.go
generated
vendored
@@ -1,55 +0,0 @@
|
||||
package addresses
|
||||
|
||||
import (
|
||||
"crypto/sha256"
|
||||
"fmt"
|
||||
|
||||
"github.com/btcsuite/btcd/chaincfg"
|
||||
|
||||
"github.com/btcsuite/btcd/txscript"
|
||||
"github.com/btcsuite/btcutil"
|
||||
"github.com/btcsuite/btcutil/hdkeychain"
|
||||
)
|
||||
|
||||
func CreateAddressV3(userKey, muunKey *hdkeychain.ExtendedKey, path string, network *chaincfg.Params) (*WalletAddress, error) {
|
||||
|
||||
redeemScript, err := CreateRedeemScriptV3(userKey, muunKey, network)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
address, err := btcutil.NewAddressScriptHash(redeemScript, network)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &WalletAddress{
|
||||
address: address.EncodeAddress(),
|
||||
version: V3,
|
||||
derivationPath: path,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func CreateRedeemScriptV3(userKey, muunKey *hdkeychain.ExtendedKey, network *chaincfg.Params) ([]byte, error) {
|
||||
witnessScript, err := CreateWitnessScriptV3(userKey, muunKey, network)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to generate redeem script v3: %w", err)
|
||||
}
|
||||
|
||||
return createNonNativeSegwitRedeemScript(witnessScript)
|
||||
}
|
||||
|
||||
func CreateWitnessScriptV3(userKey, muunKey *hdkeychain.ExtendedKey, network *chaincfg.Params) ([]byte, error) {
|
||||
// createMultisigRedeemScript creates a valid script for both V2 and V3 schemes
|
||||
return createMultisigRedeemScript(userKey, muunKey, network)
|
||||
}
|
||||
|
||||
func createNonNativeSegwitRedeemScript(witnessScript []byte) ([]byte, error) {
|
||||
witnessScriptHash := sha256.Sum256(witnessScript)
|
||||
|
||||
builder := txscript.NewScriptBuilder()
|
||||
builder.AddInt64(0)
|
||||
builder.AddData(witnessScriptHash[:])
|
||||
|
||||
return builder.Script()
|
||||
}
|
||||
36
vendor/github.com/muun/libwallet/addresses/v4.go
generated
vendored
36
vendor/github.com/muun/libwallet/addresses/v4.go
generated
vendored
@@ -1,36 +0,0 @@
|
||||
package addresses
|
||||
|
||||
import (
|
||||
"crypto/sha256"
|
||||
"fmt"
|
||||
|
||||
"github.com/btcsuite/btcd/chaincfg"
|
||||
"github.com/btcsuite/btcutil"
|
||||
"github.com/btcsuite/btcutil/hdkeychain"
|
||||
)
|
||||
|
||||
// CreateAddressV4 returns a P2WSH WalletAddress from a user HD-pubkey and a Muun co-signing HD-pubkey.
|
||||
func CreateAddressV4(userKey, muunKey *hdkeychain.ExtendedKey, path string, network *chaincfg.Params) (*WalletAddress, error) {
|
||||
|
||||
witnessScript, err := CreateWitnessScriptV4(userKey, muunKey, network)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to generate witness script v4: %w", err)
|
||||
}
|
||||
witnessScript256 := sha256.Sum256(witnessScript)
|
||||
|
||||
address, err := btcutil.NewAddressWitnessScriptHash(witnessScript256[:], network)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &WalletAddress{
|
||||
address: address.EncodeAddress(),
|
||||
version: V4,
|
||||
derivationPath: path,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func CreateWitnessScriptV4(userKey, muunKey *hdkeychain.ExtendedKey, network *chaincfg.Params) ([]byte, error) {
|
||||
// createMultisigRedeemScript creates a valid script for V2, V3 and V4 schemes
|
||||
return createMultisigRedeemScript(userKey, muunKey, network)
|
||||
}
|
||||
50
vendor/github.com/muun/libwallet/addresses/v5.go
generated
vendored
50
vendor/github.com/muun/libwallet/addresses/v5.go
generated
vendored
@@ -1,50 +0,0 @@
|
||||
package addresses
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/btcsuite/btcd/chaincfg"
|
||||
"github.com/btcsuite/btcutil/hdkeychain"
|
||||
"github.com/muun/libwallet/btcsuitew/btcutilw"
|
||||
"github.com/muun/libwallet/musig"
|
||||
)
|
||||
|
||||
// CreateAddressV5 returns a P2TR WalletAddress using Musig with the signing and cosigning keys.
|
||||
func CreateAddressV5(userKey, muunKey *hdkeychain.ExtendedKey, path string, network *chaincfg.Params) (*WalletAddress, error) {
|
||||
witnessProgram, err := CreateWitnessScriptV5(userKey, muunKey)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to generate witness script v5: %w", err)
|
||||
}
|
||||
|
||||
address, err := btcutilw.NewAddressTaprootKey(witnessProgram, network)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &WalletAddress{
|
||||
address: address.EncodeAddress(),
|
||||
version: V5,
|
||||
derivationPath: path,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func CreateWitnessScriptV5(userKey, muunKey *hdkeychain.ExtendedKey) ([]byte, error) {
|
||||
userPublicKey, err := userKey.ECPubKey()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
muunPublicKey, err := muunKey.ECPubKey()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
combined, err := musig.CombinePubKeysWithTweak(userPublicKey, muunPublicKey, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
xOnlyCombined := combined.SerializeCompressed()[1:]
|
||||
|
||||
return xOnlyCombined, nil
|
||||
}
|
||||
83
vendor/github.com/muun/libwallet/aescbc/aescbc.go
generated
vendored
83
vendor/github.com/muun/libwallet/aescbc/aescbc.go
generated
vendored
@@ -1,83 +0,0 @@
|
||||
package aescbc
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/aes"
|
||||
"crypto/cipher"
|
||||
"errors"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
const KeySize = 32
|
||||
|
||||
func EncryptPkcs7(key []byte, iv []byte, plaintext []byte) ([]byte, error) {
|
||||
plaintext = pkcs7Padding(plaintext)
|
||||
return EncryptNoPadding(key, iv, plaintext)
|
||||
}
|
||||
|
||||
func EncryptNoPadding(key []byte, iv []byte, plaintext []byte) ([]byte, error) {
|
||||
if len(key) != KeySize {
|
||||
return nil, fmt.Errorf("invalid key size, expected %v, got %v", KeySize, len(key))
|
||||
}
|
||||
block, err := aes.NewCipher(key)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
ciphertext := make([]byte, len(plaintext))
|
||||
|
||||
mode := cipher.NewCBCEncrypter(block, iv)
|
||||
mode.CryptBlocks(ciphertext, plaintext)
|
||||
|
||||
return ciphertext, nil
|
||||
}
|
||||
|
||||
func DecryptPkcs7(key []byte, iv []byte, cypertext []byte) ([]byte, error) {
|
||||
paddedPlaintext, err := DecryptNoPadding(key, iv, cypertext)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return pkcs7UnPadding(paddedPlaintext)
|
||||
}
|
||||
|
||||
func DecryptNoPadding(key []byte, iv []byte, cypertext []byte) ([]byte, error) {
|
||||
if len(key) != KeySize {
|
||||
return nil, fmt.Errorf("invalid key size, expected %v, got %v", KeySize, len(key))
|
||||
}
|
||||
block, err := aes.NewCipher(key)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
plaintext := make([]byte, len(cypertext))
|
||||
|
||||
mode := cipher.NewCBCDecrypter(block, iv)
|
||||
mode.CryptBlocks(plaintext, cypertext)
|
||||
|
||||
return plaintext, nil
|
||||
}
|
||||
|
||||
func pkcs7Padding(src []byte) []byte {
|
||||
padding := aes.BlockSize - len(src)%aes.BlockSize
|
||||
padtext := bytes.Repeat([]byte{byte(padding)}, padding)
|
||||
return append(src, padtext...)
|
||||
}
|
||||
|
||||
func pkcs7UnPadding(src []byte) ([]byte, error) {
|
||||
length := len(src)
|
||||
unpadding := int(src[length-1])
|
||||
|
||||
if unpadding > aes.BlockSize || unpadding == 0 {
|
||||
return nil, errors.New("invalid pkcs7 padding (unpadding > aes.BlockSize || unpadding == 0)")
|
||||
}
|
||||
|
||||
pad := src[len(src)-unpadding:]
|
||||
for i := 0; i < unpadding; i++ {
|
||||
if pad[i] != byte(unpadding) {
|
||||
return nil, errors.New("invalid pkcs7 padding (pad[i] != unpadding)")
|
||||
}
|
||||
}
|
||||
|
||||
return src[:(length - unpadding)], nil
|
||||
}
|
||||
530
vendor/github.com/muun/libwallet/bip70.pb.go
generated
vendored
530
vendor/github.com/muun/libwallet/bip70.pb.go
generated
vendored
@@ -1,530 +0,0 @@
|
||||
//
|
||||
// Simple Bitcoin Payment Protocol messages
|
||||
//
|
||||
// Use fields 1000+ for extensions;
|
||||
// to avoid conflicts, register extensions via pull-req at
|
||||
// https://github.com/bitcoin/bips/blob/master/bip-0070/extensions.mediawiki
|
||||
//
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.1
|
||||
// protoc v3.21.6
|
||||
// source: bip70.proto
|
||||
|
||||
package libwallet
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// Generalized form of "send payment to this/these bitcoin addresses"
|
||||
type Output struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Amount uint64 `protobuf:"varint,1,opt,name=amount,proto3" json:"amount,omitempty"` // amount is integer-number-of-satoshis
|
||||
Script []byte `protobuf:"bytes,2,opt,name=script,proto3" json:"script,omitempty"` // usually one of the standard Script forms
|
||||
}
|
||||
|
||||
func (x *Output) Reset() {
|
||||
*x = Output{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_bip70_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Output) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Output) ProtoMessage() {}
|
||||
|
||||
func (x *Output) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_bip70_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Output.ProtoReflect.Descriptor instead.
|
||||
func (*Output) Descriptor() ([]byte, []int) {
|
||||
return file_bip70_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Output) GetAmount() uint64 {
|
||||
if x != nil {
|
||||
return x.Amount
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type PaymentDetails struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Network string `protobuf:"bytes,1,opt,name=network,proto3" json:"network,omitempty"` // "main" or "test"
|
||||
Outputs []*Output `protobuf:"bytes,2,rep,name=outputs,proto3" json:"outputs,omitempty"` // Where payment should be sent
|
||||
Time uint64 `protobuf:"varint,3,opt,name=time,proto3" json:"time,omitempty"` // Timestamp; when payment request created
|
||||
Expires uint64 `protobuf:"varint,4,opt,name=expires,proto3" json:"expires,omitempty"` // Timestamp; when this request should be considered invalid
|
||||
Memo string `protobuf:"bytes,5,opt,name=memo,proto3" json:"memo,omitempty"` // Human-readable description of request for the customer
|
||||
PaymentUrl string `protobuf:"bytes,6,opt,name=payment_url,json=paymentUrl,proto3" json:"payment_url,omitempty"` // URL to send Payment and get PaymentACK
|
||||
MerchantData []byte `protobuf:"bytes,7,opt,name=merchant_data,json=merchantData,proto3" json:"merchant_data,omitempty"` // Arbitrary data to include in the Payment message
|
||||
}
|
||||
|
||||
func (x *PaymentDetails) Reset() {
|
||||
*x = PaymentDetails{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_bip70_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *PaymentDetails) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*PaymentDetails) ProtoMessage() {}
|
||||
|
||||
func (x *PaymentDetails) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_bip70_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use PaymentDetails.ProtoReflect.Descriptor instead.
|
||||
func (*PaymentDetails) Descriptor() ([]byte, []int) {
|
||||
return file_bip70_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *PaymentDetails) GetOutputs() []*Output {
|
||||
if x != nil {
|
||||
return x.Outputs
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *PaymentDetails) GetTime() uint64 {
|
||||
if x != nil {
|
||||
return x.Time
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *PaymentDetails) GetExpires() uint64 {
|
||||
if x != nil {
|
||||
return x.Expires
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type PaymentRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
PaymentDetailsVersion uint32 `protobuf:"varint,1,opt,name=payment_details_version,json=paymentDetailsVersion,proto3" json:"payment_details_version,omitempty"`
|
||||
PkiType string `protobuf:"bytes,2,opt,name=pki_type,json=pkiType,proto3" json:"pki_type,omitempty"` // none / x509+sha256 / x509+sha1
|
||||
PkiData []byte `protobuf:"bytes,3,opt,name=pki_data,json=pkiData,proto3" json:"pki_data,omitempty"` // depends on pki_type
|
||||
SerializedPaymentDetails []byte `protobuf:"bytes,4,opt,name=serialized_payment_details,json=serializedPaymentDetails,proto3" json:"serialized_payment_details,omitempty"` // PaymentDetails
|
||||
Signature []byte `protobuf:"bytes,5,opt,name=signature,proto3" json:"signature,omitempty"` // pki-dependent signature
|
||||
}
|
||||
|
||||
func (x *PaymentRequest) Reset() {
|
||||
*x = PaymentRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_bip70_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *PaymentRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*PaymentRequest) ProtoMessage() {}
|
||||
|
||||
func (x *PaymentRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_bip70_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use PaymentRequest.ProtoReflect.Descriptor instead.
|
||||
func (*PaymentRequest) Descriptor() ([]byte, []int) {
|
||||
return file_bip70_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *PaymentRequest) GetPaymentDetailsVersion() uint32 {
|
||||
if x != nil {
|
||||
return x.PaymentDetailsVersion
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type X509Certificates struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Certificate [][]byte `protobuf:"bytes,1,rep,name=certificate,proto3" json:"certificate,omitempty"` // DER-encoded X.509 certificate chain
|
||||
}
|
||||
|
||||
func (x *X509Certificates) Reset() {
|
||||
*x = X509Certificates{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_bip70_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *X509Certificates) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*X509Certificates) ProtoMessage() {}
|
||||
|
||||
func (x *X509Certificates) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_bip70_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use X509Certificates.ProtoReflect.Descriptor instead.
|
||||
func (*X509Certificates) Descriptor() ([]byte, []int) {
|
||||
return file_bip70_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *X509Certificates) GetCertificate() [][]byte {
|
||||
if x != nil {
|
||||
return x.Certificate
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type Payment struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
MerchantData []byte `protobuf:"bytes,1,opt,name=merchant_data,json=merchantData,proto3" json:"merchant_data,omitempty"` // From PaymentDetails.merchant_data
|
||||
Transactions [][]byte `protobuf:"bytes,2,rep,name=transactions,proto3" json:"transactions,omitempty"` // Signed transactions that satisfy PaymentDetails.outputs
|
||||
RefundTo []*Output `protobuf:"bytes,3,rep,name=refund_to,json=refundTo,proto3" json:"refund_to,omitempty"` // Where to send refunds, if a refund is necessary
|
||||
Memo string `protobuf:"bytes,4,opt,name=memo,proto3" json:"memo,omitempty"` // Human-readable message for the merchant
|
||||
}
|
||||
|
||||
func (x *Payment) Reset() {
|
||||
*x = Payment{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_bip70_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Payment) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Payment) ProtoMessage() {}
|
||||
|
||||
func (x *Payment) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_bip70_proto_msgTypes[4]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Payment.ProtoReflect.Descriptor instead.
|
||||
func (*Payment) Descriptor() ([]byte, []int) {
|
||||
return file_bip70_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *Payment) GetTransactions() [][]byte {
|
||||
if x != nil {
|
||||
return x.Transactions
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Payment) GetRefundTo() []*Output {
|
||||
if x != nil {
|
||||
return x.RefundTo
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type PaymentACK struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Payment *Payment `protobuf:"bytes,1,opt,name=payment,proto3" json:"payment,omitempty"` // Payment message that triggered this ACK
|
||||
Memo string `protobuf:"bytes,2,opt,name=memo,proto3" json:"memo,omitempty"` // human-readable message for customer
|
||||
}
|
||||
|
||||
func (x *PaymentACK) Reset() {
|
||||
*x = PaymentACK{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_bip70_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *PaymentACK) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*PaymentACK) ProtoMessage() {}
|
||||
|
||||
func (x *PaymentACK) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_bip70_proto_msgTypes[5]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use PaymentACK.ProtoReflect.Descriptor instead.
|
||||
func (*PaymentACK) Descriptor() ([]byte, []int) {
|
||||
return file_bip70_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
var File_bip70_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_bip70_proto_rawDesc = []byte{
|
||||
0x0a, 0x0b, 0x62, 0x69, 0x70, 0x37, 0x30, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x6c,
|
||||
0x69, 0x62, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x22, 0x38, 0x0a, 0x06, 0x4f, 0x75, 0x74, 0x70,
|
||||
0x75, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63,
|
||||
0x72, 0x69, 0x70, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x73, 0x63, 0x72, 0x69,
|
||||
0x70, 0x74, 0x22, 0xdf, 0x01, 0x0a, 0x0e, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x44, 0x65,
|
||||
0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12,
|
||||
0x2b, 0x0a, 0x07, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b,
|
||||
0x32, 0x11, 0x2e, 0x6c, 0x69, 0x62, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e, 0x4f, 0x75, 0x74,
|
||||
0x70, 0x75, 0x74, 0x52, 0x07, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04,
|
||||
0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65,
|
||||
0x12, 0x18, 0x0a, 0x07, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28,
|
||||
0x04, 0x52, 0x07, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65,
|
||||
0x6d, 0x6f, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x1f,
|
||||
0x0a, 0x0b, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x06, 0x20,
|
||||
0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x55, 0x72, 0x6c, 0x12,
|
||||
0x23, 0x0a, 0x0d, 0x6d, 0x65, 0x72, 0x63, 0x68, 0x61, 0x6e, 0x74, 0x5f, 0x64, 0x61, 0x74, 0x61,
|
||||
0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x6d, 0x65, 0x72, 0x63, 0x68, 0x61, 0x6e, 0x74,
|
||||
0x44, 0x61, 0x74, 0x61, 0x22, 0xda, 0x01, 0x0a, 0x0e, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74,
|
||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x36, 0x0a, 0x17, 0x70, 0x61, 0x79, 0x6d, 0x65,
|
||||
0x6e, 0x74, 0x5f, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69,
|
||||
0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x15, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e,
|
||||
0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12,
|
||||
0x19, 0x0a, 0x08, 0x70, 0x6b, 0x69, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||
0x09, 0x52, 0x07, 0x70, 0x6b, 0x69, 0x54, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x6b,
|
||||
0x69, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x6b,
|
||||
0x69, 0x44, 0x61, 0x74, 0x61, 0x12, 0x3c, 0x0a, 0x1a, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69,
|
||||
0x7a, 0x65, 0x64, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x64, 0x65, 0x74, 0x61,
|
||||
0x69, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x18, 0x73, 0x65, 0x72, 0x69, 0x61,
|
||||
0x6c, 0x69, 0x7a, 0x65, 0x64, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x74, 0x61,
|
||||
0x69, 0x6c, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65,
|
||||
0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72,
|
||||
0x65, 0x22, 0x34, 0x0a, 0x10, 0x58, 0x35, 0x30, 0x39, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69,
|
||||
0x63, 0x61, 0x74, 0x65, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69,
|
||||
0x63, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0b, 0x63, 0x65, 0x72, 0x74,
|
||||
0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x22, 0x96, 0x01, 0x0a, 0x07, 0x50, 0x61, 0x79, 0x6d,
|
||||
0x65, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x65, 0x72, 0x63, 0x68, 0x61, 0x6e, 0x74, 0x5f,
|
||||
0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x6d, 0x65, 0x72, 0x63,
|
||||
0x68, 0x61, 0x6e, 0x74, 0x44, 0x61, 0x74, 0x61, 0x12, 0x22, 0x0a, 0x0c, 0x74, 0x72, 0x61, 0x6e,
|
||||
0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0c,
|
||||
0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2e, 0x0a, 0x09,
|
||||
0x72, 0x65, 0x66, 0x75, 0x6e, 0x64, 0x5f, 0x74, 0x6f, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32,
|
||||
0x11, 0x2e, 0x6c, 0x69, 0x62, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e, 0x4f, 0x75, 0x74, 0x70,
|
||||
0x75, 0x74, 0x52, 0x08, 0x72, 0x65, 0x66, 0x75, 0x6e, 0x64, 0x54, 0x6f, 0x12, 0x12, 0x0a, 0x04,
|
||||
0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f,
|
||||
0x22, 0x4e, 0x0a, 0x0a, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x41, 0x43, 0x4b, 0x12, 0x2c,
|
||||
0x0a, 0x07, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
||||
0x12, 0x2e, 0x6c, 0x69, 0x62, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e, 0x50, 0x61, 0x79, 0x6d,
|
||||
0x65, 0x6e, 0x74, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04,
|
||||
0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f,
|
||||
0x42, 0x08, 0x5a, 0x06, 0x2f, 0x62, 0x69, 0x70, 0x37, 0x30, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_bip70_proto_rawDescOnce sync.Once
|
||||
file_bip70_proto_rawDescData = file_bip70_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_bip70_proto_rawDescGZIP() []byte {
|
||||
file_bip70_proto_rawDescOnce.Do(func() {
|
||||
file_bip70_proto_rawDescData = protoimpl.X.CompressGZIP(file_bip70_proto_rawDescData)
|
||||
})
|
||||
return file_bip70_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_bip70_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
|
||||
var file_bip70_proto_goTypes = []interface{}{
|
||||
(*Output)(nil), // 0: libwallet.Output
|
||||
(*PaymentDetails)(nil), // 1: libwallet.PaymentDetails
|
||||
(*PaymentRequest)(nil), // 2: libwallet.PaymentRequest
|
||||
(*X509Certificates)(nil), // 3: libwallet.X509Certificates
|
||||
(*Payment)(nil), // 4: libwallet.Payment
|
||||
(*PaymentACK)(nil), // 5: libwallet.PaymentACK
|
||||
}
|
||||
var file_bip70_proto_depIdxs = []int32{
|
||||
0, // 0: libwallet.PaymentDetails.outputs:type_name -> libwallet.Output
|
||||
0, // 1: libwallet.Payment.refund_to:type_name -> libwallet.Output
|
||||
4, // 2: libwallet.PaymentACK.payment:type_name -> libwallet.Payment
|
||||
3, // [3:3] is the sub-list for method output_type
|
||||
3, // [3:3] is the sub-list for method input_type
|
||||
3, // [3:3] is the sub-list for extension type_name
|
||||
3, // [3:3] is the sub-list for extension extendee
|
||||
0, // [0:3] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_bip70_proto_init() }
|
||||
func file_bip70_proto_init() {
|
||||
if File_bip70_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_bip70_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Output); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_bip70_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*PaymentDetails); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_bip70_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*PaymentRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_bip70_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*X509Certificates); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_bip70_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Payment); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_bip70_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*PaymentACK); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_bip70_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 6,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_bip70_proto_goTypes,
|
||||
DependencyIndexes: file_bip70_proto_depIdxs,
|
||||
MessageInfos: file_bip70_proto_msgTypes,
|
||||
}.Build()
|
||||
File_bip70_proto = out.File
|
||||
file_bip70_proto_rawDesc = nil
|
||||
file_bip70_proto_goTypes = nil
|
||||
file_bip70_proto_depIdxs = nil
|
||||
}
|
||||
46
vendor/github.com/muun/libwallet/bip70.proto
generated
vendored
46
vendor/github.com/muun/libwallet/bip70.proto
generated
vendored
@@ -1,46 +0,0 @@
|
||||
//
|
||||
// Simple Bitcoin Payment Protocol messages
|
||||
//
|
||||
// Use fields 1000+ for extensions;
|
||||
// to avoid conflicts, register extensions via pull-req at
|
||||
// https://github.com/bitcoin/bips/blob/master/bip-0070/extensions.mediawiki
|
||||
//
|
||||
|
||||
syntax = "proto3";
|
||||
package libwallet;
|
||||
option go_package = "/bip70";
|
||||
|
||||
// Generalized form of "send payment to this/these bitcoin addresses"
|
||||
message Output {
|
||||
uint64 amount = 1; // amount is integer-number-of-satoshis
|
||||
bytes script = 2; // usually one of the standard Script forms
|
||||
}
|
||||
message PaymentDetails {
|
||||
string network = 1; // "main" or "test"
|
||||
repeated Output outputs = 2; // Where payment should be sent
|
||||
uint64 time = 3; // Timestamp; when payment request created
|
||||
uint64 expires = 4; // Timestamp; when this request should be considered invalid
|
||||
string memo = 5; // Human-readable description of request for the customer
|
||||
string payment_url = 6; // URL to send Payment and get PaymentACK
|
||||
bytes merchant_data = 7; // Arbitrary data to include in the Payment message
|
||||
}
|
||||
message PaymentRequest {
|
||||
uint32 payment_details_version = 1;
|
||||
string pki_type = 2; // none / x509+sha256 / x509+sha1
|
||||
bytes pki_data = 3; // depends on pki_type
|
||||
bytes serialized_payment_details = 4; // PaymentDetails
|
||||
bytes signature = 5; // pki-dependent signature
|
||||
}
|
||||
message X509Certificates {
|
||||
repeated bytes certificate = 1; // DER-encoded X.509 certificate chain
|
||||
}
|
||||
message Payment {
|
||||
bytes merchant_data = 1; // From PaymentDetails.merchant_data
|
||||
repeated bytes transactions = 2; // Signed transactions that satisfy PaymentDetails.outputs
|
||||
repeated Output refund_to = 3; // Where to send refunds, if a refund is necessary
|
||||
string memo = 4; // Human-readable message for the merchant
|
||||
}
|
||||
message PaymentACK {
|
||||
Payment payment = 1; // Payment message that triggered this ACK
|
||||
string memo = 2; // human-readable message for customer
|
||||
}
|
||||
69
vendor/github.com/muun/libwallet/bridge.go
generated
vendored
69
vendor/github.com/muun/libwallet/bridge.go
generated
vendored
@@ -1,69 +0,0 @@
|
||||
package libwallet
|
||||
|
||||
type StringList struct {
|
||||
elems []string
|
||||
}
|
||||
|
||||
func NewStringList() *StringList {
|
||||
return &StringList{}
|
||||
}
|
||||
|
||||
func NewStringListWithElements(elems []string) *StringList {
|
||||
return &StringList{elems}
|
||||
}
|
||||
|
||||
func (l *StringList) Length() int {
|
||||
return len(l.elems)
|
||||
}
|
||||
|
||||
func (l *StringList) Get(index int) string {
|
||||
return l.elems[index]
|
||||
}
|
||||
|
||||
func (l *StringList) Add(s string) {
|
||||
l.elems = append(l.elems, s)
|
||||
}
|
||||
|
||||
func (l *StringList) Contains(s string) bool {
|
||||
for _, v := range l.elems {
|
||||
if v == s {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
type IntList struct {
|
||||
elems []int
|
||||
}
|
||||
|
||||
func NewIntList() *IntList {
|
||||
return &IntList{}
|
||||
}
|
||||
|
||||
func newIntList(elems []int) *IntList {
|
||||
return &IntList{elems}
|
||||
}
|
||||
|
||||
func (l *IntList) Length() int {
|
||||
return len(l.elems)
|
||||
}
|
||||
|
||||
func (l *IntList) Get(index int) int {
|
||||
return l.elems[index]
|
||||
}
|
||||
|
||||
func (l *IntList) Add(number int) {
|
||||
l.elems = append(l.elems, number)
|
||||
}
|
||||
|
||||
func (l *IntList) Contains(number int) bool {
|
||||
for _, v := range l.elems {
|
||||
if v == number {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
257
vendor/github.com/muun/libwallet/btcsuitew/bech32m/bech32m.go
generated
vendored
257
vendor/github.com/muun/libwallet/btcsuitew/bech32m/bech32m.go
generated
vendored
@@ -1,257 +0,0 @@
|
||||
package bech32m
|
||||
|
||||
// This file was copied from btcd's bech32.go implementation, then modified to change
|
||||
// the checksum XOR constant for bech32m. No other changes were made, so some comments and names
|
||||
// might be inadequate.
|
||||
|
||||
// TODO (maybe):
|
||||
// Own both implementations and unify them by writing a function that receives the constant as
|
||||
// parameter. If we do, there will be checksum logic duplicated in descriptors.go (lik polymod).
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
const charset = "qpzry9x8gf2tvdw0s3jn54khce6mua7l"
|
||||
const bech32mChecksumConst = 0x2bc830a3
|
||||
|
||||
var gen = []int{0x3b6a57b2, 0x26508e6d, 0x1ea119fa, 0x3d4233dd, 0x2a1462b3}
|
||||
|
||||
// Decode decodes a bech32 encoded string, returning the human-readable
|
||||
// part and the data part excluding the checksum.
|
||||
func Decode(bech string) (string, []byte, error) {
|
||||
// The maximum allowed length for a bech32 string is 90. It must also
|
||||
// be at least 8 characters, since it needs a non-empty HRP, a
|
||||
// separator, and a 6 character checksum.
|
||||
if len(bech) < 8 || len(bech) > 90 {
|
||||
return "", nil, fmt.Errorf("invalid bech32 string length %d",
|
||||
len(bech))
|
||||
}
|
||||
// Only ASCII characters between 33 and 126 are allowed.
|
||||
for i := 0; i < len(bech); i++ {
|
||||
if bech[i] < 33 || bech[i] > 126 {
|
||||
return "", nil, fmt.Errorf("invalid character in "+
|
||||
"string: '%c'", bech[i])
|
||||
}
|
||||
}
|
||||
|
||||
// The characters must be either all lowercase or all uppercase.
|
||||
lower := strings.ToLower(bech)
|
||||
upper := strings.ToUpper(bech)
|
||||
if bech != lower && bech != upper {
|
||||
return "", nil, fmt.Errorf("string not all lowercase or all " +
|
||||
"uppercase")
|
||||
}
|
||||
|
||||
// We'll work with the lowercase string from now on.
|
||||
bech = lower
|
||||
|
||||
// The string is invalid if the last '1' is non-existent, it is the
|
||||
// first character of the string (no human-readable part) or one of the
|
||||
// last 6 characters of the string (since checksum cannot contain '1'),
|
||||
// or if the string is more than 90 characters in total.
|
||||
one := strings.LastIndexByte(bech, '1')
|
||||
if one < 1 || one+7 > len(bech) {
|
||||
return "", nil, fmt.Errorf("invalid index of 1")
|
||||
}
|
||||
|
||||
// The human-readable part is everything before the last '1'.
|
||||
hrp := bech[:one]
|
||||
data := bech[one+1:]
|
||||
|
||||
// Each character corresponds to the byte with value of the index in
|
||||
// 'charset'.
|
||||
decoded, err := toBytes(data)
|
||||
if err != nil {
|
||||
return "", nil, fmt.Errorf("failed converting data to bytes: "+
|
||||
"%v", err)
|
||||
}
|
||||
|
||||
if !bech32VerifyChecksum(hrp, decoded) {
|
||||
moreInfo := ""
|
||||
checksum := bech[len(bech)-6:]
|
||||
expected, err := toChars(bech32Checksum(hrp,
|
||||
decoded[:len(decoded)-6]))
|
||||
if err == nil {
|
||||
moreInfo = fmt.Sprintf("Expected %v, got %v.",
|
||||
expected, checksum)
|
||||
}
|
||||
return "", nil, fmt.Errorf("checksum failed. " + moreInfo)
|
||||
}
|
||||
|
||||
// We exclude the last 6 bytes, which is the checksum.
|
||||
return hrp, decoded[:len(decoded)-6], nil
|
||||
}
|
||||
|
||||
// Encode encodes a byte slice into a bech32 string with the
|
||||
// human-readable part hrb. Note that the bytes must each encode 5 bits
|
||||
// (base32).
|
||||
func Encode(hrp string, data []byte) (string, error) {
|
||||
// Calculate the checksum of the data and append it at the end.
|
||||
checksum := bech32Checksum(hrp, data)
|
||||
combined := append(data, checksum...)
|
||||
|
||||
// The resulting bech32 string is the concatenation of the hrp, the
|
||||
// separator 1, data and checksum. Everything after the separator is
|
||||
// represented using the specified charset.
|
||||
dataChars, err := toChars(combined)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("unable to convert data bytes to chars: "+
|
||||
"%v", err)
|
||||
}
|
||||
return hrp + "1" + dataChars, nil
|
||||
}
|
||||
|
||||
// toBytes converts each character in the string 'chars' to the value of the
|
||||
// index of the correspoding character in 'charset'.
|
||||
func toBytes(chars string) ([]byte, error) {
|
||||
decoded := make([]byte, 0, len(chars))
|
||||
for i := 0; i < len(chars); i++ {
|
||||
index := strings.IndexByte(charset, chars[i])
|
||||
if index < 0 {
|
||||
return nil, fmt.Errorf("invalid character not part of "+
|
||||
"charset: %v", chars[i])
|
||||
}
|
||||
decoded = append(decoded, byte(index))
|
||||
}
|
||||
return decoded, nil
|
||||
}
|
||||
|
||||
// toChars converts the byte slice 'data' to a string where each byte in 'data'
|
||||
// encodes the index of a character in 'charset'.
|
||||
func toChars(data []byte) (string, error) {
|
||||
result := make([]byte, 0, len(data))
|
||||
for _, b := range data {
|
||||
if int(b) >= len(charset) {
|
||||
return "", fmt.Errorf("invalid data byte: %v", b)
|
||||
}
|
||||
result = append(result, charset[b])
|
||||
}
|
||||
return string(result), nil
|
||||
}
|
||||
|
||||
// ConvertBits converts a byte slice where each byte is encoding fromBits bits,
|
||||
// to a byte slice where each byte is encoding toBits bits.
|
||||
func ConvertBits(data []byte, fromBits, toBits uint8, pad bool) ([]byte, error) {
|
||||
if fromBits < 1 || fromBits > 8 || toBits < 1 || toBits > 8 {
|
||||
return nil, fmt.Errorf("only bit groups between 1 and 8 allowed")
|
||||
}
|
||||
|
||||
// The final bytes, each byte encoding toBits bits.
|
||||
var regrouped []byte
|
||||
|
||||
// Keep track of the next byte we create and how many bits we have
|
||||
// added to it out of the toBits goal.
|
||||
nextByte := byte(0)
|
||||
filledBits := uint8(0)
|
||||
|
||||
for _, b := range data {
|
||||
|
||||
// Discard unused bits.
|
||||
b = b << (8 - fromBits)
|
||||
|
||||
// How many bits remaining to extract from the input data.
|
||||
remFromBits := fromBits
|
||||
for remFromBits > 0 {
|
||||
// How many bits remaining to be added to the next byte.
|
||||
remToBits := toBits - filledBits
|
||||
|
||||
// The number of bytes to next extract is the minimum of
|
||||
// remFromBits and remToBits.
|
||||
toExtract := remFromBits
|
||||
if remToBits < toExtract {
|
||||
toExtract = remToBits
|
||||
}
|
||||
|
||||
// Add the next bits to nextByte, shifting the already
|
||||
// added bits to the left.
|
||||
nextByte = (nextByte << toExtract) | (b >> (8 - toExtract))
|
||||
|
||||
// Discard the bits we just extracted and get ready for
|
||||
// next iteration.
|
||||
b = b << toExtract
|
||||
remFromBits -= toExtract
|
||||
filledBits += toExtract
|
||||
|
||||
// If the nextByte is completely filled, we add it to
|
||||
// our regrouped bytes and start on the next byte.
|
||||
if filledBits == toBits {
|
||||
regrouped = append(regrouped, nextByte)
|
||||
filledBits = 0
|
||||
nextByte = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// We pad any unfinished group if specified.
|
||||
if pad && filledBits > 0 {
|
||||
nextByte = nextByte << (toBits - filledBits)
|
||||
regrouped = append(regrouped, nextByte)
|
||||
filledBits = 0
|
||||
nextByte = 0
|
||||
}
|
||||
|
||||
// Any incomplete group must be <= 4 bits, and all zeroes.
|
||||
if filledBits > 0 && (filledBits > 4 || nextByte != 0) {
|
||||
return nil, fmt.Errorf("invalid incomplete group")
|
||||
}
|
||||
|
||||
return regrouped, nil
|
||||
}
|
||||
|
||||
// For more details on the checksum calculation, please refer to BIP 173.
|
||||
func bech32Checksum(hrp string, data []byte) []byte {
|
||||
// Convert the bytes to list of integers, as this is needed for the
|
||||
// checksum calculation.
|
||||
integers := make([]int, len(data))
|
||||
for i, b := range data {
|
||||
integers[i] = int(b)
|
||||
}
|
||||
values := append(bech32HrpExpand(hrp), integers...)
|
||||
values = append(values, []int{0, 0, 0, 0, 0, 0}...)
|
||||
polymod := bech32Polymod(values) ^ bech32mChecksumConst
|
||||
var res []byte
|
||||
for i := 0; i < 6; i++ {
|
||||
res = append(res, byte((polymod>>uint(5*(5-i)))&31))
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
// For more details on the polymod calculation, please refer to BIP 173.
|
||||
func bech32Polymod(values []int) int {
|
||||
chk := 1
|
||||
for _, v := range values {
|
||||
b := chk >> 25
|
||||
chk = (chk&0x1ffffff)<<5 ^ v
|
||||
for i := 0; i < 5; i++ {
|
||||
if (b>>uint(i))&1 == 1 {
|
||||
chk ^= gen[i]
|
||||
}
|
||||
}
|
||||
}
|
||||
return chk
|
||||
}
|
||||
|
||||
// For more details on HRP expansion, please refer to BIP 173.
|
||||
func bech32HrpExpand(hrp string) []int {
|
||||
v := make([]int, 0, len(hrp)*2+1)
|
||||
for i := 0; i < len(hrp); i++ {
|
||||
v = append(v, int(hrp[i]>>5))
|
||||
}
|
||||
v = append(v, 0)
|
||||
for i := 0; i < len(hrp); i++ {
|
||||
v = append(v, int(hrp[i]&31))
|
||||
}
|
||||
return v
|
||||
}
|
||||
|
||||
// For more details on the checksum verification, please refer to BIP 173.
|
||||
func bech32VerifyChecksum(hrp string, data []byte) bool {
|
||||
integers := make([]int, len(data))
|
||||
for i, b := range data {
|
||||
integers[i] = int(b)
|
||||
}
|
||||
concat := append(bech32HrpExpand(hrp), integers...)
|
||||
return bech32Polymod(concat) == bech32mChecksumConst
|
||||
}
|
||||
127
vendor/github.com/muun/libwallet/btcsuitew/btcutilw/address.go
generated
vendored
127
vendor/github.com/muun/libwallet/btcsuitew/btcutilw/address.go
generated
vendored
@@ -1,127 +0,0 @@
|
||||
package btcutilw
|
||||
|
||||
// This package wraps some methods from btcutil, using the same interface and delegating all
|
||||
// supported cases to that module. It's written to be both compatible and similar in implementation,
|
||||
// so it's easy to swap out in the future.
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/btcsuite/btcd/chaincfg"
|
||||
"github.com/btcsuite/btcutil"
|
||||
)
|
||||
|
||||
// DecodeAddress uses btcutil.DecodeAddress for all cases except SegWit version 1, which is handled
|
||||
// by this wrapper.
|
||||
func DecodeAddress(addr string, defaultNet *chaincfg.Params) (btcutil.Address, error) {
|
||||
// Try to decode the address using btcutil:
|
||||
decoded, libErr := btcutil.DecodeAddress(addr, defaultNet)
|
||||
if libErr == nil {
|
||||
return decoded, nil
|
||||
}
|
||||
|
||||
// If this is a Taproot address, we're here because the bech32 checksum failed. The easiest way
|
||||
// to know is to try:
|
||||
witnessVer, witnessProg, err := decodeSegWitAddressV1(addr)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to decode %s (%v after %w)", addr, err, libErr)
|
||||
}
|
||||
|
||||
if witnessVer != 1 {
|
||||
return nil, btcutil.UnsupportedWitnessVerError(witnessVer)
|
||||
}
|
||||
|
||||
if len(witnessProg) != 32 {
|
||||
return nil, btcutil.UnsupportedWitnessProgLenError(len(witnessProg))
|
||||
}
|
||||
|
||||
oneIndex := strings.LastIndexByte(addr, '1')
|
||||
hrp := addr[:oneIndex]
|
||||
|
||||
return newAddressTaprootKey(hrp, witnessProg)
|
||||
}
|
||||
|
||||
// AddressTaprootKey is an Address for a keyspend-only P2TR output.
|
||||
type AddressTaprootKey struct {
|
||||
hrp string
|
||||
witnessVersion byte
|
||||
witnessProgram [32]byte
|
||||
}
|
||||
|
||||
// NewAddressTaprootKey returns a new AddressTaprootKey.
|
||||
func NewAddressTaprootKey(xOnlyPubKey []byte, net *chaincfg.Params) (*AddressTaprootKey, error) {
|
||||
if len(xOnlyPubKey) != 32 {
|
||||
return nil, fmt.Errorf("witness program must be 32 bytes for p2tr, not %d", len(xOnlyPubKey))
|
||||
}
|
||||
|
||||
addr := &AddressTaprootKey{
|
||||
hrp: net.Bech32HRPSegwit,
|
||||
witnessVersion: 0x01,
|
||||
witnessProgram: [32]byte{},
|
||||
}
|
||||
|
||||
copy(addr.witnessProgram[:], xOnlyPubKey)
|
||||
|
||||
return addr, nil
|
||||
}
|
||||
|
||||
// EncodeAddress returns the bech32m string encoding of an AddressTaprootKey.
|
||||
// Part of the Address interface.
|
||||
func (a *AddressTaprootKey) EncodeAddress() string {
|
||||
str, err := encodeSegWitAddressV1(a.hrp, a.witnessVersion, a.witnessProgram[:])
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
|
||||
return str
|
||||
}
|
||||
|
||||
// ScriptAddress returns the witness program for this address.
|
||||
// Part of the Address interface.
|
||||
func (a *AddressTaprootKey) ScriptAddress() []byte {
|
||||
return a.witnessProgram[:]
|
||||
}
|
||||
|
||||
// IsForNet returns whether or not the AddressTaprootKey is associated with a network.
|
||||
// Part of the Address interface.
|
||||
func (a *AddressTaprootKey) IsForNet(net *chaincfg.Params) bool {
|
||||
return a.hrp == net.Bech32HRPSegwit
|
||||
}
|
||||
|
||||
// String returns a human-readable string for the AddressTaprootKey.
|
||||
// This is equivalent to calling EncodeAddress, but allows use of fmt.Stringer.
|
||||
// Part of the Address interface.
|
||||
func (a *AddressTaprootKey) String() string {
|
||||
return a.EncodeAddress()
|
||||
}
|
||||
|
||||
// Hrp returns the human-readable part of the bech32 encoded AddressTaprootKey.
|
||||
func (a *AddressTaprootKey) Hrp() string {
|
||||
return a.hrp
|
||||
}
|
||||
|
||||
// WitnessVersion returns the witness version of the AddressTaprootKey.
|
||||
func (a *AddressTaprootKey) WitnessVersion() byte {
|
||||
return a.witnessVersion
|
||||
}
|
||||
|
||||
// WitnessProgram returns the witness program of the AddressTaprootKey.
|
||||
func (a *AddressTaprootKey) WitnessProgram() []byte {
|
||||
return a.witnessProgram[:]
|
||||
}
|
||||
|
||||
func newAddressTaprootKey(hrp string, witnessProg []byte) (*AddressTaprootKey, error) {
|
||||
if len(witnessProg) != 32 {
|
||||
return nil, fmt.Errorf("witness program must be 32 bytes for p2tr")
|
||||
}
|
||||
|
||||
addr := &AddressTaprootKey{
|
||||
hrp: strings.ToLower(hrp),
|
||||
witnessVersion: 0x01,
|
||||
}
|
||||
|
||||
copy(addr.witnessProgram[:], witnessProg)
|
||||
|
||||
return addr, nil
|
||||
}
|
||||
84
vendor/github.com/muun/libwallet/btcsuitew/btcutilw/segwit.go
generated
vendored
84
vendor/github.com/muun/libwallet/btcsuitew/btcutilw/segwit.go
generated
vendored
@@ -1,84 +0,0 @@
|
||||
package btcutilw
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
|
||||
"github.com/muun/libwallet/btcsuitew/bech32m"
|
||||
)
|
||||
|
||||
// -------------------------------------------------------------------------------------------------
|
||||
// Methods below copied from btcd (address.go), but using our bech32m module instead of their bech32.
|
||||
// Only that change was made. Some comments inside this code are not correct.
|
||||
|
||||
func encodeSegWitAddressV1(hrp string, witnessVersion byte, witnessProgram []byte) (string, error) {
|
||||
// Group the address bytes into 5 bit groups, as this is what is used to
|
||||
// encode each character in the address string.
|
||||
converted, err := bech32m.ConvertBits(witnessProgram, 8, 5, true)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
// Concatenate the witness version and program, and encode the resulting
|
||||
// bytes using bech32 encoding.
|
||||
combined := make([]byte, len(converted)+1)
|
||||
combined[0] = witnessVersion
|
||||
copy(combined[1:], converted)
|
||||
bech, err := bech32m.Encode(hrp, combined)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
// Check validity by decoding the created address.
|
||||
version, program, err := decodeSegWitAddressV1(bech)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("invalid taproot address: %v", err)
|
||||
}
|
||||
|
||||
if version != witnessVersion || !bytes.Equal(program, witnessProgram) {
|
||||
return "", fmt.Errorf("invalid taproot address")
|
||||
}
|
||||
|
||||
return bech, nil
|
||||
}
|
||||
|
||||
func decodeSegWitAddressV1(address string) (byte, []byte, error) {
|
||||
// Decode the bech32 encoded address.
|
||||
_, data, err := bech32m.Decode(address)
|
||||
if err != nil {
|
||||
return 0, nil, err
|
||||
}
|
||||
|
||||
// The first byte of the decoded address is the witness version, it must
|
||||
// exist.
|
||||
if len(data) < 1 {
|
||||
return 0, nil, fmt.Errorf("no witness version")
|
||||
}
|
||||
|
||||
// ...and be <= 16.
|
||||
version := data[0]
|
||||
if version > 16 {
|
||||
return 0, nil, fmt.Errorf("invalid witness version for taproot: %v", version)
|
||||
}
|
||||
|
||||
// The remaining characters of the address returned are grouped into
|
||||
// words of 5 bits. In order to restore the original witness program
|
||||
// bytes, we'll need to regroup into 8 bit words.
|
||||
regrouped, err := bech32m.ConvertBits(data[1:], 5, 8, false)
|
||||
if err != nil {
|
||||
return 0, nil, err
|
||||
}
|
||||
|
||||
// The regrouped data must be between 2 and 40 bytes.
|
||||
if len(regrouped) < 2 || len(regrouped) > 40 {
|
||||
return 0, nil, fmt.Errorf("invalid data length")
|
||||
}
|
||||
|
||||
// For witness version 0, address MUST be exactly 20 or 32 bytes.
|
||||
if version == 0 && len(regrouped) != 20 && len(regrouped) != 32 {
|
||||
return 0, nil, fmt.Errorf("invalid data length for witness "+
|
||||
"version 0: %v", len(regrouped))
|
||||
}
|
||||
|
||||
return version, regrouped, nil
|
||||
}
|
||||
58
vendor/github.com/muun/libwallet/btcsuitew/chainhashw/chainhashw.go
generated
vendored
58
vendor/github.com/muun/libwallet/btcsuitew/chainhashw/chainhashw.go
generated
vendored
@@ -1,58 +0,0 @@
|
||||
package chainhashw
|
||||
|
||||
// This package adds some methods on top of chainhash. It's written to be both compatible and
|
||||
// similar in implementation, so it's easy to swap out in the future.
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/sha256"
|
||||
|
||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
||||
)
|
||||
|
||||
var knownTagPrefix = map[string][]byte{}
|
||||
|
||||
const (
|
||||
TagTapLeaf = "TapLeaf"
|
||||
TagTapBranch = "TapBranch"
|
||||
TagTapTweak = "TapTweak"
|
||||
TagTapSighash = "TapSighash"
|
||||
)
|
||||
|
||||
func init() {
|
||||
knownTagPrefix[TagTapLeaf] = calcTagPrefix(TagTapLeaf)
|
||||
knownTagPrefix[TagTapBranch] = calcTagPrefix(TagTapBranch)
|
||||
knownTagPrefix[TagTapTweak] = calcTagPrefix(TagTapTweak)
|
||||
knownTagPrefix[TagTapSighash] = calcTagPrefix(TagTapSighash)
|
||||
}
|
||||
|
||||
func TagPrefix(tag string) []byte {
|
||||
if prefix, ok := knownTagPrefix[tag]; ok {
|
||||
return prefix
|
||||
}
|
||||
|
||||
return calcTagPrefix(tag)
|
||||
}
|
||||
|
||||
func TaggedHashB(tag string, data []byte) []byte {
|
||||
// NOTE: BIP-340 suggests optimizations that we don't make
|
||||
b := new(bytes.Buffer)
|
||||
b.Write(TagPrefix(tag))
|
||||
b.Write(data)
|
||||
|
||||
return chainhash.HashB(b.Bytes())
|
||||
}
|
||||
|
||||
func TaggedHashH(tag string, data []byte) chainhash.Hash {
|
||||
// NOTE: BIP-340 suggests optimizations that we don't make
|
||||
b := new(bytes.Buffer)
|
||||
b.Write(TagPrefix(tag))
|
||||
b.Write(data)
|
||||
|
||||
return chainhash.HashH(b.Bytes())
|
||||
}
|
||||
|
||||
func calcTagPrefix(tag string) []byte {
|
||||
tagHash := sha256.Sum256([]byte(tag))
|
||||
return append(tagHash[:], tagHash[:]...)
|
||||
}
|
||||
26
vendor/github.com/muun/libwallet/btcsuitew/txscriptw/hashcache.go
generated
vendored
26
vendor/github.com/muun/libwallet/btcsuitew/txscriptw/hashcache.go
generated
vendored
@@ -1,26 +0,0 @@
|
||||
package txscriptw
|
||||
|
||||
import (
|
||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
)
|
||||
|
||||
// TaprootSigHashes contains the sigHash parts for a PayToTaproot signature
|
||||
type TaprootSigHashes struct {
|
||||
HashPrevOuts chainhash.Hash
|
||||
HashSequence chainhash.Hash
|
||||
HashOutputs chainhash.Hash
|
||||
HashAmounts chainhash.Hash
|
||||
HashScriptPubKeys chainhash.Hash
|
||||
}
|
||||
|
||||
// NewTaprootSigHashes calculates and returns the TaprootSigHashes
|
||||
func NewTaprootSigHashes(tx *wire.MsgTx, prevOuts []*wire.TxOut) *TaprootSigHashes {
|
||||
return &TaprootSigHashes{
|
||||
HashPrevOuts: calcHashPrevOuts(tx),
|
||||
HashSequence: calcHashSequences(tx),
|
||||
HashOutputs: calcHashOutputs(tx),
|
||||
HashAmounts: calcHashAmounts(prevOuts),
|
||||
HashScriptPubKeys: calcHashScriptPubKeys(prevOuts),
|
||||
}
|
||||
}
|
||||
149
vendor/github.com/muun/libwallet/btcsuitew/txscriptw/script.go
generated
vendored
149
vendor/github.com/muun/libwallet/btcsuitew/txscriptw/script.go
generated
vendored
@@ -1,149 +0,0 @@
|
||||
package txscriptw
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
|
||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
||||
"github.com/btcsuite/btcd/txscript"
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/muun/libwallet/btcsuitew/chainhashw"
|
||||
)
|
||||
|
||||
// CalcTaprootSigHash crafts signature digest.
|
||||
// It only supports SIGHASH_ALL without ANYONECANPAY, and no annex or script paths.
|
||||
func CalcTaprootSigHash(
|
||||
tx *wire.MsgTx,
|
||||
sigHashes *TaprootSigHashes,
|
||||
index int,
|
||||
hashType txscript.SigHashType,
|
||||
) ([]byte, error) {
|
||||
|
||||
if index >= len(tx.TxIn) {
|
||||
return nil, fmt.Errorf("wanted index %d but found only %d inputs", index, len(tx.TxIn))
|
||||
}
|
||||
|
||||
anyoneCanPay := hashType&txscript.SigHashAnyOneCanPay != 0
|
||||
hashType = hashType & 0x1f
|
||||
|
||||
if hashType != txscript.SigHashAll {
|
||||
return nil, fmt.Errorf("only SIGHASH_ALL is supported")
|
||||
}
|
||||
|
||||
if anyoneCanPay {
|
||||
return nil, fmt.Errorf("anyoneCanPay is not supported")
|
||||
}
|
||||
|
||||
b := new(bytes.Buffer)
|
||||
|
||||
// Epoch [1] (not technically part of the message, but every use-case adds this prefix later)
|
||||
b.WriteByte(0x00)
|
||||
|
||||
// SigHash type [1]
|
||||
b.WriteByte(byte(hashType))
|
||||
|
||||
// nVersion [4]
|
||||
b.Write(uInt32Le(uint32(tx.Version)))
|
||||
|
||||
// nLockTime [4]
|
||||
b.Write(uInt32Le(tx.LockTime))
|
||||
|
||||
// input data [128 per input] always included since we failed for anyoneCanPay
|
||||
if !anyoneCanPay {
|
||||
b.Write(sigHashes.HashPrevOuts[:])
|
||||
b.Write(sigHashes.HashAmounts[:])
|
||||
b.Write(sigHashes.HashScriptPubKeys[:])
|
||||
b.Write(sigHashes.HashSequence[:])
|
||||
}
|
||||
|
||||
// output data [?] always included since we checked for SigHashAll
|
||||
if hashType != txscript.SigHashNone && hashType != txscript.SigHashSingle {
|
||||
b.Write(sigHashes.HashOutputs[:])
|
||||
}
|
||||
|
||||
// Spend type [1] always 0x00 since we don't support annex or script path
|
||||
b.WriteByte(0x00)
|
||||
|
||||
if anyoneCanPay {
|
||||
// MISSING: commit to the spent output and sequence (never since we failed for anyoneCanPay)
|
||||
} else {
|
||||
// Input index [4]
|
||||
b.Write(uInt32Le(uint32(index)))
|
||||
}
|
||||
|
||||
// MISSING: do some more hashing and commit to the annex (not supported)
|
||||
|
||||
if hashType == txscript.SigHashSingle {
|
||||
return nil, fmt.Errorf("SIGHASH_SINGLE is not supported")
|
||||
}
|
||||
|
||||
// MISSING: encode extensions, such as the script path commitment from BIP-342 (not supported)
|
||||
// As with the epoch byte above, not technically part of the message, but used in all cases
|
||||
|
||||
return chainhashw.TaggedHashB(chainhashw.TagTapSighash, b.Bytes()), nil
|
||||
}
|
||||
|
||||
func uInt32Le(n uint32) []byte {
|
||||
var nBytes [4]byte
|
||||
binary.LittleEndian.PutUint32(nBytes[:], n)
|
||||
return nBytes[:]
|
||||
}
|
||||
|
||||
func uInt64Le(n uint64) []byte {
|
||||
var nBytes [8]byte
|
||||
binary.LittleEndian.PutUint64(nBytes[:], n)
|
||||
return nBytes[:]
|
||||
}
|
||||
|
||||
func calcHashPrevOuts(tx *wire.MsgTx) chainhash.Hash {
|
||||
b := new(bytes.Buffer)
|
||||
|
||||
for _, txIn := range tx.TxIn {
|
||||
b.Write(txIn.PreviousOutPoint.Hash[:])
|
||||
b.Write(uInt32Le(txIn.PreviousOutPoint.Index))
|
||||
}
|
||||
|
||||
return chainhash.HashH(b.Bytes())
|
||||
}
|
||||
|
||||
func calcHashSequences(tx *wire.MsgTx) chainhash.Hash {
|
||||
b := new(bytes.Buffer)
|
||||
|
||||
for _, txIn := range tx.TxIn {
|
||||
b.Write(uInt32Le(txIn.Sequence))
|
||||
}
|
||||
|
||||
return chainhash.HashH(b.Bytes())
|
||||
}
|
||||
|
||||
func calcHashOutputs(tx *wire.MsgTx) chainhash.Hash {
|
||||
b := new(bytes.Buffer)
|
||||
|
||||
for _, txOut := range tx.TxOut {
|
||||
wire.WriteTxOut(b, 0, 0, txOut)
|
||||
}
|
||||
|
||||
return chainhash.HashH(b.Bytes())
|
||||
}
|
||||
|
||||
func calcHashScriptPubKeys(txOuts []*wire.TxOut) chainhash.Hash {
|
||||
b := new(bytes.Buffer)
|
||||
|
||||
for _, txOut := range txOuts {
|
||||
wire.WriteVarInt(b, 0, uint64(len(txOut.PkScript)))
|
||||
b.Write(txOut.PkScript)
|
||||
}
|
||||
|
||||
return chainhash.HashH(b.Bytes())
|
||||
}
|
||||
|
||||
func calcHashAmounts(txOuts []*wire.TxOut) chainhash.Hash {
|
||||
b := new(bytes.Buffer)
|
||||
|
||||
for _, txOut := range txOuts {
|
||||
b.Write(uInt64Le(uint64(txOut.Value)))
|
||||
}
|
||||
|
||||
return chainhash.HashH(b.Bytes())
|
||||
}
|
||||
23
vendor/github.com/muun/libwallet/btcsuitew/txscriptw/standard.go
generated
vendored
23
vendor/github.com/muun/libwallet/btcsuitew/txscriptw/standard.go
generated
vendored
@@ -1,23 +0,0 @@
|
||||
package txscriptw
|
||||
|
||||
import (
|
||||
"github.com/btcsuite/btcd/txscript"
|
||||
"github.com/btcsuite/btcutil"
|
||||
"github.com/muun/libwallet/btcsuitew/btcutilw"
|
||||
)
|
||||
|
||||
// PayToAddrScript uses txscript.PayToAddrScript for all cases except AddressTaprootKey, which is
|
||||
// by this wrapper.
|
||||
func PayToAddrScript(address btcutil.Address) ([]byte, error) {
|
||||
// Detect the only additional case we support, delegate otherwise:
|
||||
trkAddr, ok := address.(*btcutilw.AddressTaprootKey)
|
||||
if !ok {
|
||||
return txscript.PayToAddrScript(address)
|
||||
}
|
||||
|
||||
return payToTaprootKeyScript(trkAddr.ScriptAddress())
|
||||
}
|
||||
|
||||
func payToTaprootKeyScript(key []byte) ([]byte, error) {
|
||||
return txscript.NewScriptBuilder().AddOp(txscript.OP_1).AddData(key).Script()
|
||||
}
|
||||
197
vendor/github.com/muun/libwallet/challenge_keys.go
generated
vendored
197
vendor/github.com/muun/libwallet/challenge_keys.go
generated
vendored
@@ -1,197 +0,0 @@
|
||||
package libwallet
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/sha256"
|
||||
"encoding/binary"
|
||||
"encoding/hex"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/btcsuite/btcd/btcec"
|
||||
"github.com/btcsuite/btcutil/base58"
|
||||
)
|
||||
|
||||
const (
|
||||
// EncodedKeyLength is the size of a modern encoded key, as exported by the clients.
|
||||
EncodedKeyLength = 147
|
||||
|
||||
// EncodedKeyLengthLegacy is the size of a legacy key, when salt resided only in the 2nd key.
|
||||
EncodedKeyLengthLegacy = 136
|
||||
)
|
||||
|
||||
type ChallengePrivateKey struct {
|
||||
key *btcec.PrivateKey
|
||||
}
|
||||
|
||||
type encryptedPrivateKey struct {
|
||||
Version uint8
|
||||
Birthday uint16
|
||||
EphPublicKey []byte // 33-byte compressed public-key
|
||||
CipherText []byte // 64-byte encrypted text
|
||||
Salt []byte // (optional) 8-byte salt
|
||||
}
|
||||
|
||||
// EncryptedPrivateKeyInfo is a Gomobile-compatible version of EncryptedPrivateKey using hex-encoding.
|
||||
type EncryptedPrivateKeyInfo struct {
|
||||
Version int
|
||||
Birthday int
|
||||
EphPublicKey string
|
||||
CipherText string
|
||||
Salt string
|
||||
}
|
||||
|
||||
type DecryptedPrivateKey struct {
|
||||
Key *HDPrivateKey
|
||||
Birthday int
|
||||
}
|
||||
|
||||
func NewChallengePrivateKey(input, salt []byte) *ChallengePrivateKey {
|
||||
|
||||
key := Scrypt256(input, salt)
|
||||
|
||||
// 2nd return value is the pub key which we don't need right now
|
||||
priv, _ := btcec.PrivKeyFromBytes(btcec.S256(), key)
|
||||
|
||||
return &ChallengePrivateKey{key: priv}
|
||||
}
|
||||
|
||||
// SignSha computes the SHA-256 digest of the given payload and signs it.
|
||||
func (k *ChallengePrivateKey) SignSha(payload []byte) ([]byte, error) {
|
||||
|
||||
hash := sha256.Sum256(payload)
|
||||
sig, err := k.key.Sign(hash[:])
|
||||
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to sign payload: %w", err)
|
||||
}
|
||||
|
||||
return sig.Serialize(), nil
|
||||
}
|
||||
|
||||
func (k *ChallengePrivateKey) PubKeyHex() string {
|
||||
rawKey := k.key.PubKey().SerializeCompressed()
|
||||
return hex.EncodeToString(rawKey)
|
||||
}
|
||||
|
||||
func (k *ChallengePrivateKey) PubKey() *ChallengePublicKey {
|
||||
return &ChallengePublicKey{pubKey: k.key.PubKey()}
|
||||
}
|
||||
|
||||
func (k *ChallengePrivateKey) DecryptRawKey(encryptedKey string, network *Network) (*DecryptedPrivateKey, error) {
|
||||
decoded, err := DecodeEncryptedPrivateKey(encryptedKey)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return k.DecryptKey(decoded, network)
|
||||
}
|
||||
|
||||
func (k *ChallengePrivateKey) DecryptKey(decodedInfo *EncryptedPrivateKeyInfo, network *Network) (*DecryptedPrivateKey, error) {
|
||||
decoded, err := unwrapEncryptedPrivateKey(decodedInfo)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
plaintext, err := decryptWithPrivKey(k.key, decoded.EphPublicKey, decoded.CipherText)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
rawPrivKey := plaintext[0:32]
|
||||
rawChainCode := plaintext[32:]
|
||||
|
||||
privKey, err := NewHDPrivateKeyFromBytes(rawPrivKey, rawChainCode, network)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("decrypting key: failed to parse key: %w", err)
|
||||
}
|
||||
|
||||
return &DecryptedPrivateKey{
|
||||
privKey,
|
||||
int(decoded.Birthday),
|
||||
}, nil
|
||||
}
|
||||
|
||||
func DecodeEncryptedPrivateKey(encodedKey string) (*EncryptedPrivateKeyInfo, error) {
|
||||
reader := bytes.NewReader(base58.Decode(encodedKey))
|
||||
version, err := reader.ReadByte()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("decrypting key: %w", err)
|
||||
}
|
||||
if version != 2 {
|
||||
return nil, fmt.Errorf("decrypting key: found key version %v, expected 2", version)
|
||||
}
|
||||
|
||||
birthdayBytes := make([]byte, 2)
|
||||
rawPubEph := make([]byte, serializedPublicKeyLength)
|
||||
ciphertext := make([]byte, 64)
|
||||
recoveryCodeSalt := make([]byte, 8)
|
||||
|
||||
n, err := reader.Read(birthdayBytes)
|
||||
if err != nil || n != 2 {
|
||||
return nil, errors.New("decrypting key: failed to read birthday")
|
||||
}
|
||||
birthday := binary.BigEndian.Uint16(birthdayBytes)
|
||||
|
||||
n, err = reader.Read(rawPubEph)
|
||||
if err != nil || n != serializedPublicKeyLength {
|
||||
return nil, errors.New("decrypting key: failed to read pubeph")
|
||||
}
|
||||
|
||||
n, err = reader.Read(ciphertext)
|
||||
if err != nil || n != 64 {
|
||||
return nil, errors.New("decrypting key: failed to read ciphertext")
|
||||
}
|
||||
|
||||
// NOTE:
|
||||
// The very, very old format for encrypted keys didn't contain the encryption salt in the first
|
||||
// of the two keys. This is a valid scenario, and a zero-filled salt can be returned.
|
||||
if shouldHaveSalt(encodedKey) {
|
||||
n, err = reader.Read(recoveryCodeSalt)
|
||||
|
||||
if err != nil || n != 8 {
|
||||
return nil, errors.New("decrypting key: failed to read recoveryCodeSalt")
|
||||
}
|
||||
}
|
||||
|
||||
result := &EncryptedPrivateKeyInfo{
|
||||
Version: int(version),
|
||||
Birthday: int(birthday),
|
||||
EphPublicKey: hex.EncodeToString(rawPubEph),
|
||||
CipherText: hex.EncodeToString(ciphertext),
|
||||
Salt: hex.EncodeToString(recoveryCodeSalt),
|
||||
}
|
||||
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func shouldHaveSalt(encodedKey string) bool {
|
||||
return len(encodedKey) > EncodedKeyLengthLegacy // not military-grade logic, but works for now
|
||||
}
|
||||
|
||||
func unwrapEncryptedPrivateKey(info *EncryptedPrivateKeyInfo) (*encryptedPrivateKey, error) {
|
||||
ephPublicKey, err := hex.DecodeString(info.EphPublicKey)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
cipherText, err := hex.DecodeString(info.CipherText)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
salt, err := hex.DecodeString(info.Salt)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
unwrapped := &encryptedPrivateKey{
|
||||
Version: uint8(info.Version),
|
||||
Birthday: uint16(info.Birthday),
|
||||
EphPublicKey: ephPublicKey,
|
||||
CipherText: cipherText,
|
||||
Salt: salt,
|
||||
}
|
||||
|
||||
return unwrapped, nil
|
||||
}
|
||||
65
vendor/github.com/muun/libwallet/challenge_public_key.go
generated
vendored
65
vendor/github.com/muun/libwallet/challenge_public_key.go
generated
vendored
@@ -1,65 +0,0 @@
|
||||
package libwallet
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
|
||||
"github.com/btcsuite/btcd/btcec"
|
||||
"github.com/btcsuite/btcutil/base58"
|
||||
)
|
||||
|
||||
type ChallengePublicKey struct {
|
||||
pubKey *btcec.PublicKey
|
||||
}
|
||||
|
||||
func NewChallengePublicKeyFromSerialized(serializedKey []byte) (*ChallengePublicKey, error) {
|
||||
|
||||
pubKey, err := btcec.ParsePubKey(serializedKey, btcec.S256())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &ChallengePublicKey{pubKey}, nil
|
||||
}
|
||||
|
||||
func (k *ChallengePublicKey) EncryptKey(privKey *HDPrivateKey, recoveryCodeSalt []byte, birthday int) (string, error) {
|
||||
|
||||
const (
|
||||
chainCodeStart = 13
|
||||
chainCodeLength = 32
|
||||
privKeyStart = 46
|
||||
privKeyLength = 32
|
||||
)
|
||||
|
||||
rawHDKey := base58.Decode(privKey.String())
|
||||
plaintext := make([]byte, 0)
|
||||
plaintext = append(plaintext, rawHDKey[privKeyStart:privKeyStart+privKeyLength]...)
|
||||
plaintext = append(plaintext, rawHDKey[chainCodeStart:chainCodeStart+chainCodeLength]...)
|
||||
if len(plaintext) != 64 {
|
||||
return "", fmt.Errorf("failed to encrypt key: expected payload of 64 bytes, found %v", len(plaintext))
|
||||
}
|
||||
|
||||
pubEph, ciphertext, err := encryptWithPubKey(k.pubKey, plaintext)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
birthdayBytes := make([]byte, 2)
|
||||
binary.BigEndian.PutUint16(birthdayBytes, uint16(birthday))
|
||||
|
||||
if len(recoveryCodeSalt) == 0 {
|
||||
// Fill the salt with zeros to maintain the encrypted keys format
|
||||
recoveryCodeSalt = make([]byte, 8)
|
||||
}
|
||||
|
||||
result := make([]byte, 0, 1+2+serializedPublicKeyLength+len(ciphertext)+len(recoveryCodeSalt))
|
||||
buf := bytes.NewBuffer(result)
|
||||
buf.WriteByte(2)
|
||||
buf.Write(birthdayBytes)
|
||||
buf.Write(pubEph.SerializeCompressed())
|
||||
buf.Write(ciphertext)
|
||||
buf.Write(recoveryCodeSalt)
|
||||
|
||||
return base58.Encode(buf.Bytes()), nil
|
||||
}
|
||||
150
vendor/github.com/muun/libwallet/emergency_kit.go
generated
vendored
150
vendor/github.com/muun/libwallet/emergency_kit.go
generated
vendored
@@ -1,150 +0,0 @@
|
||||
package libwallet
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
"github.com/muun/libwallet/emergencykit"
|
||||
)
|
||||
|
||||
const (
|
||||
EKVersionNeverExported = -1
|
||||
// EKVersionOnlyKeys is the encrypted keys to be written down / emailed
|
||||
EKVersionOnlyKeys = 1
|
||||
// EKVersionDescriptors is the first PDF including the descriptors
|
||||
EKVersionDescriptors = 2
|
||||
// EKVersionMusig add the musig descriptors
|
||||
EKVersionMusig = 3
|
||||
ekVersionCurrent = EKVersionMusig
|
||||
)
|
||||
|
||||
// EKInput input struct to fill the PDF
|
||||
type EKInput struct {
|
||||
FirstEncryptedKey string
|
||||
FirstFingerprint string
|
||||
SecondEncryptedKey string
|
||||
SecondFingerprint string
|
||||
}
|
||||
|
||||
// EKOutput with the html as string and the verification code
|
||||
type EKOutput struct {
|
||||
HTML string
|
||||
VerificationCode string
|
||||
Metadata string
|
||||
Version int
|
||||
}
|
||||
|
||||
// GenerateEmergencyKitHTML returns the translated html as a string along with the verification
|
||||
// code and the kit metadata, represented in an opaque string.
|
||||
// After calling this method, clients should use their Chromium/WebKit implementations to render
|
||||
// the HTML into a PDF (better done there), and then come back to call `AddEmergencyKitMetadata`
|
||||
// and produce the final PDF (better done here).
|
||||
func GenerateEmergencyKitHTML(ekParams *EKInput, language string) (*EKOutput, error) {
|
||||
moduleInput := &emergencykit.Input{
|
||||
FirstEncryptedKey: ekParams.FirstEncryptedKey,
|
||||
FirstFingerprint: ekParams.FirstFingerprint,
|
||||
SecondEncryptedKey: ekParams.SecondEncryptedKey,
|
||||
SecondFingerprint: ekParams.SecondFingerprint,
|
||||
Version: ekVersionCurrent,
|
||||
}
|
||||
|
||||
// Create the HTML and the verification code:
|
||||
htmlWithCode, err := emergencykit.GenerateHTML(moduleInput, language)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("GenerateEkHtml failed to render: %w", err)
|
||||
}
|
||||
|
||||
// Create and serialize the metadata:
|
||||
metadata, err := createEmergencyKitMetadata(ekParams)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("GenerateEkHtml failed to create metadata: %w", err)
|
||||
}
|
||||
|
||||
metadataBytes, err := json.Marshal(&metadata)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("GenerateEkHtml failed to marshal %s: %w", string(metadataBytes), err)
|
||||
}
|
||||
|
||||
output := &EKOutput{
|
||||
HTML: htmlWithCode.HTML,
|
||||
VerificationCode: htmlWithCode.VerificationCode,
|
||||
Metadata: string(metadataBytes),
|
||||
Version: moduleInput.Version,
|
||||
}
|
||||
|
||||
return output, nil
|
||||
}
|
||||
|
||||
// AddEmergencyKitMetadata produces a copy of the PDF file at `srcFile` with embedded metadata,
|
||||
// writing it into `dstFile`. The provided metadata must be the same opaque string produced by
|
||||
// `GenerateEmergencyKitHTML`.
|
||||
func AddEmergencyKitMetadata(metadataText string, srcFile string, dstFile string) error {
|
||||
// Initialize the MetadataWriter:
|
||||
metadataWriter := &emergencykit.MetadataWriter{
|
||||
SrcFile: srcFile,
|
||||
DstFile: dstFile,
|
||||
}
|
||||
|
||||
// Deserialize the metadata:
|
||||
var metadata emergencykit.Metadata
|
||||
|
||||
err := json.Unmarshal([]byte(metadataText), &metadata)
|
||||
if err != nil {
|
||||
return fmt.Errorf("AddEkMetadata failed to unmarshal: %w", err)
|
||||
}
|
||||
|
||||
err = metadataWriter.WriteMetadata(&metadata)
|
||||
if err != nil {
|
||||
return fmt.Errorf("AddEkMetadata failed to write metadata: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func createEmergencyKitMetadata(ekParams *EKInput) (*emergencykit.Metadata, error) {
|
||||
// NOTE:
|
||||
// This method would be more naturally placed in the `emergencykit` module, but given the current
|
||||
// project structure (heavily determined by `gomobile` and the need for top-level bindings) and
|
||||
// the use of `decodeEncryptedPrivateKey` this isn't possible. Instead, we peek through the layer
|
||||
// boundary to craft the object here.
|
||||
|
||||
// Decode both keys, to extract their inner properties:
|
||||
firstKey, err := DecodeEncryptedPrivateKey(ekParams.FirstEncryptedKey)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("createEkMetadata failed to decode first key: %w", err)
|
||||
}
|
||||
|
||||
secondKey, err := DecodeEncryptedPrivateKey(ekParams.SecondEncryptedKey)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("createEkMetadata failed to decode second key: %w", err)
|
||||
}
|
||||
|
||||
// Obtain the list of checksumed output descriptors:
|
||||
descriptors := emergencykit.GetDescriptors(&emergencykit.DescriptorsData{
|
||||
FirstFingerprint: ekParams.FirstFingerprint,
|
||||
SecondFingerprint: ekParams.SecondFingerprint,
|
||||
})
|
||||
|
||||
// Create the keys for the key array:
|
||||
keys := []*emergencykit.MetadataKey{
|
||||
createEmergencyKitMetadataKey(firstKey),
|
||||
createEmergencyKitMetadataKey(secondKey),
|
||||
}
|
||||
|
||||
metadata := &emergencykit.Metadata{
|
||||
Version: ekVersionCurrent,
|
||||
BirthdayBlock: secondKey.Birthday,
|
||||
EncryptedKeys: keys,
|
||||
OutputDescriptors: descriptors,
|
||||
}
|
||||
|
||||
return metadata, nil
|
||||
}
|
||||
|
||||
func createEmergencyKitMetadataKey(key *EncryptedPrivateKeyInfo) *emergencykit.MetadataKey {
|
||||
return &emergencykit.MetadataKey{
|
||||
DhPubKey: key.EphPublicKey,
|
||||
EncryptedPrivKey: key.CipherText,
|
||||
Salt: key.Salt,
|
||||
}
|
||||
}
|
||||
357
vendor/github.com/muun/libwallet/emergencykit/content.go
generated
vendored
357
vendor/github.com/muun/libwallet/emergencykit/content.go
generated
vendored
@@ -1,357 +0,0 @@
|
||||
package emergencykit
|
||||
|
||||
type pageData struct {
|
||||
Css string
|
||||
Content string
|
||||
}
|
||||
|
||||
type contentData struct {
|
||||
FirstEncryptedKey string
|
||||
SecondEncryptedKey string
|
||||
VerificationCode string
|
||||
CurrentDate string
|
||||
Descriptors string
|
||||
IconHelp string
|
||||
IconPadlock string
|
||||
}
|
||||
|
||||
const page = `
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Emergency Kit</title>
|
||||
|
||||
<style>
|
||||
{{.Css}}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
{{.Content}}
|
||||
</body>
|
||||
</html>
|
||||
`
|
||||
|
||||
const contentEN = `
|
||||
<header>
|
||||
<h1>Emergency Kit</h1>
|
||||
<h2>Verification <span class="verification-code">#{{.VerificationCode}}</span></p>
|
||||
</header>
|
||||
|
||||
<div class="backup">
|
||||
<div class="intro">
|
||||
{{.IconPadlock}}
|
||||
<div class="text">
|
||||
<h1>Encrypted backup</h1>
|
||||
<h2>It can only be decrypted using your <strong>Recovery Code</strong>.</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="keys">
|
||||
|
||||
<div class="key">
|
||||
<h3>First key</h3>
|
||||
<p>{{.FirstEncryptedKey}}</p>
|
||||
</div>
|
||||
|
||||
<div class="key">
|
||||
<h3>Second key</h3>
|
||||
<p>{{.SecondEncryptedKey}}</p>
|
||||
</div>
|
||||
|
||||
<div class="date">
|
||||
Created on <date>{{.CurrentDate}}</date>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<section class="instructions">
|
||||
<h1>Instructions</h1>
|
||||
<p>This emergency procedure will help you recover your funds if you are unable to use Muun on your phone.</p>
|
||||
|
||||
<div class="item">
|
||||
<div class="number-box">
|
||||
<div class="number">1</div>
|
||||
</div>
|
||||
<div class="text-box">
|
||||
<h3>Find your Recovery Code</h3>
|
||||
<p>You wrote this code on paper before creating your Emergency Kit. You’ll need it later.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item">
|
||||
<div class="number-box">
|
||||
<div class="number">2</div>
|
||||
</div>
|
||||
<div class="text-box">
|
||||
<h3>Download the Recovery Tool</h3>
|
||||
<p>Go to <a href="https://github.com/muun/recovery">github.com/muun/recovery</a> and download the tool on your computer.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item">
|
||||
<div class="number-box">
|
||||
<div class="number">3</div>
|
||||
</div>
|
||||
<div class="text-box">
|
||||
<h3>Recover your funds</h3>
|
||||
<p>Run the Recovery Tool and follow the steps. It will safely transfer your funds to a Bitcoin address that you
|
||||
choose.</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="help">
|
||||
{{.IconHelp}}
|
||||
<div class="text-box">
|
||||
<h3>Need help?</h3>
|
||||
<p>
|
||||
Contact us at <a href="mailto:support@muun.com">support@muun.com</a>. We’re always there to help.
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="advanced page-break-before">
|
||||
<h1>Advanced information</h1>
|
||||
|
||||
<h2>Output descriptors</h2>
|
||||
<p>These descriptors, combined with your keys, specify how to locate your wallet’s funds on the Bitcoin blockchain.</p>
|
||||
|
||||
{{ if .Descriptors }}
|
||||
{{.Descriptors}}
|
||||
{{ else }}
|
||||
<ul class="descriptors">
|
||||
<!-- These lines are way too long, but dividing them introduces unwanted spaces -->
|
||||
<li><span class="f">sh</span>(<span class="f">wsh</span>(<span class="f">multi</span>(2, <span class="fp">first key</span>/1'/1'/0/*, <span class="fp">second key</span>/1'/1'/0/*)))</li>
|
||||
<li><span class="f">sh</span>(<span class="f">wsh</span>(<span class="f">multi</span>(2, <span class="fp">first key</span>/1'/1'/1/*, <span class="fp">second key</span>/1'/1'/1/*)))</li>
|
||||
<li><span class="f">sh</span>(<span class="f">wsh</span>(<span class="f">multi</span>(2, <span class="fp">first key</span>/1'/1'/2/*/*, <span class="fp">second key</span>/1'/1'/2/*/*)))</li>
|
||||
<li><span class="f">wsh</span>(<span class="f">multi</span>(2, <span class="fp">first key</span>/1'/1'/0/*, <span class="fp">second key</span>/1'/1'/0/*))</li>
|
||||
<li><span class="f">wsh</span>(<span class="f">multi</span>(2, <span class="fp">first key</span>/1'/1'/1/*, <span class="fp">second key</span>/1'/1'/1/*))</li>
|
||||
<li><span class="f">wsh</span>(<span class="f">multi</span>(2, <span class="fp">first key</span>/1'/1'/2]/*/*, <span class="fp">second key</span>/1'/1'/2/*/*))</li>
|
||||
</ul>
|
||||
{{ end }}
|
||||
|
||||
<p>
|
||||
Output descriptors are part of a developing standard for Recovery that Muun intends to support and is helping grow.
|
||||
Since the standard is in a very early stage, the list above includes some non-standard elements.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
When descriptors reach a more mature stage, you’ll be able to take your funds from one wallet to another with
|
||||
complete independence. Muun believes this freedom is at the core of Bitcoin’s promise, and is working towards
|
||||
that goal.
|
||||
</p>
|
||||
</section>
|
||||
`
|
||||
|
||||
const contentES = `
|
||||
<header>
|
||||
<h1>Kit de Emergencia</h1>
|
||||
<h2>Verificación <span class="verification-code">#{{.VerificationCode}}</span></p>
|
||||
</header>
|
||||
|
||||
<div class="backup">
|
||||
<div class="intro">
|
||||
{{.IconPadlock}}
|
||||
<div class="text">
|
||||
<h1>Respaldo encriptado</h1>
|
||||
<h2>Sólo puede ser desencriptado con tu <strong>Código de Recuperación</strong>.</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="keys">
|
||||
|
||||
<div class="key">
|
||||
<h3>Primera clave</h3>
|
||||
<p>{{.FirstEncryptedKey}}</p>
|
||||
</div>
|
||||
|
||||
<div class="key">
|
||||
<h3>Segunda clave</h3>
|
||||
<p>{{.SecondEncryptedKey}}</p>
|
||||
</div>
|
||||
|
||||
<div class="date">
|
||||
Creado el <date>{{.CurrentDate}}</date>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<section class="instructions">
|
||||
<h1>Instrucciones</h1>
|
||||
<p>Éste procedimiento de emergencia te ayudará a recuperar tus fondos si no puedes usar Muun en tu teléfono.</p>
|
||||
|
||||
<div class="item">
|
||||
<div class="number-box">
|
||||
<div class="number">1</div>
|
||||
</div>
|
||||
<div class="text-box">
|
||||
<h3>Encuentra tu Código de Recuperación</h3>
|
||||
<p>Lo escribiste en papel antes de crear tu Kit de Emergencia. Lo necesitarás después.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item">
|
||||
<div class="number-box">
|
||||
<div class="number">2</div>
|
||||
</div>
|
||||
<div class="text-box">
|
||||
<h3>Descarga la Herramienta de Recuperación</h3>
|
||||
<p>Ingresa en <a href="github.com/muun/recovery">github.com/muun/recovery</a> y descarga la herramienta en tu computadora..</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item">
|
||||
<div class="number-box">
|
||||
<div class="number">3</div>
|
||||
</div>
|
||||
<div class="text-box">
|
||||
<h3>Recupera tus fondos</h3>
|
||||
<p>Ejecuta la Herramienta de Recuperación y sigue los pasos. Transferirá tus fondos a una dirección de Bitcoin que elijas.</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="help">
|
||||
{{.IconHelp}}
|
||||
<div class="text-box">
|
||||
<h3>¿Necesitas ayuda?</h3>
|
||||
<p>
|
||||
Contáctanos en <a href="mailto:support@muun.com">support@muun.com</a>. Siempre estamos disponibles para ayudar.
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="advanced page-break-before">
|
||||
<h1>Información Avanzada</h1>
|
||||
|
||||
<h2>Output descriptors</h2>
|
||||
<p>Estos descriptors, combinados con tus claves, indican cómo encontrar los fondos de tu billetera en la blockchain de Bitcoin.</p>
|
||||
|
||||
{{ if .Descriptors }}
|
||||
{{.Descriptors}}
|
||||
{{ else }}
|
||||
<ul class="descriptors">
|
||||
<!-- These lines are way too long, but dividing them introduces unwanted spaces -->
|
||||
<li><span class="f">sh</span>(<span class="f">wsh</span>(<span class="f">multi</span>(2, <span class="fp">primera clave</span>/1'/1'/0/*, <span class="fp">segunda clave</span>/1'/1'/0/*)))</li>
|
||||
<li><span class="f">sh</span>(<span class="f">wsh</span>(<span class="f">multi</span>(2, <span class="fp">primera clave</span>/1'/1'/1/*, <span class="fp">segunda clave</span>/1'/1'/1/*)))</li>
|
||||
<li><span class="f">sh</span>(<span class="f">wsh</span>(<span class="f">multi</span>(2, <span class="fp">primera clave</span>/1'/1'/2/*/*, <span class="fp">segunda clave</span>/1'/1'/2/*/*)))</li>
|
||||
<li><span class="f">wsh</span>(<span class="f">multi</span>(2, <span class="fp">primera clave</span>/1'/1'/0/*, <span class="fp">segunda clave</span>/1'/1'/0/*))</li>
|
||||
<li><span class="f">wsh</span>(<span class="f">multi</span>(2, <span class="fp">primera clave</span>/1'/1'/1/*, <span class="fp">segunda clave</span>/1'/1'/1/*))</li>
|
||||
<li><span class="f">wsh</span>(<span class="f">multi</span>(2, <span class="fp">primera clave</span>/1'/1'/2]/*/*, <span class="fp">segunda clave</span>/1'/1'/2/*/*))</li>
|
||||
</ul>
|
||||
{{ end }}
|
||||
|
||||
<p>
|
||||
Los output descriptors son parte de un estándar de recuperación actualmente en desarrollo. Muun tiene la intención
|
||||
de soportar este estándar y apoyar su crecimiento. Dado que se encuentra en una etapa muy temprana, la siguiente lista
|
||||
incluye algunos elementos que aún no están estandarizados.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Cuando los descriptors lleguen a una etapa más madura, podrás llevar tus fondos de una billetera a la otra con completa
|
||||
independencia. Muun cree que ésta libertad es central a la promesa de Bitcoin, y está trabajando para que eso suceda.
|
||||
</p>
|
||||
</section>
|
||||
`
|
||||
|
||||
const iconHelp = `
|
||||
<svg width="72" height="72" viewBox="0 0 72 72" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0)">
|
||||
<g filter="url(#filter0_d)">
|
||||
<circle cx="36" cy="36" r="28" fill="white"/>
|
||||
</g>
|
||||
<path d="M51.9762 41.7833L51.9999 28.1164C52.005 27.3149 51.8507 26.5203 51.5461 25.7789C51.2414 25.0374 50.7924 24.3638 50.2252 23.7972C49.6572 23.2232 48.9802 22.7686 48.2338 22.4599C47.4874 22.1513 46.6869 21.995 45.8791 22.0001H26.1208C24.4981 22.0022 22.9424 22.6473 21.795 23.7938C20.6476 24.9404 20.0021 26.4949 20 28.1164V41.2789C20.0021 42.9004 20.6476 44.4548 21.795 45.6014C22.9424 46.748 24.4981 47.393 26.1208 47.3951H26.5625V51.1547C26.5578 51.7232 26.7257 52.2798 27.0439 52.7512C27.3621 53.2225 27.8158 53.5865 28.3451 53.7951C28.6816 53.9281 29.04 53.9976 29.402 54C29.7741 53.9998 30.1425 53.9251 30.4852 53.7803C30.828 53.6354 31.1382 53.4234 31.3975 53.1567L36.6901 47.3951L48.1895 46.2128L51.9762 41.7833ZM35.8698 45.3774L29.7175 51.4778C29.6594 51.5449 29.5815 51.5917 29.495 51.6116C29.4085 51.6314 29.3179 51.6232 29.2363 51.5882C29.1493 51.5551 29.075 51.4953 29.024 51.4175C28.973 51.3396 28.948 51.2476 28.9524 51.1547V46.2128C28.9524 45.8993 28.8277 45.5986 28.6059 45.3769C28.384 45.1551 28.083 45.0306 27.7693 45.0306H26.1208C25.125 45.0306 24.17 44.6353 23.4659 43.9317C22.7618 43.2281 22.3663 42.2739 22.3663 41.2789V28.1164C22.3663 27.1213 22.7618 26.1671 23.4659 25.4635C24.17 24.7599 25.125 24.3646 26.1208 24.3646H45.8791C46.372 24.3641 46.86 24.4614 47.315 24.6508C47.7699 24.8402 48.1827 25.118 48.5293 25.4681C48.8797 25.8145 49.1577 26.227 49.3472 26.6816C49.5368 27.1362 49.6341 27.6239 49.6336 28.1164V41.2789C49.6336 42.2739 49.238 43.2281 48.5339 43.9317C47.8298 44.6353 46.8749 45.0306 45.8791 45.0306H36.6901C36.3764 45.0309 36.0757 45.1556 35.854 45.3774H35.8698ZM36.6901 47.3951H45.8791C47.4141 47.3926 48.8922 46.8146 50.0211 45.7755C51.1501 44.7364 51.8478 43.3117 51.9762 41.7833L48.1895 46.2128L36.6901 47.3951Z" fill="#2474CD"/>
|
||||
<path d="M34.708 37.1242C34.612 37.1242 34.528 37.0942 34.456 37.034C34.384 36.9619 34.348 36.8777 34.348 36.7815V36.3666C34.432 35.8615 34.618 35.4105 34.906 35.0136C35.206 34.6168 35.614 34.1658 36.13 33.6607C36.514 33.2758 36.802 32.9631 36.994 32.7226C37.186 32.4701 37.288 32.2175 37.3 31.965C37.336 31.5922 37.21 31.2975 36.922 31.081C36.646 30.8525 36.31 30.7383 35.914 30.7383C34.978 30.7383 34.402 31.1893 34.186 32.0912C34.09 32.3799 33.904 32.5242 33.628 32.5242H31.432C31.3 32.5242 31.192 32.4821 31.108 32.3979C31.036 32.3017 31 32.1814 31 32.0371C31.024 31.3757 31.234 30.7503 31.63 30.161C32.026 29.5597 32.608 29.0727 33.376 28.6998C34.144 28.327 35.062 28.1406 36.13 28.1406C37.222 28.1406 38.11 28.315 38.794 28.6638C39.478 29.0005 39.964 29.4214 40.252 29.9265C40.552 30.4196 40.702 30.9247 40.702 31.4418C40.702 32.0311 40.564 32.5482 40.288 32.9932C40.024 33.4382 39.628 33.9493 39.1 34.5266C38.776 34.8753 38.518 35.17 38.326 35.4105C38.146 35.651 38.008 35.9036 37.912 36.1681C37.876 36.2764 37.834 36.4387 37.786 36.6552C37.69 36.8236 37.606 36.9438 37.534 37.016C37.462 37.0881 37.36 37.1242 37.228 37.1242H34.708ZM34.744 40.9486C34.612 40.9486 34.504 40.9065 34.42 40.8223C34.336 40.7381 34.294 40.6299 34.294 40.4976V38.4411C34.294 38.3088 34.336 38.2006 34.42 38.1164C34.504 38.0322 34.612 37.9901 34.744 37.9901H37.048C37.18 37.9901 37.288 38.0322 37.372 38.1164C37.468 38.2006 37.516 38.3088 37.516 38.4411V40.4976C37.516 40.6299 37.468 40.7381 37.372 40.8223C37.288 40.9065 37.18 40.9486 37.048 40.9486H34.744Z" fill="#182449"/>
|
||||
</g>
|
||||
<defs>
|
||||
<filter id="filter0_d" x="0" y="4" width="72" height="72" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"/>
|
||||
<feOffset dy="4"/>
|
||||
<feGaussianBlur stdDeviation="4"/>
|
||||
<feColorMatrix type="matrix" values="0 0 0 0 0.124943 0 0 0 0 0.228158 0 0 0 0 0.346117 0 0 0 0.05 0"/>
|
||||
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow"/>
|
||||
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow" result="shape"/>
|
||||
</filter>
|
||||
<clipPath id="clip0">
|
||||
<rect width="72" height="72" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
`
|
||||
|
||||
const iconPadlock = `
|
||||
<svg width="72" height="72" viewBox="0 0 72 72" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0)">
|
||||
<g filter="url(#filter0_dd)">
|
||||
<g filter="url(#filter1_i)">
|
||||
<path d="M48.7367 30.2734H23.2633C21.461 30.2734 20 31.7345 20 33.5367V53.192C20 54.9942 21.461 56.4553 23.2633 56.4553H48.7367C50.539 56.4553 52 54.9942 52 53.192V33.5367C52 31.7345 50.539 30.2734 48.7367 30.2734Z" fill="url(#paint0_linear)"/>
|
||||
</g>
|
||||
<path d="M38.9119 41.1786C38.9119 42.7853 37.6095 44.0877 36.0028 44.0877C34.3962 44.0877 33.0938 42.7853 33.0938 41.1786C33.0938 39.572 34.3962 38.2695 36.0028 38.2695C37.6095 38.2695 38.9119 39.572 38.9119 41.1786Z" fill="url(#paint1_radial)"/>
|
||||
<path d="M34.4106 43.9113C34.4915 43.5876 34.7824 43.3604 35.1161 43.3604H36.8895C37.2233 43.3604 37.5142 43.5876 37.5951 43.9113L38.686 48.275C38.8008 48.734 38.4536 49.1786 37.9805 49.1786H34.0252C33.5521 49.1786 33.2049 48.734 33.3197 48.275L34.4106 43.9113Z" fill="url(#paint2_radial)"/>
|
||||
<g filter="url(#filter2_i)">
|
||||
<path d="M25.0906 24.8182V30.2727H29.0906V24.8182C29.0906 22.8788 30.4724 19 35.9997 19C41.5269 19 42.9088 22.8788 42.9088 24.8182V30.2727H46.9088V24.8182C46.9088 21.5455 44.7269 15 35.9997 15C27.2724 15 25.0906 21.5455 25.0906 24.8182Z" fill="#2573F7"/>
|
||||
<path d="M25.0906 24.8182V30.2727H29.0906V24.8182C29.0906 22.8788 30.4724 19 35.9997 19C41.5269 19 42.9088 22.8788 42.9088 24.8182V30.2727H46.9088V24.8182C46.9088 21.5455 44.7269 15 35.9997 15C27.2724 15 25.0906 21.5455 25.0906 24.8182Z" fill="url(#paint3_linear)"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<defs>
|
||||
<filter id="filter0_dd" x="7.99957" y="8.99978" width="56.0009" height="65.4561" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"/>
|
||||
<feOffset dy="6.00022"/>
|
||||
<feGaussianBlur stdDeviation="6.00022"/>
|
||||
<feColorMatrix type="matrix" values="0 0 0 0 0.340702 0 0 0 0 0.386926 0 0 0 0 0.529451 0 0 0 0.3 0"/>
|
||||
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow"/>
|
||||
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"/>
|
||||
<feOffset dy="1.50005"/>
|
||||
<feGaussianBlur stdDeviation="1.50005"/>
|
||||
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.12 0"/>
|
||||
<feBlend mode="normal" in2="effect1_dropShadow" result="effect2_dropShadow"/>
|
||||
<feBlend mode="normal" in="SourceGraphic" in2="effect2_dropShadow" result="shape"/>
|
||||
</filter>
|
||||
<filter id="filter1_i" x="19.5921" y="29.4576" width="32.4079" height="26.9976" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
|
||||
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
||||
<feOffset dx="-0.40791" dy="-0.815819"/>
|
||||
<feGaussianBlur stdDeviation="0.815819"/>
|
||||
<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>
|
||||
<feColorMatrix type="matrix" values="0 0 0 0 0.25098 0 0 0 0 0.380392 0 0 0 0 0.552941 0 0 0 1 0"/>
|
||||
<feBlend mode="normal" in2="shape" result="effect1_innerShadow"/>
|
||||
</filter>
|
||||
<filter id="filter2_i" x="24.7156" y="14.625" width="22.1932" height="15.6477" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
|
||||
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
||||
<feOffset dx="-0.375014" dy="-0.375014"/>
|
||||
<feGaussianBlur stdDeviation="0.375014"/>
|
||||
<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>
|
||||
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.12 0"/>
|
||||
<feBlend mode="normal" in2="shape" result="effect1_innerShadow"/>
|
||||
</filter>
|
||||
<linearGradient id="paint0_linear" x1="25.8754" y1="40.3205" x2="64.6733" y2="80.0278" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#91ACC9"/>
|
||||
<stop offset="0.561326" stop-color="#3D5F8C"/>
|
||||
</linearGradient>
|
||||
<radialGradient id="paint1_radial" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(36.0028 43.7241) rotate(90) scale(5.45455 2.90909)">
|
||||
<stop stop-color="#0B141D"/>
|
||||
<stop offset="1" stop-color="#27394D"/>
|
||||
</radialGradient>
|
||||
<radialGradient id="paint2_radial" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(36.0028 43.7241) rotate(90) scale(5.45455 2.90909)">
|
||||
<stop stop-color="#0B141D"/>
|
||||
<stop offset="1" stop-color="#27394D"/>
|
||||
</radialGradient>
|
||||
<linearGradient id="paint3_linear" x1="35.9997" y1="26.0114" x2="35.9997" y2="34.4318" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#435F7D"/>
|
||||
<stop offset="1" stop-color="#213953"/>
|
||||
</linearGradient>
|
||||
<clipPath id="clip0">
|
||||
<rect width="72" height="72" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
`
|
||||
229
vendor/github.com/muun/libwallet/emergencykit/css.go
generated
vendored
229
vendor/github.com/muun/libwallet/emergencykit/css.go
generated
vendored
@@ -1,229 +0,0 @@
|
||||
package emergencykit
|
||||
|
||||
// NOTE:
|
||||
// To view this file comfortably, disable line-wrapping in your editor.
|
||||
|
||||
const css = `
|
||||
@page {
|
||||
size: auto;
|
||||
margin: 0mm; /* remove margin in printer settings */
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
margin-block-start: 0;
|
||||
margin-block-end: 0;
|
||||
|
||||
font-family: -apple-system, Roboto;
|
||||
}
|
||||
|
||||
body {
|
||||
width: 480px;
|
||||
}
|
||||
|
||||
strong {
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 20px 16px;
|
||||
background-color: #F7FBFF;
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin: 0;
|
||||
font-family: -apple-system, Roboto;
|
||||
font-weight: 500;
|
||||
font-size: 24px;
|
||||
line-height: 30px;
|
||||
color: #182449;
|
||||
}
|
||||
|
||||
h2 {
|
||||
color: #182449;
|
||||
}
|
||||
|
||||
h3 {
|
||||
color: #182449;
|
||||
}
|
||||
|
||||
header h2 {
|
||||
margin: 3px 0 0 0;
|
||||
font-family: Menlo, Roboto Mono;
|
||||
font-weight: 500;
|
||||
font-size: 18px;
|
||||
line-height: 27px;
|
||||
color: #576580;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #337cd0;
|
||||
}
|
||||
|
||||
.backup {
|
||||
margin: 24px 16px 0 16px;
|
||||
background-color: #DFECFB;
|
||||
}
|
||||
|
||||
.backup .intro {
|
||||
display: flex;
|
||||
padding: 16px 16px 16px 0;
|
||||
}
|
||||
|
||||
.backup h1 {
|
||||
margin-top: 16px;
|
||||
margin-bottom: 8px;
|
||||
font-weight: 500;
|
||||
font-size: 32px;
|
||||
line-height: 32px;
|
||||
line-height: 32px;
|
||||
}
|
||||
|
||||
.backup h2 {
|
||||
font-size: 15px;
|
||||
font-weight: 400;
|
||||
font-size: 15px;
|
||||
line-height: 24px;
|
||||
color: #57656F;
|
||||
}
|
||||
|
||||
.backup h2 strong {
|
||||
color: #182449;
|
||||
}
|
||||
|
||||
.backup h3 {
|
||||
margin-bottom: 8px;
|
||||
font-weight: 500;
|
||||
font-size: 18px;
|
||||
line-height: 24px;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
}
|
||||
|
||||
.backup svg {
|
||||
margin: 8px 4px 0;
|
||||
}
|
||||
|
||||
.backup .key {
|
||||
padding: 32px 16px 24px 16px;
|
||||
margin: 0 4px 4px 4px;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.backup .key p {
|
||||
font-family: Menlo, Roboto Mono;
|
||||
font-weight: 400;
|
||||
font-size: 13px;
|
||||
word-wrap: break-word;
|
||||
line-height: 24px;
|
||||
color: #57656F;
|
||||
}
|
||||
|
||||
.backup .date {
|
||||
padding: 12px 0;
|
||||
font-size: 13px;
|
||||
line-height: 24px;
|
||||
text-align: center;
|
||||
letter-spacing: 0.05em;
|
||||
text-transform: uppercase;
|
||||
color: #57656F;
|
||||
}
|
||||
|
||||
.backup .date date {
|
||||
font-weight: 500;
|
||||
color: #182449;
|
||||
}
|
||||
|
||||
section {
|
||||
margin-top: 40px;
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
section h2 {
|
||||
margin-top: 24px;
|
||||
font-weight: 500;
|
||||
font-size: 20px;
|
||||
line-height: 32px;
|
||||
}
|
||||
|
||||
section h3 {
|
||||
font-weight: 500;
|
||||
font-size: 20px;
|
||||
line-height: 32px;
|
||||
color: #182449;
|
||||
}
|
||||
|
||||
section p {
|
||||
margin-top: 8px;
|
||||
font-weight: normal;
|
||||
font-size: 16px;
|
||||
line-height: 24px;
|
||||
color: #576580;
|
||||
}
|
||||
|
||||
.instructions .item {
|
||||
display: flex;
|
||||
margin-top: 32px;
|
||||
}
|
||||
|
||||
.instructions .item .number-box {
|
||||
margin-right: 16px;
|
||||
padding-top: 6px;
|
||||
}
|
||||
|
||||
.instructions .item .number {
|
||||
width: 20px;
|
||||
border-radius: 50%;
|
||||
text-align: center;
|
||||
font-weight: 500;
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
background: #2474CD;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.help {
|
||||
display: flex;
|
||||
padding: 32px 16px 32px 0;
|
||||
background: #F6F9FF;
|
||||
}
|
||||
|
||||
.help svg {
|
||||
margin: 0 8px;
|
||||
}
|
||||
|
||||
.descriptors {
|
||||
margin: 16px 0;
|
||||
padding: 16px;
|
||||
font-family: Menlo, Roboto Mono;
|
||||
font-weight: 500;
|
||||
font-size: 9px;
|
||||
line-height: 240%;
|
||||
letter-spacing: 1px;
|
||||
list-style-type: none;
|
||||
background: #F6F9FF;
|
||||
color: #576580;
|
||||
}
|
||||
|
||||
.descriptors .f {
|
||||
color: #447BEF;
|
||||
}
|
||||
|
||||
.descriptors .fp {
|
||||
color: #d74a41;
|
||||
}
|
||||
|
||||
.descriptors .checksum {
|
||||
color: #a42fa2;
|
||||
}
|
||||
|
||||
@media print {
|
||||
.page-break-before { page-break-before: always; }
|
||||
}
|
||||
`
|
||||
175
vendor/github.com/muun/libwallet/emergencykit/descriptors.go
generated
vendored
175
vendor/github.com/muun/libwallet/emergencykit/descriptors.go
generated
vendored
@@ -1,175 +0,0 @@
|
||||
package emergencykit
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type DescriptorsData struct {
|
||||
FirstFingerprint string
|
||||
SecondFingerprint string
|
||||
}
|
||||
|
||||
// Output descriptors shown in the PDF do not include legacy descriptors no longer in use. We leave
|
||||
// the decision of whether to scan them to the Recovery Tool.
|
||||
var descriptorFormats = []string{
|
||||
"sh(wsh(multi(2, %s/1'/1'/0/*, %s/1'/1'/0/*)))", // V3 change
|
||||
"sh(wsh(multi(2, %s/1'/1'/1/*, %s/1'/1'/1/*)))", // V3 external
|
||||
"wsh(multi(2, %s/1'/1'/0/*, %s/1'/1'/0/*))", // V4 change
|
||||
"wsh(multi(2, %s/1'/1'/1/*, %s/1'/1'/1/*))", // V4 external
|
||||
"tr(musig(%s/1'/1'/0/*, %s/1'/1'/0/*))", // V5 change
|
||||
"tr(musig(%s/1'/1'/1/*, %s/1'/1'/1/*))", // V5 external
|
||||
}
|
||||
|
||||
// GetDescriptors returns an array of raw output descriptors.
|
||||
func GetDescriptors(data *DescriptorsData) []string {
|
||||
var descriptors []string
|
||||
|
||||
for _, descriptorFormat := range descriptorFormats {
|
||||
descriptor := fmt.Sprintf(descriptorFormat, data.FirstFingerprint, data.SecondFingerprint)
|
||||
checksum := calculateChecksum(descriptor)
|
||||
|
||||
descriptors = append(descriptors, descriptor+"#"+checksum)
|
||||
}
|
||||
|
||||
return descriptors
|
||||
}
|
||||
|
||||
// GetDescriptorsHTML returns the HTML for the output descriptor list in the Emergency Kit.
|
||||
func GetDescriptorsHTML(data *DescriptorsData) string {
|
||||
descriptors := GetDescriptors(data)
|
||||
|
||||
var itemsHTML []string
|
||||
|
||||
for _, descriptor := range descriptors {
|
||||
descriptor, checksum := splitChecksum(descriptor)
|
||||
|
||||
html := descriptor
|
||||
|
||||
// Replace script type expressions (parenthesis in match prevent replacing the "sh" in "wsh")
|
||||
html = strings.ReplaceAll(html, "wsh(", renderScriptType("wsh")+"(")
|
||||
html = strings.ReplaceAll(html, "sh(", renderScriptType("sh")+"(")
|
||||
html = strings.ReplaceAll(html, "multi(", renderScriptType("multi")+"(")
|
||||
html = strings.ReplaceAll(html, "tr(", renderScriptType("tr")+"(")
|
||||
html = strings.ReplaceAll(html, "musig(", renderScriptType("musig")+"(")
|
||||
|
||||
// Replace fingerprint expressions:
|
||||
html = strings.ReplaceAll(html, data.FirstFingerprint, renderFingerprint(data.FirstFingerprint))
|
||||
html = strings.ReplaceAll(html, data.SecondFingerprint, renderFingerprint(data.SecondFingerprint))
|
||||
|
||||
// Add checksum and wrap everything:
|
||||
html += renderChecksum(checksum)
|
||||
html = renderItem(html)
|
||||
|
||||
itemsHTML = append(itemsHTML, html)
|
||||
}
|
||||
|
||||
return renderList(itemsHTML)
|
||||
}
|
||||
|
||||
func renderList(itemsHTML []string) string {
|
||||
return fmt.Sprintf(`<ul class="descriptors">%s</ul>`, strings.Join(itemsHTML, "\n"))
|
||||
}
|
||||
|
||||
func renderItem(innerHTML string) string {
|
||||
return fmt.Sprintf(`<li>%s</li>`, innerHTML)
|
||||
}
|
||||
|
||||
func renderScriptType(scriptType string) string {
|
||||
return fmt.Sprintf(`<span class="f">%s</span>`, scriptType)
|
||||
}
|
||||
|
||||
func renderFingerprint(fingerprint string) string {
|
||||
return fmt.Sprintf(`<span class="fp">%s</span>`, fingerprint)
|
||||
}
|
||||
|
||||
func renderChecksum(checksum string) string {
|
||||
return fmt.Sprintf(`#<span class="checksum">%s</span>`, checksum)
|
||||
}
|
||||
|
||||
func splitChecksum(descriptor string) (string, string) {
|
||||
parts := strings.Split(descriptor, "#")
|
||||
|
||||
if len(parts) == 1 {
|
||||
return parts[0], ""
|
||||
}
|
||||
|
||||
return parts[0], parts[1]
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------------------------
|
||||
// WARNING:
|
||||
// Below this point, you may find only fear and confusion.
|
||||
|
||||
// I translated the code for computing checksums from the original C++ in the bitcoind source,
|
||||
// making a few adjustments for language differences. It's a specialized algorithm for the domain of
|
||||
// output descriptors, and it uses the same primitives as the bech32 encoding.
|
||||
|
||||
var inputCharset = "0123456789()[],'/*abcdefgh@:$%{}IJKLMNOPQRSTUVWXYZ&+-.;<=>?!^_|~ijklmnopqrstuvwxyzABCDEFGH`#\"\\ "
|
||||
var checksumCharset = "qpzry9x8gf2tvdw0s3jn54khce6mua7l"
|
||||
|
||||
func calculateChecksum(desc string) string {
|
||||
var c uint64 = 1
|
||||
var cls int = 0
|
||||
var clscount int = 0
|
||||
|
||||
for _, ch := range desc {
|
||||
pos := strings.IndexRune(inputCharset, ch)
|
||||
|
||||
if pos == -1 {
|
||||
return ""
|
||||
}
|
||||
|
||||
c = polyMod(c, pos&31)
|
||||
cls = cls*3 + (pos >> 5)
|
||||
|
||||
clscount++
|
||||
if clscount == 3 {
|
||||
c = polyMod(c, cls)
|
||||
cls = 0
|
||||
clscount = 0
|
||||
}
|
||||
}
|
||||
|
||||
if clscount > 0 {
|
||||
c = polyMod(c, cls)
|
||||
}
|
||||
|
||||
for i := 0; i < 8; i++ {
|
||||
c = polyMod(c, 0)
|
||||
}
|
||||
|
||||
c ^= 1
|
||||
|
||||
ret := make([]byte, 8)
|
||||
for i := 0; i < 8; i++ {
|
||||
ret[i] = checksumCharset[(c>>(5*(7-i)))&31]
|
||||
}
|
||||
|
||||
return string(ret)
|
||||
}
|
||||
|
||||
func polyMod(c uint64, intVal int) uint64 {
|
||||
val := uint64(intVal)
|
||||
|
||||
c0 := c >> 35
|
||||
c = ((c & 0x7ffffffff) << 5) ^ val
|
||||
|
||||
if c0&1 != 0 {
|
||||
c ^= 0xf5dee51989
|
||||
}
|
||||
if c0&2 != 0 {
|
||||
c ^= 0xa9fdca3312
|
||||
}
|
||||
if c0&4 != 0 {
|
||||
c ^= 0x1bab10e32d
|
||||
}
|
||||
if c0&8 != 0 {
|
||||
c ^= 0x3706b1677a
|
||||
}
|
||||
if c0&16 != 0 {
|
||||
c ^= 0x644d626ffd
|
||||
}
|
||||
|
||||
return c
|
||||
}
|
||||
157
vendor/github.com/muun/libwallet/emergencykit/emergencykit.go
generated
vendored
157
vendor/github.com/muun/libwallet/emergencykit/emergencykit.go
generated
vendored
@@ -1,157 +0,0 @@
|
||||
package emergencykit
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/sha256"
|
||||
"fmt"
|
||||
"strconv"
|
||||
"text/template"
|
||||
"time"
|
||||
)
|
||||
|
||||
// Input struct to fill the PDF
|
||||
type Input struct {
|
||||
FirstEncryptedKey string
|
||||
FirstFingerprint string
|
||||
SecondEncryptedKey string
|
||||
SecondFingerprint string
|
||||
Version int
|
||||
}
|
||||
|
||||
// Output with the html as string and the verification code
|
||||
type Output struct {
|
||||
HTML string
|
||||
VerificationCode string
|
||||
}
|
||||
|
||||
var spanishMonthNames = []string{
|
||||
"Enero",
|
||||
"Febrero",
|
||||
"Marzo",
|
||||
"Abril",
|
||||
"Mayo",
|
||||
"Junio",
|
||||
"Julio",
|
||||
"Agosto",
|
||||
"Septiembre",
|
||||
"Octubre",
|
||||
"Noviembre",
|
||||
"Diciembre",
|
||||
}
|
||||
|
||||
// GenerateHTML returns the translated emergency kit html as a string along with the verification code.
|
||||
func GenerateHTML(params *Input, lang string) (*Output, error) {
|
||||
verificationCode := generateDeterministicCode(params)
|
||||
|
||||
// Render output descriptors:
|
||||
var descriptors string
|
||||
|
||||
if params.hasFingerprints() {
|
||||
descriptors = GetDescriptorsHTML(&DescriptorsData{
|
||||
FirstFingerprint: params.FirstFingerprint,
|
||||
SecondFingerprint: params.SecondFingerprint,
|
||||
})
|
||||
}
|
||||
|
||||
// Render page body:
|
||||
content, err := render("EmergencyKitContent", lang, &contentData{
|
||||
// Externally provided:
|
||||
FirstEncryptedKey: params.FirstEncryptedKey,
|
||||
SecondEncryptedKey: params.SecondEncryptedKey,
|
||||
|
||||
// Computed by us:
|
||||
VerificationCode: verificationCode,
|
||||
CurrentDate: formatDate(time.Now(), lang),
|
||||
Descriptors: descriptors,
|
||||
|
||||
// Template pieces separated for reuse:
|
||||
IconHelp: iconHelp,
|
||||
IconPadlock: iconPadlock,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to render EmergencyKitContent template: %w", err)
|
||||
}
|
||||
|
||||
// Render complete HTML page:
|
||||
page, err := render("EmergencyKitPage", lang, &pageData{
|
||||
Css: css,
|
||||
Content: content,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to render EmergencyKitPage template: %w", err)
|
||||
}
|
||||
|
||||
return &Output{
|
||||
HTML: page,
|
||||
VerificationCode: verificationCode,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func formatDate(t time.Time, lang string) string {
|
||||
if lang == "en" {
|
||||
return t.Format("January 2, 2006")
|
||||
|
||||
} else {
|
||||
// Golang has no i18n facilities, so we do our own formatting.
|
||||
year, month, day := t.Date()
|
||||
monthName := spanishMonthNames[month-1]
|
||||
|
||||
return fmt.Sprintf("%d de %s, %d", day, monthName, year)
|
||||
}
|
||||
}
|
||||
|
||||
func generateDeterministicCode(params *Input) string {
|
||||
// NOTE:
|
||||
// This function creates a stable verification code given the inputs to render the Emergency Kit. For now, the
|
||||
// implementation relies exclusively on the SecondEncryptedKey, which is the Muun key. This is obviously not ideal,
|
||||
// since we're both dropping part of the input and introducing the assumption that the Muun key will always be
|
||||
// rendered second -- but it compensates for a problem with one of our clients that causes the user key serialization
|
||||
// to be recreated each time the kit is rendered (making this deterministic approach useless).
|
||||
|
||||
// Create a deterministic serialization of the input:
|
||||
inputMaterial := params.SecondEncryptedKey + strconv.Itoa(params.Version)
|
||||
|
||||
// Compute a cryptographically secure hash of the material (critical, these are keys):
|
||||
inputHash := sha256.Sum256([]byte(inputMaterial))
|
||||
|
||||
// Extract a verification code from the hash (doesn't matter if we discard bytes):
|
||||
var code string
|
||||
for _, b := range inputHash[:6] {
|
||||
code += strconv.Itoa(int(b) % 10)
|
||||
}
|
||||
|
||||
return code
|
||||
}
|
||||
|
||||
func render(name, language string, data interface{}) (string, error) {
|
||||
tmpl, err := template.New(name).Parse(getContent(name, language))
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
var buf bytes.Buffer
|
||||
err = tmpl.Execute(&buf, data)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return buf.String(), nil
|
||||
}
|
||||
|
||||
func getContent(name string, language string) string {
|
||||
switch name {
|
||||
case "EmergencyKitPage":
|
||||
return page
|
||||
|
||||
case "EmergencyKitContent":
|
||||
if language == "es" {
|
||||
return contentES
|
||||
}
|
||||
return contentEN
|
||||
|
||||
default:
|
||||
panic("could not find template with name: " + name)
|
||||
}
|
||||
}
|
||||
|
||||
func (i *Input) hasFingerprints() bool {
|
||||
return i.FirstFingerprint != "" && i.SecondFingerprint != ""
|
||||
}
|
||||
145
vendor/github.com/muun/libwallet/emergencykit/metadata.go
generated
vendored
145
vendor/github.com/muun/libwallet/emergencykit/metadata.go
generated
vendored
@@ -1,145 +0,0 @@
|
||||
package emergencykit
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/pdfcpu/pdfcpu/pkg/api"
|
||||
"github.com/pdfcpu/pdfcpu/pkg/pdfcpu"
|
||||
)
|
||||
|
||||
// MetadataReader can extract the metadata file from a PDF.
|
||||
type MetadataReader struct {
|
||||
SrcFile string
|
||||
}
|
||||
|
||||
// MetadataWriter can add the metadata file to a PDF.
|
||||
type MetadataWriter struct {
|
||||
SrcFile string
|
||||
DstFile string
|
||||
}
|
||||
|
||||
// Metadata holds the machine-readable data for an Emergency Kit.
|
||||
type Metadata struct {
|
||||
Version int `json:"version"`
|
||||
BirthdayBlock int `json:"birthdayBlock"`
|
||||
EncryptedKeys []*MetadataKey `json:"encryptedKeys"`
|
||||
OutputDescriptors []string `json:"outputDescriptors"`
|
||||
}
|
||||
|
||||
// MetadataKey holds an entry in the Metadata key array.
|
||||
type MetadataKey struct {
|
||||
DhPubKey string `json:"dhPubKey"`
|
||||
EncryptedPrivKey string `json:"encryptedPrivKey"`
|
||||
Salt string `json:"salt"`
|
||||
}
|
||||
|
||||
// The name for the embedded metadata file in the PDF document:
|
||||
const metadataName = "metadata.json"
|
||||
|
||||
// Default configuration values copied from pdfcpu source code (some values are irrelevant to us):
|
||||
var pdfConfig = &pdfcpu.Configuration{
|
||||
Reader15: true,
|
||||
DecodeAllStreams: false,
|
||||
ValidationMode: pdfcpu.ValidationRelaxed,
|
||||
Eol: pdfcpu.EolLF,
|
||||
WriteObjectStream: true,
|
||||
WriteXRefStream: true,
|
||||
EncryptUsingAES: true,
|
||||
EncryptKeyLength: 256,
|
||||
Permissions: pdfcpu.PermissionsNone,
|
||||
}
|
||||
|
||||
// HasMetadata returns whether the metadata is present (and alone) in SrcFile.
|
||||
func (mr *MetadataReader) HasMetadata() (bool, error) {
|
||||
fs, err := api.ListAttachmentsFile(mr.SrcFile, pdfConfig)
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("HasMetadata failed to list attachments: %w", err)
|
||||
}
|
||||
|
||||
return len(fs) == 1 && fs[0] == metadataName, nil
|
||||
}
|
||||
|
||||
// ReadMetadata returns the deserialized metadata file embedded in the SrcFile PDF.
|
||||
func (mr *MetadataReader) ReadMetadata() (*Metadata, error) {
|
||||
// NOTE:
|
||||
// Due to library constraints, this makes use of a temporary directory in the default system temp
|
||||
// location, which for the Recovery Tool will always be accessible. If we eventually want to read
|
||||
// this metadata in mobile clients, we'll need the caller to provide a directory.
|
||||
|
||||
// Before we begin, verify that the metadata file is embedded:
|
||||
hasMetadata, err := mr.HasMetadata()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("ReadMetadata failed to check for existence: %w", err)
|
||||
}
|
||||
if !hasMetadata {
|
||||
return nil, fmt.Errorf("ReadMetadata didn't find %s (or found more) in this PDF", metadataName)
|
||||
}
|
||||
|
||||
// Create the temporary directory, with a deferred call to clean up:
|
||||
tmpDir, err := ioutil.TempDir("", "ek-metadata-*")
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("ReadMetadata failed to create a temporary directory")
|
||||
}
|
||||
|
||||
defer os.RemoveAll(tmpDir)
|
||||
|
||||
// Extract the embedded attachment from the PDF into that directory:
|
||||
err = api.ExtractAttachmentsFile(mr.SrcFile, tmpDir, []string{metadataName}, pdfConfig)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("ReadMetadata failed to extract attachment: %w", err)
|
||||
}
|
||||
|
||||
// Read the contents of the file:
|
||||
metadataBytes, err := ioutil.ReadFile(filepath.Join(tmpDir, metadataName))
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("ReadMetadata failed to read the extracted file: %w", err)
|
||||
}
|
||||
|
||||
// Deserialize the metadata:
|
||||
var metadata Metadata
|
||||
err = json.Unmarshal(metadataBytes, &metadata)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("ReadMetadata failed to unmarshal %s: %w", string(metadataBytes), err)
|
||||
}
|
||||
|
||||
// Done we are!
|
||||
return &metadata, nil
|
||||
}
|
||||
|
||||
// WriteMetadata creates a copy of SrcFile with attached JSON metadata into DstFile.
|
||||
func (mw *MetadataWriter) WriteMetadata(metadata *Metadata) error {
|
||||
// NOTE:
|
||||
// Due to library constraints, this makes use of a temporary file placed in the same directory as
|
||||
// `SrcFile`, which is assumed to be writable. This is a much safer bet than attempting to pick a
|
||||
// location for temporary files ourselves.
|
||||
|
||||
// Decide the location of the temporary file:
|
||||
srcDir := filepath.Dir(mw.SrcFile)
|
||||
tmpFile := filepath.Join(srcDir, metadataName)
|
||||
|
||||
// Serialize the metadata:
|
||||
metadataBytes, err := json.Marshal(metadata)
|
||||
if err != nil {
|
||||
return fmt.Errorf("WriteMetadata failed to marshal: %w", err)
|
||||
}
|
||||
|
||||
// Write to the temporary file, with a deferred call to clean up:
|
||||
err = ioutil.WriteFile(tmpFile, metadataBytes, os.FileMode(0600))
|
||||
if err != nil {
|
||||
return fmt.Errorf("WriteMetadata failed to write a temporary file: %w", err)
|
||||
}
|
||||
|
||||
defer os.Remove(tmpFile)
|
||||
|
||||
// Add the attachment, returning potential errors:
|
||||
err = api.AddAttachmentsFile(mw.SrcFile, mw.DstFile, []string{tmpFile}, false, pdfConfig)
|
||||
if err != nil {
|
||||
return fmt.Errorf("WriteMetadata failed to add attachment file %s: %w", tmpFile, err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
16
vendor/github.com/muun/libwallet/encodings.go
generated
vendored
16
vendor/github.com/muun/libwallet/encodings.go
generated
vendored
@@ -1,16 +0,0 @@
|
||||
package libwallet
|
||||
|
||||
import (
|
||||
"math/big"
|
||||
)
|
||||
|
||||
func paddedSerializeBigInt(size uint, x *big.Int) []byte {
|
||||
src := x.Bytes()
|
||||
dst := make([]byte, 0, size)
|
||||
|
||||
for i := 0; i < int(size)-len(src); i++ {
|
||||
dst = append(dst, 0)
|
||||
}
|
||||
|
||||
return append(dst, src...)
|
||||
}
|
||||
445
vendor/github.com/muun/libwallet/encrypt.go
generated
vendored
445
vendor/github.com/muun/libwallet/encrypt.go
generated
vendored
@@ -1,445 +0,0 @@
|
||||
package libwallet
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/aes"
|
||||
"crypto/cipher"
|
||||
"crypto/rand"
|
||||
"crypto/sha256"
|
||||
"encoding/binary"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"math"
|
||||
"math/big"
|
||||
|
||||
"github.com/muun/libwallet/aescbc"
|
||||
|
||||
"github.com/btcsuite/btcd/btcec"
|
||||
"github.com/btcsuite/btcutil/base58"
|
||||
)
|
||||
|
||||
const serializedPublicKeyLength = btcec.PubKeyBytesLenCompressed
|
||||
const PKEncryptionVersion = 1
|
||||
|
||||
// maxDerivationPathLen is a safety limit to avoid stupid size allocations
|
||||
const maxDerivationPathLen = 1000
|
||||
|
||||
// maxSignatureLen is a safety limit to avoid giant allocations
|
||||
const maxSignatureLen = 200
|
||||
|
||||
// minNonceLen is the safe minimum we'll set for the nonce. This is the default for golang, but it's not exposed.
|
||||
const minNonceLen = 12
|
||||
|
||||
type Encrypter interface {
|
||||
// Encrypt the payload and return a string with the necesary information for decryption
|
||||
Encrypt(payload []byte) (string, error)
|
||||
}
|
||||
|
||||
type Decrypter interface {
|
||||
// Decrypt a payload generated by Encrypter
|
||||
Decrypt(payload string) ([]byte, error)
|
||||
}
|
||||
|
||||
type hdPubKeyEncrypter struct {
|
||||
receiverKey *HDPublicKey
|
||||
senderKey *HDPrivateKey
|
||||
}
|
||||
|
||||
func addVariableBytes(writer io.Writer, data []byte) error {
|
||||
if len(data) > math.MaxUint16 {
|
||||
return fmt.Errorf("data length can't exceeed %v", math.MaxUint16)
|
||||
}
|
||||
|
||||
dataLen := uint16(len(data))
|
||||
err := binary.Write(writer, binary.BigEndian, &dataLen)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to write var bytes len: %w", err)
|
||||
}
|
||||
|
||||
n, err := writer.Write(data)
|
||||
if err != nil || n != len(data) {
|
||||
return errors.New("failed to write var bytes")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (e *hdPubKeyEncrypter) Encrypt(payload []byte) (string, error) {
|
||||
// Uses AES128-GCM with associated data. ECDHE is used for key exchange and ECDSA for authentication.
|
||||
// The goal is to be able to send an arbitrary message to a 3rd party or our future selves via
|
||||
// an intermediary which has knowledge of public keys for all parties involved.
|
||||
//
|
||||
// Conceptually, what we do is:
|
||||
// 1. Sign the payload using the senders private key so the receiver can check it's authentic
|
||||
// The signature also covers the receivers public key to avoid payload reuse by the intermediary
|
||||
// 2. Establish an encryption key via ECDH given the receivers pub key
|
||||
// 3. Encrypt the payload and signature using AES with a new random nonce
|
||||
// 4. Add the metadata the receiver will need to decode the message:
|
||||
// * The derivation path for his pub key
|
||||
// * The ephemeral key used for ECDH
|
||||
// * The version code of this scheme
|
||||
// 5. HMAC the encrypted payload and the metadata so the receiver can check it hasn't been tampered
|
||||
// 6. Add the nonce to the payload so the receiver can actually decrypt the message.
|
||||
// The nonce can't be covered by the HMAC since it's used to generate it.
|
||||
// 7. Profit!
|
||||
//
|
||||
// The implementation actually use an AES128-GCM with is an AEAD, so the encryption and HMAC all happen
|
||||
// at the same time.
|
||||
|
||||
signingKey, err := e.senderKey.key.ECPrivKey()
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("Encrypt: failed to extract signing key: %w", err)
|
||||
}
|
||||
|
||||
encryptionKey, err := e.receiverKey.key.ECPubKey()
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("Encrypt: failed to extract pub key: %w", err)
|
||||
}
|
||||
|
||||
// Sign "payload || encryptionKey" to protect against payload reuse by 3rd parties
|
||||
signaturePayload := make([]byte, 0, len(payload)+serializedPublicKeyLength)
|
||||
signaturePayload = append(signaturePayload, payload...)
|
||||
signaturePayload = append(signaturePayload, encryptionKey.SerializeCompressed()...)
|
||||
hash := sha256.Sum256(signaturePayload)
|
||||
senderSignature, err := btcec.SignCompact(btcec.S256(), signingKey, hash[:], false)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("Encrypt: failed to sign payload: %w", err)
|
||||
}
|
||||
|
||||
// plaintext is "senderSignature || payload"
|
||||
plaintext := bytes.NewBuffer(make([]byte, 0, 2+len(payload)+2+len(senderSignature)))
|
||||
err = addVariableBytes(plaintext, senderSignature)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("Encrypter: failed to add senderSignature: %w", err)
|
||||
}
|
||||
|
||||
err = addVariableBytes(plaintext, payload)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("Encrypter: failed to add payload: %w", err)
|
||||
}
|
||||
|
||||
pubEph, sharedSecret, err := generateSharedEncryptionSecretForAES(encryptionKey)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("Encrypt: failed to generate shared encryption key: %w", err)
|
||||
}
|
||||
|
||||
blockCipher, err := aes.NewCipher(sharedSecret)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("Encrypt: new aes failed: %w", err)
|
||||
}
|
||||
|
||||
gcm, err := cipher.NewGCM(blockCipher)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("Encrypt: new gcm failed: %w", err)
|
||||
}
|
||||
|
||||
nonce := randomBytes(gcm.NonceSize())
|
||||
|
||||
// additionalData is "version || pubEph || receiverKeyPath || nonceLen"
|
||||
additionalDataLen := 1 + serializedPublicKeyLength + 2 + len(e.receiverKey.Path) + 2
|
||||
result := bytes.NewBuffer(make([]byte, 0, additionalDataLen))
|
||||
result.WriteByte(PKEncryptionVersion)
|
||||
result.Write(pubEph.SerializeCompressed())
|
||||
|
||||
err = addVariableBytes(result, []byte(e.receiverKey.Path))
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("Encrypt: failed to add receiver path: %w", err)
|
||||
}
|
||||
|
||||
nonceLen := uint16(len(nonce))
|
||||
err = binary.Write(result, binary.BigEndian, &nonceLen)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("Encrypt: failed to add nonce len: %w", err)
|
||||
}
|
||||
|
||||
ciphertext := gcm.Seal(nil, nonce, plaintext.Bytes(), result.Bytes())
|
||||
|
||||
// result is "additionalData || nonce || ciphertext"
|
||||
n, err := result.Write(nonce)
|
||||
if err != nil || n != len(nonce) {
|
||||
return "", errors.New("Encrypt: failed to add nonce")
|
||||
}
|
||||
|
||||
n, err = result.Write(ciphertext)
|
||||
if err != nil || n != len(ciphertext) {
|
||||
return "", errors.New("Encrypt: failed to add ciphertext")
|
||||
}
|
||||
|
||||
return base58.Encode(result.Bytes()), nil
|
||||
}
|
||||
|
||||
// hdPrivKeyDecrypter holds the keys for validation and decryption of messages using Muun's scheme
|
||||
type hdPrivKeyDecrypter struct {
|
||||
receiverKey *HDPrivateKey
|
||||
|
||||
// senderKey optionally holds the pub key used by sender
|
||||
// If the sender is the same as the receiver, set this to nil and set fromSelf to true.
|
||||
// If the sender is unknown, set this to nil. If so, the authenticity of the message won't be validated.
|
||||
senderKey *PublicKey
|
||||
|
||||
// fromSelf is true if this message is from yourself
|
||||
fromSelf bool
|
||||
}
|
||||
|
||||
func extractVariableBytes(reader *bytes.Reader, limit int) ([]byte, error) {
|
||||
var len uint16
|
||||
err := binary.Read(reader, binary.BigEndian, &len)
|
||||
if err != nil || int(len) > limit || int(len) > reader.Len() {
|
||||
return nil, errors.New("failed to read byte array len")
|
||||
}
|
||||
|
||||
result := make([]byte, len)
|
||||
n, err := reader.Read(result)
|
||||
if err != nil || n != int(len) {
|
||||
return nil, errors.New("failed to extract byte array")
|
||||
}
|
||||
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func extractVariableString(reader *bytes.Reader, limit int) (string, error) {
|
||||
bytes, err := extractVariableBytes(reader, limit)
|
||||
return string(bytes), err
|
||||
}
|
||||
|
||||
func (d *hdPrivKeyDecrypter) Decrypt(payload string) ([]byte, error) {
|
||||
// Uses AES128-GCM with associated data. ECDHE is used for key exchange and ECDSA for authentication.
|
||||
// See Encrypt further up for an in depth dive into the scheme used
|
||||
|
||||
decoded := base58.Decode(payload)
|
||||
reader := bytes.NewReader(decoded)
|
||||
version, err := reader.ReadByte()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Decrypt: failed to read version byte: %w", err)
|
||||
}
|
||||
if version != PKEncryptionVersion {
|
||||
return nil, fmt.Errorf("Decrypt: found key version %v, expected %v",
|
||||
version, PKEncryptionVersion)
|
||||
}
|
||||
|
||||
rawPubEph := make([]byte, serializedPublicKeyLength)
|
||||
n, err := reader.Read(rawPubEph)
|
||||
if err != nil || n != serializedPublicKeyLength {
|
||||
return nil, errors.New("Decrypt: failed to read pubeph")
|
||||
}
|
||||
|
||||
receiverPath, err := extractVariableString(reader, maxDerivationPathLen)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Decrypt: failed to extract receiver path: %w", err)
|
||||
}
|
||||
|
||||
// additionalDataSize is Whatever I've read so far plus two bytes for the nonce len
|
||||
additionalDataSize := len(decoded) - reader.Len() + 2
|
||||
|
||||
minCiphertextLen := 2 // an empty sig with no plaintext
|
||||
nonce, err := extractVariableBytes(reader, reader.Len()-minCiphertextLen)
|
||||
if err != nil || len(nonce) < minNonceLen {
|
||||
return nil, errors.New("Decrypt: failed to read nonce")
|
||||
}
|
||||
|
||||
// What's left is the ciphertext
|
||||
ciphertext := make([]byte, reader.Len())
|
||||
_, err = reader.Read(ciphertext)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Decrypt: failed to read ciphertext: %w", err)
|
||||
}
|
||||
|
||||
receiverKey, err := d.receiverKey.DeriveTo(receiverPath)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Decrypt: failed to derive receiver key to path %v: %w", receiverPath, err)
|
||||
}
|
||||
|
||||
encryptionKey, err := receiverKey.key.ECPrivKey()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Decrypt: failed to extract encryption key: %w", err)
|
||||
}
|
||||
|
||||
var verificationKey *btcec.PublicKey
|
||||
if d.fromSelf {
|
||||
// Use the derived receiver key if the sender key is not provided
|
||||
verificationKey, err = receiverKey.PublicKey().key.ECPubKey()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Decrypt: failed to extract verification key: %w", err)
|
||||
}
|
||||
} else if d.senderKey != nil {
|
||||
verificationKey = d.senderKey.key
|
||||
}
|
||||
|
||||
sharedSecret, err := recoverSharedEncryptionSecretForAES(encryptionKey, rawPubEph)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Decrypt: failed to recover shared secret: %w", err)
|
||||
}
|
||||
|
||||
blockCipher, err := aes.NewCipher(sharedSecret)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Decrypt: new aes failed: %w", err)
|
||||
}
|
||||
|
||||
gcm, err := cipher.NewGCMWithNonceSize(blockCipher, len(nonce))
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Decrypt: new gcm failed: %w", err)
|
||||
}
|
||||
|
||||
plaintext, err := gcm.Open(nil, nonce, ciphertext, decoded[:additionalDataSize])
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Decrypt: AEAD failed: %w", err)
|
||||
}
|
||||
|
||||
plaintextReader := bytes.NewReader(plaintext)
|
||||
|
||||
sig, err := extractVariableBytes(plaintextReader, maxSignatureLen)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Decrypt: failed to read sig: %w", err)
|
||||
}
|
||||
|
||||
data, err := extractVariableBytes(plaintextReader, plaintextReader.Len())
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Decrypt: failed to extract user data: %w", err)
|
||||
}
|
||||
|
||||
signatureData := make([]byte, 0, len(sig)+serializedPublicKeyLength)
|
||||
signatureData = append(signatureData, data...)
|
||||
signatureData = append(signatureData, encryptionKey.PubKey().SerializeCompressed()...)
|
||||
hash := sha256.Sum256(signatureData)
|
||||
signatureKey, _, err := btcec.RecoverCompact(btcec.S256(), sig, hash[:])
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Decrypt: failed to verify signature: %w", err)
|
||||
}
|
||||
if verificationKey != nil && !signatureKey.IsEqual(verificationKey) {
|
||||
return nil, errors.New("Decrypt: signing key mismatch")
|
||||
}
|
||||
|
||||
return data, nil
|
||||
}
|
||||
|
||||
// Assert hdPubKeyEncrypter fulfills Encrypter interface
|
||||
var _ Encrypter = (*hdPubKeyEncrypter)(nil)
|
||||
|
||||
// Assert hdPrivKeyDecrypter fulfills Decrypter interface
|
||||
var _ Decrypter = (*hdPrivKeyDecrypter)(nil)
|
||||
|
||||
// encryptWithPubKey encrypts a message using a pubKey
|
||||
// It uses ECDHE/AES/CBC leaving padding up to the caller.
|
||||
func encryptWithPubKey(pubKey *btcec.PublicKey, plaintext []byte) (*btcec.PublicKey, []byte, error) {
|
||||
// Use deprecated ECDH for compat
|
||||
pubEph, sharedSecret, err := generateSharedEncryptionSecret(pubKey)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
serializedPubkey := pubEph.SerializeCompressed()
|
||||
iv := serializedPubkey[len(serializedPubkey)-aes.BlockSize:]
|
||||
|
||||
ciphertext, err := aescbc.EncryptNoPadding(paddedSerializeBigInt(aescbc.KeySize, sharedSecret), iv, plaintext)
|
||||
if err != nil {
|
||||
return nil, nil, fmt.Errorf("encryptWithPubKey: encrypt failed: %w", err)
|
||||
}
|
||||
|
||||
return pubEph, ciphertext, nil
|
||||
}
|
||||
|
||||
// generateSharedEncryptionSecret performs a ECDH with pubKey
|
||||
// Deprecated: this function is unsafe and generateSharedEncryptionSecretForAES should be used
|
||||
func generateSharedEncryptionSecret(pubKey *btcec.PublicKey) (*btcec.PublicKey, *big.Int, error) {
|
||||
privEph, err := btcec.NewPrivateKey(btcec.S256())
|
||||
if err != nil {
|
||||
return nil, nil, fmt.Errorf("generateSharedEncryptionSecretForAES: failed to generate key: %w", err)
|
||||
}
|
||||
|
||||
sharedSecret, _ := pubKey.ScalarMult(pubKey.X, pubKey.Y, privEph.D.Bytes())
|
||||
|
||||
return privEph.PubKey(), sharedSecret, nil
|
||||
}
|
||||
|
||||
// generateSharedEncryptionSecret performs a ECDH with pubKey and produces a secret usable with AES
|
||||
func generateSharedEncryptionSecretForAES(pubKey *btcec.PublicKey) (*btcec.PublicKey, []byte, error) {
|
||||
privEph, sharedSecret, err := generateSharedEncryptionSecret(pubKey)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
hash := sha256.Sum256(paddedSerializeBigInt(aescbc.KeySize, sharedSecret))
|
||||
return privEph, hash[:], nil
|
||||
}
|
||||
|
||||
// decryptWithPrivKey decrypts a message encrypted to a pubKey using the corresponding privKey
|
||||
// It uses ECDHE/AES/CBC leaving padding up to the caller.
|
||||
func decryptWithPrivKey(privKey *btcec.PrivateKey, rawPubEph []byte, ciphertext []byte) ([]byte, error) {
|
||||
// Use deprecated ECDH for compat
|
||||
sharedSecret, err := recoverSharedEncryptionSecret(privKey, rawPubEph)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
iv := rawPubEph[len(rawPubEph)-aes.BlockSize:]
|
||||
|
||||
plaintext, err := aescbc.DecryptNoPadding(paddedSerializeBigInt(aescbc.KeySize, sharedSecret), iv, ciphertext)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("decryptWithPrivKey: failed to decrypt: %w", err)
|
||||
}
|
||||
|
||||
return plaintext, nil
|
||||
}
|
||||
|
||||
// recoverSharedEncryptionSecret performs an ECDH to recover the encryption secret meant for privKey from rawPubEph
|
||||
// Deprecated: this function is unsafe and recoverSharedEncryptionSecretForAES should be used
|
||||
func recoverSharedEncryptionSecret(privKey *btcec.PrivateKey, rawPubEph []byte) (*big.Int, error) {
|
||||
pubEph, err := btcec.ParsePubKey(rawPubEph, btcec.S256())
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("recoverSharedEncryptionSecretForAES: failed to parse pub eph: %w", err)
|
||||
}
|
||||
|
||||
sharedSecret, _ := pubEph.ScalarMult(pubEph.X, pubEph.Y, privKey.D.Bytes())
|
||||
return sharedSecret, nil
|
||||
}
|
||||
|
||||
func recoverSharedEncryptionSecretForAES(privKey *btcec.PrivateKey, rawPubEph []byte) ([]byte, error) {
|
||||
sharedSecret, err := recoverSharedEncryptionSecret(privKey, rawPubEph)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
hash := sha256.Sum256(paddedSerializeBigInt(aescbc.KeySize, sharedSecret))
|
||||
return hash[:], nil
|
||||
}
|
||||
|
||||
func randomBytes(count int) []byte {
|
||||
buf := make([]byte, count)
|
||||
_, err := rand.Read(buf)
|
||||
if err != nil {
|
||||
panic("couldn't read random bytes")
|
||||
}
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// What follows are work arounds for https://github.com/golang/go/issues/46893
|
||||
|
||||
type DecryptOperation struct {
|
||||
d Decrypter
|
||||
payload string
|
||||
}
|
||||
|
||||
func NewDecryptOperation(key *HDPrivateKey, payload string) *DecryptOperation {
|
||||
return &DecryptOperation{key.Decrypter(), payload}
|
||||
}
|
||||
func NewDecryptOperationFrom(sender *PublicKey, key *HDPrivateKey, payload string) *DecryptOperation {
|
||||
return &DecryptOperation{key.DecrypterFrom(sender), payload}
|
||||
}
|
||||
|
||||
func (o *DecryptOperation) Decrypt() ([]byte, error) {
|
||||
return o.d.Decrypt(o.payload)
|
||||
}
|
||||
|
||||
type EncryptOperation struct {
|
||||
e Encrypter
|
||||
payload []byte
|
||||
}
|
||||
|
||||
func NewEncryptOperation(key *HDPrivateKey, payload []byte) *EncryptOperation {
|
||||
return &EncryptOperation{key.Encrypter(), append([]byte{}, payload...)}
|
||||
}
|
||||
|
||||
func (o *EncryptOperation) Encrypt() (string, error) {
|
||||
return o.e.Encrypt(o.payload)
|
||||
}
|
||||
22
vendor/github.com/muun/libwallet/errors.go
generated
vendored
22
vendor/github.com/muun/libwallet/errors.go
generated
vendored
@@ -1,22 +0,0 @@
|
||||
package libwallet
|
||||
|
||||
const (
|
||||
ErrUnknown = 1
|
||||
ErrInvalidURI = 2
|
||||
ErrNetwork = 3
|
||||
ErrInvalidPrivateKey = 4
|
||||
ErrInvalidDerivationPath = 5
|
||||
ErrInvalidInvoice = 6
|
||||
)
|
||||
|
||||
func ErrorCode(err error) int64 {
|
||||
type coder interface {
|
||||
Code() int64
|
||||
}
|
||||
switch e := err.(type) {
|
||||
case coder:
|
||||
return e.Code()
|
||||
default:
|
||||
return ErrUnknown
|
||||
}
|
||||
}
|
||||
28
vendor/github.com/muun/libwallet/errors/errors.go
generated
vendored
28
vendor/github.com/muun/libwallet/errors/errors.go
generated
vendored
@@ -1,28 +0,0 @@
|
||||
package errors
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
type Error struct {
|
||||
err error
|
||||
code int64
|
||||
}
|
||||
|
||||
func (e *Error) Error() string {
|
||||
return e.err.Error()
|
||||
}
|
||||
|
||||
func (e *Error) Code() int64 {
|
||||
return e.code
|
||||
}
|
||||
|
||||
func New(code int64, msg string) error {
|
||||
return &Error{errors.New(msg), code}
|
||||
}
|
||||
|
||||
func Errorf(code int64, format string, a ...interface{}) error {
|
||||
err := fmt.Errorf(format, a...)
|
||||
return &Error{err, code}
|
||||
}
|
||||
140
vendor/github.com/muun/libwallet/features.go
generated
vendored
140
vendor/github.com/muun/libwallet/features.go
generated
vendored
@@ -1,140 +0,0 @@
|
||||
package libwallet
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
const (
|
||||
BackendFeatureTaproot = "TAPROOT"
|
||||
BackendFeatureTaprootPreactivation = "TAPROOT_PREACTIVATION"
|
||||
BackendFeatureApolloBiometrics = "APOLLO_BIOMETRICS"
|
||||
|
||||
UserActivatedFeatureStatusOff = "off"
|
||||
UserActivatedFeatureStatusCanPreactivate = "can_preactivate"
|
||||
UserActivatedFeatureStatusCanActivate = "can_activate"
|
||||
UserActivatedFeatureStatusPreactivated = "preactivated"
|
||||
UserActivatedFeatureStatusScheduledActivation = "scheduled_activation"
|
||||
UserActivatedFeatureStatusActive = "active"
|
||||
)
|
||||
|
||||
var UserActivatedFeatureTaproot UserActivatedFeature = &taprootUserActivatedFeature{}
|
||||
|
||||
type UserActivatedFeature interface {
|
||||
Blockheight(*Network) int
|
||||
RequiredKitVersion() int
|
||||
BackendFeature() string
|
||||
BackendPreactivationFeature() string
|
||||
}
|
||||
|
||||
type taprootUserActivatedFeature struct {}
|
||||
|
||||
func (t *taprootUserActivatedFeature) Blockheight(network *Network) int {
|
||||
|
||||
switch network.Name() {
|
||||
case Mainnet().Name():
|
||||
// 709_632 is defined in the BIP and we use a 6 block safety margin
|
||||
return 709_632 + 6
|
||||
|
||||
case Regtest().Name():
|
||||
// A nice low value for testing
|
||||
return 100
|
||||
|
||||
case Testnet().Name():
|
||||
// A nice low value for testing
|
||||
return 100
|
||||
}
|
||||
|
||||
panic(fmt.Sprintf("Unexpected network: %v", network.Name()))
|
||||
}
|
||||
|
||||
func (t *taprootUserActivatedFeature) RequiredKitVersion() int {
|
||||
return EKVersionMusig
|
||||
}
|
||||
|
||||
func (t *taprootUserActivatedFeature) BackendFeature() string {
|
||||
return BackendFeatureTaproot
|
||||
}
|
||||
|
||||
func (t *taprootUserActivatedFeature) BackendPreactivationFeature() string {
|
||||
return BackendFeatureTaprootPreactivation
|
||||
}
|
||||
|
||||
func DetermineUserActivatedFeatureStatus(
|
||||
feature UserActivatedFeature,
|
||||
blockHeight int,
|
||||
exportedKitVersions *IntList,
|
||||
backendFeatures *StringList,
|
||||
network *Network,
|
||||
) string {
|
||||
|
||||
// If the feature is turned off by houston, two things can happen:
|
||||
// 1. The (pre)activation event is not enabled: ie kill switch
|
||||
// 2. Activation is held-off and the status is frozen as if the network
|
||||
// never activated.: ie backend feature toggle
|
||||
|
||||
if len(feature.BackendFeature()) > 0 &&
|
||||
!backendFeatures.Contains(feature.BackendPreactivationFeature()) {
|
||||
return UserActivatedFeatureStatusOff
|
||||
}
|
||||
|
||||
activatedByHouston := len(feature.BackendFeature()) > 0 &&
|
||||
backendFeatures.Contains(feature.BackendFeature())
|
||||
|
||||
activatedByNetwork := blockHeight >= feature.Blockheight(network)
|
||||
|
||||
// If the user never exported a kit, they have the feature implicitly active
|
||||
if exportedKitVersions.Length() == 0 {
|
||||
|
||||
if activatedByNetwork && activatedByHouston {
|
||||
return UserActivatedFeatureStatusActive
|
||||
|
||||
} else if activatedByHouston {
|
||||
return UserActivatedFeatureStatusScheduledActivation
|
||||
|
||||
} else {
|
||||
return UserActivatedFeatureStatusOff
|
||||
}
|
||||
}
|
||||
|
||||
var maxKitVersion int
|
||||
for i := 0; i < exportedKitVersions.Length(); i++ {
|
||||
if exportedKitVersions.Get(i) > maxKitVersion {
|
||||
maxKitVersion = exportedKitVersions.Get(i)
|
||||
}
|
||||
}
|
||||
|
||||
if maxKitVersion >= feature.RequiredKitVersion() {
|
||||
|
||||
// If the user activated already, it's up to the network
|
||||
|
||||
if activatedByNetwork && activatedByHouston {
|
||||
return UserActivatedFeatureStatusActive
|
||||
|
||||
} else if exportedKitVersions.Length() > 1 {
|
||||
// If the user had pre-existing kits, then they updated
|
||||
return UserActivatedFeatureStatusPreactivated
|
||||
|
||||
} else {
|
||||
// Otherwise they just happened to export during the activation
|
||||
return UserActivatedFeatureStatusScheduledActivation
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
// Otherwise it's up to the user
|
||||
|
||||
if !activatedByHouston {
|
||||
return UserActivatedFeatureStatusOff
|
||||
|
||||
} else if activatedByNetwork {
|
||||
return UserActivatedFeatureStatusCanActivate
|
||||
|
||||
} else {
|
||||
return UserActivatedFeatureStatusCanPreactivate
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
58
vendor/github.com/muun/libwallet/fees.go
generated
vendored
58
vendor/github.com/muun/libwallet/fees.go
generated
vendored
@@ -1,58 +0,0 @@
|
||||
package libwallet
|
||||
|
||||
import (
|
||||
"github.com/btcsuite/btcutil"
|
||||
"github.com/muun/libwallet/fees"
|
||||
)
|
||||
|
||||
type BestRouteFees struct {
|
||||
MaxCapacity int64
|
||||
FeeProportionalMillionth int64
|
||||
FeeBase int64
|
||||
}
|
||||
|
||||
type BestRouteFeesList struct {
|
||||
list []fees.BestRouteFees
|
||||
}
|
||||
|
||||
func (l *BestRouteFeesList) Add(f *BestRouteFees) {
|
||||
l.list = append(l.list, fees.BestRouteFees{
|
||||
MaxCapacity: btcutil.Amount(f.MaxCapacity),
|
||||
FeeProportionalMillionth: uint64(f.FeeProportionalMillionth),
|
||||
FeeBase: btcutil.Amount(f.FeeBase),
|
||||
})
|
||||
}
|
||||
|
||||
type FundingOutputPolicies struct {
|
||||
MaximumDebt int64
|
||||
PotentialCollect int64
|
||||
MaxAmountFor0Conf int64
|
||||
}
|
||||
|
||||
type SwapFees struct {
|
||||
RoutingFee int64
|
||||
SweepFee int64 // TODO: this should be called outputPadding, keeping name for retrocompat for now
|
||||
DebtType string
|
||||
DebtAmount int64
|
||||
ConfirmationsNeeded int64
|
||||
}
|
||||
|
||||
func ComputeSwapFees(amount int64, bestRouteFees *BestRouteFeesList, policies *FundingOutputPolicies) *SwapFees {
|
||||
swapFees := fees.ComputeSwapFees(
|
||||
btcutil.Amount(amount),
|
||||
bestRouteFees.list,
|
||||
&fees.FundingOutputPolicies{
|
||||
MaximumDebt: btcutil.Amount(policies.MaximumDebt),
|
||||
PotentialCollect: btcutil.Amount(policies.PotentialCollect),
|
||||
MaxAmountFor0Conf: btcutil.Amount(policies.MaxAmountFor0Conf),
|
||||
},
|
||||
false,
|
||||
)
|
||||
return &SwapFees{
|
||||
RoutingFee: int64(swapFees.RoutingFee),
|
||||
SweepFee: int64(swapFees.OutputPadding),
|
||||
DebtType: string(swapFees.DebtType),
|
||||
DebtAmount: int64(swapFees.DebtAmount),
|
||||
ConfirmationsNeeded: int64(swapFees.ConfirmationsNeeded),
|
||||
}
|
||||
}
|
||||
141
vendor/github.com/muun/libwallet/fees/fees.go
generated
vendored
141
vendor/github.com/muun/libwallet/fees/fees.go
generated
vendored
@@ -1,141 +0,0 @@
|
||||
package fees
|
||||
|
||||
import "github.com/btcsuite/btcutil"
|
||||
|
||||
const dustThreshold = 546
|
||||
|
||||
type BestRouteFees struct {
|
||||
MaxCapacity btcutil.Amount
|
||||
FeeProportionalMillionth uint64
|
||||
FeeBase btcutil.Amount
|
||||
}
|
||||
|
||||
type FundingOutputPolicies struct {
|
||||
MaximumDebt btcutil.Amount
|
||||
PotentialCollect btcutil.Amount
|
||||
MaxAmountFor0Conf btcutil.Amount
|
||||
}
|
||||
|
||||
type DebtType string
|
||||
|
||||
const (
|
||||
DebtTypeNone DebtType = "NONE"
|
||||
DebtTypeCollect DebtType = "COLLECT"
|
||||
DebtTypeLend DebtType = "LEND"
|
||||
)
|
||||
|
||||
type SwapFees struct {
|
||||
RoutingFee btcutil.Amount
|
||||
DebtType DebtType
|
||||
DebtAmount btcutil.Amount
|
||||
OutputAmount btcutil.Amount
|
||||
OutputPadding btcutil.Amount
|
||||
ConfirmationsNeeded uint
|
||||
}
|
||||
|
||||
func (p *FundingOutputPolicies) FundingConfirmations(paymentAmount, lightningFee btcutil.Amount) uint {
|
||||
totalAmount := paymentAmount + lightningFee
|
||||
if totalAmount <= p.MaxAmountFor0Conf {
|
||||
return 0
|
||||
}
|
||||
return 1
|
||||
}
|
||||
|
||||
func (p *FundingOutputPolicies) DebtType(paymentAmount, lightningFee btcutil.Amount) DebtType {
|
||||
numConfirmations := p.FundingConfirmations(paymentAmount, lightningFee)
|
||||
totalAmount := paymentAmount + lightningFee
|
||||
if numConfirmations == 0 && totalAmount <= p.MaximumDebt {
|
||||
return DebtTypeLend
|
||||
}
|
||||
if p.PotentialCollect > 0 {
|
||||
return DebtTypeCollect
|
||||
}
|
||||
return DebtTypeNone
|
||||
}
|
||||
|
||||
func (p *FundingOutputPolicies) DebtAmount(paymentAmount, lightningFee btcutil.Amount) btcutil.Amount {
|
||||
switch p.DebtType(paymentAmount, lightningFee) {
|
||||
case DebtTypeLend:
|
||||
return paymentAmount + lightningFee
|
||||
case DebtTypeCollect:
|
||||
return p.PotentialCollect
|
||||
case DebtTypeNone:
|
||||
return 0
|
||||
default:
|
||||
return 0
|
||||
}
|
||||
}
|
||||
|
||||
func (p *FundingOutputPolicies) MinFundingAmount(paymentAmount, lightningFee btcutil.Amount) btcutil.Amount {
|
||||
inputAmount := paymentAmount + lightningFee
|
||||
if p.DebtType(paymentAmount, lightningFee) == DebtTypeCollect {
|
||||
inputAmount += p.DebtAmount(paymentAmount, lightningFee)
|
||||
}
|
||||
return inputAmount
|
||||
}
|
||||
|
||||
func (p *FundingOutputPolicies) FundingOutputAmount(paymentAmount, lightningFee btcutil.Amount) btcutil.Amount {
|
||||
minAmount := p.MinFundingAmount(paymentAmount, lightningFee)
|
||||
if minAmount < dustThreshold {
|
||||
return dustThreshold
|
||||
}
|
||||
return minAmount
|
||||
}
|
||||
|
||||
func (p *FundingOutputPolicies) FundingOutputPadding(paymentAmount, lightningFee btcutil.Amount) btcutil.Amount {
|
||||
minAmount := p.MinFundingAmount(paymentAmount, lightningFee)
|
||||
outputAmount := p.FundingOutputAmount(paymentAmount, lightningFee)
|
||||
return outputAmount - minAmount
|
||||
}
|
||||
|
||||
func ComputeSwapFees(amount btcutil.Amount, bestRouteFees []BestRouteFees, policies *FundingOutputPolicies, takeFeeFromAmount bool) *SwapFees {
|
||||
if takeFeeFromAmount {
|
||||
// Handle edge cases for TFFA swaps. We don't allow lend for TFFA. This impacts sub-dust
|
||||
// swaps because we don't allow debt for output padding. Except, the very special case of
|
||||
// sub-dust TFFA swaps, in which you cant have output padding > 0 since you are using all
|
||||
// your balance and all your balance is < dust. In this case, since we can't use debt nor
|
||||
// output padding, if its necessary, the payment is unpayable.
|
||||
policies = &FundingOutputPolicies{
|
||||
MaximumDebt: 0,
|
||||
PotentialCollect: policies.PotentialCollect,
|
||||
MaxAmountFor0Conf: policies.MaxAmountFor0Conf,
|
||||
}
|
||||
}
|
||||
|
||||
lightningFee := computeLightningFee(amount, bestRouteFees)
|
||||
outputPadding := policies.FundingOutputPadding(amount, lightningFee)
|
||||
|
||||
offchainFee := lightningFee + outputPadding
|
||||
outputAmount := amount + offchainFee
|
||||
|
||||
debtType := policies.DebtType(amount, lightningFee)
|
||||
debtAmount := policies.DebtAmount(amount, lightningFee)
|
||||
if debtType == DebtTypeCollect {
|
||||
outputAmount += debtAmount
|
||||
} else if debtType == DebtTypeLend {
|
||||
outputAmount = 0
|
||||
}
|
||||
|
||||
return &SwapFees{
|
||||
RoutingFee: lightningFee,
|
||||
OutputPadding: outputPadding,
|
||||
DebtType: debtType,
|
||||
DebtAmount: debtAmount,
|
||||
ConfirmationsNeeded: policies.FundingConfirmations(amount, lightningFee),
|
||||
OutputAmount: outputAmount,
|
||||
}
|
||||
}
|
||||
|
||||
func computeLightningFee(amount btcutil.Amount, bestRouteFees []BestRouteFees) btcutil.Amount {
|
||||
for _, fee := range bestRouteFees {
|
||||
if amount <= fee.MaxCapacity {
|
||||
return fee.ForAmount(amount)
|
||||
}
|
||||
}
|
||||
lastRouteFee := bestRouteFees[len(bestRouteFees)-1]
|
||||
return lastRouteFee.ForAmount(amount)
|
||||
}
|
||||
|
||||
func (f *BestRouteFees) ForAmount(amount btcutil.Amount) btcutil.Amount {
|
||||
return (btcutil.Amount(f.FeeProportionalMillionth)*amount)/1000000 + f.FeeBase
|
||||
}
|
||||
27
vendor/github.com/muun/libwallet/go.mod
generated
vendored
27
vendor/github.com/muun/libwallet/go.mod
generated
vendored
@@ -1,27 +0,0 @@
|
||||
module github.com/muun/libwallet
|
||||
|
||||
go 1.14
|
||||
|
||||
require (
|
||||
github.com/btcsuite/btcd v0.20.1-beta.0.20200515232429-9f0179fd2c46
|
||||
github.com/btcsuite/btcutil v1.0.2
|
||||
github.com/fiatjaf/go-lnurl v1.3.1
|
||||
github.com/jinzhu/gorm v1.9.16
|
||||
github.com/lightningnetwork/lightning-onion v1.0.1
|
||||
github.com/lightningnetwork/lnd v0.10.4-beta
|
||||
github.com/miekg/dns v1.1.29 // indirect
|
||||
github.com/pdfcpu/pdfcpu v0.3.11
|
||||
github.com/pkg/errors v0.9.1
|
||||
github.com/shopspring/decimal v1.2.0
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519
|
||||
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f // indirect
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
|
||||
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6 // indirect
|
||||
golang.org/x/text v0.3.7 // indirect
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
|
||||
google.golang.org/protobuf v1.25.0
|
||||
gopkg.in/gormigrate.v1 v1.6.0
|
||||
)
|
||||
|
||||
// Fork that includes the -cache flag for quicker builds
|
||||
replace golang.org/x/mobile => github.com/muun/mobile v0.0.0-20220913162405-8cc629edd37b
|
||||
378
vendor/github.com/muun/libwallet/go.sum
generated
vendored
378
vendor/github.com/muun/libwallet/go.sum
generated
vendored
@@ -1,378 +0,0 @@
|
||||
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
cloud.google.com/go v0.33.1/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
git.schwanenlied.me/yawning/bsaes.git v0.0.0-20180720073208-c0276d75487e/go.mod h1:BWqTsj8PgcPriQJGl7el20J/7TuT1d/hSyFDXMEpoEo=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/NebulousLabs/fastrand v0.0.0-20181203155948-6fb6489aac4e/go.mod h1:Bdzq+51GR4/0DIhaICZEOm+OHvXGwwB2trKZ8B4Y6eQ=
|
||||
github.com/NebulousLabs/go-upnp v0.0.0-20180202185039-29b680b06c82/go.mod h1:GbuBk21JqF+driLX3XtJYNZjGa45YDoa9IqCTzNSfEc=
|
||||
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
|
||||
github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc=
|
||||
github.com/Yawning/aez v0.0.0-20180114000226-4dad034d9db2/go.mod h1:9pIqrY6SXNL8vjRQE5Hd/OL5GyK/9MrGUWs87z/eFfk=
|
||||
github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da h1:KjTM2ks9d14ZYCvmHS9iAKVt9AyzRSqNU1qabPih5BY=
|
||||
github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da/go.mod h1:eHEWzANqSiWQsof+nXEI9bUVUyV6F53Fp89EuCh2EAA=
|
||||
github.com/aead/siphash v1.0.1 h1:FwHfE/T45KPKYuuSAKyyvE+oPWcaQ+CUmFW0bPlM+kg=
|
||||
github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII=
|
||||
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
||||
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||
github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y=
|
||||
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
|
||||
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
|
||||
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
|
||||
github.com/btcsuite/btcd v0.0.0-20190629003639-c26ffa870fd8/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI=
|
||||
github.com/btcsuite/btcd v0.0.0-20190824003749-130ea5bddde3/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI=
|
||||
github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ=
|
||||
github.com/btcsuite/btcd v0.20.1-beta.0.20200513120220-b470eee47728/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ=
|
||||
github.com/btcsuite/btcd v0.20.1-beta.0.20200515232429-9f0179fd2c46 h1:QyTpiR5nQe94vza2qkvf7Ns8XX2Rjh/vdIhO3RzGj4o=
|
||||
github.com/btcsuite/btcd v0.20.1-beta.0.20200515232429-9f0179fd2c46/go.mod h1:Yktc19YNjh/Iz2//CX0vfRTS4IJKM/RKO5YZ9Fn+Pgo=
|
||||
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f h1:bAs4lUbRJpnnkd9VhRV3jjAVU7DJVjMaK+IsvSeZvFo=
|
||||
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA=
|
||||
github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg=
|
||||
github.com/btcsuite/btcutil v1.0.2 h1:9iZ1Terx9fMIOtq1VrwdqfsATL9MC2l8ZrUY6YZ2uts=
|
||||
github.com/btcsuite/btcutil v1.0.2/go.mod h1:j9HUFwoQRsZL3V4n+qG+CUnEGHOarIxfC3Le2Yhbcts=
|
||||
github.com/btcsuite/btcutil/psbt v1.0.2 h1:gCVY3KxdoEVU7Q6TjusPO+GANIwVgr9yTLqM+a6CZr8=
|
||||
github.com/btcsuite/btcutil/psbt v1.0.2/go.mod h1:LVveMu4VaNSkIRTZu2+ut0HDBRuYjqGocxDMNS1KuGQ=
|
||||
github.com/btcsuite/btcwallet v0.11.1-0.20200612012534-48addcd5591a h1:AZ1Mf0gd9mgJqrTTIFUc17ep9EKUbQusVAIzJ6X+x3Q=
|
||||
github.com/btcsuite/btcwallet v0.11.1-0.20200612012534-48addcd5591a/go.mod h1:9+AH3V5mcTtNXTKe+fe63fDLKGOwQbZqmvOVUef+JFE=
|
||||
github.com/btcsuite/btcwallet/wallet/txauthor v1.0.0 h1:KGHMW5sd7yDdDMkCZ/JpP0KltolFsQcB973brBnfj4c=
|
||||
github.com/btcsuite/btcwallet/wallet/txauthor v1.0.0/go.mod h1:VufDts7bd/zs3GV13f/lXc/0lXrPnvxD/NvmpG/FEKU=
|
||||
github.com/btcsuite/btcwallet/wallet/txrules v1.0.0 h1:2VsfS0sBedcM5KmDzRMT3+b6xobqWveZGvjb+jFez5w=
|
||||
github.com/btcsuite/btcwallet/wallet/txrules v1.0.0/go.mod h1:UwQE78yCerZ313EXZwEiu3jNAtfXj2n2+c8RWiE/WNA=
|
||||
github.com/btcsuite/btcwallet/wallet/txsizes v1.0.0 h1:6DxkcoMnCPY4E9cUDPB5tbuuf40SmmMkSQkoE8vCT+s=
|
||||
github.com/btcsuite/btcwallet/wallet/txsizes v1.0.0/go.mod h1:pauEU8UuMFiThe5PB3EO+gO5kx87Me5NvdQDsTuq6cs=
|
||||
github.com/btcsuite/btcwallet/walletdb v1.0.0/go.mod h1:bZTy9RyYZh9fLnSua+/CD48TJtYJSHjjYcSaszuxCCk=
|
||||
github.com/btcsuite/btcwallet/walletdb v1.2.0/go.mod h1:9cwc1Yyg4uvd4ZdfdoMnALji+V9gfWSMfxEdLdR5Vwc=
|
||||
github.com/btcsuite/btcwallet/walletdb v1.3.1/go.mod h1:9cwc1Yyg4uvd4ZdfdoMnALji+V9gfWSMfxEdLdR5Vwc=
|
||||
github.com/btcsuite/btcwallet/walletdb v1.3.2/go.mod h1:GZCMPNpUu5KE3ASoVd+k06p/1OW8OwNGCCaNWRto2cQ=
|
||||
github.com/btcsuite/btcwallet/walletdb v1.3.3 h1:u6e7vRIKBF++cJy+hOHaMGg+88ZTwvpaY27AFvtB668=
|
||||
github.com/btcsuite/btcwallet/walletdb v1.3.3/go.mod h1:oJDxAEUHVtnmIIBaa22wSBPTVcs6hUp5NKWmI8xDwwU=
|
||||
github.com/btcsuite/btcwallet/wtxmgr v1.0.0/go.mod h1:vc4gBprll6BP0UJ+AIGDaySoc7MdAmZf8kelfNb8CFY=
|
||||
github.com/btcsuite/btcwallet/wtxmgr v1.2.0 h1:ZUYPsSv8GjF9KK7lboB2OVHF0uYEcHxgrCfFWqPd9NA=
|
||||
github.com/btcsuite/btcwallet/wtxmgr v1.2.0/go.mod h1:h8hkcKUE3X7lMPzTUoGnNiw5g7VhGrKEW3KpR2r0VnY=
|
||||
github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd h1:R/opQEbFEy9JGkIguV40SvRY1uliPX8ifOvi6ICsFCw=
|
||||
github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg=
|
||||
github.com/btcsuite/golangcrypto v0.0.0-20150304025918-53f62d9b43e8/go.mod h1:tYvUd8KLhm/oXvUeSEs2VlLghFjQt9+ZaF9ghH0JNjc=
|
||||
github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY=
|
||||
github.com/btcsuite/goleveldb v1.0.0 h1:Tvd0BfvqX9o823q1j2UZ/epQo09eJh6dTcRp79ilIN4=
|
||||
github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I=
|
||||
github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc=
|
||||
github.com/btcsuite/snappy-go v1.0.0 h1:ZxaA6lo2EpxGddsA8JwWOcxlzRybb444sgmeJQMJGQE=
|
||||
github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc=
|
||||
github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792 h1:R8vQdOQdZ9Y3SkEwmHoWBmX1DNXhXZqlTpq6s4tyJGc=
|
||||
github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY=
|
||||
github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs=
|
||||
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
|
||||
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
||||
github.com/coreos/bbolt v1.3.3/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
|
||||
github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/denisenkom/go-mssqldb v0.0.0-20181014144952-4e0d7dc8888f/go.mod h1:xN/JuLBIz4bjkxNmByTiV1IbhfnYb6oo99phBn4Eqhc=
|
||||
github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd h1:83Wprp6ROGeiHFAP8WJdI2RoxALQYgdllERc3N5N2DM=
|
||||
github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU=
|
||||
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
|
||||
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
||||
github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 h1:Yzb9+7DPaBjB8zlTR87/ElzFsnQfuHnVUVqpZZIcV5Y=
|
||||
github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0=
|
||||
github.com/fiatjaf/go-lnurl v1.3.1 h1:9Qn4n1ZyzTMW/YuVX2Wr9cE+LEAzpE1hrCbxVK/yBKE=
|
||||
github.com/fiatjaf/go-lnurl v1.3.1/go.mod h1:BqA8WXAOzntF7Z3EkVO7DfP4y5rhWUmJ/Bu9KBke+rs=
|
||||
github.com/frankban/quicktest v1.2.2/go.mod h1:Qh/WofXFeiAFII1aEBu529AtJo6Zg2VHscnEsbBnJ20=
|
||||
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
|
||||
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
||||
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
|
||||
github.com/go-errors/errors v1.0.1 h1:LUHzmkK3GUKUrL/1gfBUxAHzcev3apQlezX/+O7ma6w=
|
||||
github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q=
|
||||
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
|
||||
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
|
||||
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
|
||||
github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94=
|
||||
github.com/go-openapi/strfmt v0.19.5/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk=
|
||||
github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
|
||||
github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs=
|
||||
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
|
||||
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
|
||||
github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
|
||||
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
||||
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY=
|
||||
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0=
|
||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
||||
github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E=
|
||||
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
|
||||
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
|
||||
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
|
||||
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
|
||||
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
|
||||
github.com/golang/protobuf v1.4.1 h1:ZFgWrT+bLgsYPirOnRfKLYJLvssAegOj/hgyMFdJZe0=
|
||||
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
|
||||
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
|
||||
github.com/google/go-cmp v0.2.1-0.20190312032427-6f77996f0c42/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.0 h1:/QaMHBdZ26BB3SSst0Iwl10Epc+xhTquomWX0oZEB6w=
|
||||
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
|
||||
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.8.6/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
|
||||
github.com/hhrutter/lzw v0.0.0-20190827003112-58b82c5a41cc/go.mod h1:yJBvOcu1wLQ9q9XZmfiPfur+3dQJuIhYQsMGLYcItZk=
|
||||
github.com/hhrutter/lzw v0.0.0-20190829144645-6f07a24e8650 h1:1yY/RQWNSBjJe2GDCIYoLmpWVidrooriUr4QS/zaATQ=
|
||||
github.com/hhrutter/lzw v0.0.0-20190829144645-6f07a24e8650/go.mod h1:yJBvOcu1wLQ9q9XZmfiPfur+3dQJuIhYQsMGLYcItZk=
|
||||
github.com/hhrutter/tiff v0.0.0-20190829141212-736cae8d0bc7 h1:o1wMw7uTNyA58IlEdDpxIrtFHTgnvYzA8sCQz8luv94=
|
||||
github.com/hhrutter/tiff v0.0.0-20190829141212-736cae8d0bc7/go.mod h1:WkUxfS2JUu3qPo6tRld7ISb8HiC0gVSU91kooBMDVok=
|
||||
github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
|
||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||
github.com/jackpal/gateway v1.0.5/go.mod h1:lTpwd4ACLXmpyiCTRtfiNyVnUmqT9RivzCDQetPfnjA=
|
||||
github.com/jackpal/go-nat-pmp v0.0.0-20170405195558-28a68d0c24ad/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc=
|
||||
github.com/jedib0t/go-pretty v4.3.0+incompatible/go.mod h1:XemHduiw8R651AF9Pt4FwCTKeG3oo7hrHJAoznj9nag=
|
||||
github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
|
||||
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
|
||||
github.com/jinzhu/gorm v1.9.2/go.mod h1:Vla75njaFJ8clLU1W44h34PjIkijhjHIYnZxMqCdxqo=
|
||||
github.com/jinzhu/gorm v1.9.16 h1:+IyIjPEABKRpsu/F8OvDPy9fyQlgsg2luMV2ZIH5i5o=
|
||||
github.com/jinzhu/gorm v1.9.16/go.mod h1:G3LB3wezTOWM2ITLzPxEXgSkOXAntiLHS7UdBefADcs=
|
||||
github.com/jinzhu/inflection v0.0.0-20180308033659-04140366298a/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
|
||||
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
|
||||
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
|
||||
github.com/jinzhu/now v0.0.0-20181116074157-8ec929ed50c3/go.mod h1:oHTiXerJ20+SfYcrdlBO7rzZRJWGwSTQ0iUY2jI6Gfc=
|
||||
github.com/jinzhu/now v1.0.1 h1:HjfetcXq097iXP0uoPCdnM4Efp5/9MsM0/M+XOTeR3M=
|
||||
github.com/jinzhu/now v1.0.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
|
||||
github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc=
|
||||
github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=
|
||||
github.com/jrick/logrotate v1.0.0 h1:lQ1bL/n9mBNeIXoTUoYRlK4dHuNJVofX9oWqBtPnSzI=
|
||||
github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ=
|
||||
github.com/juju/clock v0.0.0-20190205081909-9c5c9712527c/go.mod h1:nD0vlnrUjcjJhqN5WuCWZyzfd5AHZAC9/ajvbSx69xA=
|
||||
github.com/juju/errors v0.0.0-20190806202954-0232dcc7464d/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q=
|
||||
github.com/juju/loggo v0.0.0-20190526231331-6e530bcce5d8/go.mod h1:vgyd7OREkbtVEN/8IXZe5Ooef3LQePvuBm9UWj6ZL8U=
|
||||
github.com/juju/retry v0.0.0-20180821225755-9058e192b216/go.mod h1:OohPQGsr4pnxwD5YljhQ+TZnuVRYpa5irjugL1Yuif4=
|
||||
github.com/juju/testing v0.0.0-20190723135506-ce30eb24acd2/go.mod h1:63prj8cnj0tU0S9OHjGJn+b1h0ZghCndfnbQolrYTwA=
|
||||
github.com/juju/utils v0.0.0-20180820210520-bf9cc5bdd62d/go.mod h1:6/KLg8Wz/y2KVGWEpkK9vMNGkOnu4k/cqs8Z1fKjTOk=
|
||||
github.com/juju/version v0.0.0-20180108022336-b64dbd566305/go.mod h1:kE8gK5X0CImdr7qpSKl3xB2PmpySSmfj7zVbkZFs81U=
|
||||
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
|
||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||
github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4=
|
||||
github.com/kkdai/bstream v0.0.0-20181106074824-b3251f7901ec h1:n1NeQ3SgUHyISrjFFoO5dR748Is8dBL9qpaTNfphQrs=
|
||||
github.com/kkdai/bstream v0.0.0-20181106074824-b3251f7901ec/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
|
||||
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
||||
github.com/lib/pq v1.1.1 h1:sJZmqHoEaY7f+NPP8pgLB/WxulyR3fewgCM2qaSlBb4=
|
||||
github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
||||
github.com/lightninglabs/gozmq v0.0.0-20191113021534-d20a764486bf h1:HZKvJUHlcXI/f/O0Avg7t8sqkPo78HFzjmeYFl6DPnc=
|
||||
github.com/lightninglabs/gozmq v0.0.0-20191113021534-d20a764486bf/go.mod h1:vxmQPeIQxPf6Jf9rM8R+B4rKBqLA2AjttNxkFBL2Plk=
|
||||
github.com/lightninglabs/neutrino v0.11.0/go.mod h1:CuhF0iuzg9Sp2HO6ZgXgayviFTn1QHdSTJlMncK80wg=
|
||||
github.com/lightninglabs/neutrino v0.11.1-0.20200316235139-bffc52e8f200 h1:j4iZ1XlUAPQmW6oSzMcJGILYsRHNs+4O3Gk+2Ms5Dww=
|
||||
github.com/lightninglabs/neutrino v0.11.1-0.20200316235139-bffc52e8f200/go.mod h1:MlZmoKa7CJP3eR1s5yB7Rm5aSyadpKkxqAwLQmog7N0=
|
||||
github.com/lightninglabs/protobuf-hex-display v1.3.3-0.20191212020323-b444784ce75d/go.mod h1:KDb67YMzoh4eudnzClmvs2FbiLG9vxISmLApUkCa4uI=
|
||||
github.com/lightningnetwork/lightning-onion v1.0.1 h1:qChGgS5+aPxFeR6JiUsGvanei1bn6WJpYbvosw/1604=
|
||||
github.com/lightningnetwork/lightning-onion v1.0.1/go.mod h1:rigfi6Af/KqsF7Za0hOgcyq2PNH4AN70AaMRxcJkff4=
|
||||
github.com/lightningnetwork/lnd v0.10.4-beta h1:Af2zOCPePeaU8Tkl8IqtTjr4BP3zYfi+hAtQYcCMM58=
|
||||
github.com/lightningnetwork/lnd v0.10.4-beta/go.mod h1:4d02pduRVtZwgTJ+EimKJTsEAY0jDwi0SPE9h5aRneM=
|
||||
github.com/lightningnetwork/lnd/cert v1.0.2/go.mod h1:fmtemlSMf5t4hsQmcprSoOykypAPp+9c+0d0iqTScMo=
|
||||
github.com/lightningnetwork/lnd/clock v1.0.1 h1:QQod8+m3KgqHdvVMV+2DRNNZS1GRFir8mHZYA+Z2hFo=
|
||||
github.com/lightningnetwork/lnd/clock v1.0.1/go.mod h1:KnQudQ6w0IAMZi1SgvecLZQZ43ra2vpDNj7H/aasemg=
|
||||
github.com/lightningnetwork/lnd/queue v1.0.1/go.mod h1:vaQwexir73flPW43Mrm7JOgJHmcEFBWWSl9HlyASoms=
|
||||
github.com/lightningnetwork/lnd/queue v1.0.4 h1:8Dq3vxAFSACPy+pKN88oPFhuCpCoAAChPBwa4BJxH4k=
|
||||
github.com/lightningnetwork/lnd/queue v1.0.4/go.mod h1:YTkTVZCxz8tAYreH27EO3s8572ODumWrNdYW2E/YKxg=
|
||||
github.com/lightningnetwork/lnd/ticker v1.0.0 h1:S1b60TEGoTtCe2A0yeB+ecoj/kkS4qpwh6l+AkQEZwU=
|
||||
github.com/lightningnetwork/lnd/ticker v1.0.0/go.mod h1:iaLXJiVgI1sPANIF2qYYUJXjoksPNvGNYowB8aRbpX0=
|
||||
github.com/ltcsuite/ltcd v0.0.0-20190101042124-f37f8bf35796 h1:sjOGyegMIhvgfq5oaue6Td+hxZuf3tDC8lAPrFldqFw=
|
||||
github.com/ltcsuite/ltcd v0.0.0-20190101042124-f37f8bf35796/go.mod h1:3p7ZTf9V1sNPI5H8P3NkTFF4LuwMdPl2DodF60qAKqY=
|
||||
github.com/ltcsuite/ltcutil v0.0.0-20181217130922-17f3b04680b6/go.mod h1:8Vg/LTOO0KYa/vlHWJ6XZAevPQThGH5sufO0Hrou/lA=
|
||||
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
|
||||
github.com/mattn/go-sqlite3 v1.10.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
|
||||
github.com/mattn/go-sqlite3 v1.14.0 h1:mLyGNKR8+Vv9CAU7PphKa2hkEqxxhn8i32J6FPj1/QA=
|
||||
github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus=
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
|
||||
github.com/miekg/dns v0.0.0-20171125082028-79bfde677fa8/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
|
||||
github.com/miekg/dns v1.1.29 h1:xHBEhR+t5RzcFJjBLJlax2daXOrTYtr9z4WdKEfWFzg=
|
||||
github.com/miekg/dns v1.1.29/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM=
|
||||
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
|
||||
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
|
||||
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
|
||||
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/ginkgo v1.7.0 h1:WSHQ+IS43OoUrWtD1/bbclrwK8TTH5hzp+umCiuxHgs=
|
||||
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
|
||||
github.com/onsi/gomega v1.4.3 h1:RE1xgDvH7imwFD45h+u2SgIfERHlS2yNG4DObb5BSKU=
|
||||
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
|
||||
github.com/pdfcpu/pdfcpu v0.3.11 h1:T5XLD5blrB61tBjkSrQnwikrQO4gmwQm61fsyGZa04w=
|
||||
github.com/pdfcpu/pdfcpu v0.3.11/go.mod h1:SZ51teSs9l709Xim2VEuOYGf+uf7RdH2eY0LrXvz7n8=
|
||||
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
|
||||
github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso=
|
||||
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
|
||||
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
|
||||
github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
|
||||
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
|
||||
github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
|
||||
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
|
||||
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
|
||||
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
|
||||
github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ=
|
||||
github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
|
||||
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
|
||||
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=
|
||||
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
||||
github.com/tidwall/gjson v1.6.0 h1:9VEQWz6LLMUsUl6PueE49ir4Ka6CzLymOAZDxpFsTDc=
|
||||
github.com/tidwall/gjson v1.6.0/go.mod h1:P256ACg0Mn+j1RXIDXoss50DeIABTYK1PULOJHhxOls=
|
||||
github.com/tidwall/match v1.0.1 h1:PnKP62LPNxHKTwvHHZZzdOAOCtsJTjo6dZLCwpKm5xc=
|
||||
github.com/tidwall/match v1.0.1/go.mod h1:LujAq0jyVjBy028G1WhWfIzbpQfMO8bBZ6Tyb0+pL9E=
|
||||
github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4=
|
||||
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
|
||||
github.com/tv42/zbase32 v0.0.0-20160707012821-501572607d02/go.mod h1:tHlrkM198S068ZqfrO6S8HsoJq2bF3ETfTL+kt4tInY=
|
||||
github.com/urfave/cli v1.18.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
|
||||
go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
|
||||
go.etcd.io/bbolt v1.3.5-0.20200615073812-232d8fc87f50 h1:ASw9n1EHMftwnP3Az4XW6e308+gNsrHzmdhd0Olz9Hs=
|
||||
go.etcd.io/bbolt v1.3.5-0.20200615073812-232d8fc87f50/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
|
||||
go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM=
|
||||
golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20181112202954-3d3f9f413869/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20191205180655-e7c4368fe9dd/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/image v0.0.0-20190823064033-3a9bac650e44/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||
golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb h1:fqpd0EBDzlHRCjiphRR5Zo/RSWWQlWv34418dnEixWk=
|
||||
golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||
golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
||||
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
||||
golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20181106065722-10aee1819953/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190206173232-65e2d4e15006/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f h1:OfiFi4JbukWwe3lzw+xunroH1mnC1e2Gy5cxNJApiSY=
|
||||
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6 h1:nonptSpoQ4vQjyraW20DXPAglgQfVnM9ZC6MmNLMR60=
|
||||
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
|
||||
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||
golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||
google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||
google.golang.org/genproto v0.0.0-20190201180003-4b09977fb922/go.mod h1:L3J43x8/uS+qIUoksaLKe6OS3nUKxOKuIFz1sl2/jx4=
|
||||
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
|
||||
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
|
||||
google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio=
|
||||
google.golang.org/grpc v1.18.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
|
||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
|
||||
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
|
||||
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
||||
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
||||
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
|
||||
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
|
||||
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
|
||||
google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c=
|
||||
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
|
||||
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/errgo.v1 v1.0.1/go.mod h1:3NjfXwocQRYAPTq4/fzX+CwUhPRcR/azYRhj8G+LqMo=
|
||||
gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=
|
||||
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
|
||||
gopkg.in/gormigrate.v1 v1.6.0 h1:XpYM6RHQPmzwY7Uyu+t+xxMXc86JYFJn4nEc9HzQjsI=
|
||||
gopkg.in/gormigrate.v1 v1.6.0/go.mod h1:Lf00lQrHqfSYWiTtPcyQabsDdM6ejZaMgV0OU6JMSlw=
|
||||
gopkg.in/macaroon-bakery.v2 v2.0.1/go.mod h1:B4/T17l+ZWGwxFSZQmlBwp25x+og7OkhETfr3S9MbIA=
|
||||
gopkg.in/macaroon.v2 v2.0.0/go.mod h1:+I6LnTMkm/uV5ew/0nsulNjL16SK4+C8yDmRUzHR17I=
|
||||
gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA=
|
||||
gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
|
||||
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
|
||||
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
||||
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||
honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
10
vendor/github.com/muun/libwallet/hashes.go
generated
vendored
10
vendor/github.com/muun/libwallet/hashes.go
generated
vendored
@@ -1,10 +0,0 @@
|
||||
package libwallet
|
||||
|
||||
import (
|
||||
"crypto/sha256"
|
||||
)
|
||||
|
||||
func SHA256(data []byte) []byte {
|
||||
hash := sha256.Sum256(data)
|
||||
return hash[:]
|
||||
}
|
||||
128
vendor/github.com/muun/libwallet/hdpath/hdpath.go
generated
vendored
128
vendor/github.com/muun/libwallet/hdpath/hdpath.go
generated
vendored
@@ -1,128 +0,0 @@
|
||||
package hdpath
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/btcsuite/btcutil/hdkeychain"
|
||||
)
|
||||
|
||||
type Path string
|
||||
|
||||
const HardenedSymbol = "'"
|
||||
|
||||
var re = regexp.MustCompile("^(m?|\\/|(([a-z]+:)?\\d+'?))(\\/([a-z]+:)?\\d+'?)*$")
|
||||
|
||||
func Parse(s string) (Path, error) {
|
||||
if !re.MatchString(s) {
|
||||
return "", fmt.Errorf("path is not valid: `%s`", s)
|
||||
}
|
||||
return Path(s), nil
|
||||
}
|
||||
|
||||
func MustParse(s string) Path {
|
||||
p, err := Parse(s)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return p
|
||||
}
|
||||
|
||||
func (p Path) Child(i uint32) Path {
|
||||
isChildHardened := i >= hdkeychain.HardenedKeyStart
|
||||
if isChildHardened {
|
||||
i -= hdkeychain.HardenedKeyStart
|
||||
return Path(fmt.Sprintf("%s/%d'", p, i))
|
||||
}
|
||||
return Path(fmt.Sprintf("%s/%d", p, i))
|
||||
}
|
||||
|
||||
func (p Path) NamedChild(name string, i uint32) Path {
|
||||
isChildHardened := i >= hdkeychain.HardenedKeyStart
|
||||
if isChildHardened {
|
||||
i -= hdkeychain.HardenedKeyStart
|
||||
return Path(fmt.Sprintf("%s/%s:%d'", p, name, i))
|
||||
}
|
||||
return Path(fmt.Sprintf("%s/%s:%d", p, name, i))
|
||||
}
|
||||
|
||||
func (p Path) String() string {
|
||||
return string(p)
|
||||
}
|
||||
|
||||
type PathIndex struct {
|
||||
Index uint32
|
||||
Hardened bool
|
||||
Name string
|
||||
}
|
||||
|
||||
// Indexes returns the derivation indexes corresponding to this path.
|
||||
//
|
||||
// The following paths are valid:
|
||||
//
|
||||
// "" (root key)
|
||||
// "m" (root key)
|
||||
// "/" (root key)
|
||||
// "m/0'" (hardened child #0 of the root key)
|
||||
// "/0'" (hardened child #0 of the root key)
|
||||
// "0'" (hardened child #0 of the root key)
|
||||
// "m/44'/1'/2'" (BIP44 testnet account #2)
|
||||
// "/44'/1'/2'" (BIP44 testnet account #2)
|
||||
// "44'/1'/2'" (BIP44 testnet account #2)
|
||||
// "m/schema:1'" (Muun schema path)
|
||||
//
|
||||
// The following paths are invalid:
|
||||
//
|
||||
// "m / 0 / 1" (contains spaces)
|
||||
// "m/b/c" (alphabetical characters instead of numerical indexes)
|
||||
// "m/1.2^3" (contains illegal characters)
|
||||
func (p Path) Indexes() []PathIndex {
|
||||
path := string(p)
|
||||
|
||||
if path == "m" || path == "/" || path == "" {
|
||||
return make([]PathIndex, 0)
|
||||
}
|
||||
|
||||
var indexes []PathIndex
|
||||
path = strings.TrimPrefix(path, "m")
|
||||
path = strings.TrimPrefix(path, "/")
|
||||
|
||||
for _, chunk := range strings.Split(path, "/") {
|
||||
hardened := false
|
||||
indexText := chunk
|
||||
if strings.HasSuffix(indexText, HardenedSymbol) {
|
||||
hardened = true
|
||||
indexText = strings.TrimSuffix(indexText, HardenedSymbol)
|
||||
}
|
||||
|
||||
parts := strings.Split(indexText, ":")
|
||||
if len(parts) > 2 {
|
||||
panic("path is malformed: " + path)
|
||||
}
|
||||
|
||||
var name string
|
||||
if len(parts) == 2 {
|
||||
name = parts[0]
|
||||
}
|
||||
|
||||
index, err := strconv.ParseUint(parts[len(parts)-1], 10, 32)
|
||||
if err != nil {
|
||||
panic("path is malformed: " + err.Error())
|
||||
}
|
||||
|
||||
indexes = append(indexes, PathIndex{
|
||||
Index: uint32(index),
|
||||
Hardened: hardened,
|
||||
Name: name,
|
||||
})
|
||||
}
|
||||
|
||||
return indexes
|
||||
}
|
||||
|
||||
// IndexesFrom returns the indexes starting from the given parent path.
|
||||
func (p Path) IndexesFrom(parentPath Path) []PathIndex {
|
||||
return p.Indexes()[len(parentPath.Indexes()):]
|
||||
}
|
||||
163
vendor/github.com/muun/libwallet/hdprivatekey.go
generated
vendored
163
vendor/github.com/muun/libwallet/hdprivatekey.go
generated
vendored
@@ -1,163 +0,0 @@
|
||||
package libwallet
|
||||
|
||||
import (
|
||||
"crypto/sha256"
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/muun/libwallet/hdpath"
|
||||
|
||||
"github.com/btcsuite/btcutil/hdkeychain"
|
||||
)
|
||||
|
||||
// HDPrivateKey is an HD capable priv key
|
||||
type HDPrivateKey struct {
|
||||
key hdkeychain.ExtendedKey
|
||||
Network *Network
|
||||
Path string
|
||||
}
|
||||
|
||||
// NewHDPrivateKey builds an HD priv key from a seed for a given network
|
||||
func NewHDPrivateKey(seed []byte, network *Network) (*HDPrivateKey, error) {
|
||||
|
||||
key, err := hdkeychain.NewMaster(seed, network.network)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &HDPrivateKey{key: *key, Network: network, Path: "m"}, nil
|
||||
}
|
||||
|
||||
// NewHDPrivateKeyFromBytes builds an HD priv key from the compress priv and chain code for a given network
|
||||
func NewHDPrivateKeyFromBytes(rawKey, chainCode []byte, network *Network) (*HDPrivateKey, error) {
|
||||
|
||||
parentFP := []byte{0, 0, 0, 0}
|
||||
key := hdkeychain.NewExtendedKey(network.network.HDPrivateKeyID[:],
|
||||
rawKey, chainCode, parentFP, 0, 0, true)
|
||||
|
||||
return &HDPrivateKey{key: *key, Network: network, Path: "m"}, nil
|
||||
}
|
||||
|
||||
// NewHDPrivateKeyFromString creates an HD priv key from a base58-encoded string
|
||||
// If the parsed key is public, it returns an error
|
||||
func NewHDPrivateKeyFromString(str, path string, network *Network) (*HDPrivateKey, error) {
|
||||
|
||||
key, err := hdkeychain.NewKeyFromString(str)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if !key.IsPrivate() {
|
||||
return nil, errors.New("encoded key was not a private key")
|
||||
}
|
||||
|
||||
return &HDPrivateKey{key: *key, Network: network, Path: path}, nil
|
||||
}
|
||||
|
||||
// PublicKey returns the matching pub key
|
||||
func (p *HDPrivateKey) PublicKey() *HDPublicKey {
|
||||
|
||||
key, err := p.key.Neuter()
|
||||
if err != nil {
|
||||
panic("original key was invalid")
|
||||
}
|
||||
|
||||
return &HDPublicKey{key: *key, Network: p.Network, Path: p.Path}
|
||||
}
|
||||
|
||||
// String return the key base58-encoded
|
||||
func (p *HDPrivateKey) String() string {
|
||||
return p.key.String()
|
||||
}
|
||||
|
||||
// DerivedAt derives a new child priv key, which may be hardened
|
||||
// index should be uint32 but for java compat we use int64
|
||||
func (p *HDPrivateKey) DerivedAt(index int64, hardened bool) (*HDPrivateKey, error) {
|
||||
var modifier uint32
|
||||
if hardened {
|
||||
modifier = hdkeychain.HardenedKeyStart
|
||||
}
|
||||
|
||||
child, err := p.key.Child(uint32(index) | modifier)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
parentPath, err := hdpath.Parse(p.Path)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
path := parentPath.Child(uint32(index) | modifier)
|
||||
|
||||
return &HDPrivateKey{key: *child, Network: p.Network, Path: path.String()}, nil
|
||||
}
|
||||
|
||||
func (p *HDPrivateKey) DeriveTo(path string) (*HDPrivateKey, error) {
|
||||
|
||||
if !strings.HasPrefix(path, p.Path) {
|
||||
return nil, fmt.Errorf("derivation path %v is not prefix of the keys path %v", path, p.Path)
|
||||
}
|
||||
|
||||
firstPath, err := hdpath.Parse(p.Path)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("couldn't parse derivation path %v: %w", p.Path, err)
|
||||
}
|
||||
|
||||
secondPath, err := hdpath.Parse(path)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("couldn't parse derivation path %v: %w", path, err)
|
||||
}
|
||||
|
||||
indexes := secondPath.IndexesFrom(firstPath)
|
||||
derivedKey := p
|
||||
for depth, index := range indexes {
|
||||
derivedKey, err = derivedKey.DerivedAt(int64(index.Index), index.Hardened)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to derive key at path %v on depth %v: %w", path, depth, err)
|
||||
}
|
||||
}
|
||||
// The generated path has no names in it, so replace it
|
||||
derivedKey.Path = path
|
||||
|
||||
return derivedKey, nil
|
||||
}
|
||||
|
||||
// Sign a payload using the backing EC key
|
||||
func (p *HDPrivateKey) Sign(data []byte) ([]byte, error) {
|
||||
|
||||
signingKey, err := p.key.ECPrivKey()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
hash := sha256.Sum256(data)
|
||||
sig, err := signingKey.Sign(hash[:])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return sig.Serialize(), nil
|
||||
}
|
||||
|
||||
func (p *HDPrivateKey) Decrypter() Decrypter {
|
||||
return &hdPrivKeyDecrypter{p, nil, true}
|
||||
}
|
||||
|
||||
func (p *HDPrivateKey) DecrypterFrom(senderKey *PublicKey) Decrypter {
|
||||
return &hdPrivKeyDecrypter{p, senderKey, false}
|
||||
}
|
||||
|
||||
func (p *HDPrivateKey) Encrypter() Encrypter {
|
||||
return &hdPubKeyEncrypter{p.PublicKey(), p}
|
||||
}
|
||||
|
||||
func (p *HDPrivateKey) EncrypterTo(receiver *HDPublicKey) Encrypter {
|
||||
return &hdPubKeyEncrypter{receiver, p}
|
||||
}
|
||||
|
||||
// What follows is a workaround for https://github.com/golang/go/issues/46893
|
||||
|
||||
func SignWithPrivateKey(key *HDPrivateKey, data []byte) ([]byte, error) {
|
||||
return key.Sign(data)
|
||||
}
|
||||
121
vendor/github.com/muun/libwallet/hdpublickey.go
generated
vendored
121
vendor/github.com/muun/libwallet/hdpublickey.go
generated
vendored
@@ -1,121 +0,0 @@
|
||||
package libwallet
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/muun/libwallet/hdpath"
|
||||
|
||||
"github.com/btcsuite/btcutil"
|
||||
"github.com/btcsuite/btcutil/hdkeychain"
|
||||
)
|
||||
|
||||
// HDPublicKey is an HD capable pub key
|
||||
type HDPublicKey struct {
|
||||
key hdkeychain.ExtendedKey
|
||||
Network *Network
|
||||
Path string
|
||||
}
|
||||
|
||||
// NewHDPublicKeyFromString creates an HD pub key from a base58-encoded string
|
||||
// If the parsed key is private, it returns an error
|
||||
func NewHDPublicKeyFromString(str, path string, network *Network) (*HDPublicKey, error) {
|
||||
|
||||
key, err := hdkeychain.NewKeyFromString(str)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if key.IsPrivate() {
|
||||
return nil, errors.New("encoded key was not a public key")
|
||||
}
|
||||
|
||||
return &HDPublicKey{key: *key, Network: network, Path: path}, nil
|
||||
}
|
||||
|
||||
// String return the key base58-encoded
|
||||
func (p *HDPublicKey) String() string {
|
||||
return p.key.String()
|
||||
}
|
||||
|
||||
// DerivedAt derives a new child pub key
|
||||
// index should be uint32 but for java compat we use int64
|
||||
func (p *HDPublicKey) DerivedAt(index int64) (*HDPublicKey, error) {
|
||||
|
||||
if index&hdkeychain.HardenedKeyStart != 0 {
|
||||
return nil, fmt.Errorf("can't derive a hardened pub key (index %v)", index)
|
||||
}
|
||||
|
||||
child, err := p.key.Child(uint32(index))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
parentPath, err := hdpath.Parse(p.Path)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
path := parentPath.Child(uint32(index))
|
||||
|
||||
return &HDPublicKey{key: *child, Network: p.Network, Path: path.String()}, nil
|
||||
}
|
||||
|
||||
func (p *HDPublicKey) DeriveTo(path string) (*HDPublicKey, error) {
|
||||
|
||||
if !strings.HasPrefix(path, p.Path) {
|
||||
return nil, fmt.Errorf("derivation path %v is not prefix of the keys path %v", path, p.Path)
|
||||
}
|
||||
|
||||
firstPath, err := hdpath.Parse(p.Path)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("couldn't parse derivation path %v: %w", p.Path, err)
|
||||
}
|
||||
|
||||
secondPath, err := hdpath.Parse(path)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("couldn't parse derivation path %v: %w", path, err)
|
||||
}
|
||||
|
||||
indexes := secondPath.IndexesFrom(firstPath)
|
||||
derivedKey := p
|
||||
for depth, index := range indexes {
|
||||
if index.Hardened {
|
||||
return nil, fmt.Errorf("can't derive a hardened pub key (path %v)", path)
|
||||
}
|
||||
|
||||
derivedKey, err = derivedKey.DerivedAt(int64(index.Index))
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to derive key at path %v on depth %v: %w", path, depth, err)
|
||||
}
|
||||
}
|
||||
// The generated path has no names in it, so replace it
|
||||
derivedKey.Path = path
|
||||
|
||||
return derivedKey, nil
|
||||
}
|
||||
|
||||
// Raw returns the backing EC compressed raw key
|
||||
func (p *HDPublicKey) Raw() []byte {
|
||||
|
||||
key, err := p.key.ECPubKey()
|
||||
if err != nil {
|
||||
panic("failed to extract pub key")
|
||||
}
|
||||
|
||||
return key.SerializeCompressed()
|
||||
}
|
||||
|
||||
// Fingerprint returns the 4-byte fingerprint for this pubkey
|
||||
func (p *HDPublicKey) Fingerprint() []byte {
|
||||
|
||||
key, err := p.key.ECPubKey()
|
||||
if err != nil {
|
||||
panic("failed to extract pub key")
|
||||
}
|
||||
|
||||
bytes := key.SerializeCompressed()
|
||||
hash := btcutil.Hash160(bytes)
|
||||
|
||||
return hash[:4]
|
||||
}
|
||||
470
vendor/github.com/muun/libwallet/incoming_swap.go
generated
vendored
470
vendor/github.com/muun/libwallet/incoming_swap.go
generated
vendored
@@ -1,470 +0,0 @@
|
||||
package libwallet
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/sha256"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/btcsuite/btcd/chaincfg"
|
||||
"github.com/btcsuite/btcd/txscript"
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/btcsuite/btcutil"
|
||||
"github.com/lightningnetwork/lnd/lnwire"
|
||||
"github.com/muun/libwallet/btcsuitew/txscriptw"
|
||||
"github.com/muun/libwallet/hdpath"
|
||||
"github.com/muun/libwallet/sphinx"
|
||||
"github.com/muun/libwallet/walletdb"
|
||||
)
|
||||
|
||||
type IncomingSwap struct {
|
||||
Htlc *IncomingSwapHtlc
|
||||
SphinxPacket []byte
|
||||
PaymentHash []byte
|
||||
PaymentAmountSat int64
|
||||
CollectSat int64
|
||||
}
|
||||
|
||||
type IncomingSwapHtlc struct {
|
||||
HtlcTx []byte
|
||||
ExpirationHeight int64
|
||||
SwapServerPublicKey []byte
|
||||
}
|
||||
|
||||
type IncomingSwapFulfillmentData struct {
|
||||
FulfillmentTx []byte
|
||||
MuunSignature []byte
|
||||
OutputVersion int // unused
|
||||
OutputPath string // unused
|
||||
MerkleTree []byte // unused
|
||||
HtlcBlock []byte // unused
|
||||
BlockHeight int64 // unused
|
||||
ConfirmationTarget int64 // to validate fee rate, unused for now
|
||||
}
|
||||
|
||||
type IncomingSwapFulfillmentResult struct {
|
||||
FulfillmentTx []byte
|
||||
Preimage []byte
|
||||
}
|
||||
|
||||
func (s *IncomingSwap) getInvoice() (*walletdb.Invoice, error) {
|
||||
db, err := openDB()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer db.Close()
|
||||
|
||||
return db.FindByPaymentHash(s.PaymentHash)
|
||||
}
|
||||
|
||||
// VerifyFulfillable checks that an incoming swap is fulfillable.
|
||||
func (s *IncomingSwap) VerifyFulfillable(userKey *HDPrivateKey, net *Network) error {
|
||||
paymentHash := s.PaymentHash
|
||||
|
||||
if len(paymentHash) != 32 {
|
||||
return fmt.Errorf("VerifyFulfillable: received invalid hash len %v", len(paymentHash))
|
||||
}
|
||||
|
||||
// Lookup invoice data matching this HTLC using the payment hash
|
||||
invoice, err := s.getInvoice()
|
||||
if err != nil {
|
||||
return fmt.Errorf("VerifyFulfillable: could not find invoice data for payment hash: %w", err)
|
||||
}
|
||||
|
||||
parentPath, err := hdpath.Parse(invoice.KeyPath)
|
||||
if err != nil {
|
||||
return fmt.Errorf("VerifyFulfillable: invoice key path is not valid: %v", invoice.KeyPath)
|
||||
}
|
||||
identityKeyPath := parentPath.Child(identityKeyChildIndex)
|
||||
|
||||
nodeHDKey, err := userKey.DeriveTo(identityKeyPath.String())
|
||||
if err != nil {
|
||||
return fmt.Errorf("VerifyFulfillable: failed to derive key: %w", err)
|
||||
}
|
||||
nodeKey, err := nodeHDKey.key.ECPrivKey()
|
||||
if err != nil {
|
||||
return fmt.Errorf("VerifyFulfillable: failed to get priv key: %w", err)
|
||||
}
|
||||
|
||||
// implementation is allowed to send a few extra sats
|
||||
if invoice.AmountSat != 0 && invoice.AmountSat > s.PaymentAmountSat {
|
||||
return fmt.Errorf("VerifyFulfillable: payment amount (%v) does not match invoice amount (%v)",
|
||||
s.PaymentAmountSat, invoice.AmountSat)
|
||||
}
|
||||
|
||||
if len(s.SphinxPacket) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
err = sphinx.Validate(
|
||||
s.SphinxPacket,
|
||||
paymentHash,
|
||||
invoice.PaymentSecret,
|
||||
nodeKey,
|
||||
0, // This is used internally by the sphinx decoder but it's not needed
|
||||
lnwire.MilliSatoshi(uint64(s.PaymentAmountSat)*1000),
|
||||
net.network,
|
||||
)
|
||||
if err != nil {
|
||||
return fmt.Errorf("VerifyFulfillable: invalid sphinx: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Fulfill validates and creates a fulfillment tx for the incoming swap.
|
||||
// It returns the fullfillment tx and the preimage.
|
||||
func (s *IncomingSwap) Fulfill(
|
||||
data *IncomingSwapFulfillmentData,
|
||||
userKey *HDPrivateKey, muunKey *HDPublicKey,
|
||||
net *Network) (*IncomingSwapFulfillmentResult, error) {
|
||||
|
||||
if s.Htlc == nil {
|
||||
return nil, fmt.Errorf("Fulfill: missing swap htlc data")
|
||||
}
|
||||
|
||||
err := s.VerifyFulfillable(userKey, net)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Validate the fullfillment tx proposed by Muun.
|
||||
tx := wire.MsgTx{}
|
||||
err = tx.DeserializeNoWitness(bytes.NewReader(data.FulfillmentTx))
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Fulfill: could not deserialize fulfillment tx: %w", err)
|
||||
}
|
||||
if len(tx.TxIn) != 1 {
|
||||
return nil, fmt.Errorf("Fulfill: expected fulfillment tx to have exactly 1 input, found %d", len(tx.TxIn))
|
||||
}
|
||||
if len(tx.TxOut) != 1 {
|
||||
return nil, fmt.Errorf("Fulfill: expected fulfillment tx to have exactly 1 output, found %d", len(tx.TxOut))
|
||||
}
|
||||
|
||||
// Lookup invoice data matching this HTLC using the payment hash
|
||||
invoice, err := s.getInvoice()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Fulfill: could not find invoice data for payment hash: %w", err)
|
||||
}
|
||||
|
||||
// Sign the htlc input (there is only one, at index 0)
|
||||
coin := coinIncomingSwap{
|
||||
Network: net.network,
|
||||
MuunSignature: data.MuunSignature,
|
||||
Sphinx: s.SphinxPacket,
|
||||
HtlcTx: s.Htlc.HtlcTx,
|
||||
PaymentHash256: s.PaymentHash,
|
||||
SwapServerPublicKey: []byte(s.Htlc.SwapServerPublicKey),
|
||||
ExpirationHeight: s.Htlc.ExpirationHeight,
|
||||
VerifyOutputAmount: true,
|
||||
Collect: btcutil.Amount(s.CollectSat),
|
||||
}
|
||||
err = coin.SignInput(0, &tx, userKey, muunKey)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Serialize and return the signed fulfillment tx
|
||||
var buf bytes.Buffer
|
||||
err = tx.Serialize(&buf)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Fulfill: could not serialize fulfillment tx: %w", err)
|
||||
}
|
||||
return &IncomingSwapFulfillmentResult{
|
||||
FulfillmentTx: buf.Bytes(),
|
||||
Preimage: invoice.Preimage,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// FulfillFullDebt gives the preimage matching a payment hash if we have it
|
||||
func (s *IncomingSwap) FulfillFullDebt() (*IncomingSwapFulfillmentResult, error) {
|
||||
|
||||
// Lookup invoice data matching this HTLC using the payment hash
|
||||
db, err := openDB()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer db.Close()
|
||||
|
||||
secrets, err := db.FindByPaymentHash(s.PaymentHash)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("FulfillFullDebt: could not find invoice data for payment hash: %w", err)
|
||||
}
|
||||
|
||||
return &IncomingSwapFulfillmentResult{
|
||||
FulfillmentTx: nil,
|
||||
Preimage: secrets.Preimage,
|
||||
}, nil
|
||||
}
|
||||
|
||||
type coinIncomingSwap struct {
|
||||
Network *chaincfg.Params
|
||||
MuunSignature []byte
|
||||
Sphinx []byte
|
||||
HtlcTx []byte
|
||||
PaymentHash256 []byte
|
||||
SwapServerPublicKey []byte
|
||||
ExpirationHeight int64
|
||||
VerifyOutputAmount bool // used only for fulfilling swaps through IncomingSwap
|
||||
Collect btcutil.Amount
|
||||
}
|
||||
|
||||
func (c *coinIncomingSwap) SignInput(index int, tx *wire.MsgTx, userKey *HDPrivateKey, muunKey *HDPublicKey) error {
|
||||
// Deserialize the HTLC transaction
|
||||
htlcTx := wire.MsgTx{}
|
||||
err := htlcTx.Deserialize(bytes.NewReader(c.HtlcTx))
|
||||
if err != nil {
|
||||
return fmt.Errorf("could not deserialize htlc tx: %w", err)
|
||||
}
|
||||
|
||||
// Lookup invoice data matching this HTLC using the payment hash
|
||||
db, err := openDB()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer db.Close()
|
||||
|
||||
secrets, err := db.FindByPaymentHash(c.PaymentHash256)
|
||||
if err != nil {
|
||||
return fmt.Errorf("could not find invoice data for payment hash: %w", err)
|
||||
}
|
||||
|
||||
parentPath, err := hdpath.Parse(secrets.KeyPath)
|
||||
if err != nil {
|
||||
return fmt.Errorf("invalid invoice key path: %w", err)
|
||||
}
|
||||
|
||||
// Recreate the HTLC script to verify it matches the transaction. For this
|
||||
// we must derive the keys used in the HTLC script
|
||||
htlcKeyPath := parentPath.Child(htlcKeyChildIndex)
|
||||
|
||||
// Derive first the private key, which we are going to use for signing later
|
||||
userPrivateKey, err := userKey.DeriveTo(htlcKeyPath.String())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
userPublicKey := userPrivateKey.PublicKey()
|
||||
|
||||
muunPublicKey, err := muunKey.DeriveTo(htlcKeyPath.String())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
htlcScript, err := c.createHtlcScript(userPublicKey, muunPublicKey)
|
||||
if err != nil {
|
||||
return fmt.Errorf("could not create htlc script: %w", err)
|
||||
}
|
||||
|
||||
// Try to find the script we just built inside the HTLC output scripts
|
||||
htlcOutputIndex, err := c.findHtlcOutputIndex(&htlcTx, htlcScript)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Next, we must validate the sphinx data. We derive the client identity
|
||||
// key used by this invoice with the key path stored in the db.
|
||||
identityKeyPath := parentPath.Child(identityKeyChildIndex)
|
||||
|
||||
nodeHDKey, err := userKey.DeriveTo(identityKeyPath.String())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
nodeKey, err := nodeHDKey.key.ECPrivKey()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
txInput := tx.TxIn[index]
|
||||
|
||||
if txInput.PreviousOutPoint.Hash != htlcTx.TxHash() {
|
||||
return fmt.Errorf("expected fulfillment tx input to point to htlc tx")
|
||||
}
|
||||
if txInput.PreviousOutPoint.Index != uint32(htlcOutputIndex) {
|
||||
return fmt.Errorf("expected fulfillment tx input to point to correct htlc output")
|
||||
}
|
||||
|
||||
sigHashes := txscript.NewTxSigHashes(tx)
|
||||
|
||||
muunSigKey, err := muunPublicKey.key.ECPubKey()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Verify Muun signature
|
||||
htlcOutputAmount := htlcTx.TxOut[htlcOutputIndex].Value
|
||||
err = verifyTxWitnessSignature(
|
||||
tx,
|
||||
sigHashes,
|
||||
index,
|
||||
htlcOutputAmount,
|
||||
htlcScript,
|
||||
c.MuunSignature,
|
||||
muunSigKey,
|
||||
)
|
||||
if err != nil {
|
||||
return fmt.Errorf("could not verify Muun signature for htlc: %w", err)
|
||||
}
|
||||
|
||||
var outputAmount, expectedAmount lnwire.MilliSatoshi
|
||||
if c.VerifyOutputAmount {
|
||||
outputAmount = lnwire.MilliSatoshi(tx.TxOut[0].Value * 1000)
|
||||
|
||||
// This incoming swap might be collecting debt, which would be deducted from the outputAmount
|
||||
// so we add it back up so the amount will match with the sphinx
|
||||
expectedAmount = outputAmount + lnwire.NewMSatFromSatoshis(c.Collect)
|
||||
}
|
||||
|
||||
// Now check the information we have against the sphinx created by the payer
|
||||
if len(c.Sphinx) > 0 {
|
||||
err = sphinx.Validate(
|
||||
c.Sphinx,
|
||||
c.PaymentHash256,
|
||||
secrets.PaymentSecret,
|
||||
nodeKey,
|
||||
uint32(c.ExpirationHeight),
|
||||
expectedAmount,
|
||||
c.Network,
|
||||
)
|
||||
if err != nil {
|
||||
return fmt.Errorf("could not verify sphinx blob: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
// Sign the fulfillment tx
|
||||
sig, err := signNativeSegwitInput(
|
||||
index,
|
||||
tx,
|
||||
userPrivateKey,
|
||||
htlcScript,
|
||||
btcutil.Amount(htlcOutputAmount),
|
||||
)
|
||||
if err != nil {
|
||||
return fmt.Errorf("could not sign fulfillment tx: %w", err)
|
||||
}
|
||||
|
||||
txInput.Witness = wire.TxWitness{
|
||||
secrets.Preimage,
|
||||
sig,
|
||||
c.MuunSignature,
|
||||
htlcScript,
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *coinIncomingSwap) FullySignInput(index int, tx *wire.MsgTx, userKey, muunKey *HDPrivateKey) error {
|
||||
// Lookup invoice data matching this HTLC using the payment hash
|
||||
db, err := openDB()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer db.Close()
|
||||
|
||||
secrets, err := db.FindByPaymentHash(c.PaymentHash256)
|
||||
if err != nil {
|
||||
return fmt.Errorf("could not find invoice data for payment hash: %w", err)
|
||||
}
|
||||
|
||||
derivedMuunKey, err := muunKey.DeriveTo(secrets.KeyPath)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to derive muun key: %w", err)
|
||||
}
|
||||
|
||||
muunSignature, err := c.signature(index, tx, userKey.PublicKey(), derivedMuunKey.PublicKey(), derivedMuunKey)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
c.MuunSignature = muunSignature
|
||||
return c.SignInput(index, tx, userKey, muunKey.PublicKey())
|
||||
}
|
||||
|
||||
func (c *coinIncomingSwap) createHtlcScript(userPublicKey, muunPublicKey *HDPublicKey) ([]byte, error) {
|
||||
return createHtlcScript(
|
||||
userPublicKey.Raw(),
|
||||
muunPublicKey.Raw(),
|
||||
c.SwapServerPublicKey,
|
||||
c.ExpirationHeight,
|
||||
c.PaymentHash256,
|
||||
)
|
||||
}
|
||||
|
||||
func (c *coinIncomingSwap) signature(index int, tx *wire.MsgTx, userKey *HDPublicKey, muunKey *HDPublicKey,
|
||||
signingKey *HDPrivateKey) ([]byte, error) {
|
||||
|
||||
htlcTx := wire.MsgTx{}
|
||||
err := htlcTx.Deserialize(bytes.NewReader(c.HtlcTx))
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not deserialize htlc tx: %w", err)
|
||||
}
|
||||
|
||||
htlcScript, err := c.createHtlcScript(userKey, muunKey)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not create htlc script: %w", err)
|
||||
}
|
||||
|
||||
htlcOutputIndex, err := c.findHtlcOutputIndex(&htlcTx, htlcScript)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prevOutAmount := htlcTx.TxOut[htlcOutputIndex].Value
|
||||
|
||||
sig, err := signNativeSegwitInput(
|
||||
index,
|
||||
tx,
|
||||
signingKey,
|
||||
htlcScript,
|
||||
btcutil.Amount(prevOutAmount),
|
||||
)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not sign fulfillment tx: %w", err)
|
||||
}
|
||||
return sig, nil
|
||||
}
|
||||
|
||||
func (c *coinIncomingSwap) findHtlcOutputIndex(htlcTx *wire.MsgTx, htlcScript []byte) (int, error) {
|
||||
witnessHash := sha256.Sum256(htlcScript)
|
||||
address, err := btcutil.NewAddressWitnessScriptHash(witnessHash[:], c.Network)
|
||||
if err != nil {
|
||||
return 0, fmt.Errorf("could not create htlc address: %w", err)
|
||||
}
|
||||
|
||||
pkScript, err := txscriptw.PayToAddrScript(address)
|
||||
if err != nil {
|
||||
return 0, fmt.Errorf("could not create pk script: %w", err)
|
||||
}
|
||||
|
||||
// Try to find the script we just built inside the HTLC output scripts
|
||||
for i, out := range htlcTx.TxOut {
|
||||
if bytes.Equal(pkScript, out.PkScript) {
|
||||
return i, nil
|
||||
}
|
||||
}
|
||||
|
||||
return 0, errors.New("could not find valid htlc output in htlc tx")
|
||||
}
|
||||
|
||||
func createHtlcScript(userPublicKey, muunPublicKey, swapServerPublicKey []byte, expiry int64, paymentHash []byte) ([]byte, error) {
|
||||
sb := txscript.NewScriptBuilder()
|
||||
sb.AddData(muunPublicKey)
|
||||
sb.AddOp(txscript.OP_CHECKSIG)
|
||||
sb.AddOp(txscript.OP_NOTIF)
|
||||
sb.AddOp(txscript.OP_DUP)
|
||||
sb.AddOp(txscript.OP_HASH160)
|
||||
sb.AddData(btcutil.Hash160(swapServerPublicKey))
|
||||
sb.AddOp(txscript.OP_EQUALVERIFY)
|
||||
sb.AddOp(txscript.OP_CHECKSIGVERIFY)
|
||||
sb.AddInt64(expiry)
|
||||
sb.AddOp(txscript.OP_CHECKLOCKTIMEVERIFY)
|
||||
sb.AddOp(txscript.OP_ELSE)
|
||||
sb.AddData(userPublicKey)
|
||||
sb.AddOp(txscript.OP_CHECKSIGVERIFY)
|
||||
sb.AddOp(txscript.OP_SIZE)
|
||||
sb.AddInt64(32)
|
||||
sb.AddOp(txscript.OP_EQUALVERIFY)
|
||||
sb.AddOp(txscript.OP_HASH160)
|
||||
sb.AddData(ripemd160(paymentHash))
|
||||
sb.AddOp(txscript.OP_EQUAL)
|
||||
sb.AddOp(txscript.OP_ENDIF)
|
||||
return sb.Script()
|
||||
}
|
||||
26
vendor/github.com/muun/libwallet/init.go
generated
vendored
26
vendor/github.com/muun/libwallet/init.go
generated
vendored
@@ -1,26 +0,0 @@
|
||||
package libwallet
|
||||
|
||||
import (
|
||||
"runtime/debug"
|
||||
)
|
||||
|
||||
// Listener is an interface implemented by the apps to receive notifications
|
||||
// of data changes from the libwallet code. Each change is reported with a
|
||||
// string tag identifying the type of change.
|
||||
type Listener interface {
|
||||
OnDataChanged(tag string)
|
||||
}
|
||||
|
||||
// Config defines the global libwallet configuration.
|
||||
type Config struct {
|
||||
DataDir string
|
||||
Listener Listener
|
||||
}
|
||||
|
||||
var cfg *Config
|
||||
|
||||
// Init configures the libwallet
|
||||
func Init(c *Config) {
|
||||
debug.SetTraceback("crash")
|
||||
cfg = c
|
||||
}
|
||||
83
vendor/github.com/muun/libwallet/invoice.go
generated
vendored
83
vendor/github.com/muun/libwallet/invoice.go
generated
vendored
@@ -1,83 +0,0 @@
|
||||
package libwallet
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/lightningnetwork/lnd/zpay32"
|
||||
"github.com/muun/libwallet/errors"
|
||||
)
|
||||
|
||||
// Invoice is muun's invoice struct
|
||||
type Invoice struct {
|
||||
RawInvoice string
|
||||
FallbackAddress *MuunPaymentURI
|
||||
Network *Network
|
||||
MilliSat string
|
||||
Destination []byte
|
||||
PaymentHash []byte
|
||||
Expiry int64
|
||||
Description string
|
||||
Sats int64
|
||||
}
|
||||
|
||||
const lightningScheme = "lightning:"
|
||||
|
||||
// ParseInvoice parses an Invoice from an invoice string and a network
|
||||
func ParseInvoice(rawInput string, network *Network) (*Invoice, error) {
|
||||
|
||||
_, components := buildUriFromString(rawInput, lightningScheme)
|
||||
if components == nil {
|
||||
return nil, errors.Errorf(ErrInvalidInvoice, "failed to parse uri %v", rawInput)
|
||||
}
|
||||
|
||||
if components.Scheme != "lightning" {
|
||||
return nil, errors.Errorf(ErrInvalidInvoice, "invalid scheme %v", components.Scheme)
|
||||
}
|
||||
|
||||
invoice := components.Opaque
|
||||
|
||||
// When URIs are scheme:// the address comes in host
|
||||
// this happens in iOS that mostly ignores scheme: format
|
||||
if len(invoice) == 0 {
|
||||
invoice = components.Host
|
||||
}
|
||||
|
||||
parsedInvoice, err := zpay32.Decode(invoice, network.network)
|
||||
if err != nil {
|
||||
return nil, errors.Errorf(ErrInvalidInvoice, "Couldn't parse invoice: %w", err)
|
||||
}
|
||||
|
||||
var fallbackAdd *MuunPaymentURI
|
||||
|
||||
if parsedInvoice.FallbackAddr != nil {
|
||||
fallbackAdd, err = GetPaymentURI(parsedInvoice.FallbackAddr.String(), network)
|
||||
if err != nil {
|
||||
return nil, errors.Errorf(ErrInvalidInvoice, "Couldn't get address: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
var description string
|
||||
if parsedInvoice.Description != nil {
|
||||
description = *parsedInvoice.Description
|
||||
}
|
||||
|
||||
var milliSats string
|
||||
var sats int64
|
||||
if parsedInvoice.MilliSat != nil {
|
||||
milliSat := uint64(*parsedInvoice.MilliSat)
|
||||
milliSats = fmt.Sprintf("%v", milliSat)
|
||||
sats = int64(milliSat / 1000)
|
||||
}
|
||||
|
||||
return &Invoice{
|
||||
RawInvoice: invoice,
|
||||
FallbackAddress: fallbackAdd,
|
||||
Network: network,
|
||||
MilliSat: milliSats,
|
||||
Destination: parsedInvoice.Destination.SerializeCompressed(),
|
||||
PaymentHash: parsedInvoice.PaymentHash[:],
|
||||
Expiry: parsedInvoice.Timestamp.Unix() + int64(parsedInvoice.Expiry().Seconds()),
|
||||
Description: description,
|
||||
Sats: sats,
|
||||
}, nil
|
||||
}
|
||||
417
vendor/github.com/muun/libwallet/invoices.go
generated
vendored
417
vendor/github.com/muun/libwallet/invoices.go
generated
vendored
@@ -1,417 +0,0 @@
|
||||
package libwallet
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/sha256"
|
||||
"encoding/binary"
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"path"
|
||||
"time"
|
||||
|
||||
"github.com/btcsuite/btcd/btcec"
|
||||
"github.com/btcsuite/btcd/txscript"
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/btcsuite/btcutil"
|
||||
"github.com/lightningnetwork/lnd/lnwire"
|
||||
"github.com/lightningnetwork/lnd/netann"
|
||||
"github.com/lightningnetwork/lnd/zpay32"
|
||||
|
||||
"github.com/muun/libwallet/hdpath"
|
||||
"github.com/muun/libwallet/walletdb"
|
||||
)
|
||||
|
||||
const MaxUnusedSecrets = 5
|
||||
|
||||
const (
|
||||
identityKeyChildIndex = 0
|
||||
htlcKeyChildIndex = 1
|
||||
encryptedMetadataKeyChildIndex = 3
|
||||
)
|
||||
|
||||
// InvoiceSecrets represents a bundle of secrets required to generate invoices
|
||||
// from the client. These secrets must be registered with the remote server
|
||||
// and persisted in the client database before use.
|
||||
type InvoiceSecrets struct {
|
||||
preimage []byte
|
||||
paymentSecret []byte
|
||||
keyPath string
|
||||
PaymentHash []byte
|
||||
IdentityKey *HDPublicKey
|
||||
UserHtlcKey *HDPublicKey
|
||||
MuunHtlcKey *HDPublicKey
|
||||
ShortChanId int64
|
||||
}
|
||||
|
||||
// RouteHints is a struct returned by the remote server containing the data
|
||||
// necessary for constructing an invoice locally.
|
||||
type RouteHints struct {
|
||||
Pubkey string
|
||||
FeeBaseMsat int64
|
||||
FeeProportionalMillionths int64
|
||||
CltvExpiryDelta int32
|
||||
}
|
||||
|
||||
type OperationMetadata struct {
|
||||
Invoice string `json:"invoice,omitempty"`
|
||||
LnurlSender string `json:"lnurlSender,omitempty"`
|
||||
}
|
||||
|
||||
// InvoiceOptions defines additional options that can be configured when
|
||||
// creating a new invoice.
|
||||
type InvoiceOptions struct {
|
||||
Description string
|
||||
AmountSat int64 // deprecated
|
||||
AmountMSat int64
|
||||
Metadata *OperationMetadata
|
||||
}
|
||||
|
||||
// InvoiceSecretsList is a wrapper around an InvoiceSecrets slice to be
|
||||
// able to pass through the gomobile bridge.
|
||||
type InvoiceSecretsList struct {
|
||||
secrets []*InvoiceSecrets
|
||||
}
|
||||
|
||||
// Length returns the number of secrets in the list.
|
||||
func (l *InvoiceSecretsList) Length() int {
|
||||
return len(l.secrets)
|
||||
}
|
||||
|
||||
// Get returns the secret at the given index.
|
||||
func (l *InvoiceSecretsList) Get(i int) *InvoiceSecrets {
|
||||
return l.secrets[i]
|
||||
}
|
||||
|
||||
// GenerateInvoiceSecrets returns a slice of new secrets to register with
|
||||
// the remote server. Once registered, those invoices should be stored with
|
||||
// the PersistInvoiceSecrets method.
|
||||
func GenerateInvoiceSecrets(userKey, muunKey *HDPublicKey) (*InvoiceSecretsList, error) {
|
||||
|
||||
var secrets []*InvoiceSecrets
|
||||
|
||||
db, err := openDB()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer db.Close()
|
||||
|
||||
unused, err := db.CountUnusedInvoices()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if unused >= MaxUnusedSecrets {
|
||||
return &InvoiceSecretsList{make([]*InvoiceSecrets, 0)}, nil
|
||||
}
|
||||
|
||||
num := MaxUnusedSecrets - unused
|
||||
|
||||
for i := 0; i < num; i++ {
|
||||
preimage := randomBytes(32)
|
||||
paymentSecret := randomBytes(32)
|
||||
paymentHashArray := sha256.Sum256(preimage)
|
||||
paymentHash := paymentHashArray[:]
|
||||
|
||||
levels := randomBytes(8)
|
||||
l1 := binary.LittleEndian.Uint32(levels[:4]) & 0x7FFFFFFF
|
||||
l2 := binary.LittleEndian.Uint32(levels[4:]) & 0x7FFFFFFF
|
||||
|
||||
keyPath := hdpath.MustParse("m/schema:1'/recovery:1'/invoices:4").Child(l1).Child(l2)
|
||||
|
||||
identityKeyPath := keyPath.Child(identityKeyChildIndex)
|
||||
|
||||
identityKey, err := userKey.DeriveTo(identityKeyPath.String())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
htlcKeyPath := keyPath.Child(htlcKeyChildIndex)
|
||||
|
||||
userHtlcKey, err := userKey.DeriveTo(htlcKeyPath.String())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
muunHtlcKey, err := muunKey.DeriveTo(htlcKeyPath.String())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
shortChanId := binary.LittleEndian.Uint64(randomBytes(8)) | (1 << 63)
|
||||
|
||||
secrets = append(secrets, &InvoiceSecrets{
|
||||
preimage: preimage,
|
||||
paymentSecret: paymentSecret,
|
||||
keyPath: keyPath.String(),
|
||||
PaymentHash: paymentHash,
|
||||
IdentityKey: identityKey,
|
||||
UserHtlcKey: userHtlcKey,
|
||||
MuunHtlcKey: muunHtlcKey,
|
||||
ShortChanId: int64(shortChanId),
|
||||
})
|
||||
}
|
||||
|
||||
// TODO: cleanup used secrets
|
||||
|
||||
return &InvoiceSecretsList{secrets}, nil
|
||||
}
|
||||
|
||||
// PersistInvoiceSecrets stores secrets registered with the remote server
|
||||
// in the device local database. These secrets can be used to craft new
|
||||
// Lightning invoices.
|
||||
func PersistInvoiceSecrets(list *InvoiceSecretsList) error {
|
||||
db, err := openDB()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer db.Close()
|
||||
|
||||
for _, s := range list.secrets {
|
||||
db.CreateInvoice(&walletdb.Invoice{
|
||||
Preimage: s.preimage,
|
||||
PaymentHash: s.PaymentHash,
|
||||
PaymentSecret: s.paymentSecret,
|
||||
KeyPath: s.keyPath,
|
||||
ShortChanId: uint64(s.ShortChanId),
|
||||
State: walletdb.InvoiceStateRegistered,
|
||||
})
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type InvoiceBuilder struct {
|
||||
net *Network
|
||||
userKey *HDPrivateKey
|
||||
routeHints []*RouteHints
|
||||
description string
|
||||
amountMSat lnwire.MilliSatoshi
|
||||
metadata *OperationMetadata
|
||||
}
|
||||
|
||||
func (i *InvoiceBuilder) Description(description string) *InvoiceBuilder {
|
||||
i.description = description
|
||||
return i
|
||||
}
|
||||
|
||||
func (i *InvoiceBuilder) AmountMSat(amountMSat int64) *InvoiceBuilder {
|
||||
i.amountMSat = lnwire.MilliSatoshi(amountMSat)
|
||||
return i
|
||||
}
|
||||
|
||||
func (i *InvoiceBuilder) AmountSat(amountSat int64) *InvoiceBuilder {
|
||||
i.amountMSat = lnwire.NewMSatFromSatoshis(btcutil.Amount(amountSat))
|
||||
return i
|
||||
}
|
||||
|
||||
func (i *InvoiceBuilder) Metadata(metadata *OperationMetadata) *InvoiceBuilder {
|
||||
i.metadata = metadata
|
||||
return i
|
||||
}
|
||||
|
||||
func (i *InvoiceBuilder) Network(net *Network) *InvoiceBuilder {
|
||||
i.net = net
|
||||
return i
|
||||
}
|
||||
|
||||
func (i *InvoiceBuilder) UserKey(userKey *HDPrivateKey) *InvoiceBuilder {
|
||||
i.userKey = userKey
|
||||
return i
|
||||
}
|
||||
|
||||
func (i *InvoiceBuilder) AddRouteHints(routeHints *RouteHints) *InvoiceBuilder {
|
||||
i.routeHints = append(i.routeHints, routeHints)
|
||||
return i
|
||||
}
|
||||
|
||||
func (i *InvoiceBuilder) Build() (string, error) {
|
||||
// obtain first unused secret from db
|
||||
db, err := openDB()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
defer db.Close()
|
||||
|
||||
dbInvoice, err := db.FindFirstUnusedInvoice()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
if dbInvoice == nil {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
var paymentHash [32]byte
|
||||
copy(paymentHash[:], dbInvoice.PaymentHash)
|
||||
|
||||
var iopts []func(*zpay32.Invoice)
|
||||
for _, hint := range i.routeHints {
|
||||
|
||||
nodeID, err := parsePubKey(hint.Pubkey)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("can't parse route hint pubkey: %w", err)
|
||||
}
|
||||
|
||||
iopts = append(iopts, zpay32.RouteHint([]zpay32.HopHint{
|
||||
{
|
||||
NodeID: nodeID,
|
||||
ChannelID: dbInvoice.ShortChanId,
|
||||
FeeBaseMSat: uint32(hint.FeeBaseMsat),
|
||||
FeeProportionalMillionths: uint32(hint.FeeProportionalMillionths),
|
||||
CLTVExpiryDelta: uint16(hint.CltvExpiryDelta),
|
||||
},
|
||||
}))
|
||||
}
|
||||
|
||||
features := lnwire.EmptyFeatureVector()
|
||||
features.RawFeatureVector.Set(lnwire.TLVOnionPayloadOptional)
|
||||
features.RawFeatureVector.Set(lnwire.PaymentAddrOptional)
|
||||
|
||||
iopts = append(iopts, zpay32.Features(features))
|
||||
iopts = append(iopts, zpay32.CLTVExpiry(72)) // ~1/2 day
|
||||
iopts = append(iopts, zpay32.Expiry(24*time.Hour))
|
||||
|
||||
var paymentAddr [32]byte
|
||||
copy(paymentAddr[:], dbInvoice.PaymentSecret)
|
||||
iopts = append(iopts, zpay32.PaymentAddr(paymentAddr))
|
||||
|
||||
if i.description != "" {
|
||||
iopts = append(iopts, zpay32.Description(i.description))
|
||||
} else {
|
||||
// description or description hash must be non-empty, adding a placeholder for now
|
||||
iopts = append(iopts, zpay32.Description(""))
|
||||
}
|
||||
if i.amountMSat != 0 {
|
||||
iopts = append(iopts, zpay32.Amount(i.amountMSat))
|
||||
}
|
||||
|
||||
// create the invoice
|
||||
invoice, err := zpay32.NewInvoice(
|
||||
i.net.network, paymentHash, time.Now(), iopts...,
|
||||
)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
// recreate the client identity privkey
|
||||
parentKeyPath, err := hdpath.Parse(dbInvoice.KeyPath)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
identityKeyPath := parentKeyPath.Child(identityKeyChildIndex)
|
||||
identityHDKey, err := i.userKey.DeriveTo(identityKeyPath.String())
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
identityKey, err := identityHDKey.key.ECPrivKey()
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("can't obtain identity privkey: %w", err)
|
||||
}
|
||||
|
||||
// sign the invoice with the identity pubkey
|
||||
signer := netann.NewNodeSigner(identityKey)
|
||||
bech32, err := invoice.Encode(zpay32.MessageSigner{
|
||||
SignCompact: signer.SignDigestCompact,
|
||||
})
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
now := time.Now()
|
||||
|
||||
// This is rounding down. Invoices with amount accept any amount larger
|
||||
// but none smaller. So if we have non-integer sats amount, rounding down
|
||||
// might accept a few msats less. But, rounding up would always fail the
|
||||
// payment.
|
||||
if invoice.MilliSat != nil {
|
||||
dbInvoice.AmountSat = int64(invoice.MilliSat.ToSatoshis())
|
||||
} else {
|
||||
dbInvoice.AmountSat = 0
|
||||
}
|
||||
dbInvoice.State = walletdb.InvoiceStateUsed
|
||||
dbInvoice.UsedAt = &now
|
||||
|
||||
var metadata *OperationMetadata
|
||||
if i.metadata != nil {
|
||||
metadata = i.metadata
|
||||
metadata.Invoice = bech32
|
||||
} else if i.description != "" {
|
||||
metadata = &OperationMetadata{Invoice: bech32}
|
||||
}
|
||||
|
||||
if metadata != nil {
|
||||
var buf bytes.Buffer
|
||||
err := json.NewEncoder(&buf).Encode(metadata)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("failed to encode metadata json: %w", err)
|
||||
}
|
||||
// encryption key is derived at 3/x/y with x and y random indexes
|
||||
key, err := deriveMetadataEncryptionKey(i.userKey)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("failed to derive encryption key: %w", err)
|
||||
}
|
||||
encryptedMetadata, err := key.Encrypter().Encrypt(buf.Bytes())
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("failed to encrypt metadata: %w", err)
|
||||
}
|
||||
dbInvoice.Metadata = encryptedMetadata
|
||||
}
|
||||
|
||||
err = db.SaveInvoice(dbInvoice)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return bech32, nil
|
||||
}
|
||||
|
||||
func deriveMetadataEncryptionKey(key *HDPrivateKey) (*HDPrivateKey, error) {
|
||||
key, err := key.DerivedAt(encryptedMetadataKeyChildIndex, false)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
key, err = key.DerivedAt(int64(rand.Int()), false)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return key.DerivedAt(int64(rand.Int()), false)
|
||||
}
|
||||
|
||||
func GetInvoiceMetadata(paymentHash []byte) (string, error) {
|
||||
db, err := openDB()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
invoice, err := db.FindByPaymentHash(paymentHash)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return invoice.Metadata, nil
|
||||
}
|
||||
|
||||
func openDB() (*walletdb.DB, error) {
|
||||
return walletdb.Open(path.Join(cfg.DataDir, "wallet.db"))
|
||||
}
|
||||
|
||||
func parsePubKey(s string) (*btcec.PublicKey, error) {
|
||||
bytes, err := hex.DecodeString(s)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return btcec.ParsePubKey(bytes, btcec.S256())
|
||||
}
|
||||
|
||||
func verifyTxWitnessSignature(tx *wire.MsgTx, sigHashes *txscript.TxSigHashes, outputIndex int, amount int64, script []byte, sig []byte, signKey *btcec.PublicKey) error {
|
||||
sigHash, err := txscript.CalcWitnessSigHash(script, sigHashes, txscript.SigHashAll, tx, outputIndex, amount)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
signature, err := btcec.ParseDERSignature(sig, btcec.S256())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !signature.Verify(sigHash, signKey) {
|
||||
return errors.New("signature does not verify")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
174
vendor/github.com/muun/libwallet/keycrypt/keycrypt.go
generated
vendored
174
vendor/github.com/muun/libwallet/keycrypt/keycrypt.go
generated
vendored
@@ -1,174 +0,0 @@
|
||||
package keycrypt
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/rand"
|
||||
"encoding/binary"
|
||||
"encoding/hex"
|
||||
"errors"
|
||||
"fmt"
|
||||
"strconv"
|
||||
"strings"
|
||||
"unicode/utf16"
|
||||
|
||||
"github.com/btcsuite/btcutil/hdkeychain"
|
||||
|
||||
"github.com/muun/libwallet/aescbc"
|
||||
"golang.org/x/crypto/scrypt"
|
||||
)
|
||||
|
||||
const (
|
||||
ivLength = 16
|
||||
saltLength = 8
|
||||
|
||||
scryptIterations = 512
|
||||
scryptBlockSize = 8
|
||||
scryptParallelizationFactor = 1
|
||||
scryptOutputLength = 32
|
||||
|
||||
separator = ":"
|
||||
)
|
||||
|
||||
// Encrypt encrypts an HD priv key using a user-provided secret into a string
|
||||
// We use SCrypt256 for key derivation and AES-CBC-PKCS7 for encryption.
|
||||
// The returned string has information about version, derivation path, scrypt and AES parameters.
|
||||
func Encrypt(key *hdkeychain.ExtendedKey, keyPath, passphrase string) (string, error) {
|
||||
iv := randomBytes(ivLength)
|
||||
salt := randomBytes(saltLength)
|
||||
|
||||
inputSecret, err := scrypt.Key(
|
||||
encodeUTF16(passphrase),
|
||||
salt,
|
||||
scryptIterations,
|
||||
scryptBlockSize,
|
||||
scryptParallelizationFactor,
|
||||
scryptOutputLength,
|
||||
)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("failed to compute scrypt key: %w", err)
|
||||
}
|
||||
|
||||
privateKeyBytes := []byte(key.String())
|
||||
|
||||
encrypted, err := aescbc.EncryptPkcs7(inputSecret, iv, privateKeyBytes)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("failed to encrypt: %w", err)
|
||||
}
|
||||
|
||||
derivationPathBytes := []byte(keyPath)
|
||||
|
||||
elements := []string{
|
||||
"v1",
|
||||
strconv.Itoa(scryptIterations),
|
||||
strconv.Itoa(scryptParallelizationFactor),
|
||||
strconv.Itoa(scryptBlockSize),
|
||||
hex.EncodeToString(salt),
|
||||
hex.EncodeToString(iv),
|
||||
hex.EncodeToString(encrypted),
|
||||
hex.EncodeToString(derivationPathBytes),
|
||||
}
|
||||
|
||||
return strings.Join(elements, separator), nil
|
||||
}
|
||||
|
||||
// Decrypt decrypts a key encrypted with Encrypt
|
||||
func Decrypt(value, passphrase string) (*hdkeychain.ExtendedKey, string, error) {
|
||||
|
||||
elements := strings.Split(value, separator)
|
||||
|
||||
if len(elements) != 8 {
|
||||
return nil, "", errors.New("invalid format")
|
||||
}
|
||||
|
||||
version := elements[0]
|
||||
iterations, err := strconv.Atoi(elements[1])
|
||||
if err != nil {
|
||||
return nil, "", fmt.Errorf("invalid iterations: %w", err)
|
||||
}
|
||||
|
||||
parallelizationFactor, err := strconv.Atoi(elements[2])
|
||||
if err != nil {
|
||||
return nil, "", fmt.Errorf("invalid p: %w", err)
|
||||
}
|
||||
|
||||
blockSize, err := strconv.Atoi(elements[3])
|
||||
if err != nil {
|
||||
return nil, "", fmt.Errorf("invalid blocksize: %w", err)
|
||||
}
|
||||
|
||||
salt, err := hex.DecodeString(elements[4])
|
||||
if err != nil {
|
||||
return nil, "", fmt.Errorf("invalid salt: %w", err)
|
||||
}
|
||||
|
||||
iv, err := hex.DecodeString(elements[5])
|
||||
if err != nil {
|
||||
return nil, "", fmt.Errorf("invalid iv: %w", err)
|
||||
}
|
||||
|
||||
payload, err := hex.DecodeString(elements[6])
|
||||
if err != nil {
|
||||
return nil, "", fmt.Errorf("invalid payload: %w", err)
|
||||
}
|
||||
|
||||
pathBytes, err := hex.DecodeString(elements[7])
|
||||
if err != nil {
|
||||
return nil, "", fmt.Errorf("invalid path: %w", err)
|
||||
}
|
||||
|
||||
if version != "v1" {
|
||||
return nil, "", fmt.Errorf("invalid version %s", version)
|
||||
}
|
||||
|
||||
inputSecret, err := scrypt.Key(
|
||||
encodeUTF16(passphrase),
|
||||
salt,
|
||||
iterations,
|
||||
blockSize,
|
||||
parallelizationFactor,
|
||||
scryptOutputLength,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, "", fmt.Errorf("failed to compute scrypt key: %w", err)
|
||||
}
|
||||
|
||||
decryptedBytes, err := aescbc.DecryptPkcs7(inputSecret, iv, payload)
|
||||
if err != nil {
|
||||
return nil, "", fmt.Errorf("failed to decrypt: %w", err)
|
||||
}
|
||||
|
||||
key, err := hdkeychain.NewKeyFromString(string(decryptedBytes[:]))
|
||||
if err != nil {
|
||||
return nil, "", fmt.Errorf("could not decode private key: %w", err)
|
||||
}
|
||||
if !key.IsPrivate() {
|
||||
return nil, "", errors.New("expected extended key to be private, not public")
|
||||
}
|
||||
|
||||
path := string(pathBytes[:])
|
||||
|
||||
return key, path, nil
|
||||
}
|
||||
|
||||
func randomBytes(count int) []byte {
|
||||
buf := make([]byte, count)
|
||||
_, err := rand.Read(buf)
|
||||
if err != nil {
|
||||
panic("couldn't read random bytes")
|
||||
}
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
func encodeUTF16(s string) []byte {
|
||||
// You might wonder why this code exists....
|
||||
// Turns out that the scrypt implementation used in android is hardwired
|
||||
// to use strings as UTF16 (which is Java's native format). So we need to
|
||||
// use the same exact byte array encoding.
|
||||
|
||||
var buf bytes.Buffer
|
||||
for _, r := range utf16.Encode([]rune(s)) {
|
||||
binary.Write(&buf, binary.BigEndian, r)
|
||||
}
|
||||
return buf.Bytes()
|
||||
}
|
||||
34
vendor/github.com/muun/libwallet/keycrypter.go
generated
vendored
34
vendor/github.com/muun/libwallet/keycrypter.go
generated
vendored
@@ -1,34 +0,0 @@
|
||||
package libwallet
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/muun/libwallet/keycrypt"
|
||||
)
|
||||
|
||||
type DecryptedKey struct {
|
||||
Key *HDPrivateKey
|
||||
Path string
|
||||
}
|
||||
|
||||
// KeyEncrypt encrypts an HD priv key using a user-provided secret into a string
|
||||
// We use SCrypt256 for key derivation and AES-CBC-PKCS7 for encryption.
|
||||
// The returned string has information about version, derivation path, scrypt and AES parameters.
|
||||
func KeyEncrypt(privKey *HDPrivateKey, passphrase string) (string, error) {
|
||||
ciphertext, err := keycrypt.Encrypt(&privKey.key, privKey.Path, passphrase)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("KeyEncrypt: failed to encrypt: %w", err)
|
||||
}
|
||||
return ciphertext, nil
|
||||
}
|
||||
|
||||
// KeyDecrypt decrypts a key encrypted with KeyEncrypt
|
||||
func KeyDecrypt(value, passphrase string, network *Network) (*DecryptedKey, error) {
|
||||
key, path, err := keycrypt.Decrypt(value, passphrase)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("KeyDecrypt: failed to decrypt: %w", err)
|
||||
}
|
||||
privateKey := &HDPrivateKey{key: *key, Network: network, Path: path}
|
||||
|
||||
return &DecryptedKey{Key: privateKey, Path: path}, nil
|
||||
}
|
||||
79
vendor/github.com/muun/libwallet/lnurl.go
generated
vendored
79
vendor/github.com/muun/libwallet/lnurl.go
generated
vendored
@@ -1,79 +0,0 @@
|
||||
package libwallet
|
||||
|
||||
import (
|
||||
"github.com/lightningnetwork/lnd/lnwire"
|
||||
"github.com/muun/libwallet/lnurl"
|
||||
)
|
||||
|
||||
type LNURLEvent struct {
|
||||
Code int
|
||||
Message string
|
||||
Metadata *LNURLEventMetadata
|
||||
}
|
||||
|
||||
type LNURLEventMetadata struct {
|
||||
Host string
|
||||
Invoice string
|
||||
}
|
||||
|
||||
const (
|
||||
LNURLErrDecode = lnurl.ErrDecode
|
||||
LNURLErrUnsafeURL = lnurl.ErrUnsafeURL
|
||||
LNURLErrUnreachable = lnurl.ErrUnreachable
|
||||
LNURLErrInvalidResponse = lnurl.ErrInvalidResponse
|
||||
LNURLErrResponse = lnurl.ErrResponse
|
||||
LNURLErrUnknown = lnurl.ErrUnknown
|
||||
LNURLErrWrongTag = lnurl.ErrWrongTag
|
||||
LNURLErrNoAvailableBalance = lnurl.ErrNoAvailableBalance
|
||||
LNURLErrRequestExpired = lnurl.ErrRequestExpired
|
||||
LNURLErrNoRoute = lnurl.ErrNoRoute
|
||||
LNURLErrTorNotSupported = lnurl.ErrTorNotSupported
|
||||
LNURLErrAlreadyUsed = lnurl.ErrAlreadyUsed
|
||||
LNURLErrForbidden = lnurl.ErrForbidden
|
||||
LNURLErrCountryNotSupported = lnurl.ErrCountryNotSupported
|
||||
LNURLStatusContacting = lnurl.StatusContacting
|
||||
LNURLStatusInvoiceCreated = lnurl.StatusInvoiceCreated
|
||||
LNURLStatusReceiving = lnurl.StatusReceiving
|
||||
)
|
||||
|
||||
type LNURLListener interface {
|
||||
OnUpdate(e *LNURLEvent)
|
||||
OnError(e *LNURLEvent)
|
||||
}
|
||||
|
||||
func LNURLValidate(qr string) bool {
|
||||
return lnurl.Validate(qr)
|
||||
}
|
||||
|
||||
// Withdraw will parse an LNURL withdraw QR and begin a withdraw process.
|
||||
// Caller must wait for the actual payment after this function has notified success.
|
||||
func LNURLWithdraw(invoiceBuilder *InvoiceBuilder, qr string, listener LNURLListener) {
|
||||
createInvoiceFunc := func(amt lnwire.MilliSatoshi, desc string, host string) (string, error) {
|
||||
metadata := &OperationMetadata{
|
||||
LnurlSender: host,
|
||||
}
|
||||
|
||||
return invoiceBuilder.AmountMSat(int64(amt)).
|
||||
Description(desc).
|
||||
Metadata(metadata).
|
||||
Build()
|
||||
}
|
||||
|
||||
allowUnsafe := invoiceBuilder.net != Mainnet()
|
||||
|
||||
go lnurl.Withdraw(qr, createInvoiceFunc, allowUnsafe, func(e *lnurl.Event) {
|
||||
event := &LNURLEvent{
|
||||
Code: e.Code,
|
||||
Message: e.Message,
|
||||
Metadata: &LNURLEventMetadata{
|
||||
Host: e.Metadata.Host,
|
||||
Invoice: e.Metadata.Invoice,
|
||||
},
|
||||
}
|
||||
if event.Code < 100 {
|
||||
listener.OnError(event)
|
||||
} else {
|
||||
listener.OnUpdate(event)
|
||||
}
|
||||
})
|
||||
}
|
||||
377
vendor/github.com/muun/libwallet/lnurl/lnurl.go
generated
vendored
377
vendor/github.com/muun/libwallet/lnurl/lnurl.go
generated
vendored
@@ -1,377 +0,0 @@
|
||||
package lnurl
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/fiatjaf/go-lnurl"
|
||||
"github.com/lightningnetwork/lnd/lnwire"
|
||||
)
|
||||
|
||||
const (
|
||||
StatusOK = "OK"
|
||||
StatusError = "ERROR"
|
||||
)
|
||||
|
||||
type Response struct {
|
||||
Status string `json:"status,omitempty"`
|
||||
Reason string `json:"reason,omitempty"`
|
||||
}
|
||||
|
||||
// stringOrNumber is used to parse either a string or a number in a JSON object
|
||||
type stringOrNumber float64
|
||||
|
||||
func (x *stringOrNumber) UnmarshalJSON(b []byte) error {
|
||||
var v stringOrNumber
|
||||
var f float64
|
||||
err := json.Unmarshal(b, &f)
|
||||
if err != nil {
|
||||
var s string
|
||||
ferr := json.Unmarshal(b, &s)
|
||||
if ferr != nil {
|
||||
return err
|
||||
}
|
||||
f, ferr = strconv.ParseFloat(s, 64)
|
||||
if ferr != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
v = stringOrNumber(f)
|
||||
*x = v
|
||||
return nil
|
||||
}
|
||||
|
||||
type WithdrawResponse struct {
|
||||
Response
|
||||
Tag string `json:"tag"`
|
||||
K1 string `json:"k1"`
|
||||
Callback string `json:"callback"`
|
||||
MaxWithdrawable stringOrNumber `json:"maxWithdrawable"`
|
||||
MinWithdrawable stringOrNumber `json:"minWithdrawable"`
|
||||
DefaultDescription string `json:"defaultDescription"`
|
||||
}
|
||||
|
||||
// After adding new codes here, remember to export them in the root libwallet
|
||||
// module so that the apps can consume them.
|
||||
const (
|
||||
ErrNone int = 0
|
||||
ErrDecode int = 1
|
||||
ErrUnsafeURL int = 2
|
||||
ErrUnreachable int = 3
|
||||
ErrInvalidResponse int = 4
|
||||
ErrResponse int = 5
|
||||
ErrUnknown int = 6
|
||||
ErrWrongTag int = 7
|
||||
ErrNoAvailableBalance int = 8
|
||||
ErrRequestExpired int = 9
|
||||
ErrNoRoute int = 10
|
||||
ErrTorNotSupported int = 11
|
||||
ErrAlreadyUsed int = 12
|
||||
ErrForbidden int = 13
|
||||
ErrCountryNotSupported int = 14 // By LNURL Service Provider
|
||||
|
||||
StatusContacting int = 100
|
||||
StatusInvoiceCreated int = 101
|
||||
StatusReceiving int = 102
|
||||
)
|
||||
|
||||
const zebedeeHostConst = "api.zebedee.io"
|
||||
|
||||
// This should definitely be a const but to simplify testing we treat it as a "conf var"
|
||||
var zebedeeHost = zebedeeHostConst
|
||||
|
||||
type Event struct {
|
||||
Code int
|
||||
Message string
|
||||
Metadata EventMetadata
|
||||
}
|
||||
|
||||
type EventMetadata struct {
|
||||
Host string
|
||||
Invoice string
|
||||
}
|
||||
|
||||
var httpClient = http.Client{Timeout: 15 * time.Second}
|
||||
|
||||
type CreateInvoiceFunction func(amt lnwire.MilliSatoshi, desc string, host string) (string, error)
|
||||
|
||||
func Validate(qr string) bool {
|
||||
_, err := decode(qr)
|
||||
return err == nil
|
||||
}
|
||||
|
||||
// Withdraw will parse an LNURL withdraw QR and begin a withdraw process.
|
||||
// Caller must wait for the actual payment after this function has notified success.
|
||||
func Withdraw(qr string, createInvoiceFunc CreateInvoiceFunction, allowUnsafe bool, notify func(e *Event)) {
|
||||
notifier := notifier{notify: notify}
|
||||
|
||||
// decode the qr
|
||||
qrUrl, err := decode(qr)
|
||||
if err != nil {
|
||||
notifier.Error(ErrDecode, err)
|
||||
return
|
||||
}
|
||||
if strings.HasSuffix(qrUrl.Host, ".onion") {
|
||||
notifier.Errorf(ErrTorNotSupported, "Tor onion links are not supported")
|
||||
return
|
||||
}
|
||||
tag := qrUrl.Query().Get("tag")
|
||||
if tag != "" && !isWithdrawRequest(tag) {
|
||||
notifier.Errorf(ErrWrongTag, "QR is not a LNURL withdraw request")
|
||||
return
|
||||
}
|
||||
if !allowUnsafe && qrUrl.Scheme != "https" {
|
||||
notifier.Errorf(ErrUnsafeURL, "URL from QR is not secure")
|
||||
return
|
||||
}
|
||||
host := qrUrl.Hostname()
|
||||
notifier.SetHost(host)
|
||||
|
||||
// update contacting
|
||||
notifier.Status(StatusContacting)
|
||||
|
||||
// start withdraw with service
|
||||
resp, err := httpClient.Get(qrUrl.String())
|
||||
if err != nil {
|
||||
notifier.Error(ErrUnreachable, err)
|
||||
return
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
if code, reason := validateHttpResponse(resp); code != ErrNone {
|
||||
notifier.Errorf(code, reason)
|
||||
return
|
||||
}
|
||||
|
||||
// parse response
|
||||
var wr WithdrawResponse
|
||||
err = json.NewDecoder(resp.Body).Decode(&wr)
|
||||
if err != nil {
|
||||
notifier.Errorf(ErrInvalidResponse, "failed to parse response: %v", err)
|
||||
return
|
||||
}
|
||||
if code, reason := wr.Validate(); code != ErrNone {
|
||||
notifier.Errorf(code, reason)
|
||||
return
|
||||
}
|
||||
|
||||
callbackURL, err := url.Parse(wr.Callback)
|
||||
if err != nil {
|
||||
notifier.Errorf(ErrInvalidResponse, "invalid callback URL: %v", err)
|
||||
return
|
||||
}
|
||||
if !allowUnsafe && callbackURL.Scheme != "https" {
|
||||
notifier.Errorf(ErrUnsafeURL, "callback URL is not secure")
|
||||
return
|
||||
}
|
||||
if callbackURL.Host != qrUrl.Host {
|
||||
notifier.Errorf(ErrInvalidResponse, "callback URL does not match QR host")
|
||||
return
|
||||
}
|
||||
|
||||
// generate invoice
|
||||
amount := lnwire.MilliSatoshi(int64(wr.MaxWithdrawable))
|
||||
invoice, err := createInvoiceFunc(amount, wr.DefaultDescription, host)
|
||||
if err != nil {
|
||||
notifier.Error(ErrUnknown, err)
|
||||
return
|
||||
}
|
||||
notifier.SetInvoice(invoice)
|
||||
notifier.Status(StatusInvoiceCreated)
|
||||
|
||||
// Mutate the query params so we keep those the original URL had
|
||||
callbackQuery := callbackURL.Query()
|
||||
callbackQuery.Add("k1", wr.K1)
|
||||
callbackQuery.Add("pr", invoice)
|
||||
callbackURL.RawQuery = callbackQuery.Encode()
|
||||
|
||||
// Confirm withdraw with service
|
||||
// Use an httpClient with a higher timeout for reliability with slow LNURL services
|
||||
withdrawClient := http.Client{Timeout: 3 * time.Minute}
|
||||
fresp, err := withdrawClient.Get(callbackURL.String())
|
||||
if err != nil {
|
||||
notifier.Errorf(ErrUnreachable, "failed to get response from callback URL: %v", err)
|
||||
return
|
||||
}
|
||||
defer fresp.Body.Close()
|
||||
|
||||
if code, reason := validateHttpResponse(fresp); code != ErrNone {
|
||||
notifier.Errorf(code, reason)
|
||||
return
|
||||
}
|
||||
|
||||
// parse response
|
||||
var fr Response
|
||||
err = json.NewDecoder(fresp.Body).Decode(&fr)
|
||||
if err != nil {
|
||||
notifier.Errorf(ErrInvalidResponse, "failed to parse response: %v", err)
|
||||
return
|
||||
}
|
||||
|
||||
if code, reason := fr.Validate(); code != ErrNone {
|
||||
notifier.Errorf(code, reason)
|
||||
return
|
||||
}
|
||||
|
||||
notifier.Status(StatusReceiving)
|
||||
}
|
||||
|
||||
func validateHttpResponse(resp *http.Response) (int, string) {
|
||||
|
||||
if resp.StatusCode >= 400 {
|
||||
// try to obtain response body
|
||||
if bytesBody, err := ioutil.ReadAll(resp.Body); err == nil {
|
||||
code := ErrInvalidResponse
|
||||
if resp.StatusCode == 403 {
|
||||
if strings.Contains(resp.Request.URL.Host, zebedeeHost) {
|
||||
code = ErrCountryNotSupported
|
||||
} else {
|
||||
code = ErrForbidden
|
||||
}
|
||||
}
|
||||
|
||||
return code, fmt.Sprintf("unexpected status code in response: %v, body: %s", resp.StatusCode, string(bytesBody))
|
||||
}
|
||||
}
|
||||
|
||||
if resp.StatusCode >= 300 {
|
||||
return ErrInvalidResponse, fmt.Sprintf("unexpected status code in response: %v", resp.StatusCode)
|
||||
}
|
||||
|
||||
return ErrNone, ""
|
||||
}
|
||||
|
||||
func (wr *WithdrawResponse) Validate() (int, string) {
|
||||
|
||||
if wr.Status == StatusError {
|
||||
return mapReasonToErrorCode(wr.Reason), wr.Reason
|
||||
}
|
||||
|
||||
if !isWithdrawRequest(wr.Tag) {
|
||||
return ErrWrongTag, "QR is not a LNURL withdraw request"
|
||||
}
|
||||
|
||||
if wr.MaxWithdrawable <= 0 {
|
||||
return ErrNoAvailableBalance, "no available balance to withdraw"
|
||||
}
|
||||
|
||||
return ErrNone, ""
|
||||
}
|
||||
|
||||
func (fr *Response) Validate() (int, string) {
|
||||
|
||||
if fr.Status == StatusError {
|
||||
return mapReasonToErrorCode(fr.Reason), fr.Reason
|
||||
}
|
||||
|
||||
return ErrNone, ""
|
||||
}
|
||||
|
||||
// reasons maps from parts of responses to the error code. The string can be in
|
||||
// any part of the response, and has to be lowercased to simplify matching.
|
||||
// Try to also document the original error string above the pattern.
|
||||
var reasons = map[string]int{
|
||||
"route": ErrNoRoute,
|
||||
"expired": ErrRequestExpired,
|
||||
// This Withdrawal Request is already being processed by another wallet. (zebedee)
|
||||
"already being processed": ErrAlreadyUsed,
|
||||
// This Withdrawal Request can only be processed once (zebedee)
|
||||
"request can only be processed once": ErrAlreadyUsed,
|
||||
// Withdraw is spent (lnbits)
|
||||
"withdraw is spent": ErrAlreadyUsed,
|
||||
// Withdraw link is empty (lnbits)
|
||||
"withdraw link is empty": ErrAlreadyUsed,
|
||||
// This LNURL has already been used (thndr.io)
|
||||
"has already been used": ErrAlreadyUsed,
|
||||
}
|
||||
|
||||
func mapReasonToErrorCode(reason string) int {
|
||||
|
||||
reason = strings.ToLower(reason)
|
||||
|
||||
for pattern, code := range reasons {
|
||||
if strings.Contains(reason, pattern) {
|
||||
return code
|
||||
}
|
||||
}
|
||||
|
||||
// Simply an invalid response for some unknown reason
|
||||
return ErrResponse
|
||||
}
|
||||
|
||||
func decode(qr string) (*url.URL, error) {
|
||||
// handle fallback scheme
|
||||
var toParse string
|
||||
if strings.HasPrefix(qr, "http://") || strings.HasPrefix(qr, "https://") {
|
||||
u, err := url.Parse(qr)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
toParse = u.Query().Get("lightning")
|
||||
} else {
|
||||
// Remove muun: prefix, including the :// version for iOS
|
||||
qr = strings.Replace(qr, "muun://", "", 1)
|
||||
qr = strings.Replace(qr, "muun:", "", 1)
|
||||
|
||||
// Use a consistent prefix
|
||||
if !strings.HasPrefix(strings.ToLower(qr), "lightning:") {
|
||||
qr = "lightning:" + qr
|
||||
}
|
||||
|
||||
uri, err := url.Parse(qr)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if len(uri.Opaque) > 0 {
|
||||
// This catches lightning:LNURL
|
||||
toParse = uri.Opaque
|
||||
} else {
|
||||
// And this catches lightning://LNURL which is needed for iOS
|
||||
toParse = uri.Host
|
||||
}
|
||||
}
|
||||
u, err := lnurl.LNURLDecode(toParse)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return url.Parse(u)
|
||||
}
|
||||
|
||||
// We allow "withdraw" as a valid LNURL withdraw tag because, even though not in spec, there are
|
||||
// implementations in the wild using it and accepting it as valid (e.g azte.co)
|
||||
func isWithdrawRequest(tag string) bool {
|
||||
return tag == "withdrawRequest" || tag == "withdraw"
|
||||
}
|
||||
|
||||
type notifier struct {
|
||||
metadata EventMetadata
|
||||
notify func(*Event)
|
||||
}
|
||||
|
||||
func (n *notifier) SetHost(host string) {
|
||||
n.metadata.Host = host
|
||||
}
|
||||
|
||||
func (n *notifier) SetInvoice(invoice string) {
|
||||
n.metadata.Invoice = invoice
|
||||
}
|
||||
|
||||
func (n *notifier) Status(status int) {
|
||||
n.notify(&Event{Code: status, Metadata: n.metadata})
|
||||
}
|
||||
|
||||
func (n *notifier) Error(status int, err error) {
|
||||
n.notify(&Event{Code: status, Message: err.Error(), Metadata: n.metadata})
|
||||
}
|
||||
|
||||
func (n *notifier) Errorf(status int, format string, a ...interface{}) {
|
||||
msg := fmt.Sprintf(format, a...)
|
||||
n.notify(&Event{Code: status, Message: msg, Metadata: n.metadata})
|
||||
}
|
||||
7
vendor/github.com/muun/libwallet/musig/README.md
generated
vendored
7
vendor/github.com/muun/libwallet/musig/README.md
generated
vendored
@@ -1,7 +0,0 @@
|
||||
CGo likes having all C files in the same folder as the go package that will use it. This can be avoided, but it requires building the lib ourselves. In the context of libwallet, that means cross compiling to iOS and Android targets, then selectively linking the proper one. Not exactly easy.
|
||||
|
||||
The alternative is then to flatten libsecp256k1 to a single folder. We can now use golangs include directives to use the headers we need. So far so good, right?
|
||||
|
||||
Wrong. The lib has a peculiar pattern of writing a lot of it's logic in .h files instead of .c files. CGo naturally only compiles .c files. To get around this, a new .c file is added: umbrella.c, which includes every source header we need. It's counterpart, umbrella.h includes every definition header we need to make things a bit easier to handle on Go's side.
|
||||
|
||||
Some things to keep in mind if you want to update libsecp. The script does it best job to make everything work, but it might fail if any details change in the lib. After executing it, review added files to see if they are relevant and remove them if not.
|
||||
84
vendor/github.com/muun/libwallet/musig/adaptor_impl.h
generated
vendored
84
vendor/github.com/muun/libwallet/musig/adaptor_impl.h
generated
vendored
@@ -1,84 +0,0 @@
|
||||
/**********************************************************************
|
||||
* Copyright (c) 2021 Jonas Nick *
|
||||
* Distributed under the MIT software license, see the accompanying *
|
||||
* file COPYING or http://www.opensource.org/licenses/mit-license.php.*
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef _SECP256K1_MODULE_MUSIG_ADAPTOR_IMPL_
|
||||
#define _SECP256K1_MODULE_MUSIG_ADAPTOR_IMPL_
|
||||
|
||||
#include "session.h"
|
||||
|
||||
int secp256k1_musig_nonce_parity(const secp256k1_context* ctx, int *nonce_parity, secp256k1_musig_session *session) {
|
||||
secp256k1_musig_session_internal session_i;
|
||||
VERIFY_CHECK(ctx != NULL);
|
||||
ARG_CHECK(nonce_parity != NULL);
|
||||
ARG_CHECK(session != NULL);
|
||||
|
||||
if (!secp256k1_musig_session_load(ctx, &session_i, session)) {
|
||||
return 0;
|
||||
}
|
||||
*nonce_parity = session_i.fin_nonce_parity;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int secp256k1_musig_adapt(const secp256k1_context* ctx, unsigned char *sig64, const unsigned char *sec_adaptor32, int nonce_parity) {
|
||||
secp256k1_scalar s;
|
||||
secp256k1_scalar t;
|
||||
int overflow;
|
||||
|
||||
VERIFY_CHECK(ctx != NULL);
|
||||
ARG_CHECK(sig64 != NULL);
|
||||
ARG_CHECK(sec_adaptor32 != NULL);
|
||||
|
||||
secp256k1_scalar_set_b32(&s, &sig64[32], &overflow);
|
||||
if (overflow) {
|
||||
return 0;
|
||||
}
|
||||
secp256k1_scalar_set_b32(&t, sec_adaptor32, &overflow);
|
||||
if (overflow) {
|
||||
secp256k1_scalar_clear(&t);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (nonce_parity) {
|
||||
secp256k1_scalar_negate(&t, &t);
|
||||
}
|
||||
|
||||
secp256k1_scalar_add(&s, &s, &t);
|
||||
secp256k1_scalar_get_b32(&sig64[32], &s);
|
||||
secp256k1_scalar_clear(&t);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int secp256k1_musig_extract_adaptor(const secp256k1_context* ctx, unsigned char *sec_adaptor32, const unsigned char *sig64, const unsigned char *pre_sig64, int nonce_parity) {
|
||||
secp256k1_scalar t;
|
||||
secp256k1_scalar s;
|
||||
int overflow;
|
||||
|
||||
VERIFY_CHECK(ctx != NULL);
|
||||
ARG_CHECK(sec_adaptor32 != NULL);
|
||||
ARG_CHECK(sig64 != NULL);
|
||||
ARG_CHECK(pre_sig64 != NULL);
|
||||
|
||||
secp256k1_scalar_set_b32(&t, &sig64[32], &overflow);
|
||||
if (overflow) {
|
||||
return 0;
|
||||
}
|
||||
secp256k1_scalar_negate(&t, &t);
|
||||
|
||||
secp256k1_scalar_set_b32(&s, &pre_sig64[32], &overflow);
|
||||
if (overflow) {
|
||||
return 0;
|
||||
}
|
||||
secp256k1_scalar_add(&t, &t, &s);
|
||||
|
||||
if (!nonce_parity) {
|
||||
secp256k1_scalar_negate(&t, &t);
|
||||
}
|
||||
secp256k1_scalar_get_b32(sec_adaptor32, &t);
|
||||
secp256k1_scalar_clear(&t);
|
||||
return 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
80
vendor/github.com/muun/libwallet/musig/assumptions.h
generated
vendored
80
vendor/github.com/muun/libwallet/musig/assumptions.h
generated
vendored
@@ -1,80 +0,0 @@
|
||||
/***********************************************************************
|
||||
* Copyright (c) 2020 Pieter Wuille *
|
||||
* Distributed under the MIT software license, see the accompanying *
|
||||
* file COPYING or https://www.opensource.org/licenses/mit-license.php.*
|
||||
***********************************************************************/
|
||||
|
||||
#ifndef SECP256K1_ASSUMPTIONS_H
|
||||
#define SECP256K1_ASSUMPTIONS_H
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
#include "util.h"
|
||||
|
||||
/* This library, like most software, relies on a number of compiler implementation defined (but not undefined)
|
||||
behaviours. Although the behaviours we require are essentially universal we test them specifically here to
|
||||
reduce the odds of experiencing an unwelcome surprise.
|
||||
*/
|
||||
|
||||
struct secp256k1_assumption_checker {
|
||||
/* This uses a trick to implement a static assertion in C89: a type with an array of negative size is not
|
||||
allowed. */
|
||||
int dummy_array[(
|
||||
/* Bytes are 8 bits. */
|
||||
(CHAR_BIT == 8) &&
|
||||
|
||||
/* No integer promotion for uint32_t. This ensures that we can multiply uintXX_t values where XX >= 32
|
||||
without signed overflow, which would be undefined behaviour. */
|
||||
(UINT_MAX <= UINT32_MAX) &&
|
||||
|
||||
/* Conversions from unsigned to signed outside of the bounds of the signed type are
|
||||
implementation-defined. Verify that they function as reinterpreting the lower
|
||||
bits of the input in two's complement notation. Do this for conversions:
|
||||
- from uint(N)_t to int(N)_t with negative result
|
||||
- from uint(2N)_t to int(N)_t with negative result
|
||||
- from int(2N)_t to int(N)_t with negative result
|
||||
- from int(2N)_t to int(N)_t with positive result */
|
||||
|
||||
/* To int8_t. */
|
||||
((int8_t)(uint8_t)0xAB == (int8_t)-(int8_t)0x55) &&
|
||||
((int8_t)(uint16_t)0xABCD == (int8_t)-(int8_t)0x33) &&
|
||||
((int8_t)(int16_t)(uint16_t)0xCDEF == (int8_t)(uint8_t)0xEF) &&
|
||||
((int8_t)(int16_t)(uint16_t)0x9234 == (int8_t)(uint8_t)0x34) &&
|
||||
|
||||
/* To int16_t. */
|
||||
((int16_t)(uint16_t)0xBCDE == (int16_t)-(int16_t)0x4322) &&
|
||||
((int16_t)(uint32_t)0xA1B2C3D4 == (int16_t)-(int16_t)0x3C2C) &&
|
||||
((int16_t)(int32_t)(uint32_t)0xC1D2E3F4 == (int16_t)(uint16_t)0xE3F4) &&
|
||||
((int16_t)(int32_t)(uint32_t)0x92345678 == (int16_t)(uint16_t)0x5678) &&
|
||||
|
||||
/* To int32_t. */
|
||||
((int32_t)(uint32_t)0xB2C3D4E5 == (int32_t)-(int32_t)0x4D3C2B1B) &&
|
||||
((int32_t)(uint64_t)0xA123B456C789D012ULL == (int32_t)-(int32_t)0x38762FEE) &&
|
||||
((int32_t)(int64_t)(uint64_t)0xC1D2E3F4A5B6C7D8ULL == (int32_t)(uint32_t)0xA5B6C7D8) &&
|
||||
((int32_t)(int64_t)(uint64_t)0xABCDEF0123456789ULL == (int32_t)(uint32_t)0x23456789) &&
|
||||
|
||||
/* To int64_t. */
|
||||
((int64_t)(uint64_t)0xB123C456D789E012ULL == (int64_t)-(int64_t)0x4EDC3BA928761FEEULL) &&
|
||||
#if defined(SECP256K1_WIDEMUL_INT128)
|
||||
((int64_t)(((uint128_t)0xA1234567B8901234ULL << 64) + 0xC5678901D2345678ULL) == (int64_t)-(int64_t)0x3A9876FE2DCBA988ULL) &&
|
||||
(((int64_t)(int128_t)(((uint128_t)0xB1C2D3E4F5A6B7C8ULL << 64) + 0xD9E0F1A2B3C4D5E6ULL)) == (int64_t)(uint64_t)0xD9E0F1A2B3C4D5E6ULL) &&
|
||||
(((int64_t)(int128_t)(((uint128_t)0xABCDEF0123456789ULL << 64) + 0x0123456789ABCDEFULL)) == (int64_t)(uint64_t)0x0123456789ABCDEFULL) &&
|
||||
|
||||
/* To int128_t. */
|
||||
((int128_t)(((uint128_t)0xB1234567C8901234ULL << 64) + 0xD5678901E2345678ULL) == (int128_t)(-(int128_t)0x8E1648B3F50E80DCULL * 0x8E1648B3F50E80DDULL + 0x5EA688D5482F9464ULL)) &&
|
||||
#endif
|
||||
|
||||
/* Right shift on negative signed values is implementation defined. Verify that it
|
||||
acts as a right shift in two's complement with sign extension (i.e duplicating
|
||||
the top bit into newly added bits). */
|
||||
((((int8_t)0xE8) >> 2) == (int8_t)(uint8_t)0xFA) &&
|
||||
((((int16_t)0xE9AC) >> 4) == (int16_t)(uint16_t)0xFE9A) &&
|
||||
((((int32_t)0x937C918A) >> 9) == (int32_t)(uint32_t)0xFFC9BE48) &&
|
||||
((((int64_t)0xA8B72231DF9CF4B9ULL) >> 19) == (int64_t)(uint64_t)0xFFFFF516E4463BF3ULL) &&
|
||||
#if defined(SECP256K1_WIDEMUL_INT128)
|
||||
((((int128_t)(((uint128_t)0xCD833A65684A0DBCULL << 64) + 0xB349312F71EA7637ULL)) >> 39) == (int128_t)(((uint128_t)0xFFFFFFFFFF9B0674ULL << 64) + 0xCAD0941B79669262ULL)) &&
|
||||
#endif
|
||||
1) * 2 - 1];
|
||||
};
|
||||
|
||||
#endif /* SECP256K1_ASSUMPTIONS_H */
|
||||
17
vendor/github.com/muun/libwallet/musig/basic-config.h
generated
vendored
17
vendor/github.com/muun/libwallet/musig/basic-config.h
generated
vendored
@@ -1,17 +0,0 @@
|
||||
/***********************************************************************
|
||||
* Copyright (c) 2013, 2014 Pieter Wuille *
|
||||
* Distributed under the MIT software license, see the accompanying *
|
||||
* file COPYING or https://www.opensource.org/licenses/mit-license.php.*
|
||||
***********************************************************************/
|
||||
|
||||
#ifndef SECP256K1_BASIC_CONFIG_H
|
||||
#define SECP256K1_BASIC_CONFIG_H
|
||||
|
||||
#ifdef USE_BASIC_CONFIG
|
||||
|
||||
#define ECMULT_WINDOW_SIZE 15
|
||||
#define ECMULT_GEN_PREC_BITS 4
|
||||
|
||||
#endif /* USE_BASIC_CONFIG */
|
||||
|
||||
#endif /* SECP256K1_BASIC_CONFIG_H */
|
||||
28
vendor/github.com/muun/libwallet/musig/eccommit.h
generated
vendored
28
vendor/github.com/muun/libwallet/musig/eccommit.h
generated
vendored
@@ -1,28 +0,0 @@
|
||||
/**********************************************************************
|
||||
* Copyright (c) 2020 The libsecp256k1-zkp Developers *
|
||||
* Distributed under the MIT software license, see the accompanying *
|
||||
* file COPYING or http://www.opensource.org/licenses/mit-license.php.*
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef SECP256K1_ECCOMMIT_H
|
||||
#define SECP256K1_ECCOMMIT_H
|
||||
|
||||
/** Helper function to add a 32-byte value to a scalar */
|
||||
static int secp256k1_ec_seckey_tweak_add_helper(secp256k1_scalar *sec, const unsigned char *tweak);
|
||||
/** Helper function to add a 32-byte value, times G, to an EC point */
|
||||
static int secp256k1_ec_pubkey_tweak_add_helper(const secp256k1_ecmult_context* ecmult_ctx, secp256k1_ge *p, const unsigned char *tweak);
|
||||
|
||||
/** Serializes elem as a 33 byte array. This is non-constant time with respect to
|
||||
* whether pubp is the point at infinity. Thus, you may need to declassify
|
||||
* pubp->infinity before calling this function. */
|
||||
static int secp256k1_ec_commit_pubkey_serialize_const(secp256k1_ge *pubp, unsigned char *buf33);
|
||||
/** Compute an ec commitment tweak as hash(pubkey, data). */
|
||||
static int secp256k1_ec_commit_tweak(unsigned char *tweak32, secp256k1_ge* pubp, secp256k1_sha256* sha, const unsigned char *data, size_t data_size);
|
||||
/** Compute an ec commitment as pubkey + hash(pubkey, data)*G. */
|
||||
static int secp256k1_ec_commit(const secp256k1_ecmult_context* ecmult_ctx, secp256k1_ge* commitp, const secp256k1_ge* pubp, secp256k1_sha256* sha, const unsigned char *data, size_t data_size);
|
||||
/** Compute a secret key commitment as seckey + hash(pubkey, data). */
|
||||
static int secp256k1_ec_commit_seckey(const secp256k1_ecmult_gen_context* ecmult_gen_ctx, secp256k1_scalar* seckey, secp256k1_ge* pubp, secp256k1_sha256* sha, const unsigned char *data, size_t data_size);
|
||||
/** Verify an ec commitment as pubkey + hash(pubkey, data)*G ?= commitment. */
|
||||
static int secp256k1_ec_commit_verify(const secp256k1_ecmult_context* ecmult_ctx, const secp256k1_ge* commitp, const secp256k1_ge* pubp, secp256k1_sha256* sha, const unsigned char *data, size_t data_size);
|
||||
|
||||
#endif /* SECP256K1_ECCOMMIT_H */
|
||||
73
vendor/github.com/muun/libwallet/musig/eccommit_impl.h
generated
vendored
73
vendor/github.com/muun/libwallet/musig/eccommit_impl.h
generated
vendored
@@ -1,73 +0,0 @@
|
||||
/**********************************************************************
|
||||
* Copyright (c) 2020 The libsecp256k1 Developers *
|
||||
* Distributed under the MIT software license, see the accompanying *
|
||||
* file COPYING or http://www.opensource.org/licenses/mit-license.php.*
|
||||
**********************************************************************/
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include "eckey.h"
|
||||
#include "hash.h"
|
||||
|
||||
/* from secp256k1.c */
|
||||
static int secp256k1_ec_seckey_tweak_add_helper(secp256k1_scalar *sec, const unsigned char *tweak);
|
||||
static int secp256k1_ec_pubkey_tweak_add_helper(const secp256k1_ecmult_context* ecmult_ctx, secp256k1_ge *pubp, const unsigned char *tweak);
|
||||
|
||||
static int secp256k1_ec_commit_pubkey_serialize_const(secp256k1_ge *pubp, unsigned char *buf33) {
|
||||
if (secp256k1_ge_is_infinity(pubp)) {
|
||||
return 0;
|
||||
}
|
||||
secp256k1_fe_normalize(&pubp->x);
|
||||
secp256k1_fe_normalize(&pubp->y);
|
||||
secp256k1_fe_get_b32(&buf33[1], &pubp->x);
|
||||
buf33[0] = secp256k1_fe_is_odd(&pubp->y) ? SECP256K1_TAG_PUBKEY_ODD : SECP256K1_TAG_PUBKEY_EVEN;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Compute an ec commitment tweak as hash(pubp, data). */
|
||||
static int secp256k1_ec_commit_tweak(unsigned char *tweak32, secp256k1_ge* pubp, secp256k1_sha256* sha, const unsigned char *data, size_t data_size)
|
||||
{
|
||||
unsigned char rbuf[33];
|
||||
|
||||
if (!secp256k1_ec_commit_pubkey_serialize_const(pubp, rbuf)) {
|
||||
return 0;
|
||||
}
|
||||
secp256k1_sha256_write(sha, rbuf, sizeof(rbuf));
|
||||
secp256k1_sha256_write(sha, data, data_size);
|
||||
secp256k1_sha256_finalize(sha, tweak32);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Compute an ec commitment as pubp + hash(pubp, data)*G. */
|
||||
static int secp256k1_ec_commit(const secp256k1_ecmult_context* ecmult_ctx, secp256k1_ge* commitp, const secp256k1_ge* pubp, secp256k1_sha256* sha, const unsigned char *data, size_t data_size) {
|
||||
unsigned char tweak[32];
|
||||
|
||||
*commitp = *pubp;
|
||||
return secp256k1_ec_commit_tweak(tweak, commitp, sha, data, data_size)
|
||||
&& secp256k1_ec_pubkey_tweak_add_helper(ecmult_ctx, commitp, tweak);
|
||||
}
|
||||
|
||||
/* Compute the seckey of an ec commitment from the original secret key of the pubkey as seckey +
|
||||
* hash(pubp, data). */
|
||||
static int secp256k1_ec_commit_seckey(secp256k1_scalar* seckey, secp256k1_ge* pubp, secp256k1_sha256* sha, const unsigned char *data, size_t data_size) {
|
||||
unsigned char tweak[32];
|
||||
return secp256k1_ec_commit_tweak(tweak, pubp, sha, data, data_size)
|
||||
&& secp256k1_ec_seckey_tweak_add_helper(seckey, tweak);
|
||||
}
|
||||
|
||||
/* Verify an ec commitment as pubp + hash(pubp, data)*G ?= commitment. */
|
||||
static int secp256k1_ec_commit_verify(const secp256k1_ecmult_context* ecmult_ctx, const secp256k1_ge* commitp, const secp256k1_ge* pubp, secp256k1_sha256* sha, const unsigned char *data, size_t data_size) {
|
||||
secp256k1_gej pj;
|
||||
secp256k1_ge p;
|
||||
|
||||
if (!secp256k1_ec_commit(ecmult_ctx, &p, pubp, sha, data, data_size)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Return p == commitp */
|
||||
secp256k1_ge_neg(&p, &p);
|
||||
secp256k1_gej_set_ge(&pj, &p);
|
||||
secp256k1_gej_add_ge_var(&pj, &pj, commitp, NULL);
|
||||
return secp256k1_gej_is_infinity(&pj);
|
||||
}
|
||||
|
||||
21
vendor/github.com/muun/libwallet/musig/ecdsa.h
generated
vendored
21
vendor/github.com/muun/libwallet/musig/ecdsa.h
generated
vendored
@@ -1,21 +0,0 @@
|
||||
/***********************************************************************
|
||||
* Copyright (c) 2013, 2014 Pieter Wuille *
|
||||
* Distributed under the MIT software license, see the accompanying *
|
||||
* file COPYING or https://www.opensource.org/licenses/mit-license.php.*
|
||||
***********************************************************************/
|
||||
|
||||
#ifndef SECP256K1_ECDSA_H
|
||||
#define SECP256K1_ECDSA_H
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include "scalar.h"
|
||||
#include "group.h"
|
||||
#include "ecmult.h"
|
||||
|
||||
static int secp256k1_ecdsa_sig_parse(secp256k1_scalar *r, secp256k1_scalar *s, const unsigned char *sig, size_t size);
|
||||
static int secp256k1_ecdsa_sig_serialize(unsigned char *sig, size_t *size, const secp256k1_scalar *r, const secp256k1_scalar *s);
|
||||
static int secp256k1_ecdsa_sig_verify(const secp256k1_ecmult_context *ctx, const secp256k1_scalar* r, const secp256k1_scalar* s, const secp256k1_ge *pubkey, const secp256k1_scalar *message);
|
||||
static int secp256k1_ecdsa_sig_sign(const secp256k1_ecmult_gen_context *ctx, secp256k1_scalar* r, secp256k1_scalar* s, const secp256k1_scalar *seckey, const secp256k1_scalar *message, const secp256k1_scalar *nonce, int *recid);
|
||||
|
||||
#endif /* SECP256K1_ECDSA_H */
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user