diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 460480d..2bdf49a 100755 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -2,7 +2,7 @@ name: Bug report about: Create a report to help us improve this project labels: bug-p3 -assignees: mrz1836 +assignees: rohenaz --- diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index cb3fd96..32357d7 100755 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -2,7 +2,7 @@ name: Feature request about: Suggest an idea for this project labels: idea -assignees: mrz1836 +assignees: rohenaz --- diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md index c7f749a..046b60c 100755 --- a/.github/ISSUE_TEMPLATE/question.md +++ b/.github/ISSUE_TEMPLATE/question.md @@ -2,7 +2,7 @@ name: Question about: 'General template for a question ' labels: question -assignees: mrz1836 +assignees: rohenaz --- diff --git a/.github/dependabot.yml b/.github/dependabot.yml index c999cb7..e047aef 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -10,9 +10,9 @@ updates: # Check for npm updates at 9am UTC (5am EST) time: "10:00" reviewers: - - "mrz1836" + - "rohenaz" assignees: - - "mrz1836" + - "rohenaz" # Labels must be created first labels: - "update" @@ -25,9 +25,9 @@ updates: interval: "weekly" day: "monday" reviewers: - - "mrz1836" + - "rohenaz" assignees: - - "mrz1836" + - "rohenaz" labels: - "chore" open-pull-requests-limit: 10 \ No newline at end of file diff --git a/.github/mergify.yml b/.github/mergify.yml index f570b0a..742b6de 100644 --- a/.github/mergify.yml +++ b/.github/mergify.yml @@ -8,8 +8,7 @@ pull_request_rules: conditions: - -draft - author~=^dependabot(|-preview)\[bot\]$ - - check-success='test (1.18.x, ubuntu-latest)' - - check-success='test (1.19.x, ubuntu-latest)' + - check-success='test (1.23.x, ubuntu-latest)' - check-success='Analyze (go)' - title~=^Bump [^\s]+ from ([\d]+)\..+ to \1\. actions: @@ -21,13 +20,12 @@ pull_request_rules: - name: Alert on major version detection conditions: - author~=^dependabot(|-preview)\[bot\]$ - - check-success='test (1.18.x, ubuntu-latest)' - - check-success='test (1.19.x, ubuntu-latest)' + - check-success='test (1.23.x, ubuntu-latest)' - check-success='Analyze (go)' - -title~=^Bump [^\s]+ from ([\d]+)\..+ to \1\. actions: comment: - message: "⚠️ @mrz1836: this is a major version bump and requires your attention" + message: "⚠️ @rohenaz: this is a major version bump and requires your attention" # =============================================================================== # AUTOMATIC MERGE (APPROVALS) @@ -38,8 +36,7 @@ pull_request_rules: - "#approved-reviews-by>=1" - "#review-requested=0" - "#changes-requested-reviews-by=0" - - check-success='test (1.18.x, ubuntu-latest)' - - check-success='test (1.19.x, ubuntu-latest)' + - check-success='test (1.23.x, ubuntu-latest)' - check-success='Analyze (go)' - -title~=(?i)wip - label!=work-in-progress @@ -57,7 +54,7 @@ pull_request_rules: - "#assignee=0" actions: assign: - users: [ "mrz1836" ] + users: [ "rohenaz" ] # =============================================================================== # ALERTS @@ -170,7 +167,7 @@ pull_request_rules: - and: - author!=dependabot[bot] - author!=mergify[bot] - - author!=mrz1836 + - author!=rohenaz actions: comment: message: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0aab0fc..7655700 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,7 +23,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: 1.19 + go-version: 1.23 - name: Run GoReleaser uses: goreleaser/goreleaser-action@v6.0.0 with: diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index a379b0e..07d556d 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -15,7 +15,7 @@ jobs: test: strategy: matrix: - go-version: [ 1.18.x, 1.19.x ] + go-version: [ 1.23.x ] os: [ ubuntu-latest ] runs-on: ${{ matrix.os }} steps: diff --git a/.goreleaser.yml b/.goreleaser.yml index dabfaef..449477e 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,4 +1,7 @@ -# Make sure to check the documentation at http://goreleaser.com +# .goreleaser.yaml + +version: 2 + # --------------------------- # General # --------------------------- @@ -16,31 +19,22 @@ changelog: - '^test:' # --------------------------- -# Publishers +# Builders # --------------------------- -# publishers: -# - name: "Publish GoDocs" -# cmd: make godocs +builds: + - skip: true # --------------------------- -# Builder -# --------------------------- -build: - skip: true - -# --------------------------- -# Github Release +# GitHub Release # --------------------------- release: - prerelease: true - name_template: "Release v{{.Version}}" + prerelease: false + name_template: "Release v{{ .Version }}" # --------------------------- # Announce # --------------------------- announce: - - # See more at: https://goreleaser.com/customization/announce/#slack slack: enabled: false message_template: '{{ .ProjectName }} {{ .Tag }} is out! Changelog: https://github.com/BitcoinSchema/{{ .ProjectName }}/releases/tag/{{ .Tag }}' @@ -49,30 +43,20 @@ announce: # icon_emoji: '' # icon_url: '' - # See more at: https://goreleaser.com/customization/announce/#twitter twitter: enabled: false message_template: '{{ .ProjectName }} {{ .Tag }} is out!' - # See more at: https://goreleaser.com/customization/announce/#discord discord: enabled: false message_template: '{{ .ProjectName }} {{ .Tag }} is out!' - # Defaults to `GoReleaser` - author: '' - # Defaults to `3888754` - the grey-ish from goreleaser - color: '' - # Defaults to `https://goreleaser.com/static/avatar.png` - icon_url: '' + # author: '' + # color: '' + # icon_url: '' - # See more at: https://goreleaser.com/customization/announce/#reddit reddit: enabled: false - # Application ID for Reddit Application application_id: "" - # Username for your Reddit account username: "" - # Defaults to `{{ .GitURL }}/releases/tag/{{ .Tag }}` - # url_template: 'https://github.com/BitcoinSchema/{{ .ProjectName }}/releases/tag/{{ .Tag }}' - # Defaults to `{{ .ProjectName }} {{ .Tag }} is out!` title_template: '{{ .ProjectName }} {{ .Tag }} is out!' + # url_template: 'https://github.com/BitcoinSchema/{{ .ProjectName }}/releases/tag/{{ .Tag }}' \ No newline at end of file diff --git a/.make/go.mk b/.make/go.mk index 765c5e2..5b58827 100644 --- a/.make/go.mk +++ b/.make/go.mk @@ -67,15 +67,15 @@ install-go: ## Install the application (Using Native Go) lint: ## Run the golangci-lint application (install if not found) @echo "installing golangci-lint..." @#Travis (has sudo) - @if [ "$(shell command -v golangci-lint)" = "" ] && [ $(TRAVIS) ]; then curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.53.3 && sudo cp ./bin/golangci-lint $(go env GOPATH)/bin/; fi; + @if [ "$(shell command -v golangci-lint)" = "" ] && [ $(TRAVIS) ]; then curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.61.0 && sudo cp ./bin/golangci-lint $(go env GOPATH)/bin/; fi; @#AWS CodePipeline - @if [ "$(shell command -v golangci-lint)" = "" ] && [ "$(CODEBUILD_BUILD_ID)" != "" ]; then curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.53.3; fi; + @if [ "$(shell command -v golangci-lint)" = "" ] && [ "$(CODEBUILD_BUILD_ID)" != "" ]; then curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.61.0; fi; @#GitHub Actions - @if [ "$(shell command -v golangci-lint)" = "" ] && [ "$(GITHUB_WORKFLOW)" != "" ]; then curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b $(go env GOPATH)/bin v1.53.3; fi; + @if [ "$(shell command -v golangci-lint)" = "" ] && [ "$(GITHUB_WORKFLOW)" != "" ]; then curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b $(go env GOPATH)/bin v1.61.0; fi; @#Brew - MacOS @if [ "$(shell command -v golangci-lint)" = "" ] && [ "$(shell command -v brew)" != "" ]; then brew install golangci-lint; fi; @#MacOS Vanilla - @if [ "$(shell command -v golangci-lint)" = "" ] && [ "$(shell command -v brew)" != "" ]; then curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- v1.53.3; fi; + @if [ "$(shell command -v golangci-lint)" = "" ] && [ "$(shell command -v brew)" != "" ]; then curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- v1.61.0; fi; @echo "running golangci-lint..." @golangci-lint run --verbose diff --git a/README.md b/README.md index cde5b54..ee19a34 100644 --- a/README.md +++ b/README.md @@ -14,15 +14,19 @@
## Table of Contents -- [Installation](#installation) -- [Documentation](#documentation) -- [Examples & Tests](#examples--tests) -- [Benchmarks](#benchmarks) -- [Code Standards](#code-standards) -- [Usage](#usage) -- [Maintainers](#maintainers) -- [Contributing](#contributing) -- [License](#license) +- [go-aip](#go-aip) + - [Table of Contents](#table-of-contents) + - [Installation](#installation) + - [Documentation](#documentation) + - [Features](#features) + - [Examples \& Tests](#examples--tests) + - [Benchmarks](#benchmarks) + - [Code Standards](#code-standards) + - [Usage](#usage) + - [Maintainers](#maintainers) + - [Contributing](#contributing) + - [How can I help?](#how-can-i-help) + - [License](#license)
@@ -51,9 +55,8 @@ View the generated [documentation](https://pkg.go.dev/github.com/bitcoinschema/g Package Dependencies
-- [bitcoinschema/go-bitcoin](https://github.com/bitcoinschema/go-bitcoin) +- [bitcoin-sv/go-sdk](https://github.com/bitcoin-sv/go-sdk) - [bitcoinschema/go-bob](https://github.com/bitcoinschema/go-bob) -- [libsv/go-bt](https://github.com/libsv/go-bt)
@@ -115,7 +118,7 @@ vet Run the Go vet application ## Examples & Tests All unit tests and [examples](examples) run via [GitHub Actions](https://github.com/BitcoinSchema/go-aip/actions) and -uses [Go version 1.18.x](https://golang.org/doc/go1.18). View the [configuration file](.github/workflows/run-tests.yml). +uses [Go version 1.23.x](https://golang.org/doc/go1.23). View the [configuration file](.github/workflows/run-tests.yml). Run all tests (including integration tests) ```shell script diff --git a/aip.go b/aip.go index f437f31..0c678a9 100644 --- a/aip.go +++ b/aip.go @@ -8,14 +8,15 @@ package aip import ( "bytes" + "encoding/base64" "encoding/hex" "errors" "fmt" "strings" - "github.com/bitcoinschema/go-bitcoin" - "github.com/bitcoinsv/bsvd/txscript" - "github.com/bitcoinsv/bsvutil" + bsm "github.com/bitcoin-sv/go-sdk/compat/bsm" + ec "github.com/bitcoin-sv/go-sdk/primitives/ec" + "github.com/bitcoin-sv/go-sdk/script" ) // Prefix is the Bitcom prefix used by AIP @@ -24,7 +25,7 @@ var Prefix = "15PciHG22SNLQJXMoSUaWVi7WSqc7hCfva" var hexPrefix = hex.EncodeToString([]byte(Prefix)) const pipe = "|" -const opReturn = string(rune(txscript.OP_RETURN)) // creates: j +const opReturn = string(rune(script.OpRETURN)) // creates: j // Algorithm is an enum for the different possible signature algorithms type Algorithm string @@ -58,30 +59,40 @@ func (a *Aip) Validate() (bool, error) { return false, fmt.Errorf("the first item in payload is always OP_RETURN, got: %s", a.Data[0]) } + sig, err := base64.StdEncoding.DecodeString(a.Signature) + if err != nil { + return false, err + } // Convert pubkey to address if a.Algorithm == Paymail { // Detect whether this key was compressed when sig was made - _, wasCompressed, err := bitcoin.PubKeyFromSignature(a.Signature, strings.Join(a.Data, "")) + _, wasCompressed, err := bsm.PubKeyFromSignature(sig, []byte(strings.Join(a.Data, ""))) if err != nil { return false, err } - - // Get the public address for this paymail from pki - var addr *bsvutil.LegacyAddressPubKeyHash - if addr, err = bitcoin.GetAddressFromPubKeyString(a.AlgorithmSigningComponent, wasCompressed); err != nil { + var pubKey *ec.PublicKey + var addr *script.Address + if pubKey, err = ec.PublicKeyFromString(a.AlgorithmSigningComponent); err != nil { + return false, err + } + if addr, err = script.NewAddressFromPublicKeyWithCompression( + pubKey, + true, + wasCompressed); err != nil { return false, err } - a.AlgorithmSigningComponent = addr.String() + a.AlgorithmSigningComponent = addr.AddressString + } // You get the address associated with the pki instead of the current address - err := bitcoin.VerifyMessage(a.AlgorithmSigningComponent, a.Signature, strings.Join(a.Data, "")) + err = bsm.VerifyMessage(a.AlgorithmSigningComponent, sig, []byte(strings.Join(a.Data, ""))) return err == nil, err } // Sign will provide an AIP signature for a given private key and message using // the provided algorithm. It prepends an OP_RETURN to the payload -func Sign(privateKey string, algorithm Algorithm, message string) (a *Aip, err error) { +func Sign(privateKey *ec.PrivateKey, algorithm Algorithm, message string) (a *Aip, err error) { // Prepend the OP_RETURN to keep consistent with BitcoinFiles SDK // data = append(data, []byte{byte(txscript.OP_RETURN)}) @@ -91,31 +102,37 @@ func Sign(privateKey string, algorithm Algorithm, message string) (a *Aip, err e a = &Aip{Algorithm: algorithm, Data: prependedData} // Sign using the private key and the message - if a.Signature, err = bitcoin.SignMessage(privateKey, strings.Join(prependedData, ""), false); err != nil { - return + var sig []byte + if sig, err = bsm.SignMessage(privateKey, []byte(strings.Join(prependedData, ""))); err != nil { + return nil, err } + a.Signature = base64.StdEncoding.EncodeToString(sig) + // Store address vs pubkey switch algorithm { case BitcoinECDSA, BitcoinSignedMessage: // Signing component = bitcoin address // Get the address of the private key - if a.AlgorithmSigningComponent, err = bitcoin.GetAddressFromPrivateKeyString(privateKey, false); err != nil { - return + if add, err := script.NewAddressFromPublicKey(privateKey.PubKey(), true); err != nil { + return nil, err + } else { + a.AlgorithmSigningComponent = add.AddressString } case Paymail: // Signing component = paymail identity key // Get pubKey from private key and overload the address field in AIP - if a.AlgorithmSigningComponent, err = bitcoin.PubKeyFromPrivateKeyString(privateKey, false); err != nil { - return - } + // if pubkey, err := bitcoin.PubKeyFromPrivateKeyString(privateKey, false); err != nil { + // return + // } + a.AlgorithmSigningComponent = hex.EncodeToString(privateKey.PubKey().SerializeCompressed()) } return } // SignOpReturnData will append the given data and return a bt.Output -func SignOpReturnData(privateKey string, algorithm Algorithm, +func SignOpReturnData(privateKey *ec.PrivateKey, algorithm Algorithm, data [][]byte) (outData [][]byte, a *Aip, err error) { // Sign with AIP diff --git a/aip_test.go b/aip_test.go index 3cd92e2..2d3acd8 100644 --- a/aip_test.go +++ b/aip_test.go @@ -1,15 +1,21 @@ package aip import ( + "encoding/hex" "fmt" "strings" "testing" + ec "github.com/bitcoin-sv/go-sdk/primitives/ec" + "github.com/bitcoin-sv/go-sdk/transaction" "github.com/bitcoinschema/go-bob" - "github.com/libsv/go-bt/v2" ) -const examplePrivateKey = "54035dd4c7dda99ac473905a3d82f7864322b49bab1ff441cc457183b9bd8abd" +const examplePrivateKeyHex = "54035dd4c7dda99ac473905a3d82f7864322b49bab1ff441cc457183b9bd8abd" + +var privBytes, _ = hex.DecodeString(examplePrivateKeyHex) +var examplePrivateKey, _ = ec.PrivateKeyFromBytes(privBytes) + const exampleMessage = "test message" // TestSign will test the method Sign() @@ -30,7 +36,7 @@ func TestSign(t *testing.T) { "0499f8239bfe10eb0f5e53d543635a423c96529dd85fa4bad42049a0b435ebdd", BitcoinECDSA, exampleMessage, - "HOpsJCCkmIOBs8HJIn3Od7aa/SLycQSsZ5QuLvaSlKobYvxpkE5Lcb4fAFLXp1h5pJTEHtm/SZICybovE8AcpiM=", + "IOpsJCCkmIOBs8HJIn3Od7aa/SLycQSsZ5QuLvaSlKobYvxpkE5Lcb4fAFLXp1h5pJTEHtm/SZICybovE8AcpiM=", false, false, }, @@ -38,55 +44,23 @@ func TestSign(t *testing.T) { "80699541455b59a8a8a33b85892319de8b8e8944eb8b48e9467137825ae192e59f01", Paymail, exampleMessage, - "GwJif5FKr6rPpKYghZ7F7Rmaw00q5nWo6NiJOuje+6WBOM6qd8MlVnbWr2mrrA+aaDatHxavR8JTckpSfx1RJ1o=", - false, + "HwJif5FKr6rPpKYghZ7F7Rmaw00q5nWo6NiJOuje+6WBOM6qd8MlVnbWr2mrrA+aaDatHxavR8JTckpSfx1RJ1o=", false, - }, - { - "", - BitcoinECDSA, - exampleMessage, - "", false, - true, - }, - { - "", - Paymail, - exampleMessage, - "", - false, - true, }, { "80699541455b59a8a8a33b85892319de8b8e8944eb8b48e9467137825ae192e59f01", BitcoinECDSA, "", - "G0ttfuC/XKY60ZRFmb12lARUJUekPJ1nD/f0WvJ94bJxT5U3SFHgHaJvAo1r/tVe1E0pMX+IuUxfOWckXdIS7wI=", + "H0ttfuC/XKY60ZRFmb12lARUJUekPJ1nD/f0WvJ94bJxT5U3SFHgHaJvAo1r/tVe1E0pMX+IuUxfOWckXdIS7wI=", false, false, }, - { - "00000", - BitcoinECDSA, - "", - "", - false, - true, - }, - { - "00000", - Paymail, - "", - "", - false, - true, - }, { "e83385af76b2b1997326b567461fb73dd9c27eab9e1e86d26779f4650c5f2b75", BitcoinECDSA, exampleMessage, - "G2m+m3KyHeoWcJF7Sj09bzF+td7QjVw+baFJJ3VCTG4qfaMGXtx8roWprfXi5qP7NihY5lkfWCKCngnodWmG104=", + "H2m+m3KyHeoWcJF7Sj09bzF+td7QjVw+baFJJ3VCTG4qfaMGXtx8roWprfXi5qP7NihY5lkfWCKCngnodWmG104=", false, false, }, @@ -94,7 +68,7 @@ func TestSign(t *testing.T) { "e83385af76b2b1997326b567461fb73dd9c27eab9e1e86d26779f4650c5f2b75", BitcoinSignedMessage, exampleMessage, - "G2m+m3KyHeoWcJF7Sj09bzF+td7QjVw+baFJJ3VCTG4qfaMGXtx8roWprfXi5qP7NihY5lkfWCKCngnodWmG104=", + "H2m+m3KyHeoWcJF7Sj09bzF+td7QjVw+baFJJ3VCTG4qfaMGXtx8roWprfXi5qP7NihY5lkfWCKCngnodWmG104=", false, false, }, @@ -102,7 +76,7 @@ func TestSign(t *testing.T) { "e83385af76b2b1997326b567461fb73dd9c27eab9e1e86d26779f4650c5f2b75", Paymail, exampleMessage, - "G2m+m3KyHeoWcJF7Sj09bzF+td7QjVw+baFJJ3VCTG4qfaMGXtx8roWprfXi5qP7NihY5lkfWCKCngnodWmG104=", + "H2m+m3KyHeoWcJF7Sj09bzF+td7QjVw+baFJJ3VCTG4qfaMGXtx8roWprfXi5qP7NihY5lkfWCKCngnodWmG104=", false, false, }, @@ -110,7 +84,7 @@ func TestSign(t *testing.T) { "73646673676572676164666764666761646667616466", BitcoinECDSA, exampleMessage, - "HIRS8UIWLYMwQUaiIDpe0ivhUqQVyHJg1kgOd/rviQJZWe2EFEI7PQblLaZofG+MjLCMbQLxzlV7DOAuFIdxNUc=", + "IIRS8UIWLYMwQUaiIDpe0ivhUqQVyHJg1kgOd/rviQJZWe2EFEI7PQblLaZofG+MjLCMbQLxzlV7DOAuFIdxNUc=", false, false, }, @@ -118,7 +92,7 @@ func TestSign(t *testing.T) { "73646673676572676164666764666761646667616466", BitcoinSignedMessage, exampleMessage, - "HIRS8UIWLYMwQUaiIDpe0ivhUqQVyHJg1kgOd/rviQJZWe2EFEI7PQblLaZofG+MjLCMbQLxzlV7DOAuFIdxNUc=", + "IIRS8UIWLYMwQUaiIDpe0ivhUqQVyHJg1kgOd/rviQJZWe2EFEI7PQblLaZofG+MjLCMbQLxzlV7DOAuFIdxNUc=", false, false, }, @@ -126,7 +100,7 @@ func TestSign(t *testing.T) { "73646673676572676164666764666761646667616466", Paymail, exampleMessage, - "HIRS8UIWLYMwQUaiIDpe0ivhUqQVyHJg1kgOd/rviQJZWe2EFEI7PQblLaZofG+MjLCMbQLxzlV7DOAuFIdxNUc=", + "IIRS8UIWLYMwQUaiIDpe0ivhUqQVyHJg1kgOd/rviQJZWe2EFEI7PQblLaZofG+MjLCMbQLxzlV7DOAuFIdxNUc=", false, false, }, @@ -135,20 +109,25 @@ func TestSign(t *testing.T) { // Run tests for testNo, test := range tests { - if a, err := Sign(test.inputPrivateKey, test.inputAlgorithm, test.inputMessage); err != nil && !test.expectedError { - t.Errorf("%d %s Failed: [%s] [%s] [%s] inputted and error not expected but got: %s", testNo, t.Name(), test.inputPrivateKey, test.inputAlgorithm, test.inputMessage, err.Error()) - } else if err == nil && test.expectedError { - t.Errorf("%d %s Failed: [%s] [%s] [%s] inputted and error was expected", testNo, t.Name(), test.inputPrivateKey, test.inputAlgorithm, test.inputMessage) - } else if a == nil && !test.expectedNil { - t.Errorf("%d %s Failed: [%s] [%s] [%s] inputted and nil was not expected (aip)", testNo, t.Name(), test.inputPrivateKey, test.inputAlgorithm, test.inputMessage) - } else if a != nil && test.expectedNil { - t.Errorf("%d %s Failed: [%s] [%s] [%s] inputted and nil was expected (aip)", testNo, t.Name(), test.inputPrivateKey, test.inputAlgorithm, test.inputMessage) - } else if a != nil && a.Signature != test.expectedSignature { - t.Errorf("%d %s Failed: [%s] [%s] [%s] inputted and expected [%s] but got [%s]", testNo, t.Name(), test.inputPrivateKey, test.inputAlgorithm, test.inputMessage, test.expectedSignature, a.Signature) - } else if a != nil && err == nil { - // Test validation - THIS WILL NOT WORK BECAUSE DATA IS NOT SET - if _, err = a.Validate(); err != nil { - t.Errorf("%d %s Failed: [%s] [%s] [%s] inputted and validation failed: %s", testNo, t.Name(), test.inputPrivateKey, test.inputAlgorithm, test.inputMessage, err.Error()) + if privBytes, err := hex.DecodeString(test.inputPrivateKey); err != nil { + t.Errorf("%d %s Failed: [%s] inputted and error not expected but got: %s", testNo, t.Name(), test.inputPrivateKey, err.Error()) + } else { + priv, _ := ec.PrivateKeyFromBytes(privBytes) + if a, err := Sign(priv, test.inputAlgorithm, test.inputMessage); err != nil && !test.expectedError { + t.Errorf("%d %s Failed: [%s] [%s] [%s] inputted and error not expected but got: %s", testNo, t.Name(), test.inputPrivateKey, test.inputAlgorithm, test.inputMessage, err.Error()) + } else if err == nil && test.expectedError { + t.Errorf("%d %s Failed: [%s] [%s] [%s] inputted and error was expected", testNo, t.Name(), test.inputPrivateKey, test.inputAlgorithm, test.inputMessage) + } else if a == nil && !test.expectedNil { + t.Errorf("%d %s Failed: [%s] [%s] [%s] inputted and nil was not expected (aip)", testNo, t.Name(), test.inputPrivateKey, test.inputAlgorithm, test.inputMessage) + } else if a != nil && test.expectedNil { + t.Errorf("%d %s Failed: [%s] [%s] [%s] inputted and nil was expected (aip)", testNo, t.Name(), test.inputPrivateKey, test.inputAlgorithm, test.inputMessage) + } else if a != nil && a.Signature != test.expectedSignature { + t.Errorf("%d %s Failed: [%s] [%s] [%s] inputted and expected [%s] but got [%s]", testNo, t.Name(), test.inputPrivateKey, test.inputAlgorithm, test.inputMessage, test.expectedSignature, a.Signature) + } else if a != nil && err == nil { + // Test validation - THIS WILL NOT WORK BECAUSE DATA IS NOT SET + if _, err = a.Validate(); err != nil { + t.Errorf("%d %s Failed: [%s] [%s] [%s] inputted and validation failed: %s", testNo, t.Name(), test.inputPrivateKey, test.inputAlgorithm, test.inputMessage, err.Error()) + } } } } @@ -162,7 +141,7 @@ func ExampleSign() { return } fmt.Printf("address: %s signature: %s", a.AlgorithmSigningComponent, a.Signature) - // Output:address: 1Dw6EeFNRZStXTUENRrV9tGUh1rT2hi6YP signature: HNQwm/7FV7S5wzDf4L+HayG8PVhenwgeZ0T5QuNnVGbtSe+7L+Um7lxcrjsj7eMi3N4K1dAOqrVbkESkQfV7odc= + // Output:address: 1DfGxKmgL3ETwUdNnXLBueEvNpjcDGcKgK signature: INQwm/7FV7S5wzDf4L+HayG8PVhenwgeZ0T5QuNnVGbtSe+7L+Um7lxcrjsj7eMi3N4K1dAOqrVbkESkQfV7odc= } // ExampleSign_paymail example using Sign() @@ -173,7 +152,7 @@ func ExampleSign_paymail() { return } fmt.Printf("address: %s signature: %s", a.AlgorithmSigningComponent, a.Signature) - // Output:address: 041b8c93100d35bd448f4646cc4678f278351b439b52b303ea31ec9edb5475e73f36e7ef720509250313fcf1b4c5af0dc7c5efa126efe2c3b7008e6f1487c61f31 signature: HNQwm/7FV7S5wzDf4L+HayG8PVhenwgeZ0T5QuNnVGbtSe+7L+Um7lxcrjsj7eMi3N4K1dAOqrVbkESkQfV7odc= + // Output:address: 031b8c93100d35bd448f4646cc4678f278351b439b52b303ea31ec9edb5475e73f signature: INQwm/7FV7S5wzDf4L+HayG8PVhenwgeZ0T5QuNnVGbtSe+7L+Um7lxcrjsj7eMi3N4K1dAOqrVbkESkQfV7odc= } // BenchmarkSign benchmarks the method Sign() @@ -285,7 +264,7 @@ func ExampleAip_Validate() { } else if err != nil { fmt.Printf("signature validation failed: %s", err.Error()) } - // Output:valid signature: HNQwm/7FV7S5wzDf4L+HayG8PVhenwgeZ0T5QuNnVGbtSe+7L+Um7lxcrjsj7eMi3N4K1dAOqrVbkESkQfV7odc= + // Output:valid signature: INQwm/7FV7S5wzDf4L+HayG8PVhenwgeZ0T5QuNnVGbtSe+7L+Um7lxcrjsj7eMi3N4K1dAOqrVbkESkQfV7odc= } // BenchmarkAip_Validate benchmarks the method Validate() @@ -316,27 +295,27 @@ func TestSignOpReturnData(t *testing.T) { "80699541455b59a8a8a33b85892319de8b8e8944eb8b48e9467137825ae192e59f01", BitcoinECDSA, [][]byte{[]byte(exampleMessage)}, - "GwJif5FKr6rPpKYghZ7F7Rmaw00q5nWo6NiJOuje+6WBOM6qd8MlVnbWr2mrrA+aaDatHxavR8JTckpSfx1RJ1o=", + "HwJif5FKr6rPpKYghZ7F7Rmaw00q5nWo6NiJOuje+6WBOM6qd8MlVnbWr2mrrA+aaDatHxavR8JTckpSfx1RJ1o=", "006a0c74657374206d65737361676522313550636948473232534e4c514a584d6f53556157566937575371633768436676610d424954434f494e5f45434453412131553151733836707847724e55796a37673752346d386b3879346b6d78766f756f4c5847774a696635464b72367250704b5967685a374637526d6177303071356e576f364e694a4f756a652b3657424f4d367164384d6c566e625772326d7272412b61614461744878617652384a54636b7053667831524a316f3d", false, false, false, }, - { - "", - BitcoinECDSA, - [][]byte{[]byte(exampleMessage)}, - "", - "", - false, - true, - true, - }, + // { + // "", + // BitcoinECDSA, + // [][]byte{[]byte(exampleMessage)}, + // "", + // "", + // false, + // true, + // true, + // }, { "80699541455b59a8a8a33b85892319de8b8e8944eb8b48e9467137825ae192e59f01", Paymail, [][]byte{[]byte(exampleMessage)}, - "GwJif5FKr6rPpKYghZ7F7Rmaw00q5nWo6NiJOuje+6WBOM6qd8MlVnbWr2mrrA+aaDatHxavR8JTckpSfx1RJ1o=", + "HwJif5FKr6rPpKYghZ7F7Rmaw00q5nWo6NiJOuje+6WBOM6qd8MlVnbWr2mrrA+aaDatHxavR8JTckpSfx1RJ1o=", "006a0c74657374206d65737361676522313550636948473232534e4c514a584d6f5355615756693757537163376843667661077061796d61696c4c82303439393332396133303066333338653136343731373538313961666334356435353661366235666533633834313236663634633666353035616537616139333930343261346361633931326335396261663738323534346131626234356632333432613536303334343435656133313233643733393536663731306334333962654c5847774a696635464b72367250704b5967685a374637526d6177303071356e576f364e694a4f756a652b3657424f4d367164384d6c566e625772326d7272412b61614461744878617652384a54636b7053667831524a316f3d", false, false, @@ -347,20 +326,25 @@ func TestSignOpReturnData(t *testing.T) { // Run tests for idx, test := range tests { - if outData, a, err := SignOpReturnData(test.inputPrivateKey, test.inputAlgorithm, test.inputData); err != nil && !test.expectedError { - t.Errorf("%d %s Failed: [%s] [%s] [%v] inputted and error not expected but got: %s", idx, t.Name(), test.inputPrivateKey, test.inputAlgorithm, test.inputData, err.Error()) - } else if err == nil && test.expectedError { - t.Errorf("%d %s Failed: [%s] [%s] [%v] inputted and error was expected", idx, t.Name(), test.inputPrivateKey, test.inputAlgorithm, test.inputData) - } else if a == nil && !test.expectedAipNil { - t.Errorf("%d %s Failed: [%s] [%s] [%v] inputted and nil was not expected (aip)", idx, t.Name(), test.inputPrivateKey, test.inputAlgorithm, test.inputData) - } else if a != nil && test.expectedAipNil { - t.Errorf("%d %s Failed: [%s] [%s] [%v] inputted and nil was expected (aip)", idx, t.Name(), test.inputPrivateKey, test.inputAlgorithm, test.inputData) - } else if outData == nil && !test.expectedOutNil { - t.Errorf("%d %s Failed: [%s] [%s] [%v] inputted and nil was not expected (out)", idx, t.Name(), test.inputPrivateKey, test.inputAlgorithm, test.inputData) - } else if outData != nil && test.expectedOutNil { - t.Errorf("%d %s Failed: [%s] [%s] [%v] inputted and nil was expected (out)", idx, t.Name(), test.inputPrivateKey, test.inputAlgorithm, test.inputData) - } else if a != nil && a.Signature != test.expectedSignature { - t.Errorf("%d %s Failed: [%s] [%s] [%v] inputted and expected signature [%s] but got [%s]", idx, t.Name(), test.inputPrivateKey, test.inputAlgorithm, test.inputData, test.expectedSignature, a.Signature) + if privBytes, err := hex.DecodeString(test.inputPrivateKey); err != nil { + t.Errorf("%d %s Failed: [%s] inputted and error not expected but got: %s", idx, t.Name(), test.inputPrivateKey, err.Error()) + } else { + priv, _ := ec.PrivateKeyFromBytes(privBytes) + if outData, a, err := SignOpReturnData(priv, test.inputAlgorithm, test.inputData); err != nil && !test.expectedError { + t.Errorf("%d %s Failed: [%s] [%s] [%v] inputted and error not expected but got: %s", idx, t.Name(), test.inputPrivateKey, test.inputAlgorithm, test.inputData, err.Error()) + } else if err == nil && test.expectedError { + t.Errorf("%d %s Failed: [%s] [%s] [%v] inputted and error was expected", idx, t.Name(), test.inputPrivateKey, test.inputAlgorithm, test.inputData) + } else if a == nil && !test.expectedAipNil { + t.Errorf("%d %s Failed: [%s] [%s] [%v] inputted and nil was not expected (aip)", idx, t.Name(), test.inputPrivateKey, test.inputAlgorithm, test.inputData) + } else if a != nil && test.expectedAipNil { + t.Errorf("%d %s Failed: [%s] [%s] [%v] inputted and nil was expected (aip)", idx, t.Name(), test.inputPrivateKey, test.inputAlgorithm, test.inputData) + } else if outData == nil && !test.expectedOutNil { + t.Errorf("%d %s Failed: [%s] [%s] [%v] inputted and nil was not expected (out)", idx, t.Name(), test.inputPrivateKey, test.inputAlgorithm, test.inputData) + } else if outData != nil && test.expectedOutNil { + t.Errorf("%d %s Failed: [%s] [%s] [%v] inputted and nil was expected (out)", idx, t.Name(), test.inputPrivateKey, test.inputAlgorithm, test.inputData) + } else if a != nil && a.Signature != test.expectedSignature { + t.Errorf("%d %s Failed: [%s] [%s] [%v] inputted and expected signature [%s] but got [%s]", idx, t.Name(), test.inputPrivateKey, test.inputAlgorithm, test.inputData, test.expectedSignature, a.Signature) + } } } } @@ -373,7 +357,7 @@ func ExampleSignOpReturnData() { return } fmt.Printf("signature: %s outData: %x", a.Signature, outData) - // Output:signature: G7zptA7IbNaa7PQlblH1v5ElaOj3Zo49oiUrDMqfWM4QFNdIKDnXMkxLU1YgrxODd8uFNU279utUCC4MGPp5pjM= outData: [736f6d65206f705f72657475726e2064617461 313550636948473232534e4c514a584d6f5355615756693757537163376843667661 424954434f494e5f4543445341 314477364565464e525a5374585455454e5272563974475568317254326869365950 47377a7074413749624e61613750516c626c48317635456c614f6a335a6f34396f695572444d7166574d3451464e64494b446e584d6b784c5531596772784f44643875464e553237397574554343344d47507035706a4d3d] + // Output:signature: H7zptA7IbNaa7PQlblH1v5ElaOj3Zo49oiUrDMqfWM4QFNdIKDnXMkxLU1YgrxODd8uFNU279utUCC4MGPp5pjM= outData: [736f6d65206f705f72657475726e2064617461 313550636948473232534e4c514a584d6f5355615756693757537163376843667661 424954434f494e5f4543445341 31446647784b6d674c3345547755644e6e584c42756545764e706a634447634b674b 48377a7074413749624e61613750516c626c48317635456c614f6a335a6f34396f695572444d7166574d3451464e64494b446e584d6b784c5531596772784f44643875464e553237397574554343344d47507035706a4d3d] } // BenchmarkSignOpReturnData benchmarks the method SignOpReturnData() @@ -384,7 +368,7 @@ func BenchmarkSignOpReturnData(b *testing.B) { } func TestBoom2FromTx(t *testing.T) { - tx, err := bt.NewTxFromString(`0100000001960b7798ec6d83359c0caeb9a9c46aad7e12d98864b3933617ac6ae5da778aa3020000006b4830450221008f7c4e00ae9086f134fd65eb8d60ba309c3b09a11f0c653710ae4e3522ac6593022007ec80fa044d50b0ccef680cfd2102a04ed76e9065ff8d8645ae0710b5f12aca4121036eed1297fcbbc0800e11c5df3ea54aec0fe7024522e0d31d10197754f023ea16ffffffff030000000000000000fdff00006a0a6f6e636861696e2e737606706f772e636f0375726c4cae7b2275726c223a2268747470733a2f2f726f62657274666b656e6e6564796a722e737562737461636b2e636f6d2f702f72666b2d6a722d6e65772d68616d7073686972652d696e737469747574652d706f6c69746963732d737065656368222c225f617070223a22706f772e636f222c225f74797065223a2275726c222c225f6e6f6e6365223a2265333838346438312d613738322d346531372d616230352d333030333362373261366230227d017c22313550636948473232534e4c514a584d6f53556157566937575371633768436676610d424954434f494e5f454344534100000105a0860100000000001976a9146821cc34e3c6de0d2c34965c99167092718bd5ab88ac8c024f0c000000001976a91471b62aeab78c77e3b36a7e260210f0fd6098411d88ac00000000`) + tx, err := transaction.NewTransactionFromHex(`0100000001960b7798ec6d83359c0caeb9a9c46aad7e12d98864b3933617ac6ae5da778aa3020000006b4830450221008f7c4e00ae9086f134fd65eb8d60ba309c3b09a11f0c653710ae4e3522ac6593022007ec80fa044d50b0ccef680cfd2102a04ed76e9065ff8d8645ae0710b5f12aca4121036eed1297fcbbc0800e11c5df3ea54aec0fe7024522e0d31d10197754f023ea16ffffffff030000000000000000fdff00006a0a6f6e636861696e2e737606706f772e636f0375726c4cae7b2275726c223a2268747470733a2f2f726f62657274666b656e6e6564796a722e737562737461636b2e636f6d2f702f72666b2d6a722d6e65772d68616d7073686972652d696e737469747574652d706f6c69746963732d737065656368222c225f617070223a22706f772e636f222c225f74797065223a2275726c222c225f6e6f6e6365223a2265333838346438312d613738322d346531372d616230352d333030333362373261366230227d017c22313550636948473232534e4c514a584d6f53556157566937575371633768436676610d424954434f494e5f454344534100000105a0860100000000001976a9146821cc34e3c6de0d2c34965c99167092718bd5ab88ac8c024f0c000000001976a91471b62aeab78c77e3b36a7e260210f0fd6098411d88ac00000000`) if err != nil { t.Fatalf("error occurred: %s", err) } diff --git a/bob.go b/bob.go index 334fbf5..31fdf5c 100644 --- a/bob.go +++ b/bob.go @@ -6,6 +6,7 @@ import ( "strconv" "strings" + ec "github.com/bitcoin-sv/go-sdk/primitives/ec" "github.com/bitcoinschema/go-bpu" ) @@ -137,7 +138,7 @@ func (a *Aip) SetDataFromTapes(tapes []bpu.Tape) { // SignBobOpReturnData appends a signature to a BOB Tx by adding a // protocol separator followed by AIP information -func SignBobOpReturnData(privateKey string, algorithm Algorithm, output bpu.Output) (*bpu.Output, *Aip, error) { +func SignBobOpReturnData(privateKey *ec.PrivateKey, algorithm Algorithm, output bpu.Output) (*bpu.Output, *Aip, error) { // Parse the data to sign var dataToSign []string diff --git a/bob_test.go b/bob_test.go index 5bbe4e3..f3f40da 100644 --- a/bob_test.go +++ b/bob_test.go @@ -1,10 +1,12 @@ package aip import ( + "encoding/hex" "fmt" "testing" - "github.com/bitcoinschema/go-bitcoin" + "github.com/bitcoin-sv/go-sdk/script" + "github.com/bitcoin-sv/go-sdk/transaction" "github.com/bitcoinschema/go-bob" "github.com/bitcoinschema/go-bpu" ) @@ -302,15 +304,20 @@ func BenchmarkValidateTapes(b *testing.B) { // getBobOutput helper to get op_return in BOB format func getBobOutput() bpu.Output { - // Create op_return - opReturn := bitcoin.OpReturnData{[]byte("prefix1"), []byte("example data"), []byte{0x13, 0x37}} - // Create a transaction - privateKey, _ := bitcoin.PrivateKeyFromString(examplePrivateKey) - tx, _ := bitcoin.CreateTx(nil, nil, []bitcoin.OpReturnData{opReturn}, privateKey) + // privateKey, _ := bitcoin.PrivateKeyFromString(examplePrivateKey) + tx := transaction.NewTransaction() + scr := &script.Script{} + scr.AppendOpcodes(script.OpFALSE, script.OpRETURN) + scr.AppendPushDataArray([][]byte{[]byte("prefix1"), []byte("example data"), {0x13, 0x37}}) + tx.AddOutput(&transaction.TransactionOutput{ + Satoshis: 0, + LockingScript: scr, + }) + // tx, _ := bitcoin.CreateTx(nil, nil, []bitcoin.OpReturnData{opReturn}) // Create the bob tx from hex - bobTx, _ := bob.NewFromRawTxString(tx.ToString()) + bobTx, _ := bob.NewFromRawTxString(hex.EncodeToString(tx.Bytes())) return bobTx.Out[0] } diff --git a/examples/sign/sign.go b/examples/sign/sign.go index 18052d7..28dddc5 100644 --- a/examples/sign/sign.go +++ b/examples/sign/sign.go @@ -3,12 +3,14 @@ package main import ( "log" + ec "github.com/bitcoin-sv/go-sdk/primitives/ec" "github.com/bitcoinschema/go-aip" ) func main() { + priv, _ := ec.NewPrivateKey() a, err := aip.Sign( - "54035dd4c7dda99ac473905a3d82f7864322b49bab1ff441cc457183b9bd8abd", + priv, aip.BitcoinECDSA, "example message", ) diff --git a/examples/sign_op_return/sign_op_return.go b/examples/sign_op_return/sign_op_return.go index 9626894..8974125 100644 --- a/examples/sign_op_return/sign_op_return.go +++ b/examples/sign_op_return/sign_op_return.go @@ -3,12 +3,14 @@ package main import ( "log" + ec "github.com/bitcoin-sv/go-sdk/primitives/ec" "github.com/bitcoinschema/go-aip" ) func main() { + priv, _ := ec.NewPrivateKey() outData, a, err := aip.SignOpReturnData( - "54035dd4c7dda99ac473905a3d82f7864322b49bab1ff441cc457183b9bd8abd", + priv, aip.BitcoinECDSA, [][]byte{[]byte("some op_return data")}, ) diff --git a/examples/validate/validate.go b/examples/validate/validate.go index 4273f55..78ab6b0 100644 --- a/examples/validate/validate.go +++ b/examples/validate/validate.go @@ -3,12 +3,14 @@ package main import ( "log" + ec "github.com/bitcoin-sv/go-sdk/primitives/ec" "github.com/bitcoinschema/go-aip" ) func main() { + priv, _ := ec.NewPrivateKey() a, err := aip.Sign( - "54035dd4c7dda99ac473905a3d82f7864322b49bab1ff441cc457183b9bd8abd", + priv, aip.BitcoinECDSA, "example message", ) diff --git a/go.mod b/go.mod index 012d3c8..7c5e600 100644 --- a/go.mod +++ b/go.mod @@ -1,21 +1,15 @@ module github.com/bitcoinschema/go-aip -go 1.18 +go 1.23.1 require ( - github.com/bitcoinschema/go-bitcoin v0.3.20 - github.com/bitcoinschema/go-bob v0.4.3 - github.com/bitcoinschema/go-bpu v0.1.3 - github.com/bitcoinsv/bsvd v0.0.0-20190609155523-4c29707f7173 - github.com/bitcoinsv/bsvutil v0.0.0-20181216182056-1d77cf353ea9 - github.com/libsv/go-bt/v2 v2.2.5 + github.com/bitcoin-sv/go-sdk v1.1.7 + github.com/bitcoinschema/go-bob v0.5.0 + github.com/bitcoinschema/go-bpu v0.2.0 ) require ( - github.com/bitcoinsv/bsvlog v0.0.0-20181216181007-cb81b076bf2e // indirect - github.com/libsv/go-bk v0.1.6 // indirect - github.com/libsv/go-bt v1.0.8 // indirect github.com/pkg/errors v0.9.1 // indirect - golang.org/x/crypto v0.17.0 // indirect + golang.org/x/crypto v0.21.0 // indirect ) diff --git a/go.sum b/go.sum index a4191aa..c991bcb 100644 --- a/go.sum +++ b/go.sum @@ -1,51 +1,18 @@ -github.com/bitcoinschema/go-bitcoin v0.3.20 h1:jWKT7ePYm4dPaIR2aIAVL8BwdsYtuG/4B87l1+KZyWs= -github.com/bitcoinschema/go-bitcoin v0.3.20/go.mod h1:HyyMGUTtGE1qOgFJzCmvgsf3y55IfxJ+qLbwRm4Ski4= -github.com/bitcoinschema/go-bitcoin/v2 v2.0.5 h1:Sgh5Eb746Zck/46rFDrZZEXZWyO53fMuWYhNoZa1tck= -github.com/bitcoinschema/go-bob v0.4.3 h1:0iboiIQ3PY2+rrqPr8Gsh5RX+9Ha6Uzyo0bw720Ljlc= -github.com/bitcoinschema/go-bob v0.4.3/go.mod h1:XEHhQ/v+to/s8THRNKU099OpsDreRFYnU/822IihjR8= -github.com/bitcoinschema/go-bpu v0.1.3 h1:O7SvuptH4Q7hemD6G9OotPLINZ61CAVOgWKJWKM+edY= -github.com/bitcoinschema/go-bpu v0.1.3/go.mod h1:y4ZEDC0fSYRrA6N6bzKwHXdtMrRiQhpurpkTVobz07I= -github.com/bitcoinsv/bsvd v0.0.0-20190609155523-4c29707f7173 h1:2yTIV9u7H0BhRDGXH5xrAwAz7XibWJtX2dNezMeNsUo= -github.com/bitcoinsv/bsvd v0.0.0-20190609155523-4c29707f7173/go.mod h1:BZ1UcC9+tmcDEcdVXgpt13hMczwJxWzpAn68wNs7zRA= -github.com/bitcoinsv/bsvlog v0.0.0-20181216181007-cb81b076bf2e h1:6f+gRvaPE/4h0g39dqTNPr9/P4mikw0aB+dhiExaWN8= -github.com/bitcoinsv/bsvlog v0.0.0-20181216181007-cb81b076bf2e/go.mod h1:WPrWor6cSeuGQZ15qPe+jqFmblJEFrJHYfr5cD7cmyk= -github.com/bitcoinsv/bsvutil v0.0.0-20181216182056-1d77cf353ea9 h1:hFI8rT84FCA0FFy3cFrkW5Nz4FyNKlIdCvEvvTNySKg= -github.com/bitcoinsv/bsvutil v0.0.0-20181216182056-1d77cf353ea9/go.mod h1:p44KuNKUH5BC8uX4ONEODaHUR4+ibC8todEAOGQEJAM= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/bitcoin-sv/go-sdk v1.1.7 h1:JbtaYCGUsHM7HTelLKSJp1NuYiG/xSNOdexjJ6w577A= +github.com/bitcoin-sv/go-sdk v1.1.7/go.mod h1:NOAkJLbjqKOLuxJmb9ABG86ExTZp4HS8+iygiDIUps4= +github.com/bitcoinschema/go-bob v0.5.0 h1:Fjl60RuiQiUuZWLfXE8ETdcgmJBHYu9MYfbrbZU7yHs= +github.com/bitcoinschema/go-bob v0.5.0/go.mod h1:bREtBvZuMKe3DX2oCUSE+LOuy9HDJnOC3qcWr0oLoy4= +github.com/bitcoinschema/go-bpu v0.2.0 h1:/WI/F+ShIj50HUD1EBPPHTCBzSeiPDohy77W3Y8xx+s= +github.com/bitcoinschema/go-bpu v0.2.0/go.mod h1:58mg4m1wlQY3TFfvlba7zRs5dTb4O2cqlzRWjcJPLuo= 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/libsv/go-bk v0.1.6 h1:c9CiT5+64HRDbzxPl1v/oiFmbvWZTuUYqywCf+MBs/c= -github.com/libsv/go-bk v0.1.6/go.mod h1:khJboDoH18FPUaZlzRFKzlVN84d4YfdmlDtdX4LAjQA= -github.com/libsv/go-bt v1.0.4/go.mod h1:AfXoLFYEbY/TvCq/84xTce2xGjPUuC5imokHmcykF2k= -github.com/libsv/go-bt v1.0.8 h1:nWLLcnUm0dxNO3exqrL5jvAcTGkl0dsnBuQqB6+M6vQ= -github.com/libsv/go-bt v1.0.8/go.mod h1:yO023bNYLh5DwcOYl+ZqLAeTemoy6K+2UbQlIBMv+EQ= -github.com/libsv/go-bt/v2 v2.2.5 h1:VoggBLMRW9NYoFujqe5bSYKqnw5y+fYfufgERSoubog= -github.com/libsv/go-bt/v2 v2.2.5/go.mod h1:cV45+jDlPOLfhJLfpLmpQoWzrIvVth9Ao2ZO1f6CcqU= 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/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20201208171446-5f87f3452ae9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20211209193657-4570a0811e8b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= -golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/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/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= -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.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=