diff --git a/.github/Taskfile.yml b/.github/Taskfile.yml deleted file mode 100644 index 909cd4601..000000000 --- a/.github/Taskfile.yml +++ /dev/null @@ -1,32 +0,0 @@ -version: "3" - -vars: - VERSION: - sh: git describe --tags --abbrev=0 - COMMIT: - sh: git rev-parse --short HEAD - ROOT: - sh: git rev-parse --show-toplevel - OS: - sh: uname -s - -tasks: - date: - desc: Returns date in YEAR.WEEK.DAY format - cmds: - - | - YEAR=$(date +%Y) - WEEK=$(date +%V) - DAY=$(date +%u) - echo "${YEAR}.${WEEK}.${DAY}" - vars: - DATE: '{{default "" .CLI_ARGS}}' - silent: true - - release: - desc: Create a new release with formatted date - cmds: - - go install github.com/goreleaser/goreleaser/v2@latest - - RELEASE_DATE=$(task date) goreleaser release --clean -f {{.ROOT}}/.goreleaser.yaml - silent: true - diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 47eb4a11d..000000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,281 +0,0 @@ -# To get started with Dependabot version updates, you'll need to specify which -# -# -# package ecosystems to update and where the package manifests are located. -# Please see the documentation for all configuration options: -# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file - -version: 2 -updates: - - package-ecosystem: "gomod" # See documentation for possible values - directory: "/" # Location of package manifests - schedule: - interval: "monthly" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ]]]] diff --git a/.github/scopes.json b/.github/scopes.json index 70edd27c2..66a2c07ec 100644 --- a/.github/scopes.json +++ b/.github/scopes.json @@ -2,9 +2,6 @@ "scopes": [ "core-chain", "core-ibc", - "sonr-hway", - "sonr-matrix", - "sonr-motr", "x-did", "x-dwn", "x-svc", @@ -16,35 +13,19 @@ ], "docs": [ { - "keywords": [ - "github", - "actions", - "workflows", - "syntax" - ], + "keywords": ["github", "actions", "workflows", "syntax"], "url": "https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions" }, { - "keywords": [ - "cosmos", - "tooling", - "cosmovisor" - ], + "keywords": ["cosmos", "tooling", "cosmovisor"], "url": "https://docs.cosmos.network/v0.50/build/tooling/cosmovisor" }, { - "keywords": [ - "process-compose", - "configuration" - ], + "keywords": ["process-compose", "configuration"], "url": "https://f1bonacc1.github.io/process-compose/configuration/" }, { - "keywords": [ - "taskfile", - "cli", - "reference" - ], + "keywords": ["taskfile", "cli", "reference"], "url": "https://taskfile.dev/reference/cli" }, { @@ -52,250 +33,115 @@ "url": "https://taskfile.dev/reference/schema" }, { - "keywords": [ - "taskfile", - "templating", - "reference" - ], + "keywords": ["taskfile", "templating", "reference"], "url": "https://taskfile.dev/reference/templating/" }, { - "keywords": [ - "mkdocs", - "material", - "reference" - ], + "keywords": ["mkdocs", "material", "reference"], "url": "https://squidfunk.github.io/mkdocs-material/reference/" }, { - "keywords": [ - "pkl", - "language", - "reference" - ], + "keywords": ["pkl", "language", "reference"], "url": "https://pkl-lang.org/main/current/language-reference/index.html" }, { - "keywords": [ - "pwa", - "service-workers", - "web" - ], + "keywords": ["pwa", "service-workers", "web"], "url": "https://web.dev/learn/pwa/service-workers/" }, { - "keywords": [ - "service-workers", - "web", - "api" - ], + "keywords": ["service-workers", "web", "api"], "url": "https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API" }, { - "keywords": [ - "web-authentication", - "web", - "api" - ], + "keywords": ["web-authentication", "web", "api"], "url": "https://developer.mozilla.org/en-US/docs/Web/API/Web_Authentication_API" }, { - "keywords": [ - "sdk", - "modules", - "cosmos", - "manager" - ], + "keywords": ["sdk", "modules", "cosmos", "manager"], "url": "https://docs.cosmos.network/v0.50/build/building-modules/module-manager" }, { - "keywords": [ - "sdk", - "modules", - "cosmos", - "messages", - "queries" - ], + "keywords": ["sdk", "modules", "cosmos", "messages", "queries"], "url": "https://docs.cosmos.network/v0.50/build/building-modules/messages-and-queries" }, { - "keywords": [ - "sdk", - "modules", - "messages", - "service", - "cosmos" - ], + "keywords": ["sdk", "modules", "messages", "service", "cosmos"], "url": "https://docs.cosmos.network/v0.50/build/building-modules/msg-services" }, { - "keywords": [ - "sdk", - "modules", - "services", - "cosmos", - "query" - ], + "keywords": ["sdk", "modules", "services", "cosmos", "query"], "url": "https://docs.cosmos.network/v0.50/build/building-modules/query-services" }, { - "keywords": [ - "cosmos", - "depinject", - "modules", - "sdk" - ], + "keywords": ["cosmos", "depinject", "modules", "sdk"], "url": "https://docs.cosmos.network/v0.50/build/building-modules/depinject" }, { - "keywords": [ - "ibc", - "apps", - "sdk", - "interchain-accounts" - ], + "keywords": ["ibc", "apps", "sdk", "interchain-accounts"], "url": "https://ibc.cosmos.network/v8/apps/interchain-accounts/overview/" }, { - "keywords": [ - "ibc", - "apps", - "sdk", - "transfer" - ], + "keywords": ["ibc", "apps", "sdk", "transfer"], "url": "https://ibc.cosmos.network/v8/apps/transfer/overview/" }, { - "keywords": [ - "osmosis", - "modules", - "ibc", - "assets" - ], + "keywords": ["osmosis", "modules", "ibc", "assets"], "url": "https://docs.osmosis.zone/osmosis-core/asset-info/" }, { - "keywords": [ - "ibc", - "osmosis", - "tokenfactory", - "modules", - "assets" - ], + "keywords": ["ibc", "osmosis", "tokenfactory", "modules", "assets"], "url": "https://docs.osmosis.zone/osmosis-core/modules/tokenfactory" }, { - "keywords": [ - "ibc", - "mint", - "cctp", - "noble", - "assets" - ], + "keywords": ["ibc", "mint", "cctp", "noble", "assets"], "url": "https://docs.noble.xyz/cctp/mint" }, { - "keywords": [ - "ibc", - "relayer", - "nomic", - "assets" - ], + "keywords": ["ibc", "relayer", "nomic", "assets"], "url": "https://docs.nomic.io/network/ibc-relayer" }, { - "keywords": [ - "ibc", - "cctp", - "noble", - "mint_forward", - "assets" - ], + "keywords": ["ibc", "cctp", "noble", "mint_forward", "assets"], "url": "https://docs.noble.xyz/cctp/mint_forward" }, { - "keywords": [ - "evmos", - "erc20", - "assets" - ], + "keywords": ["evmos", "erc20", "assets"], "url": "https://docs.evmos.org/protocol/modules/erc20" }, { - "keywords": [ - "nomic", - "nbtc", - "assets" - ], + "keywords": ["nomic", "nbtc", "assets"], "url": "https://docs.nomic.io/nbtc" }, { - "keywords": [ - "mpc", - "wallet", - "cryptography", - "capability", - "invokation" - ], + "keywords": ["mpc", "wallet", "cryptography", "capability", "invokation"], "url": "https://csrc.nist.gov/CSRC/media/Events/NTCW19/papers/paper-DKLS.pdf" }, { - "keywords": [ - "ucan", - "spec", - "cryptography", - "authorization" - ], + "keywords": ["ucan", "spec", "cryptography", "authorization"], "url": "https://raw.githubusercontent.com/ucan-wg/spec/refs/heads/main/README.md" }, { - "keywords": [ - "zero-knowledge", - "proofs", - "cryptography", - "privacy" - ], + "keywords": ["zero-knowledge", "proofs", "cryptography", "privacy"], "url": "https://eprint.iacr.org/2021/1672.pdf" }, { - "keywords": [ - "gateway", - "http", - "sse" - ], + "keywords": ["gateway", "http", "sse"], "url": "https://echo.labstack.com/docs/cookbook/sse" }, { - "keywords": [ - "gateway", - "http", - "websocket" - ], + "keywords": ["gateway", "http", "websocket"], "url": "https://echo.labstack.com/docs/cookbook/websocket" }, { - "keywords": [ - "gateway", - "http", - "subdomain" - ], + "keywords": ["gateway", "http", "subdomain"], "url": "https://echo.labstack.com/docs/cookbook/subdomain" }, { - "keywords": [ - "tigerbeetle", - "models", - "oracle" - ], + "keywords": ["tigerbeetle", "models", "oracle"], "url": "https://docs.tigerbeetle.com/coding/data-modeling" }, { - "keywords": [ - "tigerbeetle", - "two=phase", - "transfers", - "oracle" - ], + "keywords": ["tigerbeetle", "two=phase", "transfers", "oracle"], "url": "https://docs.tigerbeetle.com/coding/two-phase-transfers" }, { @@ -309,12 +155,7 @@ "url": "https://docs.tigerbeetle.com/coding/reliable-transaction-submission" }, { - "keywords": [ - "currency", - "exchange", - "tigerbeetle", - "oracle" - ], + "keywords": ["currency", "exchange", "tigerbeetle", "oracle"], "url": "https://docs.tigerbeetle.com/coding/recipes/currency-exchange" }, { @@ -328,171 +169,79 @@ "url": "https://docs.tigerbeetle.com/coding/recipes/balance-conditional-transfers" }, { - "keywords": [ - "tigerbeetle", - "account", - "oracle" - ], + "keywords": ["tigerbeetle", "account", "oracle"], "url": "https://docs.tigerbeetle.com/reference/account" }, { - "keywords": [ - "tigerbeetle", - "transfer", - "oracle" - ], + "keywords": ["tigerbeetle", "transfer", "oracle"], "url": "https://docs.tigerbeetle.com/reference/transfer" }, { - "keywords": [ - "substreams", - "packages", - "consumer", - "oracle" - ], + "keywords": ["substreams", "packages", "consumer", "oracle"], "url": "https://docs.substreams.dev/documentation/consume/packages" }, { - "keywords": [ - "substreams", - "deploy", - "service", - "oracle" - ], + "keywords": ["substreams", "deploy", "service", "oracle"], "url": "https://docs.substreams.dev/documentation/consume/sql/deployable-services/local-service" }, { - "keywords": [ - "substreams", - "tutorial", - "cosmos", - "injective" - ], + "keywords": ["substreams", "tutorial", "cosmos", "injective"], "url": "https://docs.substreams.dev/tutorials/cosmos/injective/foundational" }, { - "keywords": [ - "worker", - "http", - "jwt" - ], + "keywords": ["worker", "http", "jwt"], "url": "https://echo.labstack.com/docs/cookbook/jwt" }, { - "keywords": [ - "worker", - "http", - "secure" - ], + "keywords": ["worker", "http", "secure"], "url": "https://echo.labstack.com/docs/middleware/secure" }, { - "keywords": [ - "worker", - "http", - "service-workers", - "web", - "api" - ], + "keywords": ["worker", "http", "service-workers", "web", "api"], "url": "https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API" }, { - "keywords": [ - "synapse", - "matrix", - "configuration", - "usage" - ], + "keywords": ["synapse", "matrix", "configuration", "usage"], "url": "https://element-hq.github.io/synapse/latest/usage/configuration/config_documentation.html" }, { - "keywords": [ - "cosmos", - "protobuf", - "orm", - "sdk" - ], + "keywords": ["cosmos", "protobuf", "orm", "sdk"], "url": "https://docs.cosmos.network/v0.50/build/packages/orm" }, { - "keywords": [ - "cosmos", - "sdk", - "modules", - "auth" - ], + "keywords": ["cosmos", "sdk", "modules", "auth"], "url": "https://docs.cosmos.network/v0.50/build/modules/auth" }, { - "keywords": [ - "cosmos", - "sdk", - "modules", - "bank" - ], + "keywords": ["cosmos", "sdk", "modules", "bank"], "url": "https://docs.cosmos.network/v0.50/build/modules/bank" }, { - "keywords": [ - "cosmos", - "modules", - "authz", - "sdk" - ], + "keywords": ["cosmos", "modules", "authz", "sdk"], "url": "https://docs.cosmos.network/v0.50/build/modules/authz" }, { - "keywords": [ - "cosmos", - "protobuf", - "collections", - "sdk" - ], + "keywords": ["cosmos", "protobuf", "collections", "sdk"], "url": "https://docs.cosmos.network/v0.50/build/packages/collections" }, { - "keywords": [ - "cosmos", - "modules", - "gov", - "sdk" - ], + "keywords": ["cosmos", "modules", "gov", "sdk"], "url": "https://docs.cosmos.network/v0.50/build/modules/gov" }, { - "keywords": [ - "cosmos", - "modules", - "staking", - "sdk" - ], + "keywords": ["cosmos", "modules", "staking", "sdk"], "url": "https://docs.cosmos.network/v0.50/build/modules/staking" }, { - "keywords": [ - "cosmos", - "protobuf", - "annotations", - "sdk" - ], + "keywords": ["cosmos", "protobuf", "annotations", "sdk"], "url": "https://docs.cosmos.network/v0.50/build/building-modules/protobuf-annotations" }, { - "keywords": [ - "cosmos", - "sdk", - "modules", - "group" - ], + "keywords": ["cosmos", "sdk", "modules", "group"], "url": "https://docs.cosmos.network/v0.50/build/modules/group" }, { - "keywords": [ - "cosmos", - "sdk", - "modules", - "nft" - ], + "keywords": ["cosmos", "sdk", "modules", "nft"], "url": "https://docs.cosmos.network/v0.50/build/modules/nft" } ], diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 81e2a1aa8..79143aa3a 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -16,12 +16,15 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 # Required to fetch all history for merging - + - uses: TimonVS/pr-labeler-action@v5 with: repo-token: ${{ secrets.GITHUB_TOKEN }} configuration-path: .github/pr-labeler.yml # optional, .github/pr-labeler.yml is the default value - + - name: Trunk Check + uses: trunk-io/trunk-action@v1 + with: + post-annotations: true # only for fork PRs test-builds: if: github.event_name == 'pull_request' @@ -41,10 +44,6 @@ jobs: check-latest: true - name: Run Sonrd Build run: make build - - name: Run Hway Build - run: make build-hway - - name: Run Motr Build - run: make build-motr test-unit: if: github.event_name == 'pull_request' diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml index 36ade5703..7201bf386 100644 --- a/.github/workflows/merge.yml +++ b/.github/workflows/merge.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 ssh-key: "${{ secrets.COMMIT_KEY }}" diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7959533d0..1e380f590 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -22,3 +22,25 @@ jobs: with: input: proto buf_token: ${{ secrets.BUF_TOKEN }} + + docs-push: + runs-on: ubuntu-latest + name: Publish Docs to onsonr.dev + steps: + - uses: actions/checkout@v4 + - name: Configure Git Credentials + run: | + git config user.name github-actions[bot] + git config user.email 41898282+github-actions[bot]@users.noreply.github.com + - uses: actions/setup-python@v5 + with: + python-version: 3.x + - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV + - uses: actions/cache@v4 + with: + key: mkdocs-material-${{ env.cache_id }} + path: .cache + restore-keys: | + mkdocs-material- + - run: pip install mkdocs-material + - run: mkdocs gh-deploy --force diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 511f46424..ed63b3367 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -55,4 +55,3 @@ jobs: REDDIT_SECRET: ${{ secrets.REDDIT_SECRET }} REDDIT_USERNAME: ${{ secrets.REDDIT_USERNAME }} REDDIT_PASSWORD: ${{ secrets.REDDIT_PASSWORD }} - diff --git a/.gitignore b/.gitignore index 0f39af86d..043babd7d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ # Aider related generated files -MESSAGE.md -CONVENTIONS.md +.aider-context # Binaries .task diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 1b59cd82f..d064da10d 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -2,15 +2,15 @@ version: 2 project_name: sonr +before: + hooks: + - echo "Release date is {{ .Env.RELEASE_DATE }}" + - docker build -t ghcr.io/onsonr/sonr:latest . + - docker tag ghcr.io/onsonr/sonr:latest ghcr.io/onsonr/sonr:{{ .Tag }} + - docker push ghcr.io/onsonr/sonr:{{ .Tag }} + - docker push ghcr.io/onsonr/sonr:latest + builds: - - id: motr - main: ./cmd/motr - binary: app - goos: - - js - goarch: - - wasm - - id: sonr main: ./cmd/sonrd binary: sonrd @@ -36,27 +36,6 @@ builds: - netgo - ledger - - id: hway - main: ./cmd/hway - binary: hway - goos: - - linux - - darwin - goarch: - - amd64 - - arm64 - mod_timestamp: "{{ .CommitTimestamp }}" - flags: - - -mod=readonly - - -trimpath - goamd64: - - v1 - tags: - - netgo - ldflags: - - -X main.version={{.Version}} - - -X main.commit={{.Commit}} - - -X main.date={{.Date}} archives: - id: sonr builds: [sonr] @@ -69,41 +48,7 @@ archives: - src: README* wrap_in_directory: true - - id: hway - builds: [hway] - name_template: >- - hway_{{ .Os }}_{{- if eq .Arch "amd64" }}x86_64 - {{- else if eq .Arch "386" }}i386 - {{- else }}{{ .Arch }}{{ end }} - format: tar.gz - files: - - src: README* - wrap_in_directory: true - nfpms: - - id: hway - package_name: hway - file_name_template: "hway_{{ .Os }}_{{ .Arch }}{{ .ConventionalExtension }}" - builds: [hway] - vendor: Sonr - homepage: "https://onsonr.dev" - maintainer: "Sonr " - description: "Sonr Highway is a decentralized, permissionless, and censorship-resistant identity network proxy." - license: "Apache 2.0" - formats: - - rpm - - deb - - apk - dependencies: - - ipfs - contents: - - src: README* - dst: /usr/share/doc/hway - bindir: /usr/bin - section: net - priority: optional - # Add these lines to match build config - - id: sonr package_name: sonrd file_name_template: "sonrd_{{ .Os }}_{{ .Arch }}{{ .ConventionalExtension }}" @@ -128,23 +73,6 @@ nfpms: # Add these lines to match build config brews: - - name: hway - ids: [hway] - commit_author: - name: goreleaserbot - email: bot@goreleaser.com - directory: Formula - caveats: "Run a local hway node and access it with the hway proxy" - homepage: "https://onsonr.dev" - description: "Sonr is a decentralized, permissionless, and censorship-resistant identity network." - dependencies: - - name: ipfs - repository: - owner: onsonr - name: homebrew-tap - branch: master - token: "{{ .Env.GITHUB_PERSONAL_AUTH_TOKEN }}" - - name: sonr ids: [sonr] commit_author: @@ -152,7 +80,7 @@ brews: email: bot@goreleaser.com directory: Formula caveats: "Run a local sonr node and access it with the hway proxy" - homepage: "https://onsonr.dev" + homepage: "https://onson.dev" description: "Sonr is a decentralized, permissionless, and censorship-resistant identity network." dependencies: - name: ipfs @@ -166,7 +94,7 @@ release: github: owner: onsonr name: sonr - name_template: 'Release {{ .Env.RELEASE_DATE }}' + name_template: "{{ .Tag }} | {{ .Env.RELEASE_DATE }}" draft: false replace_existing_draft: true replace_existing_artifacts: true diff --git a/.trunk/.gitignore b/.trunk/.gitignore new file mode 100644 index 000000000..15966d087 --- /dev/null +++ b/.trunk/.gitignore @@ -0,0 +1,9 @@ +*out +*logs +*actions +*notifications +*tools +plugins +user_trunk.yaml +user.yaml +tmp diff --git a/.trunk/configs/.golangci.yaml b/.trunk/configs/.golangci.yaml new file mode 100644 index 000000000..7d594af8f --- /dev/null +++ b/.trunk/configs/.golangci.yaml @@ -0,0 +1,27 @@ +linters: + disable: + - unused # Disables unreachable code checking + +run: + # Exclude test files from analysis + tests: false + +# Define which files and directories to exclude +issues: + exclude-rules: + # Exclude all test files + - path: _test\.go + linters: + - all + + # Exclude specific directories + exclude-dirs: + - api/did/v1 + - api/dwn/v1 + - api/svc/v1 + - internal + + # Exclude specific file patterns + exclude-files: + - ".*\\.pb\\.go$" + - ".*_templ\\.go$" diff --git a/.trunk/configs/.hadolint.yaml b/.trunk/configs/.hadolint.yaml new file mode 100644 index 000000000..98bf0cd2e --- /dev/null +++ b/.trunk/configs/.hadolint.yaml @@ -0,0 +1,4 @@ +# Following source doesn't work in most setups +ignored: + - SC1090 + - SC1091 diff --git a/.trunk/configs/.markdownlint.yaml b/.trunk/configs/.markdownlint.yaml new file mode 100644 index 000000000..b40ee9d7a --- /dev/null +++ b/.trunk/configs/.markdownlint.yaml @@ -0,0 +1,2 @@ +# Prettier friendly markdownlint config (all formatting rules disabled) +extends: markdownlint/style/prettier diff --git a/.trunk/configs/.rustfmt.toml b/.trunk/configs/.rustfmt.toml new file mode 100644 index 000000000..3a26366d4 --- /dev/null +++ b/.trunk/configs/.rustfmt.toml @@ -0,0 +1 @@ +edition = "2021" diff --git a/.trunk/configs/.shellcheckrc b/.trunk/configs/.shellcheckrc new file mode 100644 index 000000000..8c7b1ada8 --- /dev/null +++ b/.trunk/configs/.shellcheckrc @@ -0,0 +1,7 @@ +enable=all +source-path=SCRIPTDIR +disable=SC2154 + +# If you're having issues with shellcheck following source, disable the errors via: +# disable=SC1090 +# disable=SC1091 diff --git a/.trunk/configs/.yamllint.yaml b/.trunk/configs/.yamllint.yaml new file mode 100644 index 000000000..184e251f8 --- /dev/null +++ b/.trunk/configs/.yamllint.yaml @@ -0,0 +1,7 @@ +rules: + quoted-strings: + required: only-when-needed + extra-allowed: ["{|}"] + key-duplicates: {} + octal-values: + forbid-implicit-octal: true diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml new file mode 100644 index 000000000..f8b9cb282 --- /dev/null +++ b/.trunk/trunk.yaml @@ -0,0 +1,41 @@ +# This file controls the behavior of Trunk: https://docs.trunk.io/cli +# To learn more about the format of this file, see https://docs.trunk.io/reference/trunk-yaml +version: 0.1 +cli: + version: 1.22.8 +# Trunk provides extensibility via plugins. (https://docs.trunk.io/plugins) +plugins: + sources: + - id: trunk + ref: v1.6.6 + uri: https://github.com/trunk-io/plugins +# Many linters and tools depend on runtimes - configure them here. (https://docs.trunk.io/runtimes) +runtimes: + enabled: + - go@1.23.0 + - node@18.20.5 + - python@3.10.8 +# This is the section where you manage your linters. (https://docs.trunk.io/check/configuration) +lint: + enabled: + - actionlint@1.7.6 + - checkov@3.2.347 + - clippy@1.65.0 + - git-diff-check + - gofmt@1.20.4 + - golangci-lint@1.62.2 + - hadolint@2.12.1-beta + # - markdownlint@0.43.0 + - osv-scanner@1.9.2 + - prettier@3.4.2 + - rustfmt@1.65.0 + # - shellcheck@0.10.0 + # - shfmt@3.6.0 + - taplo@0.9.3 + - trufflehog@3.88.0 +actions: + enabled: + - trunk-announce + - trunk-check-pre-push + - trunk-fmt-pre-commit + - trunk-upgrade-available diff --git a/CHANGELOG.md b/CHANGELOG.md index fd2aa4d56..190a6148f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -475,7 +475,7 @@ - **cta**: Fix typo in CTA title - change bento section title to reflect security focus - adjust hero image dimensions -- **Input**: Change type from to +- **Input**: Change type from to - update hero image height in config.pkl ### Refactor @@ -507,7 +507,7 @@ - remove old changelog entries - rename buf-publish.yml to publish-assets.yml -- remove unused field from +- remove unused field from - remove unnecessary checkout in scheduled-release workflow - rename build ID to sonr - remove unnecessary release existence check @@ -626,7 +626,7 @@ - extract root command creation to separate file - move ipfs setup to function - remove unnecessary proxy config -- rename script to +- rename script to - move DWN proxy server logic to separate file - use htmx instead of dwn for vault client - remove unused environment variables @@ -634,7 +634,7 @@ - use staking keeper in DID keeper - remove unused dependencies - remove unused image building workflow -- add field to +- add field to - Update KeyKind Enum to have proper naming conventions - Update `DIDNamespace` to have proper naming convention - expose ports directly in docker-compose diff --git a/CONVENTIONS.md b/CONVENTIONS.md new file mode 100644 index 000000000..e69de29bb diff --git a/Dockerfile b/Dockerfile index 6d9b351b7..62c1dfea5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.22-alpine AS go-builder +FROM golang:1.23-alpine AS go-builder SHELL ["/bin/sh", "-ecuxo", "pipefail"] @@ -31,6 +31,8 @@ RUN LEDGER_ENABLED=false BUILD_TAGS=muslc LINK_STATICALLY=true make build \ # -------------------------------------------------------- FROM debian:11-slim +LABEL org.opencontainers.image.source https://github.com/onsonr/sonr + COPY --from=go-builder /code/build/sonrd /usr/bin/sonrd # Install dependencies for Debian 11 diff --git a/Makefile b/Makefile index fe82040cc..52751e035 100644 --- a/Makefile +++ b/Makefile @@ -8,14 +8,16 @@ SDK_PACK := $(shell go list -m github.com/cosmos/cosmos-sdk | sed 's/ /\@/g') BINDIR ?= $(GOPATH)/bin SIMAPP = ./app -PC_PORT_NUM=42069 -PC_LOG_FILE=./sonr.log -PC_SOCKET_PATH=/tmp/sonr-net.sock +# Fetch from env +RELEASE_DATE ?= $(shell date +%Y).$(shell date +%V).$(shell date +%u) +VERSION ?= $(shell echo $(shell git describe --tags) | sed 's/^v//') +COMMIT ?= $(shell git log -1 --format='%H') +OS ?= $(shell uname -s) +ROOT ?= $(shell git rev-parse --show-toplevel) # for dockerized protobuf tools DOCKER := $(shell which docker) HTTPS_GIT := github.com/onsonr/sonr.git -PROCESS_COMPOSE := $(shell which process-compose) export GO111MODULE = on @@ -107,8 +109,14 @@ install: go.sum install-hway: go.sum go install -mod=readonly ./cmd/hway +release: fmt-date + @go install github.com/goreleaser/goreleaser/v2@latest + RELEASE_DATE=$(RELEASE_DATE) goreleaser release --clean + + ######################################## ### Tools & dependencies +######################################## go-mod-cache: go.sum @echo "--> Download go modules to local cache" @@ -134,12 +142,9 @@ clean: distclean: clean rm -rf vendor/ -init-env: - @echo "Installing process-compose" - sh scripts/init_env.sh - ######################################## ### Testing +######################################## test: test-unit test-all: test-race test-cover test-system @@ -310,6 +315,33 @@ sh-testnet: mod-tidy .PHONY: setup-testnet set-testnet-configs testnet testnet-basic sh-testnet dop-testnet +############################################################################### +### extra utils ### +############################################################################### + +push-docker: + @docker build -t ghcr.io/onsonr/sonr:latest . + @docker tag ghcr.io/onsonr/sonr:latest ghcr.io/onsonr/sonr:$(VERSION) + @docker push ghcr.io/onsonr/sonr:latest + @docker push ghcr.io/onsonr/sonr:$(VERSION) + +status: + @gh run ls -L 3 + @gum format -- "# Sonr ($OS-$VERSION)" "- ($(COMMIT)) $ROOT" "- $(RELEASE_DATE)" + @sleep 3 + +release: + @go install github.com/goreleaser/goreleaser/v2@latest + @RELEASE_DATE=$(RELEASE_DATE) goreleaser release --clean + +release-dry: + @go install github.com/goreleaser/goreleaser/v2@latest + @RELEASE_DATE=$(RELEASE_DATE) goreleaser release --snapshot --clean --skip=publish + +release-check: + @go install github.com/goreleaser/goreleaser/v2@latest + @RELEASE_DATE=$(RELEASE_DATE) goreleaser check + ############################################################################### ### help ### ############################################################################### diff --git a/Taskfile.yml b/Taskfile.yml deleted file mode 100644 index 8704a288e..000000000 --- a/Taskfile.yml +++ /dev/null @@ -1,73 +0,0 @@ -version: "3" - -vars: - VERSION: - sh: git describe --tags --abbrev=0 - COMMIT: - sh: git rev-parse --short HEAD - ROOT: - sh: git rev-parse --show-toplevel - OS: - sh: uname -s - # DOPPLER_TOKEN: - # sh: skate get DOPPLER_NETWORK - -# includes: -# deps: https://raw.githubusercontent.com/onsonr/taskfiles/main/taskfiles/deps.yml -# gen: https://raw.githubusercontent.com/onsonr/taskfiles/main/taskfiles/gen.yml -# hway: https://raw.githubusercontent.com/onsonr/taskfiles/main/taskfiles/hway.yml -# ipfs: https://raw.githubusercontent.com/onsonr/taskfiles/main/taskfiles/ipfs.yml -# issue: https://raw.githubusercontent.com/onsonr/taskfiles/main/taskfiles/ghpm.yml -# procs: https://raw.githubusercontent.com/onsonr/taskfiles/main/taskfiles/procs.yml -# postgres: https://raw.githubusercontent.com/onsonr/taskfiles/main/taskfiles/postgres.yml -# sonrd: https://raw.githubusercontent.com/onsonr/taskfiles/main/taskfiles/sonrd.yml -# -tasks: - default: - cmds: - - gh run ls -L 3 - - gum format -- "# Sonr ({{.OS}}-{{.VERSION}})" " - ({{.COMMIT}}) {{.ROOT}}" - - task -l -j | jq -r '.tasks[].name' | fzf --height=16 | xargs task - silent: true - - # start: - # desc: Start the Network - # silent: true - # cmds: - # - task: postgres:reset - # - task: ipfs:init - # - task: ipfs:mount - # - task: sonrd:install - # - task: hway:build - # - task: procs:up - # - # status: - # desc: Check the status of the Network - # silent: true - # cmds: - # - task: procs:attach - # - # stop: - # desc: Stop the Network - # silent: true - # cmds: - # - task: procs:down - date: - desc: Returns date in YEAR.WEEK.DAY format - cmds: - - | - YEAR=$(date +%Y) - WEEK=$(date +%V) - DAY=$(date +%u) - echo "${YEAR}.${WEEK}.${DAY}" - vars: - DATE: '{{default "" .CLI_ARGS}}' - silent: true - - release: - desc: Create a new release with formatted date - cmds: - - go install github.com/goreleaser/goreleaser/v2@latest - - RELEASE_DATE=$(task date) goreleaser release --clean - silent: true - diff --git a/cmd/hway/cmds.go b/cmd/hway/cmds.go deleted file mode 100644 index 745ee26e9..000000000 --- a/cmd/hway/cmds.go +++ /dev/null @@ -1,93 +0,0 @@ -package main - -import ( - "fmt" - "log" - "net/http" - "os" - "strings" - - "github.com/onsonr/sonr/gateway" - "github.com/onsonr/sonr/internal/common" - "github.com/spf13/cobra" -) - -// Command line flags -var ( - servePort int // Gateway http entry point (default 3000) - chainID string // Current chain ID (default sonr-testnet-1) - ipfsGatewayURL string // IPFS gateway URL (default localhost:8080) - sonrAPIURL string // Sonr API URL (default localhost:1317) - sonrGrpcURL string // Sonr gRPC URL (default localhost:9090) - sonrRPCURL string // Sonr RPC URL (default localhost:26657) - - psqlHost string // PostgresSQL Host Flag - psqlPort string // PostgresSQL Port Flag - psqlUser string // PostgresSQL User Flag - psqlPass string // PostgresSQL Password Flag - psqlDB string // PostgresSQL Database Flag -) - -func rootCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "hway", - Short: "Sonr DID gateway", - Run: func(cmd *cobra.Command, args []string) { - env, err := loadEnvImplFromArgs(args) - if err != nil { - panic(err) - } - ipc, err := common.NewIPFS() - if err != nil { - panic(err) - } - dbq, err := setupPostgresDB() - if err != nil { - panic(err) - } - e, err := gateway.New(env, ipc, dbq) - if err != nil { - panic(err) - } - if err := e.Start(fmt.Sprintf(":%d", env.GetServePort())); err != http.ErrServerClosed { - log.Fatal(err) - os.Exit(1) - return - } - }, - } - cmd.Flags().IntVar(&servePort, "serve-port", 3000, "Port to serve the gateway on") - cmd.Flags().StringVar(&chainID, "chain-id", "sonr-testnet-1", "Chain ID") - cmd.Flags().StringVar(&ipfsGatewayURL, "ipfs-gateway-url", "localhost:8080", "IPFS gateway URL") - cmd.Flags().StringVar(&sonrAPIURL, "sonr-api-url", "localhost:1317", "Sonr API URL") - cmd.Flags().StringVar(&sonrGrpcURL, "sonr-grpc-url", "localhost:9090", "Sonr gRPC URL") - cmd.Flags().StringVar(&sonrRPCURL, "sonr-rpc-url", "localhost:26657", "Sonr RPC URL") - cmd.Flags().StringVar(&psqlHost, "psql-host", "localhost", "PostgresSQL Host") - cmd.Flags().StringVar(&psqlPort, "psql-port", "5432", "PostgresSQL Port") - cmd.Flags().StringVar(&psqlUser, "psql-user", "highway_user", "PostgresSQL User") - cmd.Flags().StringVar(&psqlPass, "psql-pass", "highway_password123", "PostgresSQL Password") - cmd.Flags().StringVar(&psqlDB, "psql-db", "highway", "PostgresSQL Database") - return cmd -} - -func formatPsqlDSN() string { - if psqlHost == "" { - return "" - } - - host := psqlHost - port := "5432" - - if parts := strings.Split(psqlHost, ":"); len(parts) == 2 { - host = parts[0] - port = parts[1] - } - - dsn := fmt.Sprintf("host=%s port=%s user=%s password=%s dbname=%s sslmode=verify-full", - host, port, psqlUser, psqlPass, psqlDB) - - log.Printf("Attempting to connect to PostgreSQL with DSN: host=%s port=%s user=%s dbname=%s", - host, port, psqlUser, psqlDB) // Don't log the password - - return dsn -} diff --git a/cmd/hway/main.go b/cmd/hway/main.go deleted file mode 100644 index 5040bbdf7..000000000 --- a/cmd/hway/main.go +++ /dev/null @@ -1,49 +0,0 @@ -package main - -import ( - "context" - _ "embed" - "fmt" - "os" - - "github.com/jackc/pgx/v5" - config "github.com/onsonr/sonr/internal/config/hway" - hwayorm "github.com/onsonr/sonr/internal/database/hwayorm" -) - -// main is the entry point for the application -func main() { - cmd := rootCmd() - if err := cmd.Execute(); err != nil { - fmt.Println(err) - os.Exit(1) - } - os.Exit(0) -} - -func loadEnvImplFromArgs(args []string) (config.Hway, error) { - cmd := rootCmd() - if err := cmd.ParseFlags(args); err != nil { - return nil, err - } - - env := &config.HwayImpl{ - ServePort: servePort, - ChainId: chainID, - IpfsGatewayUrl: ipfsGatewayURL, - SonrApiUrl: sonrAPIURL, - SonrGrpcUrl: sonrGrpcURL, - SonrRpcUrl: sonrRPCURL, - PsqlDSN: formatPsqlDSN(), - } - return env, nil -} - -func setupPostgresDB() (*hwayorm.Queries, error) { - pgdsn := fmt.Sprintf("host=%s user=%s password=%s dbname=%s sslmode=disable", psqlHost, psqlUser, psqlPass, psqlDB) - conn, err := pgx.Connect(context.Background(), pgdsn) - if err != nil { - return nil, err - } - return hwayorm.New(conn), nil -} diff --git a/cmd/motr/main.go b/cmd/motr/main.go deleted file mode 100644 index 05cadab39..000000000 --- a/cmd/motr/main.go +++ /dev/null @@ -1,259 +0,0 @@ -//go:build js && wasm -// +build js,wasm - -package main - -import ( - "bytes" - "context" - "database/sql" - "encoding/json" - "fmt" - "io" - "log" - "net/http" - "net/http/httptest" - "strings" - "sync" - "syscall/js" - - _ "github.com/ncruces/go-sqlite3/driver" - _ "github.com/ncruces/go-sqlite3/embed" - "github.com/onsonr/sonr/internal/config/motr" - "github.com/onsonr/sonr/internal/database/motrorm" - sink "github.com/onsonr/sonr/internal/database/sink" - vault "github.com/onsonr/sonr/vault" -) - -var ( - // Global buffer pool to reduce allocations - bufferPool = sync.Pool{ - New: func() interface{} { - return new(bytes.Buffer) - }, - } - - // Cached JS globals - jsGlobal = js.Global() - jsUint8Array = jsGlobal.Get("Uint8Array") - jsResponse = jsGlobal.Get("Response") - jsPromise = jsGlobal.Get("Promise") - jsWasmHTTP = jsGlobal.Get("wasmhttp") -) - -func main() { - configString := "TODO" - config, _ := loadConfig(configString) - dbq, err := createDB() - if err != nil { - log.Fatal(err) - return - } - e, err := vault.New(config, dbq) - if err != nil { - log.Fatal(err) - return - } - serveFetch(e) -} - -// loadConfig loads the config from the given JSON string -func loadConfig(configString string) (*motr.Config, error) { - var config motr.Config - err := json.Unmarshal([]byte(configString), &config) - return &config, err -} - -// createDB initializes and returns a configured database connection -func createDB() (*motrorm.Queries, error) { - db, err := sql.Open("sqlite3", ":memory:") - if err != nil { - return nil, err - } - - // create tables - if _, err := db.ExecContext(context.Background(), sink.SchemaVaultSQL); err != nil { - return nil, err - } - return motrorm.New(db), nil -} - -// serveFetch serves HTTP requests with optimized handler management -func serveFetch(handler http.Handler) func() { - h := handler - if h == nil { - h = http.DefaultServeMux - } - - // Optimize prefix handling - prefix := strings.TrimRight(jsWasmHTTP.Get("path").String(), "/") - if prefix != "" { - mux := http.NewServeMux() - mux.Handle(prefix+"/", http.StripPrefix(prefix, h)) - h = mux - } - - // Create request handler function - cb := js.FuncOf(func(_ js.Value, args []js.Value) interface{} { - promise, resolve, reject := newPromiseOptimized() - - go handleRequest(h, args[1], resolve, reject) - - return promise - }) - - jsWasmHTTP.Call("setHandler", cb) - return cb.Release -} - -// handleRequest processes the request with panic recovery -func handleRequest(h http.Handler, jsReq js.Value, resolve, reject func(interface{})) { - defer func() { - if r := recover(); r != nil { - var errMsg string - if err, ok := r.(error); ok { - errMsg = fmt.Sprintf("wasmhttp: panic: %+v", err) - } else { - errMsg = fmt.Sprintf("wasmhttp: panic: %v", r) - } - reject(errMsg) - } - }() - - recorder := newResponseRecorder() - h.ServeHTTP(recorder, buildRequest(jsReq)) - resolve(recorder.jsResponse()) -} - -// buildRequest creates an http.Request from JS Request -func buildRequest(jsReq js.Value) *http.Request { - // Get request body - arrayBuffer, err := awaitPromiseOptimized(jsReq.Call("arrayBuffer")) - if err != nil { - panic(err) - } - - // Create body buffer - jsBody := jsUint8Array.New(arrayBuffer) - bodyLen := jsBody.Get("length").Int() - body := make([]byte, bodyLen) - js.CopyBytesToGo(body, jsBody) - - // Create request - req := httptest.NewRequest( - jsReq.Get("method").String(), - jsReq.Get("url").String(), - bytes.NewReader(body), - ) - - // Set headers efficiently - headers := jsReq.Get("headers") - headersIt := headers.Call("entries") - for { - entry := headersIt.Call("next") - if entry.Get("done").Bool() { - break - } - pair := entry.Get("value") - req.Header.Set(pair.Index(0).String(), pair.Index(1).String()) - } - - return req -} - -// ResponseRecorder with optimized buffer handling -type ResponseRecorder struct { - *httptest.ResponseRecorder - buffer *bytes.Buffer -} - -func newResponseRecorder() *ResponseRecorder { - return &ResponseRecorder{ - ResponseRecorder: httptest.NewRecorder(), - buffer: bufferPool.Get().(*bytes.Buffer), - } -} - -// jsResponse creates a JS Response with optimized memory usage -func (rr *ResponseRecorder) jsResponse() js.Value { - defer func() { - rr.buffer.Reset() - bufferPool.Put(rr.buffer) - }() - - res := rr.Result() - defer res.Body.Close() - - // Prepare response body - body := js.Undefined() - if res.ContentLength != 0 { - if _, err := io.Copy(rr.buffer, res.Body); err != nil { - panic(err) - } - bodyBytes := rr.buffer.Bytes() - body = jsUint8Array.New(len(bodyBytes)) - js.CopyBytesToJS(body, bodyBytes) - } - - // Prepare response init object - init := make(map[string]interface{}, 3) - if res.StatusCode != 0 { - init["status"] = res.StatusCode - } - - if len(res.Header) > 0 { - headers := make(map[string]interface{}, len(res.Header)) - for k, v := range res.Header { - if len(v) > 0 { - headers[k] = v[0] - } - } - init["headers"] = headers - } - - return jsResponse.New(body, init) -} - -// newPromiseOptimized creates a new JavaScript Promise with optimized callback handling -func newPromiseOptimized() (js.Value, func(interface{}), func(interface{})) { - var ( - resolve func(interface{}) - reject func(interface{}) - promiseFunc = js.FuncOf(func(_ js.Value, args []js.Value) interface{} { - resolve = func(v interface{}) { args[0].Invoke(v) } - reject = func(v interface{}) { args[1].Invoke(v) } - return js.Undefined() - }) - ) - defer promiseFunc.Release() - - return jsPromise.New(promiseFunc), resolve, reject -} - -// awaitPromiseOptimized waits for Promise resolution with optimized channel handling -func awaitPromiseOptimized(promise js.Value) (js.Value, error) { - done := make(chan struct{}) - var ( - result js.Value - err error - ) - - thenFunc := js.FuncOf(func(_ js.Value, args []js.Value) interface{} { - result = args[0] - close(done) - return nil - }) - defer thenFunc.Release() - - catchFunc := js.FuncOf(func(_ js.Value, args []js.Value) interface{} { - err = js.Error{Value: args[0]} - close(done) - return nil - }) - defer catchFunc.Release() - - promise.Call("then", thenFunc).Call("catch", catchFunc) - <-done - - return result, err -} diff --git a/internal/crypto/accumulator/accumulator.go b/crypto/accumulator/accumulator.go similarity index 98% rename from internal/crypto/accumulator/accumulator.go rename to crypto/accumulator/accumulator.go index 629f00b94..c3687628d 100755 --- a/internal/crypto/accumulator/accumulator.go +++ b/crypto/accumulator/accumulator.go @@ -16,7 +16,7 @@ import ( "git.sr.ht/~sircmpwn/go-bare" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) type structMarshal struct { diff --git a/internal/crypto/accumulator/accumulator_test.go b/crypto/accumulator/accumulator_test.go similarity index 99% rename from internal/crypto/accumulator/accumulator_test.go rename to crypto/accumulator/accumulator_test.go index fd1d467fb..65eb580b5 100755 --- a/internal/crypto/accumulator/accumulator_test.go +++ b/crypto/accumulator/accumulator_test.go @@ -13,7 +13,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) func TestNewAccumulator100(t *testing.T) { diff --git a/internal/crypto/accumulator/key.go b/crypto/accumulator/key.go similarity index 99% rename from internal/crypto/accumulator/key.go rename to crypto/accumulator/key.go index a527d7be4..7b73a3f54 100755 --- a/internal/crypto/accumulator/key.go +++ b/crypto/accumulator/key.go @@ -12,7 +12,7 @@ import ( "git.sr.ht/~sircmpwn/go-bare" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) // SecretKey is the secret alpha only held by the accumulator manager. diff --git a/internal/crypto/accumulator/key_test.go b/crypto/accumulator/key_test.go similarity index 97% rename from internal/crypto/accumulator/key_test.go rename to crypto/accumulator/key_test.go index 446b28b3c..75c8183e7 100755 --- a/internal/crypto/accumulator/key_test.go +++ b/crypto/accumulator/key_test.go @@ -11,7 +11,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) func TestSecretKeyMarshal(t *testing.T) { diff --git a/internal/crypto/accumulator/lib.go b/crypto/accumulator/lib.go similarity index 98% rename from internal/crypto/accumulator/lib.go rename to crypto/accumulator/lib.go index d971c8f9d..66c82662b 100755 --- a/internal/crypto/accumulator/lib.go +++ b/crypto/accumulator/lib.go @@ -10,7 +10,7 @@ import ( "fmt" "math" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) // dad constructs two polynomials - dA(x) and dD(x) diff --git a/internal/crypto/accumulator/lib_test.go b/crypto/accumulator/lib_test.go similarity index 99% rename from internal/crypto/accumulator/lib_test.go rename to crypto/accumulator/lib_test.go index 901d40135..b7ec55f3c 100755 --- a/internal/crypto/accumulator/lib_test.go +++ b/crypto/accumulator/lib_test.go @@ -11,7 +11,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) func TestEvaluatePolyG1(t *testing.T) { diff --git a/internal/crypto/accumulator/proof.go b/crypto/accumulator/proof.go similarity index 99% rename from internal/crypto/accumulator/proof.go rename to crypto/accumulator/proof.go index accd29fde..9af282935 100755 --- a/internal/crypto/accumulator/proof.go +++ b/crypto/accumulator/proof.go @@ -14,7 +14,7 @@ import ( "git.sr.ht/~sircmpwn/go-bare" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) type proofParamsMarshal struct { diff --git a/internal/crypto/accumulator/proof_test.go b/crypto/accumulator/proof_test.go similarity index 99% rename from internal/crypto/accumulator/proof_test.go rename to crypto/accumulator/proof_test.go index 4b0eeb832..89d086ffc 100755 --- a/internal/crypto/accumulator/proof_test.go +++ b/crypto/accumulator/proof_test.go @@ -11,7 +11,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) func TestProofParamsMarshal(t *testing.T) { diff --git a/internal/crypto/accumulator/witness.go b/crypto/accumulator/witness.go similarity index 99% rename from internal/crypto/accumulator/witness.go rename to crypto/accumulator/witness.go index 0e87b97d4..0be288136 100755 --- a/internal/crypto/accumulator/witness.go +++ b/crypto/accumulator/witness.go @@ -12,7 +12,7 @@ import ( "git.sr.ht/~sircmpwn/go-bare" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) // MembershipWitness contains the witness c and the value y respect to the accumulator state. diff --git a/internal/crypto/accumulator/witness_test.go b/crypto/accumulator/witness_test.go similarity index 99% rename from internal/crypto/accumulator/witness_test.go rename to crypto/accumulator/witness_test.go index 4639f346f..317364a1c 100755 --- a/internal/crypto/accumulator/witness_test.go +++ b/crypto/accumulator/witness_test.go @@ -11,7 +11,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) func Test_Membership_Witness_New(t *testing.T) { diff --git a/internal/crypto/bulletproof/generators.go b/crypto/bulletproof/generators.go similarity index 97% rename from internal/crypto/bulletproof/generators.go rename to crypto/bulletproof/generators.go index 7bb82a53d..31efd05f4 100755 --- a/internal/crypto/bulletproof/generators.go +++ b/crypto/bulletproof/generators.go @@ -10,7 +10,7 @@ import ( "github.com/pkg/errors" "golang.org/x/crypto/sha3" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) // generators contains a list of points to be used as generators for bulletproofs. diff --git a/internal/crypto/bulletproof/generators_test.go b/crypto/bulletproof/generators_test.go similarity index 96% rename from internal/crypto/bulletproof/generators_test.go rename to crypto/bulletproof/generators_test.go index acb6c1e7c..35ca657ff 100755 --- a/internal/crypto/bulletproof/generators_test.go +++ b/crypto/bulletproof/generators_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" "golang.org/x/crypto/sha3" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) func TestGeneratorsHappyPath(t *testing.T) { diff --git a/internal/crypto/bulletproof/helpers.go b/crypto/bulletproof/helpers.go similarity index 99% rename from internal/crypto/bulletproof/helpers.go rename to crypto/bulletproof/helpers.go index 19feef634..3be6431a8 100755 --- a/internal/crypto/bulletproof/helpers.go +++ b/crypto/bulletproof/helpers.go @@ -9,7 +9,7 @@ package bulletproof import ( "github.com/pkg/errors" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) // innerProduct takes two lists of scalars (a, b) and performs the dot product returning a single scalar. diff --git a/internal/crypto/bulletproof/helpers_test.go b/crypto/bulletproof/helpers_test.go similarity index 97% rename from internal/crypto/bulletproof/helpers_test.go rename to crypto/bulletproof/helpers_test.go index bdbbdf036..10ec288b3 100755 --- a/internal/crypto/bulletproof/helpers_test.go +++ b/crypto/bulletproof/helpers_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) func TestInnerProductHappyPath(t *testing.T) { diff --git a/internal/crypto/bulletproof/ipp_prover.go b/crypto/bulletproof/ipp_prover.go similarity index 99% rename from internal/crypto/bulletproof/ipp_prover.go rename to crypto/bulletproof/ipp_prover.go index 98cbc2d20..53eb01834 100755 --- a/internal/crypto/bulletproof/ipp_prover.go +++ b/crypto/bulletproof/ipp_prover.go @@ -11,7 +11,7 @@ import ( "github.com/gtank/merlin" "github.com/pkg/errors" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) // InnerProductProver is the struct used to create InnerProductProofs diff --git a/internal/crypto/bulletproof/ipp_prover_test.go b/crypto/bulletproof/ipp_prover_test.go similarity index 98% rename from internal/crypto/bulletproof/ipp_prover_test.go rename to crypto/bulletproof/ipp_prover_test.go index 9d4d63964..1199f178c 100755 --- a/internal/crypto/bulletproof/ipp_prover_test.go +++ b/crypto/bulletproof/ipp_prover_test.go @@ -7,7 +7,7 @@ import ( "github.com/gtank/merlin" "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) func TestIPPHappyPath(t *testing.T) { diff --git a/internal/crypto/bulletproof/ipp_verifier.go b/crypto/bulletproof/ipp_verifier.go similarity index 99% rename from internal/crypto/bulletproof/ipp_verifier.go rename to crypto/bulletproof/ipp_verifier.go index 84fcb5f32..56977b51d 100755 --- a/internal/crypto/bulletproof/ipp_verifier.go +++ b/crypto/bulletproof/ipp_verifier.go @@ -4,7 +4,7 @@ import ( "github.com/gtank/merlin" "github.com/pkg/errors" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) // InnerProductVerifier is the struct used to verify inner product proofs diff --git a/internal/crypto/bulletproof/ipp_verifier_test.go b/crypto/bulletproof/ipp_verifier_test.go similarity index 97% rename from internal/crypto/bulletproof/ipp_verifier_test.go rename to crypto/bulletproof/ipp_verifier_test.go index 9f3483e5c..84b2e2e61 100755 --- a/internal/crypto/bulletproof/ipp_verifier_test.go +++ b/crypto/bulletproof/ipp_verifier_test.go @@ -7,7 +7,7 @@ import ( "github.com/gtank/merlin" "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) func TestIPPVerifyHappyPath(t *testing.T) { diff --git a/internal/crypto/bulletproof/range_batch_prover.go b/crypto/bulletproof/range_batch_prover.go similarity index 99% rename from internal/crypto/bulletproof/range_batch_prover.go rename to crypto/bulletproof/range_batch_prover.go index 1b9e77f3e..0284ae7b6 100755 --- a/internal/crypto/bulletproof/range_batch_prover.go +++ b/crypto/bulletproof/range_batch_prover.go @@ -6,7 +6,7 @@ import ( "github.com/gtank/merlin" "github.com/pkg/errors" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) // BatchProve proves that a list of scalars v are in the range n. diff --git a/internal/crypto/bulletproof/range_batch_prover_test.go b/crypto/bulletproof/range_batch_prover_test.go similarity index 98% rename from internal/crypto/bulletproof/range_batch_prover_test.go rename to crypto/bulletproof/range_batch_prover_test.go index f5793cb00..d781c2dbf 100755 --- a/internal/crypto/bulletproof/range_batch_prover_test.go +++ b/crypto/bulletproof/range_batch_prover_test.go @@ -7,7 +7,7 @@ import ( "github.com/gtank/merlin" "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) func TestRangeBatchProverHappyPath(t *testing.T) { diff --git a/internal/crypto/bulletproof/range_batch_verifier.go b/crypto/bulletproof/range_batch_verifier.go similarity index 98% rename from internal/crypto/bulletproof/range_batch_verifier.go rename to crypto/bulletproof/range_batch_verifier.go index 32f77d4ca..e22161ccd 100755 --- a/internal/crypto/bulletproof/range_batch_verifier.go +++ b/crypto/bulletproof/range_batch_verifier.go @@ -4,7 +4,7 @@ import ( "github.com/gtank/merlin" "github.com/pkg/errors" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) // VerifyBatched verifies a given batched range proof. diff --git a/internal/crypto/bulletproof/range_batch_verifier_test.go b/crypto/bulletproof/range_batch_verifier_test.go similarity index 98% rename from internal/crypto/bulletproof/range_batch_verifier_test.go rename to crypto/bulletproof/range_batch_verifier_test.go index 987519bc8..f9f6d554c 100755 --- a/internal/crypto/bulletproof/range_batch_verifier_test.go +++ b/crypto/bulletproof/range_batch_verifier_test.go @@ -7,7 +7,7 @@ import ( "github.com/gtank/merlin" "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) func TestRangeBatchVerifyHappyPath(t *testing.T) { diff --git a/internal/crypto/bulletproof/range_prover.go b/crypto/bulletproof/range_prover.go similarity index 99% rename from internal/crypto/bulletproof/range_prover.go rename to crypto/bulletproof/range_prover.go index 0d23755e6..852a4f378 100755 --- a/internal/crypto/bulletproof/range_prover.go +++ b/crypto/bulletproof/range_prover.go @@ -14,7 +14,7 @@ import ( "github.com/gtank/merlin" "github.com/pkg/errors" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) // RangeProver is the struct used to create RangeProofs diff --git a/internal/crypto/bulletproof/range_prover_test.go b/crypto/bulletproof/range_prover_test.go similarity index 97% rename from internal/crypto/bulletproof/range_prover_test.go rename to crypto/bulletproof/range_prover_test.go index e811a918f..333e02aec 100755 --- a/internal/crypto/bulletproof/range_prover_test.go +++ b/crypto/bulletproof/range_prover_test.go @@ -7,7 +7,7 @@ import ( "github.com/gtank/merlin" "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) func TestRangeProverHappyPath(t *testing.T) { diff --git a/internal/crypto/bulletproof/range_verifier.go b/crypto/bulletproof/range_verifier.go similarity index 99% rename from internal/crypto/bulletproof/range_verifier.go rename to crypto/bulletproof/range_verifier.go index 2ba16198d..f17db1036 100755 --- a/internal/crypto/bulletproof/range_verifier.go +++ b/crypto/bulletproof/range_verifier.go @@ -4,7 +4,7 @@ import ( "github.com/gtank/merlin" "github.com/pkg/errors" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) // RangeVerifier is the struct used to verify RangeProofs diff --git a/internal/crypto/bulletproof/range_verifier_test.go b/crypto/bulletproof/range_verifier_test.go similarity index 97% rename from internal/crypto/bulletproof/range_verifier_test.go rename to crypto/bulletproof/range_verifier_test.go index 9c54cdb9e..2d5383c94 100755 --- a/internal/crypto/bulletproof/range_verifier_test.go +++ b/crypto/bulletproof/range_verifier_test.go @@ -7,7 +7,7 @@ import ( "github.com/gtank/merlin" "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) func TestRangeVerifyHappyPath(t *testing.T) { diff --git a/internal/crypto/core/README.md b/crypto/core/README.md similarity index 100% rename from internal/crypto/core/README.md rename to crypto/core/README.md diff --git a/internal/crypto/core/commit.go b/crypto/core/commit.go similarity index 100% rename from internal/crypto/core/commit.go rename to crypto/core/commit.go diff --git a/internal/crypto/core/commit_test.go b/crypto/core/commit_test.go similarity index 100% rename from internal/crypto/core/commit_test.go rename to crypto/core/commit_test.go diff --git a/internal/crypto/core/curves/bls12377_curve.go b/crypto/core/curves/bls12377_curve.go similarity index 99% rename from internal/crypto/core/curves/bls12377_curve.go rename to crypto/core/curves/bls12377_curve.go index 2642d2226..5fdf01552 100755 --- a/internal/crypto/core/curves/bls12377_curve.go +++ b/crypto/core/curves/bls12377_curve.go @@ -19,7 +19,7 @@ import ( bls12377 "github.com/consensys/gnark-crypto/ecc/bls12-377" "golang.org/x/crypto/sha3" - "github.com/onsonr/sonr/internal/crypto/core" + "github.com/onsonr/sonr/crypto/core" ) // See 'r' = https://eprint.iacr.org/2018/962.pdf Figure 16 diff --git a/internal/crypto/core/curves/bls12381_curve.go b/crypto/core/curves/bls12381_curve.go similarity index 99% rename from internal/crypto/core/curves/bls12381_curve.go rename to crypto/core/curves/bls12381_curve.go index a4c5b7b94..2be154f42 100755 --- a/internal/crypto/core/curves/bls12381_curve.go +++ b/crypto/core/curves/bls12381_curve.go @@ -13,9 +13,9 @@ import ( "golang.org/x/crypto/sha3" - "github.com/onsonr/sonr/internal/crypto/core/curves/native" - "github.com/onsonr/sonr/internal/crypto/core/curves/native/bls12381" - "github.com/onsonr/sonr/internal/crypto/internal" + "github.com/onsonr/sonr/crypto/core/curves/native" + "github.com/onsonr/sonr/crypto/core/curves/native/bls12381" + "github.com/onsonr/sonr/crypto/internal" ) var bls12381modulus = bhex("1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab") diff --git a/internal/crypto/core/curves/curve.go b/crypto/core/curves/curve.go similarity index 99% rename from internal/crypto/core/curves/curve.go rename to crypto/core/curves/curve.go index 1e9e2bf45..d06fb7f91 100755 --- a/internal/crypto/core/curves/curve.go +++ b/crypto/core/curves/curve.go @@ -16,7 +16,7 @@ import ( "math/big" "sync" - "github.com/onsonr/sonr/internal/crypto/core/curves/native/bls12381" + "github.com/onsonr/sonr/crypto/core/curves/native/bls12381" ) var ( diff --git a/internal/crypto/core/curves/ec_point.go b/crypto/core/curves/ec_point.go similarity index 98% rename from internal/crypto/core/curves/ec_point.go rename to crypto/core/curves/ec_point.go index cb2d8d67e..bfb0b0ec2 100755 --- a/internal/crypto/core/curves/ec_point.go +++ b/crypto/core/curves/ec_point.go @@ -12,10 +12,10 @@ import ( "fmt" "math/big" - "github.com/onsonr/sonr/internal/crypto/core" + "github.com/onsonr/sonr/crypto/core" "github.com/dustinxie/ecc" - "github.com/onsonr/sonr/internal/crypto/internal" + "github.com/onsonr/sonr/crypto/internal" ) var curveNameToID = map[string]byte{ diff --git a/internal/crypto/core/curves/ec_point_test.go b/crypto/core/curves/ec_point_test.go similarity index 98% rename from internal/crypto/core/curves/ec_point_test.go rename to crypto/core/curves/ec_point_test.go index 4517c7418..2199f11cb 100755 --- a/internal/crypto/core/curves/ec_point_test.go +++ b/crypto/core/curves/ec_point_test.go @@ -15,8 +15,8 @@ import ( "github.com/btcsuite/btcd/btcec/v2" "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core" - tt "github.com/onsonr/sonr/internal/crypto/internal" + "github.com/onsonr/sonr/crypto/core" + tt "github.com/onsonr/sonr/crypto/internal" ) func TestIsIdentity(t *testing.T) { diff --git a/internal/crypto/core/curves/ec_scalar.go b/crypto/core/curves/ec_scalar.go similarity index 97% rename from internal/crypto/core/curves/ec_scalar.go rename to crypto/core/curves/ec_scalar.go index a3c2f953a..3e193fb4d 100755 --- a/internal/crypto/core/curves/ec_scalar.go +++ b/crypto/core/curves/ec_scalar.go @@ -18,9 +18,9 @@ import ( "github.com/btcsuite/btcd/btcec/v2" "github.com/bwesterb/go-ristretto" - "github.com/onsonr/sonr/internal/crypto/core" - "github.com/onsonr/sonr/internal/crypto/core/curves/native/bls12381" - "github.com/onsonr/sonr/internal/crypto/internal" + "github.com/onsonr/sonr/crypto/core" + "github.com/onsonr/sonr/crypto/core/curves/native/bls12381" + "github.com/onsonr/sonr/crypto/internal" ) type EcScalar interface { diff --git a/internal/crypto/core/curves/ecdsa.go b/crypto/core/curves/ecdsa.go similarity index 100% rename from internal/crypto/core/curves/ecdsa.go rename to crypto/core/curves/ecdsa.go diff --git a/internal/crypto/core/curves/ed25519_curve.go b/crypto/core/curves/ed25519_curve.go similarity index 99% rename from internal/crypto/core/curves/ed25519_curve.go rename to crypto/core/curves/ed25519_curve.go index 076063d2c..9c31d7a5b 100755 --- a/internal/crypto/core/curves/ed25519_curve.go +++ b/crypto/core/curves/ed25519_curve.go @@ -19,7 +19,7 @@ import ( "github.com/bwesterb/go-ristretto" ed "github.com/bwesterb/go-ristretto/edwards25519" - "github.com/onsonr/sonr/internal/crypto/internal" + "github.com/onsonr/sonr/crypto/internal" ) type ScalarEd25519 struct { diff --git a/internal/crypto/core/curves/ed25519_curve_test.go b/crypto/core/curves/ed25519_curve_test.go similarity index 99% rename from internal/crypto/core/curves/ed25519_curve_test.go rename to crypto/core/curves/ed25519_curve_test.go index 3224947d0..1c665f536 100755 --- a/internal/crypto/core/curves/ed25519_curve_test.go +++ b/crypto/core/curves/ed25519_curve_test.go @@ -15,7 +15,7 @@ import ( ed "filippo.io/edwards25519" "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/internal" + "github.com/onsonr/sonr/crypto/internal" ) func TestScalarEd25519Random(t *testing.T) { diff --git a/internal/crypto/core/curves/field.go b/crypto/core/curves/field.go similarity index 100% rename from internal/crypto/core/curves/field.go rename to crypto/core/curves/field.go diff --git a/internal/crypto/core/curves/field_test.go b/crypto/core/curves/field_test.go similarity index 100% rename from internal/crypto/core/curves/field_test.go rename to crypto/core/curves/field_test.go diff --git a/internal/crypto/core/curves/k256_bench_test.go b/crypto/core/curves/k256_bench_test.go similarity index 98% rename from internal/crypto/core/curves/k256_bench_test.go rename to crypto/core/curves/k256_bench_test.go index 26412db6b..94dd39ef6 100755 --- a/internal/crypto/core/curves/k256_bench_test.go +++ b/crypto/core/curves/k256_bench_test.go @@ -9,8 +9,8 @@ import ( "github.com/btcsuite/btcd/btcec/v2" - mod "github.com/onsonr/sonr/internal/crypto/core" - "github.com/onsonr/sonr/internal/crypto/internal" + mod "github.com/onsonr/sonr/crypto/core" + "github.com/onsonr/sonr/crypto/internal" ) func BenchmarkK256(b *testing.B) { diff --git a/internal/crypto/core/curves/k256_curve.go b/crypto/core/curves/k256_curve.go similarity index 97% rename from internal/crypto/core/curves/k256_curve.go rename to crypto/core/curves/k256_curve.go index c04331048..3be001d32 100755 --- a/internal/crypto/core/curves/k256_curve.go +++ b/crypto/core/curves/k256_curve.go @@ -15,11 +15,11 @@ import ( "github.com/btcsuite/btcd/btcec/v2" - "github.com/onsonr/sonr/internal/crypto/core/curves/native" - secp256k1 "github.com/onsonr/sonr/internal/crypto/core/curves/native/k256" - "github.com/onsonr/sonr/internal/crypto/core/curves/native/k256/fp" - "github.com/onsonr/sonr/internal/crypto/core/curves/native/k256/fq" - "github.com/onsonr/sonr/internal/crypto/internal" + "github.com/onsonr/sonr/crypto/core/curves/native" + secp256k1 "github.com/onsonr/sonr/crypto/core/curves/native/k256" + "github.com/onsonr/sonr/crypto/core/curves/native/k256/fp" + "github.com/onsonr/sonr/crypto/core/curves/native/k256/fq" + "github.com/onsonr/sonr/crypto/internal" ) var ( diff --git a/internal/crypto/core/curves/k256_curve_test.go b/crypto/core/curves/k256_curve_test.go similarity index 100% rename from internal/crypto/core/curves/k256_curve_test.go rename to crypto/core/curves/k256_curve_test.go diff --git a/internal/crypto/core/curves/native/bls12381/bls12381.go b/crypto/core/curves/native/bls12381/bls12381.go similarity index 96% rename from internal/crypto/core/curves/native/bls12381/bls12381.go rename to crypto/core/curves/native/bls12381/bls12381.go index 5e798f208..4397bcbed 100755 --- a/internal/crypto/core/curves/native/bls12381/bls12381.go +++ b/crypto/core/curves/native/bls12381/bls12381.go @@ -3,7 +3,7 @@ package bls12381 import ( "math/bits" - "github.com/onsonr/sonr/internal/crypto/core/curves/native" + "github.com/onsonr/sonr/crypto/core/curves/native" ) var fqModulusBytes = [native.FieldBytes]byte{0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x5b, 0xfe, 0xff, 0x02, 0xa4, 0xbd, 0x53, 0x05, 0xd8, 0xa1, 0x09, 0x08, 0xd8, 0x39, 0x33, 0x48, 0x7d, 0x9d, 0x29, 0x53, 0xa7, 0xed, 0x73} diff --git a/internal/crypto/core/curves/native/bls12381/fp.go b/crypto/core/curves/native/bls12381/fp.go similarity index 99% rename from internal/crypto/core/curves/native/bls12381/fp.go rename to crypto/core/curves/native/bls12381/fp.go index d2c5ce67c..5391686ee 100755 --- a/internal/crypto/core/curves/native/bls12381/fp.go +++ b/crypto/core/curves/native/bls12381/fp.go @@ -6,8 +6,8 @@ import ( "io" "math/big" - "github.com/onsonr/sonr/internal/crypto/core/curves/native" - "github.com/onsonr/sonr/internal/crypto/internal" + "github.com/onsonr/sonr/crypto/core/curves/native" + "github.com/onsonr/sonr/crypto/internal" ) // fp field element mod p diff --git a/internal/crypto/core/curves/native/bls12381/fp12.go b/crypto/core/curves/native/bls12381/fp12.go similarity index 100% rename from internal/crypto/core/curves/native/bls12381/fp12.go rename to crypto/core/curves/native/bls12381/fp12.go diff --git a/internal/crypto/core/curves/native/bls12381/fp12_test.go b/crypto/core/curves/native/bls12381/fp12_test.go similarity index 100% rename from internal/crypto/core/curves/native/bls12381/fp12_test.go rename to crypto/core/curves/native/bls12381/fp12_test.go diff --git a/internal/crypto/core/curves/native/bls12381/fp2.go b/crypto/core/curves/native/bls12381/fp2.go similarity index 100% rename from internal/crypto/core/curves/native/bls12381/fp2.go rename to crypto/core/curves/native/bls12381/fp2.go diff --git a/internal/crypto/core/curves/native/bls12381/fp2_test.go b/crypto/core/curves/native/bls12381/fp2_test.go similarity index 100% rename from internal/crypto/core/curves/native/bls12381/fp2_test.go rename to crypto/core/curves/native/bls12381/fp2_test.go diff --git a/internal/crypto/core/curves/native/bls12381/fp6.go b/crypto/core/curves/native/bls12381/fp6.go similarity index 100% rename from internal/crypto/core/curves/native/bls12381/fp6.go rename to crypto/core/curves/native/bls12381/fp6.go diff --git a/internal/crypto/core/curves/native/bls12381/fp6_test.go b/crypto/core/curves/native/bls12381/fp6_test.go similarity index 100% rename from internal/crypto/core/curves/native/bls12381/fp6_test.go rename to crypto/core/curves/native/bls12381/fp6_test.go diff --git a/internal/crypto/core/curves/native/bls12381/fp_test.go b/crypto/core/curves/native/bls12381/fp_test.go similarity index 99% rename from internal/crypto/core/curves/native/bls12381/fp_test.go rename to crypto/core/curves/native/bls12381/fp_test.go index 4c1f75aef..6152ada0c 100755 --- a/internal/crypto/core/curves/native/bls12381/fp_test.go +++ b/crypto/core/curves/native/bls12381/fp_test.go @@ -14,7 +14,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/internal" + "github.com/onsonr/sonr/crypto/internal" ) func TestFpSetOne(t *testing.T) { diff --git a/internal/crypto/core/curves/native/bls12381/fq.go b/crypto/core/curves/native/bls12381/fq.go similarity index 99% rename from internal/crypto/core/curves/native/bls12381/fq.go rename to crypto/core/curves/native/bls12381/fq.go index 2fa51992e..9ecf00ef1 100755 --- a/internal/crypto/core/curves/native/bls12381/fq.go +++ b/crypto/core/curves/native/bls12381/fq.go @@ -5,7 +5,7 @@ import ( "math/big" "sync" - "github.com/onsonr/sonr/internal/crypto/core/curves/native" + "github.com/onsonr/sonr/crypto/core/curves/native" ) type Fq [native.FieldLimbs]uint64 diff --git a/internal/crypto/core/curves/native/bls12381/fq_test.go b/crypto/core/curves/native/bls12381/fq_test.go similarity index 98% rename from internal/crypto/core/curves/native/bls12381/fq_test.go rename to crypto/core/curves/native/bls12381/fq_test.go index 2746a3861..f291e63ff 100755 --- a/internal/crypto/core/curves/native/bls12381/fq_test.go +++ b/crypto/core/curves/native/bls12381/fq_test.go @@ -14,8 +14,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core/curves/native" - "github.com/onsonr/sonr/internal/crypto/internal" + "github.com/onsonr/sonr/crypto/core/curves/native" + "github.com/onsonr/sonr/crypto/internal" ) func TestFqSetOne(t *testing.T) { diff --git a/internal/crypto/core/curves/native/bls12381/g1.go b/crypto/core/curves/native/bls12381/g1.go similarity index 99% rename from internal/crypto/core/curves/native/bls12381/g1.go rename to crypto/core/curves/native/bls12381/g1.go index 81d5b73d9..6f7425c0f 100755 --- a/internal/crypto/core/curves/native/bls12381/g1.go +++ b/crypto/core/curves/native/bls12381/g1.go @@ -7,8 +7,8 @@ import ( "github.com/pkg/errors" - "github.com/onsonr/sonr/internal/crypto/core/curves/native" - "github.com/onsonr/sonr/internal/crypto/internal" + "github.com/onsonr/sonr/crypto/core/curves/native" + "github.com/onsonr/sonr/crypto/internal" ) var ( diff --git a/internal/crypto/core/curves/native/bls12381/g1_test.go b/crypto/core/curves/native/bls12381/g1_test.go similarity index 99% rename from internal/crypto/core/curves/native/bls12381/g1_test.go rename to crypto/core/curves/native/bls12381/g1_test.go index fe51cea32..e8ab16463 100755 --- a/internal/crypto/core/curves/native/bls12381/g1_test.go +++ b/crypto/core/curves/native/bls12381/g1_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core/curves/native" + "github.com/onsonr/sonr/crypto/core/curves/native" ) func TestG1IsOnCurve(t *testing.T) { diff --git a/internal/crypto/core/curves/native/bls12381/g2.go b/crypto/core/curves/native/bls12381/g2.go similarity index 99% rename from internal/crypto/core/curves/native/bls12381/g2.go rename to crypto/core/curves/native/bls12381/g2.go index 1fd28cd16..ac45d8105 100755 --- a/internal/crypto/core/curves/native/bls12381/g2.go +++ b/crypto/core/curves/native/bls12381/g2.go @@ -7,8 +7,8 @@ import ( "github.com/pkg/errors" - "github.com/onsonr/sonr/internal/crypto/core/curves/native" - "github.com/onsonr/sonr/internal/crypto/internal" + "github.com/onsonr/sonr/crypto/core/curves/native" + "github.com/onsonr/sonr/crypto/internal" ) var ( diff --git a/internal/crypto/core/curves/native/bls12381/g2_test.go b/crypto/core/curves/native/bls12381/g2_test.go similarity index 99% rename from internal/crypto/core/curves/native/bls12381/g2_test.go rename to crypto/core/curves/native/bls12381/g2_test.go index 32a280368..faee647d6 100755 --- a/internal/crypto/core/curves/native/bls12381/g2_test.go +++ b/crypto/core/curves/native/bls12381/g2_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core/curves/native" + "github.com/onsonr/sonr/crypto/core/curves/native" ) func TestG2IsOnCurve(t *testing.T) { diff --git a/internal/crypto/core/curves/native/bls12381/gt.go b/crypto/core/curves/native/bls12381/gt.go similarity index 98% rename from internal/crypto/core/curves/native/bls12381/gt.go rename to crypto/core/curves/native/bls12381/gt.go index 131d4839f..fb23ac4a8 100755 --- a/internal/crypto/core/curves/native/bls12381/gt.go +++ b/crypto/core/curves/native/bls12381/gt.go @@ -3,8 +3,8 @@ package bls12381 import ( "io" - "github.com/onsonr/sonr/internal/crypto/core/curves/native" - "github.com/onsonr/sonr/internal/crypto/internal" + "github.com/onsonr/sonr/crypto/core/curves/native" + "github.com/onsonr/sonr/crypto/internal" ) // GtFieldBytes is the number of bytes needed to represent this field diff --git a/internal/crypto/core/curves/native/bls12381/pairings.go b/crypto/core/curves/native/bls12381/pairings.go similarity index 100% rename from internal/crypto/core/curves/native/bls12381/pairings.go rename to crypto/core/curves/native/bls12381/pairings.go diff --git a/internal/crypto/core/curves/native/bls12381/pairings_test.go b/crypto/core/curves/native/bls12381/pairings_test.go similarity index 95% rename from internal/crypto/core/curves/native/bls12381/pairings_test.go rename to crypto/core/curves/native/bls12381/pairings_test.go index 538fee17f..f253b0945 100755 --- a/internal/crypto/core/curves/native/bls12381/pairings_test.go +++ b/crypto/core/curves/native/bls12381/pairings_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core/curves/native" + "github.com/onsonr/sonr/crypto/core/curves/native" ) func TestSinglePairing(t *testing.T) { diff --git a/internal/crypto/core/curves/native/field.go b/crypto/core/curves/native/field.go similarity index 99% rename from internal/crypto/core/curves/native/field.go rename to crypto/core/curves/native/field.go index 564ddce55..6a6d0a883 100755 --- a/internal/crypto/core/curves/native/field.go +++ b/crypto/core/curves/native/field.go @@ -5,7 +5,7 @@ import ( "fmt" "math/big" - "github.com/onsonr/sonr/internal/crypto/internal" + "github.com/onsonr/sonr/crypto/internal" ) // FieldLimbs is the number of limbs needed to represent this field diff --git a/internal/crypto/core/curves/native/hash2field.go b/crypto/core/curves/native/hash2field.go similarity index 100% rename from internal/crypto/core/curves/native/hash2field.go rename to crypto/core/curves/native/hash2field.go diff --git a/internal/crypto/core/curves/native/isogeny.go b/crypto/core/curves/native/isogeny.go similarity index 100% rename from internal/crypto/core/curves/native/isogeny.go rename to crypto/core/curves/native/isogeny.go diff --git a/internal/crypto/core/curves/native/k256/fp/fp.go b/crypto/core/curves/native/k256/fp/fp.go similarity index 98% rename from internal/crypto/core/curves/native/k256/fp/fp.go rename to crypto/core/curves/native/k256/fp/fp.go index b7165a2b3..8f9cc4459 100755 --- a/internal/crypto/core/curves/native/k256/fp/fp.go +++ b/crypto/core/curves/native/k256/fp/fp.go @@ -10,7 +10,7 @@ import ( "math/big" "sync" - "github.com/onsonr/sonr/internal/crypto/core/curves/native" + "github.com/onsonr/sonr/crypto/core/curves/native" ) var ( diff --git a/internal/crypto/core/curves/native/k256/fp/fp_test.go b/crypto/core/curves/native/k256/fp/fp_test.go similarity index 98% rename from internal/crypto/core/curves/native/k256/fp/fp_test.go rename to crypto/core/curves/native/k256/fp/fp_test.go index a48bed698..3016d7a13 100755 --- a/internal/crypto/core/curves/native/k256/fp/fp_test.go +++ b/crypto/core/curves/native/k256/fp/fp_test.go @@ -14,8 +14,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core/curves/native" - "github.com/onsonr/sonr/internal/crypto/internal" + "github.com/onsonr/sonr/crypto/core/curves/native" + "github.com/onsonr/sonr/crypto/internal" ) func TestFpSetOne(t *testing.T) { diff --git a/internal/crypto/core/curves/native/k256/fp/secp256k1_fp.go b/crypto/core/curves/native/k256/fp/secp256k1_fp.go similarity index 100% rename from internal/crypto/core/curves/native/k256/fp/secp256k1_fp.go rename to crypto/core/curves/native/k256/fp/secp256k1_fp.go diff --git a/internal/crypto/core/curves/native/k256/fq/fq.go b/crypto/core/curves/native/k256/fq/fq.go similarity index 99% rename from internal/crypto/core/curves/native/k256/fq/fq.go rename to crypto/core/curves/native/k256/fq/fq.go index 849a2341c..59aebecaf 100755 --- a/internal/crypto/core/curves/native/k256/fq/fq.go +++ b/crypto/core/curves/native/k256/fq/fq.go @@ -10,7 +10,7 @@ import ( "math/big" "sync" - "github.com/onsonr/sonr/internal/crypto/core/curves/native" + "github.com/onsonr/sonr/crypto/core/curves/native" ) var ( diff --git a/internal/crypto/core/curves/native/k256/fq/fq_test.go b/crypto/core/curves/native/k256/fq/fq_test.go similarity index 98% rename from internal/crypto/core/curves/native/k256/fq/fq_test.go rename to crypto/core/curves/native/k256/fq/fq_test.go index 7c11dfcaf..8416e8dc2 100755 --- a/internal/crypto/core/curves/native/k256/fq/fq_test.go +++ b/crypto/core/curves/native/k256/fq/fq_test.go @@ -14,8 +14,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core/curves/native" - "github.com/onsonr/sonr/internal/crypto/internal" + "github.com/onsonr/sonr/crypto/core/curves/native" + "github.com/onsonr/sonr/crypto/internal" ) func TestFqSetOne(t *testing.T) { diff --git a/internal/crypto/core/curves/native/k256/fq/secp256k1_fq.go b/crypto/core/curves/native/k256/fq/secp256k1_fq.go similarity index 100% rename from internal/crypto/core/curves/native/k256/fq/secp256k1_fq.go rename to crypto/core/curves/native/k256/fq/secp256k1_fq.go diff --git a/internal/crypto/core/curves/native/k256/point.go b/crypto/core/curves/native/k256/point.go similarity index 98% rename from internal/crypto/core/curves/native/k256/point.go rename to crypto/core/curves/native/k256/point.go index 3788f18b9..8b9951839 100755 --- a/internal/crypto/core/curves/native/k256/point.go +++ b/crypto/core/curves/native/k256/point.go @@ -3,9 +3,9 @@ package k256 import ( "sync" - "github.com/onsonr/sonr/internal/crypto/core/curves/native" - "github.com/onsonr/sonr/internal/crypto/core/curves/native/k256/fp" - "github.com/onsonr/sonr/internal/crypto/internal" + "github.com/onsonr/sonr/crypto/core/curves/native" + "github.com/onsonr/sonr/crypto/core/curves/native/k256/fp" + "github.com/onsonr/sonr/crypto/internal" ) var ( diff --git a/internal/crypto/core/curves/native/k256/point_test.go b/crypto/core/curves/native/k256/point_test.go similarity index 71% rename from internal/crypto/core/curves/native/k256/point_test.go rename to crypto/core/curves/native/k256/point_test.go index 3ceb24a5e..4bbeec1cc 100755 --- a/internal/crypto/core/curves/native/k256/point_test.go +++ b/crypto/core/curves/native/k256/point_test.go @@ -5,8 +5,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core/curves/native" - "github.com/onsonr/sonr/internal/crypto/core/curves/native/k256" + "github.com/onsonr/sonr/crypto/core/curves/native" + "github.com/onsonr/sonr/crypto/core/curves/native/k256" ) func TestK256PointArithmetic_Hash(t *testing.T) { diff --git a/internal/crypto/core/curves/native/osswu.go b/crypto/core/curves/native/osswu.go similarity index 100% rename from internal/crypto/core/curves/native/osswu.go rename to crypto/core/curves/native/osswu.go diff --git a/internal/crypto/core/curves/native/p256/fp/fp.go b/crypto/core/curves/native/p256/fp/fp.go similarity index 98% rename from internal/crypto/core/curves/native/p256/fp/fp.go rename to crypto/core/curves/native/p256/fp/fp.go index 0fe4c5dde..6ef6d1314 100755 --- a/internal/crypto/core/curves/native/p256/fp/fp.go +++ b/crypto/core/curves/native/p256/fp/fp.go @@ -10,7 +10,7 @@ import ( "math/big" "sync" - "github.com/onsonr/sonr/internal/crypto/core/curves/native" + "github.com/onsonr/sonr/crypto/core/curves/native" ) var ( diff --git a/internal/crypto/core/curves/native/p256/fp/fp_test.go b/crypto/core/curves/native/p256/fp/fp_test.go similarity index 98% rename from internal/crypto/core/curves/native/p256/fp/fp_test.go rename to crypto/core/curves/native/p256/fp/fp_test.go index c9acc1a6f..a198ae189 100755 --- a/internal/crypto/core/curves/native/p256/fp/fp_test.go +++ b/crypto/core/curves/native/p256/fp/fp_test.go @@ -14,8 +14,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core/curves/native" - "github.com/onsonr/sonr/internal/crypto/internal" + "github.com/onsonr/sonr/crypto/core/curves/native" + "github.com/onsonr/sonr/crypto/internal" ) func TestFpSetOne(t *testing.T) { diff --git a/internal/crypto/core/curves/native/p256/fp/p256_fp.go b/crypto/core/curves/native/p256/fp/p256_fp.go similarity index 100% rename from internal/crypto/core/curves/native/p256/fp/p256_fp.go rename to crypto/core/curves/native/p256/fp/p256_fp.go diff --git a/internal/crypto/core/curves/native/p256/fq/fq.go b/crypto/core/curves/native/p256/fq/fq.go similarity index 99% rename from internal/crypto/core/curves/native/p256/fq/fq.go rename to crypto/core/curves/native/p256/fq/fq.go index 358a7c664..d3f8fd993 100755 --- a/internal/crypto/core/curves/native/p256/fq/fq.go +++ b/crypto/core/curves/native/p256/fq/fq.go @@ -10,7 +10,7 @@ import ( "math/big" "sync" - "github.com/onsonr/sonr/internal/crypto/core/curves/native" + "github.com/onsonr/sonr/crypto/core/curves/native" ) var ( diff --git a/internal/crypto/core/curves/native/p256/fq/fq_test.go b/crypto/core/curves/native/p256/fq/fq_test.go similarity index 98% rename from internal/crypto/core/curves/native/p256/fq/fq_test.go rename to crypto/core/curves/native/p256/fq/fq_test.go index 552da7adb..df0683334 100755 --- a/internal/crypto/core/curves/native/p256/fq/fq_test.go +++ b/crypto/core/curves/native/p256/fq/fq_test.go @@ -14,8 +14,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core/curves/native" - "github.com/onsonr/sonr/internal/crypto/internal" + "github.com/onsonr/sonr/crypto/core/curves/native" + "github.com/onsonr/sonr/crypto/internal" ) func TestFqSetOne(t *testing.T) { diff --git a/internal/crypto/core/curves/native/p256/fq/p256_fq.go b/crypto/core/curves/native/p256/fq/p256_fq.go similarity index 100% rename from internal/crypto/core/curves/native/p256/fq/p256_fq.go rename to crypto/core/curves/native/p256/fq/p256_fq.go diff --git a/internal/crypto/core/curves/native/p256/point.go b/crypto/core/curves/native/p256/point.go similarity index 98% rename from internal/crypto/core/curves/native/p256/point.go rename to crypto/core/curves/native/p256/point.go index 00a8f568e..917efbb86 100755 --- a/internal/crypto/core/curves/native/p256/point.go +++ b/crypto/core/curves/native/p256/point.go @@ -3,9 +3,9 @@ package p256 import ( "sync" - "github.com/onsonr/sonr/internal/crypto/core/curves/native" - "github.com/onsonr/sonr/internal/crypto/core/curves/native/p256/fp" - "github.com/onsonr/sonr/internal/crypto/internal" + "github.com/onsonr/sonr/crypto/core/curves/native" + "github.com/onsonr/sonr/crypto/core/curves/native/p256/fp" + "github.com/onsonr/sonr/crypto/internal" ) var ( diff --git a/internal/crypto/core/curves/native/p256/point_test.go b/crypto/core/curves/native/p256/point_test.go similarity index 75% rename from internal/crypto/core/curves/native/p256/point_test.go rename to crypto/core/curves/native/p256/point_test.go index 042681b0a..8ed346f3d 100755 --- a/internal/crypto/core/curves/native/p256/point_test.go +++ b/crypto/core/curves/native/p256/point_test.go @@ -6,10 +6,10 @@ import ( "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/core/curves/native" - "github.com/onsonr/sonr/internal/crypto/core/curves/native/p256" - "github.com/onsonr/sonr/internal/crypto/core/curves/native/p256/fp" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves/native" + "github.com/onsonr/sonr/crypto/core/curves/native/p256" + "github.com/onsonr/sonr/crypto/core/curves/native/p256/fp" ) func TestP256PointArithmetic_Double(t *testing.T) { diff --git a/internal/crypto/core/curves/native/pasta/README.md b/crypto/core/curves/native/pasta/README.md similarity index 100% rename from internal/crypto/core/curves/native/pasta/README.md rename to crypto/core/curves/native/pasta/README.md diff --git a/internal/crypto/core/curves/native/pasta/fp/fp.go b/crypto/core/curves/native/pasta/fp/fp.go similarity index 99% rename from internal/crypto/core/curves/native/pasta/fp/fp.go rename to crypto/core/curves/native/pasta/fp/fp.go index 5089356f2..6154b900c 100755 --- a/internal/crypto/core/curves/native/pasta/fp/fp.go +++ b/crypto/core/curves/native/pasta/fp/fp.go @@ -11,7 +11,7 @@ import ( "fmt" "math/big" - "github.com/onsonr/sonr/internal/crypto/internal" + "github.com/onsonr/sonr/crypto/internal" ) type Fp fiat_pasta_fp_montgomery_domain_field_element diff --git a/internal/crypto/core/curves/native/pasta/fp/fp_test.go b/crypto/core/curves/native/pasta/fp/fp_test.go similarity index 100% rename from internal/crypto/core/curves/native/pasta/fp/fp_test.go rename to crypto/core/curves/native/pasta/fp/fp_test.go diff --git a/internal/crypto/core/curves/native/pasta/fp/pasta_fp.go b/crypto/core/curves/native/pasta/fp/pasta_fp.go similarity index 100% rename from internal/crypto/core/curves/native/pasta/fp/pasta_fp.go rename to crypto/core/curves/native/pasta/fp/pasta_fp.go diff --git a/internal/crypto/core/curves/native/pasta/fq/fq.go b/crypto/core/curves/native/pasta/fq/fq.go similarity index 99% rename from internal/crypto/core/curves/native/pasta/fq/fq.go rename to crypto/core/curves/native/pasta/fq/fq.go index 6253e0db4..e0e9a74b4 100755 --- a/internal/crypto/core/curves/native/pasta/fq/fq.go +++ b/crypto/core/curves/native/pasta/fq/fq.go @@ -11,7 +11,7 @@ import ( "fmt" "math/big" - "github.com/onsonr/sonr/internal/crypto/internal" + "github.com/onsonr/sonr/crypto/internal" ) type Fq fiat_pasta_fq_montgomery_domain_field_element diff --git a/internal/crypto/core/curves/native/pasta/fq/fq_test.go b/crypto/core/curves/native/pasta/fq/fq_test.go similarity index 100% rename from internal/crypto/core/curves/native/pasta/fq/fq_test.go rename to crypto/core/curves/native/pasta/fq/fq_test.go diff --git a/internal/crypto/core/curves/native/pasta/fq/pasta_fq.go b/crypto/core/curves/native/pasta/fq/pasta_fq.go similarity index 100% rename from internal/crypto/core/curves/native/pasta/fq/pasta_fq.go rename to crypto/core/curves/native/pasta/fq/pasta_fq.go diff --git a/internal/crypto/core/curves/native/pasta/pallas.go b/crypto/core/curves/native/pasta/pallas.go similarity index 100% rename from internal/crypto/core/curves/native/pasta/pallas.go rename to crypto/core/curves/native/pasta/pallas.go diff --git a/internal/crypto/core/curves/native/point.go b/crypto/core/curves/native/point.go similarity index 100% rename from internal/crypto/core/curves/native/point.go rename to crypto/core/curves/native/point.go diff --git a/internal/crypto/core/curves/p256_bench_test.go b/crypto/core/curves/p256_bench_test.go similarity index 99% rename from internal/crypto/core/curves/p256_bench_test.go rename to crypto/core/curves/p256_bench_test.go index 78a101e09..6fe7f8bce 100755 --- a/internal/crypto/core/curves/p256_bench_test.go +++ b/crypto/core/curves/p256_bench_test.go @@ -16,7 +16,7 @@ import ( "math/big" "testing" - "github.com/onsonr/sonr/internal/crypto/core" + "github.com/onsonr/sonr/crypto/core" ) func BenchmarkP256(b *testing.B) { diff --git a/internal/crypto/core/curves/p256_curve.go b/crypto/core/curves/p256_curve.go similarity index 97% rename from internal/crypto/core/curves/p256_curve.go rename to crypto/core/curves/p256_curve.go index c8290b503..2225bdb6b 100755 --- a/internal/crypto/core/curves/p256_curve.go +++ b/crypto/core/curves/p256_curve.go @@ -13,11 +13,11 @@ import ( "math/big" "sync" - "github.com/onsonr/sonr/internal/crypto/core/curves/native" - p256n "github.com/onsonr/sonr/internal/crypto/core/curves/native/p256" - "github.com/onsonr/sonr/internal/crypto/core/curves/native/p256/fp" - "github.com/onsonr/sonr/internal/crypto/core/curves/native/p256/fq" - "github.com/onsonr/sonr/internal/crypto/internal" + "github.com/onsonr/sonr/crypto/core/curves/native" + p256n "github.com/onsonr/sonr/crypto/core/curves/native/p256" + "github.com/onsonr/sonr/crypto/core/curves/native/p256/fp" + "github.com/onsonr/sonr/crypto/core/curves/native/p256/fq" + "github.com/onsonr/sonr/crypto/internal" ) var ( diff --git a/internal/crypto/core/curves/p256_curve_test.go b/crypto/core/curves/p256_curve_test.go similarity index 100% rename from internal/crypto/core/curves/p256_curve_test.go rename to crypto/core/curves/p256_curve_test.go diff --git a/internal/crypto/core/curves/pallas_curve.go b/crypto/core/curves/pallas_curve.go similarity index 99% rename from internal/crypto/core/curves/pallas_curve.go rename to crypto/core/curves/pallas_curve.go index 3685ecc56..29f8424e6 100755 --- a/internal/crypto/core/curves/pallas_curve.go +++ b/crypto/core/curves/pallas_curve.go @@ -18,8 +18,8 @@ import ( "golang.org/x/crypto/blake2b" - "github.com/onsonr/sonr/internal/crypto/core/curves/native/pasta/fp" - "github.com/onsonr/sonr/internal/crypto/core/curves/native/pasta/fq" + "github.com/onsonr/sonr/crypto/core/curves/native/pasta/fp" + "github.com/onsonr/sonr/crypto/core/curves/native/pasta/fq" ) var ( diff --git a/internal/crypto/core/curves/pallas_curve_test.go b/crypto/core/curves/pallas_curve_test.go similarity index 96% rename from internal/crypto/core/curves/pallas_curve_test.go rename to crypto/core/curves/pallas_curve_test.go index e699de338..f97ec028d 100755 --- a/internal/crypto/core/curves/pallas_curve_test.go +++ b/crypto/core/curves/pallas_curve_test.go @@ -12,8 +12,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core/curves/native/pasta/fp" - "github.com/onsonr/sonr/internal/crypto/core/curves/native/pasta/fq" + "github.com/onsonr/sonr/crypto/core/curves/native/pasta/fp" + "github.com/onsonr/sonr/crypto/core/curves/native/pasta/fq" ) func TestPointPallasAddDoubleMul(t *testing.T) { diff --git a/internal/crypto/core/curves/secp256k1/secp256k1.go b/crypto/core/curves/secp256k1/secp256k1.go similarity index 100% rename from internal/crypto/core/curves/secp256k1/secp256k1.go rename to crypto/core/curves/secp256k1/secp256k1.go diff --git a/internal/crypto/core/curves/sp256_curve.go b/crypto/core/curves/sp256_curve.go similarity index 100% rename from internal/crypto/core/curves/sp256_curve.go rename to crypto/core/curves/sp256_curve.go diff --git a/internal/crypto/core/hash.go b/crypto/core/hash.go similarity index 99% rename from internal/crypto/core/hash.go rename to crypto/core/hash.go index 6d6bf58ef..f48429170 100755 --- a/internal/crypto/core/hash.go +++ b/crypto/core/hash.go @@ -18,7 +18,7 @@ import ( "github.com/btcsuite/btcd/btcec/v2" "golang.org/x/crypto/hkdf" - "github.com/onsonr/sonr/internal/crypto/internal" + "github.com/onsonr/sonr/crypto/internal" ) type HashField struct { diff --git a/internal/crypto/core/hash_test.go b/crypto/core/hash_test.go similarity index 100% rename from internal/crypto/core/hash_test.go rename to crypto/core/hash_test.go diff --git a/internal/crypto/core/mod.go b/crypto/core/mod.go similarity index 98% rename from internal/crypto/core/mod.go rename to crypto/core/mod.go index 9cfaffed0..c6aae6a2e 100755 --- a/internal/crypto/core/mod.go +++ b/crypto/core/mod.go @@ -16,7 +16,7 @@ import ( "fmt" "math/big" - "github.com/onsonr/sonr/internal/crypto/internal" + "github.com/onsonr/sonr/crypto/internal" ) var ( diff --git a/internal/crypto/core/mod_test.go b/crypto/core/mod_test.go similarity index 99% rename from internal/crypto/core/mod_test.go rename to crypto/core/mod_test.go index d7886891f..1e0483a63 100755 --- a/internal/crypto/core/mod_test.go +++ b/crypto/core/mod_test.go @@ -12,7 +12,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/internal" + "github.com/onsonr/sonr/crypto/internal" ) var ( diff --git a/internal/crypto/core/primes.go b/crypto/core/primes.go similarity index 100% rename from internal/crypto/core/primes.go rename to crypto/core/primes.go diff --git a/internal/crypto/core/protocol/protocol.go b/crypto/core/protocol/protocol.go similarity index 100% rename from internal/crypto/core/protocol/protocol.go rename to crypto/core/protocol/protocol.go diff --git a/internal/crypto/daed/aes_siv.go b/crypto/daed/aes_siv.go similarity index 100% rename from internal/crypto/daed/aes_siv.go rename to crypto/daed/aes_siv.go diff --git a/internal/crypto/daed/aes_siv_test.go b/crypto/daed/aes_siv_test.go similarity index 98% rename from internal/crypto/daed/aes_siv_test.go rename to crypto/daed/aes_siv_test.go index 4996c14cd..335c30d71 100644 --- a/internal/crypto/daed/aes_siv_test.go +++ b/crypto/daed/aes_siv_test.go @@ -8,8 +8,8 @@ import ( "path/filepath" "testing" - subtle "github.com/onsonr/sonr/internal/crypto/daed" - "github.com/onsonr/sonr/internal/crypto/subtle/random" + subtle "github.com/onsonr/sonr/crypto/daed" + "github.com/onsonr/sonr/crypto/subtle/random" ) type testData struct { diff --git a/internal/crypto/dkg/frost/README.md b/crypto/dkg/frost/README.md similarity index 100% rename from internal/crypto/dkg/frost/README.md rename to crypto/dkg/frost/README.md diff --git a/internal/crypto/dkg/frost/dkg_round1.go b/crypto/dkg/frost/dkg_round1.go similarity index 96% rename from internal/crypto/dkg/frost/dkg_round1.go rename to crypto/dkg/frost/dkg_round1.go index dbba547e7..277abcb2a 100755 --- a/internal/crypto/dkg/frost/dkg_round1.go +++ b/crypto/dkg/frost/dkg_round1.go @@ -15,9 +15,9 @@ import ( "github.com/pkg/errors" - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/internal" - "github.com/onsonr/sonr/internal/crypto/sharing" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/internal" + "github.com/onsonr/sonr/crypto/sharing" ) // Round1Bcast are values that are broadcast to all other participants diff --git a/internal/crypto/dkg/frost/dkg_round2.go b/crypto/dkg/frost/dkg_round2.go similarity index 96% rename from internal/crypto/dkg/frost/dkg_round2.go rename to crypto/dkg/frost/dkg_round2.go index 3866a6881..ce680926e 100755 --- a/internal/crypto/dkg/frost/dkg_round2.go +++ b/crypto/dkg/frost/dkg_round2.go @@ -9,9 +9,9 @@ package frost import ( "fmt" - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/internal" - "github.com/onsonr/sonr/internal/crypto/sharing" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/internal" + "github.com/onsonr/sonr/crypto/sharing" ) // Round2Bcast are values that are broadcast to all other participants diff --git a/internal/crypto/dkg/frost/dkg_rounds_test.go b/crypto/dkg/frost/dkg_rounds_test.go similarity index 97% rename from internal/crypto/dkg/frost/dkg_rounds_test.go rename to crypto/dkg/frost/dkg_rounds_test.go index baaf5c8aa..3592ec80e 100755 --- a/internal/crypto/dkg/frost/dkg_rounds_test.go +++ b/crypto/dkg/frost/dkg_rounds_test.go @@ -11,8 +11,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/sharing" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/sharing" ) var ( diff --git a/internal/crypto/dkg/frost/participant.go b/crypto/dkg/frost/participant.go similarity index 91% rename from internal/crypto/dkg/frost/participant.go rename to crypto/dkg/frost/participant.go index ce7d6b4bc..c9ef4fc06 100755 --- a/internal/crypto/dkg/frost/participant.go +++ b/crypto/dkg/frost/participant.go @@ -10,9 +10,9 @@ package frost import ( "strconv" - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/internal" - "github.com/onsonr/sonr/internal/crypto/sharing" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/internal" + "github.com/onsonr/sonr/crypto/sharing" ) type DkgParticipant struct { diff --git a/internal/crypto/dkg/gennaro/README.md b/crypto/dkg/gennaro/README.md similarity index 100% rename from internal/crypto/dkg/gennaro/README.md rename to crypto/dkg/gennaro/README.md diff --git a/internal/crypto/dkg/gennaro/participant.go b/crypto/dkg/gennaro/participant.go similarity index 94% rename from internal/crypto/dkg/gennaro/participant.go rename to crypto/dkg/gennaro/participant.go index 27df13336..2c76e1d10 100755 --- a/internal/crypto/dkg/gennaro/participant.go +++ b/crypto/dkg/gennaro/participant.go @@ -11,9 +11,9 @@ import ( "crypto/elliptic" "fmt" - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/internal" - v1 "github.com/onsonr/sonr/internal/crypto/sharing/v1" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/internal" + v1 "github.com/onsonr/sonr/crypto/sharing/v1" ) // Participant is a DKG player that contains information needed to perform DKG rounds diff --git a/internal/crypto/dkg/gennaro/participant_test.go b/crypto/dkg/gennaro/participant_test.go similarity index 92% rename from internal/crypto/dkg/gennaro/participant_test.go rename to crypto/dkg/gennaro/participant_test.go index d2103f5d3..1088767c8 100755 --- a/internal/crypto/dkg/gennaro/participant_test.go +++ b/crypto/dkg/gennaro/participant_test.go @@ -13,8 +13,8 @@ import ( "github.com/btcsuite/btcd/btcec/v2" "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/internal" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/internal" ) var testGenerator, _ = curves.NewScalarBaseMult(btcec.S256(), big.NewInt(3333)) diff --git a/internal/crypto/dkg/gennaro/round1.go b/crypto/dkg/gennaro/round1.go similarity index 93% rename from internal/crypto/dkg/gennaro/round1.go rename to crypto/dkg/gennaro/round1.go index fad493732..e693ebfd4 100755 --- a/internal/crypto/dkg/gennaro/round1.go +++ b/crypto/dkg/gennaro/round1.go @@ -10,9 +10,9 @@ import ( "fmt" "math/big" - "github.com/onsonr/sonr/internal/crypto/core" - "github.com/onsonr/sonr/internal/crypto/internal" - v1 "github.com/onsonr/sonr/internal/crypto/sharing/v1" + "github.com/onsonr/sonr/crypto/core" + "github.com/onsonr/sonr/crypto/internal" + v1 "github.com/onsonr/sonr/crypto/sharing/v1" ) // Round1Bcast are the values that are broadcast to all other participants diff --git a/internal/crypto/dkg/gennaro/round2.go b/crypto/dkg/gennaro/round2.go similarity index 95% rename from internal/crypto/dkg/gennaro/round2.go rename to crypto/dkg/gennaro/round2.go index 69fab726a..07e453023 100755 --- a/internal/crypto/dkg/gennaro/round2.go +++ b/crypto/dkg/gennaro/round2.go @@ -9,8 +9,8 @@ package gennaro import ( "fmt" - "github.com/onsonr/sonr/internal/crypto/internal" - v1 "github.com/onsonr/sonr/internal/crypto/sharing/v1" + "github.com/onsonr/sonr/crypto/internal" + v1 "github.com/onsonr/sonr/crypto/sharing/v1" ) type Round2Bcast = []*v1.ShareVerifier diff --git a/internal/crypto/dkg/gennaro/round3.go b/crypto/dkg/gennaro/round3.go similarity index 95% rename from internal/crypto/dkg/gennaro/round3.go rename to crypto/dkg/gennaro/round3.go index f7d8956de..205e6d278 100755 --- a/internal/crypto/dkg/gennaro/round3.go +++ b/crypto/dkg/gennaro/round3.go @@ -9,8 +9,8 @@ package gennaro import ( "fmt" - "github.com/onsonr/sonr/internal/crypto/internal" - v1 "github.com/onsonr/sonr/internal/crypto/sharing/v1" + "github.com/onsonr/sonr/crypto/internal" + v1 "github.com/onsonr/sonr/crypto/sharing/v1" ) // Round3Bcast contains values that will be broadcast to other participants. diff --git a/internal/crypto/dkg/gennaro/round4.go b/crypto/dkg/gennaro/round4.go similarity index 89% rename from internal/crypto/dkg/gennaro/round4.go rename to crypto/dkg/gennaro/round4.go index ab38e021b..998c5edbf 100755 --- a/internal/crypto/dkg/gennaro/round4.go +++ b/crypto/dkg/gennaro/round4.go @@ -9,10 +9,10 @@ package gennaro import ( "math/big" - "github.com/onsonr/sonr/internal/crypto/core" - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/internal" - v1 "github.com/onsonr/sonr/internal/crypto/sharing/v1" + "github.com/onsonr/sonr/crypto/core" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/internal" + v1 "github.com/onsonr/sonr/crypto/sharing/v1" ) // Round4 computes the public shares used by tECDSA during signing diff --git a/internal/crypto/dkg/gennaro/rounds_test.go b/crypto/dkg/gennaro/rounds_test.go similarity index 99% rename from internal/crypto/dkg/gennaro/rounds_test.go rename to crypto/dkg/gennaro/rounds_test.go index 858070471..ad9715ca8 100755 --- a/internal/crypto/dkg/gennaro/rounds_test.go +++ b/crypto/dkg/gennaro/rounds_test.go @@ -13,8 +13,8 @@ import ( "github.com/btcsuite/btcd/btcec/v2" "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core/curves" - v1 "github.com/onsonr/sonr/internal/crypto/sharing/v1" + "github.com/onsonr/sonr/crypto/core/curves" + v1 "github.com/onsonr/sonr/crypto/sharing/v1" ) func TestParticipantRound1Works(t *testing.T) { diff --git a/internal/crypto/dkg/gennaro2p/README.md b/crypto/dkg/gennaro2p/README.md similarity index 100% rename from internal/crypto/dkg/gennaro2p/README.md rename to crypto/dkg/gennaro2p/README.md diff --git a/internal/crypto/dkg/gennaro2p/genarro2p.go b/crypto/dkg/gennaro2p/genarro2p.go similarity index 96% rename from internal/crypto/dkg/gennaro2p/genarro2p.go rename to crypto/dkg/gennaro2p/genarro2p.go index 36d024d5c..1b1e3930c 100755 --- a/internal/crypto/dkg/gennaro2p/genarro2p.go +++ b/crypto/dkg/gennaro2p/genarro2p.go @@ -15,9 +15,9 @@ import ( "github.com/pkg/errors" - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/dkg/gennaro" - v1 "github.com/onsonr/sonr/internal/crypto/sharing/v1" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/dkg/gennaro" + v1 "github.com/onsonr/sonr/crypto/sharing/v1" ) const threshold = 2 diff --git a/internal/crypto/dkg/gennaro2p/genarro2p_test.go b/crypto/dkg/gennaro2p/genarro2p_test.go similarity index 97% rename from internal/crypto/dkg/gennaro2p/genarro2p_test.go rename to crypto/dkg/gennaro2p/genarro2p_test.go index 72aa70f9b..5fe61d933 100755 --- a/internal/crypto/dkg/gennaro2p/genarro2p_test.go +++ b/crypto/dkg/gennaro2p/genarro2p_test.go @@ -15,8 +15,8 @@ import ( "github.com/btcsuite/btcd/btcec/v2" "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core/curves" - v1 "github.com/onsonr/sonr/internal/crypto/sharing/v1" + "github.com/onsonr/sonr/crypto/core/curves" + v1 "github.com/onsonr/sonr/crypto/sharing/v1" ) var ( diff --git a/internal/crypto/ecies/encrypt.go b/crypto/ecies/encrypt.go similarity index 100% rename from internal/crypto/ecies/encrypt.go rename to crypto/ecies/encrypt.go diff --git a/internal/crypto/ecies/keys.go b/crypto/ecies/keys.go similarity index 95% rename from internal/crypto/ecies/keys.go rename to crypto/ecies/keys.go index 4c3d6100a..458a0803e 100644 --- a/internal/crypto/ecies/keys.go +++ b/crypto/ecies/keys.go @@ -9,7 +9,7 @@ import ( eciesgo "github.com/ecies/go/v2" "lukechampine.com/blake3" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) type PrivateKey = eciesgo.PrivateKey diff --git a/internal/crypto/ecies/keys_test.go b/crypto/ecies/keys_test.go similarity index 90% rename from internal/crypto/ecies/keys_test.go rename to crypto/ecies/keys_test.go index b5999de96..d162e370c 100644 --- a/internal/crypto/ecies/keys_test.go +++ b/crypto/ecies/keys_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/onsonr/sonr/internal/crypto/ecies" + "github.com/onsonr/sonr/crypto/ecies" ) func TestGenerateKey(t *testing.T) { diff --git a/internal/crypto/internal/err.go b/crypto/internal/err.go similarity index 100% rename from internal/crypto/internal/err.go rename to crypto/internal/err.go diff --git a/internal/crypto/internal/hash.go b/crypto/internal/hash.go similarity index 100% rename from internal/crypto/internal/hash.go rename to crypto/internal/hash.go diff --git a/internal/crypto/internal/hash_test.go b/crypto/internal/hash_test.go similarity index 100% rename from internal/crypto/internal/hash_test.go rename to crypto/internal/hash_test.go diff --git a/internal/crypto/internal/point.go b/crypto/internal/point.go similarity index 100% rename from internal/crypto/internal/point.go rename to crypto/internal/point.go diff --git a/internal/crypto/internal/testutils.go b/crypto/internal/testutils.go similarity index 100% rename from internal/crypto/internal/testutils.go rename to crypto/internal/testutils.go diff --git a/internal/crypto/keys/didkey.go b/crypto/keys/didkey.go similarity index 100% rename from internal/crypto/keys/didkey.go rename to crypto/keys/didkey.go diff --git a/internal/crypto/keys/methods.go b/crypto/keys/methods.go similarity index 100% rename from internal/crypto/keys/methods.go rename to crypto/keys/methods.go diff --git a/internal/crypto/keys/parsers/btc_parser.go b/crypto/keys/parsers/btc_parser.go similarity index 100% rename from internal/crypto/keys/parsers/btc_parser.go rename to crypto/keys/parsers/btc_parser.go diff --git a/internal/crypto/keys/parsers/cosmos_parser.go b/crypto/keys/parsers/cosmos_parser.go similarity index 100% rename from internal/crypto/keys/parsers/cosmos_parser.go rename to crypto/keys/parsers/cosmos_parser.go diff --git a/internal/crypto/keys/parsers/eth_parser.go b/crypto/keys/parsers/eth_parser.go similarity index 100% rename from internal/crypto/keys/parsers/eth_parser.go rename to crypto/keys/parsers/eth_parser.go diff --git a/internal/crypto/keys/parsers/fil_parser.go b/crypto/keys/parsers/fil_parser.go similarity index 100% rename from internal/crypto/keys/parsers/fil_parser.go rename to crypto/keys/parsers/fil_parser.go diff --git a/internal/crypto/keys/parsers/key_parser.go b/crypto/keys/parsers/key_parser.go similarity index 100% rename from internal/crypto/keys/parsers/key_parser.go rename to crypto/keys/parsers/key_parser.go diff --git a/internal/crypto/keys/parsers/sol_parser.go b/crypto/keys/parsers/sol_parser.go similarity index 100% rename from internal/crypto/keys/parsers/sol_parser.go rename to crypto/keys/parsers/sol_parser.go diff --git a/internal/crypto/keys/parsers/ton_parser.go b/crypto/keys/parsers/ton_parser.go similarity index 100% rename from internal/crypto/keys/parsers/ton_parser.go rename to crypto/keys/parsers/ton_parser.go diff --git a/internal/crypto/keys/pubkey.go b/crypto/keys/pubkey.go similarity index 96% rename from internal/crypto/keys/pubkey.go rename to crypto/keys/pubkey.go index abc589fb3..4b64328b8 100644 --- a/internal/crypto/keys/pubkey.go +++ b/crypto/keys/pubkey.go @@ -7,7 +7,7 @@ import ( p2pcrypto "github.com/libp2p/go-libp2p/core/crypto" p2ppb "github.com/libp2p/go-libp2p/core/crypto/pb" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" "golang.org/x/crypto/sha3" ) diff --git a/internal/crypto/keys/utils.go b/crypto/keys/utils.go similarity index 96% rename from internal/crypto/keys/utils.go rename to crypto/keys/utils.go index 62970291a..60e817119 100644 --- a/internal/crypto/keys/utils.go +++ b/crypto/keys/utils.go @@ -5,7 +5,7 @@ import ( "fmt" "math/big" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) // getEcdsaPoint builds an elliptic curve point from a compressed byte slice diff --git a/internal/crypto/mpc/codec.go b/crypto/mpc/codec.go similarity index 90% rename from internal/crypto/mpc/codec.go rename to crypto/mpc/codec.go index af1414c94..b5f31cf81 100644 --- a/internal/crypto/mpc/codec.go +++ b/crypto/mpc/codec.go @@ -1,10 +1,10 @@ package mpc import ( - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/core/protocol" - "github.com/onsonr/sonr/internal/crypto/keys" - "github.com/onsonr/sonr/internal/crypto/tecdsa/dklsv1/dkg" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/protocol" + "github.com/onsonr/sonr/crypto/keys" + "github.com/onsonr/sonr/crypto/tecdsa/dklsv1/dkg" ) // ╭───────────────────────────────────────────────────────────╮ diff --git a/internal/crypto/mpc/codec_test.go b/crypto/mpc/codec_test.go similarity index 100% rename from internal/crypto/mpc/codec_test.go rename to crypto/mpc/codec_test.go diff --git a/internal/crypto/mpc/enclave.go b/crypto/mpc/enclave.go similarity index 97% rename from internal/crypto/mpc/enclave.go rename to crypto/mpc/enclave.go index cf90ab5b6..6f1eb1e26 100644 --- a/internal/crypto/mpc/enclave.go +++ b/crypto/mpc/enclave.go @@ -7,8 +7,8 @@ import ( "encoding/json" "fmt" - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/keys" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/keys" "golang.org/x/crypto/sha3" ) diff --git a/internal/crypto/mpc/protocol.go b/crypto/mpc/protocol.go similarity index 93% rename from internal/crypto/mpc/protocol.go rename to crypto/mpc/protocol.go index 220771473..7c137588b 100644 --- a/internal/crypto/mpc/protocol.go +++ b/crypto/mpc/protocol.go @@ -1,9 +1,9 @@ package mpc import ( - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/core/protocol" - "github.com/onsonr/sonr/internal/crypto/tecdsa/dklsv1" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/protocol" + "github.com/onsonr/sonr/crypto/tecdsa/dklsv1" ) // GenEnclave generates a new MPC keyshare diff --git a/internal/crypto/mpc/spec/jwt.go b/crypto/mpc/spec/jwt.go similarity index 100% rename from internal/crypto/mpc/spec/jwt.go rename to crypto/mpc/spec/jwt.go diff --git a/internal/crypto/mpc/spec/source.go b/crypto/mpc/spec/source.go similarity index 97% rename from internal/crypto/mpc/spec/source.go rename to crypto/mpc/spec/source.go index c99878786..4479b6b62 100644 --- a/internal/crypto/mpc/spec/source.go +++ b/crypto/mpc/spec/source.go @@ -5,8 +5,8 @@ import ( "fmt" "time" - "github.com/onsonr/sonr/internal/crypto/keys" - "github.com/onsonr/sonr/internal/crypto/ucan" + "github.com/onsonr/sonr/crypto/keys" + "github.com/onsonr/sonr/crypto/ucan" "lukechampine.com/blake3" ) diff --git a/internal/crypto/mpc/spec/ucan.go b/crypto/mpc/spec/ucan.go similarity index 96% rename from internal/crypto/mpc/spec/ucan.go rename to crypto/mpc/spec/ucan.go index 901390f7c..df5c24a2d 100644 --- a/internal/crypto/mpc/spec/ucan.go +++ b/crypto/mpc/spec/ucan.go @@ -7,8 +7,8 @@ import ( "github.com/cosmos/cosmos-sdk/types/bech32" "github.com/golang-jwt/jwt" - "github.com/onsonr/sonr/internal/crypto/keys" - "github.com/onsonr/sonr/internal/crypto/ucan" + "github.com/onsonr/sonr/crypto/keys" + "github.com/onsonr/sonr/crypto/ucan" ) type ( diff --git a/internal/crypto/mpc/utils.go b/crypto/mpc/utils.go similarity index 96% rename from internal/crypto/mpc/utils.go rename to crypto/mpc/utils.go index f247faaa6..783b77669 100644 --- a/internal/crypto/mpc/utils.go +++ b/crypto/mpc/utils.go @@ -8,9 +8,9 @@ import ( "math/big" "github.com/cosmos/cosmos-sdk/types/bech32" - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/core/protocol" - "github.com/onsonr/sonr/internal/crypto/tecdsa/dklsv1" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/protocol" + "github.com/onsonr/sonr/crypto/tecdsa/dklsv1" "golang.org/x/crypto/sha3" ) diff --git a/internal/crypto/ot/base/simplest/ot.go b/crypto/ot/base/simplest/ot.go similarity index 99% rename from internal/crypto/ot/base/simplest/ot.go rename to crypto/ot/base/simplest/ot.go index 830933fd4..d8d98b178 100755 --- a/internal/crypto/ot/base/simplest/ot.go +++ b/crypto/ot/base/simplest/ot.go @@ -27,8 +27,8 @@ import ( "github.com/pkg/errors" "golang.org/x/crypto/sha3" - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/zkp/schnorr" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/zkp/schnorr" ) const ( diff --git a/internal/crypto/ot/base/simplest/ot_test.go b/crypto/ot/base/simplest/ot_test.go similarity index 93% rename from internal/crypto/ot/base/simplest/ot_test.go rename to crypto/ot/base/simplest/ot_test.go index e155ea57a..b3b803b73 100755 --- a/internal/crypto/ot/base/simplest/ot_test.go +++ b/crypto/ot/base/simplest/ot_test.go @@ -14,9 +14,9 @@ import ( "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/ot/base/simplest" - "github.com/onsonr/sonr/internal/crypto/ot/ottest" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/ot/base/simplest" + "github.com/onsonr/sonr/crypto/ot/ottest" ) func TestOtOnMultipleCurves(t *testing.T) { diff --git a/internal/crypto/ot/base/simplest/stream.go b/crypto/ot/base/simplest/stream.go similarity index 97% rename from internal/crypto/ot/base/simplest/stream.go rename to crypto/ot/base/simplest/stream.go index 4d4c77a3c..7e7495ab3 100755 --- a/internal/crypto/ot/base/simplest/stream.go +++ b/crypto/ot/base/simplest/stream.go @@ -6,8 +6,8 @@ import ( "github.com/pkg/errors" - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/zkp/schnorr" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/zkp/schnorr" ) // ReceiverStreamOTRun exposes the entire seed OT process for the receiver in "stream mode" to the user. diff --git a/internal/crypto/ot/base/simplest/util.go b/crypto/ot/base/simplest/util.go similarity index 100% rename from internal/crypto/ot/base/simplest/util.go rename to crypto/ot/base/simplest/util.go diff --git a/internal/crypto/ot/extension/kos/kos.go b/crypto/ot/extension/kos/kos.go similarity index 99% rename from internal/crypto/ot/extension/kos/kos.go rename to crypto/ot/extension/kos/kos.go index cdc440151..e1fb9a0ad 100755 --- a/internal/crypto/ot/extension/kos/kos.go +++ b/crypto/ot/extension/kos/kos.go @@ -17,8 +17,8 @@ import ( "golang.org/x/crypto/sha3" - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/ot/base/simplest" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/ot/base/simplest" "github.com/pkg/errors" ) diff --git a/internal/crypto/ot/extension/kos/kos_test.go b/crypto/ot/extension/kos/kos_test.go similarity index 96% rename from internal/crypto/ot/extension/kos/kos_test.go rename to crypto/ot/extension/kos/kos_test.go index 010ba057e..ff40adaef 100755 --- a/internal/crypto/ot/extension/kos/kos_test.go +++ b/crypto/ot/extension/kos/kos_test.go @@ -6,9 +6,9 @@ import ( "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/ot/base/simplest" - "github.com/onsonr/sonr/internal/crypto/ot/ottest" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/ot/base/simplest" + "github.com/onsonr/sonr/crypto/ot/ottest" ) func TestBinaryMult(t *testing.T) { diff --git a/internal/crypto/ot/extension/kos/stream.go b/crypto/ot/extension/kos/stream.go similarity index 95% rename from internal/crypto/ot/extension/kos/stream.go rename to crypto/ot/extension/kos/stream.go index cfe5f51ed..739299fee 100755 --- a/internal/crypto/ot/extension/kos/stream.go +++ b/crypto/ot/extension/kos/stream.go @@ -6,8 +6,8 @@ import ( "github.com/pkg/errors" - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/ot/base/simplest" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/ot/base/simplest" ) // ReceiverStreamCOtRun exposes an end-to-end "streaming" version of the cOT process for the receiver. diff --git a/internal/crypto/ot/ottest/util.go b/crypto/ot/ottest/util.go similarity index 94% rename from internal/crypto/ot/ottest/util.go rename to crypto/ot/ottest/util.go index 64d46767b..f000da8ed 100755 --- a/internal/crypto/ot/ottest/util.go +++ b/crypto/ot/ottest/util.go @@ -5,8 +5,8 @@ package ottest import ( "github.com/pkg/errors" - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/ot/base/simplest" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/ot/base/simplest" ) // RunSimplestOT is a utility function used _only_ during various tests. diff --git a/internal/crypto/paillier/README.md b/crypto/paillier/README.md similarity index 100% rename from internal/crypto/paillier/README.md rename to crypto/paillier/README.md diff --git a/internal/crypto/paillier/paillier.go b/crypto/paillier/paillier.go similarity index 98% rename from internal/crypto/paillier/paillier.go rename to crypto/paillier/paillier.go index ec86f5501..c094f4fb9 100755 --- a/internal/crypto/paillier/paillier.go +++ b/crypto/paillier/paillier.go @@ -27,8 +27,8 @@ import ( "github.com/pkg/errors" - "github.com/onsonr/sonr/internal/crypto/core" - "github.com/onsonr/sonr/internal/crypto/internal" + "github.com/onsonr/sonr/crypto/core" + "github.com/onsonr/sonr/crypto/internal" ) // PaillierPrimeBits is the number of bits used to generate Paillier Safe Primes. diff --git a/internal/crypto/paillier/psf.go b/crypto/paillier/psf.go similarity index 97% rename from internal/crypto/paillier/psf.go rename to crypto/paillier/psf.go index 075dda229..b2d2b3583 100755 --- a/internal/crypto/paillier/psf.go +++ b/crypto/paillier/psf.go @@ -12,9 +12,9 @@ import ( "fmt" "math/big" - crypto "github.com/onsonr/sonr/internal/crypto/core" - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/internal" + crypto "github.com/onsonr/sonr/crypto/core" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/internal" ) // [spec] 10.2 and ProvePSF, VerifyPSF fig.15 diff --git a/internal/crypto/paillier/psf_test.go b/crypto/paillier/psf_test.go similarity index 99% rename from internal/crypto/paillier/psf_test.go rename to crypto/paillier/psf_test.go index 8e5237cbc..b27f25bb3 100755 --- a/internal/crypto/paillier/psf_test.go +++ b/crypto/paillier/psf_test.go @@ -15,9 +15,9 @@ import ( "github.com/btcsuite/btcd/btcec/v2" "github.com/stretchr/testify/require" - crypto "github.com/onsonr/sonr/internal/crypto/core" - curves2 "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/internal" + crypto "github.com/onsonr/sonr/crypto/core" + curves2 "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/internal" ) var testPrimes = []*big.Int{ diff --git a/internal/crypto/sharing/README.md b/crypto/sharing/README.md similarity index 100% rename from internal/crypto/sharing/README.md rename to crypto/sharing/README.md diff --git a/internal/crypto/sharing/ed25519_feldman_test.go b/crypto/sharing/ed25519_feldman_test.go similarity index 98% rename from internal/crypto/sharing/ed25519_feldman_test.go rename to crypto/sharing/ed25519_feldman_test.go index dfa6b631b..2337392ee 100755 --- a/internal/crypto/sharing/ed25519_feldman_test.go +++ b/crypto/sharing/ed25519_feldman_test.go @@ -12,7 +12,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) var testCurve = curves.ED25519() diff --git a/internal/crypto/sharing/feldman.go b/crypto/sharing/feldman.go similarity index 97% rename from internal/crypto/sharing/feldman.go rename to crypto/sharing/feldman.go index 9d24bea6f..ff2d42889 100755 --- a/internal/crypto/sharing/feldman.go +++ b/crypto/sharing/feldman.go @@ -10,7 +10,7 @@ import ( "fmt" "io" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) type FeldmanVerifier struct { diff --git a/internal/crypto/sharing/pedersen.go b/crypto/sharing/pedersen.go similarity index 98% rename from internal/crypto/sharing/pedersen.go rename to crypto/sharing/pedersen.go index a13704386..36230775f 100755 --- a/internal/crypto/sharing/pedersen.go +++ b/crypto/sharing/pedersen.go @@ -10,7 +10,7 @@ import ( "fmt" "io" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) // Pedersen Verifiable Secret Sharing Scheme diff --git a/internal/crypto/sharing/polynomial.go b/crypto/sharing/polynomial.go similarity index 92% rename from internal/crypto/sharing/polynomial.go rename to crypto/sharing/polynomial.go index 366ecb58c..e146958ad 100755 --- a/internal/crypto/sharing/polynomial.go +++ b/crypto/sharing/polynomial.go @@ -9,7 +9,7 @@ package sharing import ( "io" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) type Polynomial struct { diff --git a/internal/crypto/sharing/polynomial_test.go b/crypto/sharing/polynomial_test.go similarity index 90% rename from internal/crypto/sharing/polynomial_test.go rename to crypto/sharing/polynomial_test.go index 253d89f34..1d828f8b2 100755 --- a/internal/crypto/sharing/polynomial_test.go +++ b/crypto/sharing/polynomial_test.go @@ -18,7 +18,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) func TestNewPoly(t *testing.T) { diff --git a/internal/crypto/sharing/shamir.go b/crypto/sharing/shamir.go similarity index 98% rename from internal/crypto/sharing/shamir.go rename to crypto/sharing/shamir.go index e3a6feaab..0bc0f383b 100755 --- a/internal/crypto/sharing/shamir.go +++ b/crypto/sharing/shamir.go @@ -16,7 +16,7 @@ import ( "fmt" "io" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) type ShamirShare struct { diff --git a/internal/crypto/sharing/shamir_test.go b/crypto/sharing/shamir_test.go similarity index 98% rename from internal/crypto/sharing/shamir_test.go rename to crypto/sharing/shamir_test.go index 99e3ecc11..b9281a71d 100755 --- a/internal/crypto/sharing/shamir_test.go +++ b/crypto/sharing/shamir_test.go @@ -14,7 +14,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) func TestShamirSplitInvalidArgs(t *testing.T) { diff --git a/internal/crypto/sharing/v1/bls12381g1_feldman_test.go b/crypto/sharing/v1/bls12381g1_feldman_test.go similarity index 98% rename from internal/crypto/sharing/v1/bls12381g1_feldman_test.go rename to crypto/sharing/v1/bls12381g1_feldman_test.go index ab7be3a15..0a4e1dddf 100755 --- a/internal/crypto/sharing/v1/bls12381g1_feldman_test.go +++ b/crypto/sharing/v1/bls12381g1_feldman_test.go @@ -12,7 +12,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) var ( diff --git a/internal/crypto/sharing/v1/bls12381g1curve.go b/crypto/sharing/v1/bls12381g1curve.go similarity index 94% rename from internal/crypto/sharing/v1/bls12381g1curve.go rename to crypto/sharing/v1/bls12381g1curve.go index 4877f396f..319dfa498 100755 --- a/internal/crypto/sharing/v1/bls12381g1curve.go +++ b/crypto/sharing/v1/bls12381g1curve.go @@ -11,9 +11,9 @@ import ( "math/big" "sync" - "github.com/onsonr/sonr/internal/crypto/core/curves/native" - "github.com/onsonr/sonr/internal/crypto/core/curves/native/bls12381" - "github.com/onsonr/sonr/internal/crypto/internal" + "github.com/onsonr/sonr/crypto/core/curves/native" + "github.com/onsonr/sonr/crypto/core/curves/native/bls12381" + "github.com/onsonr/sonr/crypto/internal" ) var ( diff --git a/internal/crypto/sharing/v1/bls12381g2_feldman_test.go b/crypto/sharing/v1/bls12381g2_feldman_test.go similarity index 100% rename from internal/crypto/sharing/v1/bls12381g2_feldman_test.go rename to crypto/sharing/v1/bls12381g2_feldman_test.go diff --git a/internal/crypto/sharing/v1/bls12381g2curve.go b/crypto/sharing/v1/bls12381g2curve.go similarity index 95% rename from internal/crypto/sharing/v1/bls12381g2curve.go rename to crypto/sharing/v1/bls12381g2curve.go index b9ce74d98..58470270b 100755 --- a/internal/crypto/sharing/v1/bls12381g2curve.go +++ b/crypto/sharing/v1/bls12381g2curve.go @@ -11,8 +11,8 @@ import ( "math/big" "sync" - "github.com/onsonr/sonr/internal/crypto/core/curves/native" - "github.com/onsonr/sonr/internal/crypto/core/curves/native/bls12381" + "github.com/onsonr/sonr/crypto/core/curves/native" + "github.com/onsonr/sonr/crypto/core/curves/native/bls12381" ) var ( diff --git a/internal/crypto/sharing/v1/common.go b/crypto/sharing/v1/common.go similarity index 78% rename from internal/crypto/sharing/v1/common.go rename to crypto/sharing/v1/common.go index 71b286b9a..285b5218c 100755 --- a/internal/crypto/sharing/v1/common.go +++ b/crypto/sharing/v1/common.go @@ -7,7 +7,7 @@ package v1 import ( - kryptology "github.com/onsonr/sonr/internal/crypto/core/curves" + kryptology "github.com/onsonr/sonr/crypto/core/curves" ) // ShareVerifier is used to verify secret shares from Feldman or Pedersen VSS diff --git a/internal/crypto/sharing/v1/ed25519_feldman_test.go b/crypto/sharing/v1/ed25519_feldman_test.go similarity index 100% rename from internal/crypto/sharing/v1/ed25519_feldman_test.go rename to crypto/sharing/v1/ed25519_feldman_test.go diff --git a/internal/crypto/sharing/v1/ed25519_pedersen_test.go b/crypto/sharing/v1/ed25519_pedersen_test.go similarity index 97% rename from internal/crypto/sharing/v1/ed25519_pedersen_test.go rename to crypto/sharing/v1/ed25519_pedersen_test.go index 56ccd4adf..351f0ad23 100755 --- a/internal/crypto/sharing/v1/ed25519_pedersen_test.go +++ b/crypto/sharing/v1/ed25519_pedersen_test.go @@ -14,8 +14,8 @@ import ( "filippo.io/edwards25519" "github.com/stretchr/testify/require" - core "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/internal" + core "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/internal" ) var ( diff --git a/internal/crypto/sharing/v1/ed25519curve.go b/crypto/sharing/v1/ed25519curve.go similarity index 97% rename from internal/crypto/sharing/v1/ed25519curve.go rename to crypto/sharing/v1/ed25519curve.go index 0864416a2..cd0185e46 100755 --- a/internal/crypto/sharing/v1/ed25519curve.go +++ b/crypto/sharing/v1/ed25519curve.go @@ -13,8 +13,8 @@ import ( ed "filippo.io/edwards25519" - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/internal" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/internal" ) var ( diff --git a/internal/crypto/sharing/v1/ed25519curve_test.go b/crypto/sharing/v1/ed25519curve_test.go similarity index 100% rename from internal/crypto/sharing/v1/ed25519curve_test.go rename to crypto/sharing/v1/ed25519curve_test.go diff --git a/internal/crypto/sharing/v1/feldman.go b/crypto/sharing/v1/feldman.go similarity index 97% rename from internal/crypto/sharing/v1/feldman.go rename to crypto/sharing/v1/feldman.go index e3555db9f..2fbcde479 100755 --- a/internal/crypto/sharing/v1/feldman.go +++ b/crypto/sharing/v1/feldman.go @@ -11,7 +11,7 @@ import ( "encoding/binary" "fmt" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) // Feldman Verifiable Secret Sharing Scheme diff --git a/internal/crypto/sharing/v1/k256_feldman_test.go b/crypto/sharing/v1/k256_feldman_test.go similarity index 100% rename from internal/crypto/sharing/v1/k256_feldman_test.go rename to crypto/sharing/v1/k256_feldman_test.go diff --git a/internal/crypto/sharing/v1/k256_pedersen_test.go b/crypto/sharing/v1/k256_pedersen_test.go similarity index 98% rename from internal/crypto/sharing/v1/k256_pedersen_test.go rename to crypto/sharing/v1/k256_pedersen_test.go index 37dab8382..81f936901 100755 --- a/internal/crypto/sharing/v1/k256_pedersen_test.go +++ b/crypto/sharing/v1/k256_pedersen_test.go @@ -13,7 +13,7 @@ import ( "github.com/btcsuite/btcd/btcec/v2" "github.com/stretchr/testify/require" - core "github.com/onsonr/sonr/internal/crypto/core/curves" + core "github.com/onsonr/sonr/crypto/core/curves" ) var ( diff --git a/internal/crypto/sharing/v1/p256_feldman_test.go b/crypto/sharing/v1/p256_feldman_test.go similarity index 100% rename from internal/crypto/sharing/v1/p256_feldman_test.go rename to crypto/sharing/v1/p256_feldman_test.go diff --git a/internal/crypto/sharing/v1/pedersen.go b/crypto/sharing/v1/pedersen.go similarity index 97% rename from internal/crypto/sharing/v1/pedersen.go rename to crypto/sharing/v1/pedersen.go index 50e569069..3cbd4ac8a 100755 --- a/internal/crypto/sharing/v1/pedersen.go +++ b/crypto/sharing/v1/pedersen.go @@ -12,8 +12,8 @@ import ( "fmt" "math/big" - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/internal" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/internal" ) // Pedersen Verifiable Secret Sharing Scheme diff --git a/internal/crypto/sharing/v1/polynomial.go b/crypto/sharing/v1/polynomial.go similarity index 95% rename from internal/crypto/sharing/v1/polynomial.go rename to crypto/sharing/v1/polynomial.go index 3c3fccefd..e631a9a5d 100755 --- a/internal/crypto/sharing/v1/polynomial.go +++ b/crypto/sharing/v1/polynomial.go @@ -7,7 +7,7 @@ package v1 import ( - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) type polynomial struct { diff --git a/internal/crypto/sharing/v1/polynomial_test.go b/crypto/sharing/v1/polynomial_test.go similarity index 100% rename from internal/crypto/sharing/v1/polynomial_test.go rename to crypto/sharing/v1/polynomial_test.go diff --git a/internal/crypto/sharing/v1/shamir.go b/crypto/sharing/v1/shamir.go similarity index 99% rename from internal/crypto/sharing/v1/shamir.go rename to crypto/sharing/v1/shamir.go index 653580647..df1282d37 100755 --- a/internal/crypto/sharing/v1/shamir.go +++ b/crypto/sharing/v1/shamir.go @@ -11,7 +11,7 @@ import ( "fmt" "math/big" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) // ShamirShare is the data from splitting a secret diff --git a/internal/crypto/sharing/v1/shamir_test.go b/crypto/sharing/v1/shamir_test.go similarity index 99% rename from internal/crypto/sharing/v1/shamir_test.go rename to crypto/sharing/v1/shamir_test.go index eb855dc22..0fa383235 100755 --- a/internal/crypto/sharing/v1/shamir_test.go +++ b/crypto/sharing/v1/shamir_test.go @@ -13,7 +13,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) func TestShamirSplitInvalidArgs(t *testing.T) { diff --git a/internal/crypto/signatures/bbs/blind_signature.go b/crypto/signatures/bbs/blind_signature.go similarity index 94% rename from internal/crypto/signatures/bbs/blind_signature.go rename to crypto/signatures/bbs/blind_signature.go index 6f27d01bd..0fa16ed29 100755 --- a/internal/crypto/signatures/bbs/blind_signature.go +++ b/crypto/signatures/bbs/blind_signature.go @@ -10,8 +10,8 @@ import ( "errors" "fmt" - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/signatures/common" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/signatures/common" ) // BlindSignature is a BBS+ blind signature diff --git a/internal/crypto/signatures/bbs/blind_signature_context.go b/crypto/signatures/bbs/blind_signature_context.go similarity index 98% rename from internal/crypto/signatures/bbs/blind_signature_context.go rename to crypto/signatures/bbs/blind_signature_context.go index 55bbd000c..a05edd1e9 100755 --- a/internal/crypto/signatures/bbs/blind_signature_context.go +++ b/crypto/signatures/bbs/blind_signature_context.go @@ -14,9 +14,9 @@ import ( "github.com/gtank/merlin" "golang.org/x/crypto/sha3" - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/internal" - "github.com/onsonr/sonr/internal/crypto/signatures/common" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/internal" + "github.com/onsonr/sonr/crypto/signatures/common" ) // BlindSignatureContext contains the data used for computing diff --git a/internal/crypto/signatures/bbs/blind_signature_context_test.go b/crypto/signatures/bbs/blind_signature_context_test.go similarity index 98% rename from internal/crypto/signatures/bbs/blind_signature_context_test.go rename to crypto/signatures/bbs/blind_signature_context_test.go index 66ba85710..6853818f9 100755 --- a/internal/crypto/signatures/bbs/blind_signature_context_test.go +++ b/crypto/signatures/bbs/blind_signature_context_test.go @@ -12,7 +12,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) func TestBlindSignatureContext(t *testing.T) { diff --git a/internal/crypto/signatures/bbs/message_generators.go b/crypto/signatures/bbs/message_generators.go similarity index 97% rename from internal/crypto/signatures/bbs/message_generators.go rename to crypto/signatures/bbs/message_generators.go index fcf84637b..641093671 100755 --- a/internal/crypto/signatures/bbs/message_generators.go +++ b/crypto/signatures/bbs/message_generators.go @@ -9,7 +9,7 @@ package bbs import ( "errors" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) // MessageGenerators are used to sign a vector of commitments for diff --git a/internal/crypto/signatures/bbs/pok_signature.go b/crypto/signatures/bbs/pok_signature.go similarity index 97% rename from internal/crypto/signatures/bbs/pok_signature.go rename to crypto/signatures/bbs/pok_signature.go index 1ac14136e..b16736e34 100755 --- a/internal/crypto/signatures/bbs/pok_signature.go +++ b/crypto/signatures/bbs/pok_signature.go @@ -12,8 +12,8 @@ import ( "github.com/gtank/merlin" - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/signatures/common" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/signatures/common" ) // PokSignature a.k.a. Proof of Knowledge of a Signature diff --git a/internal/crypto/signatures/bbs/pok_signature_proof.go b/crypto/signatures/bbs/pok_signature_proof.go similarity index 98% rename from internal/crypto/signatures/bbs/pok_signature_proof.go rename to crypto/signatures/bbs/pok_signature_proof.go index 36717c868..6ba4e4ace 100755 --- a/internal/crypto/signatures/bbs/pok_signature_proof.go +++ b/crypto/signatures/bbs/pok_signature_proof.go @@ -12,8 +12,8 @@ import ( "github.com/gtank/merlin" - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/signatures/common" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/signatures/common" ) // PokSignatureProof is the actual proof sent from a prover diff --git a/internal/crypto/signatures/bbs/pok_signature_proof_test.go b/crypto/signatures/bbs/pok_signature_proof_test.go similarity index 98% rename from internal/crypto/signatures/bbs/pok_signature_proof_test.go rename to crypto/signatures/bbs/pok_signature_proof_test.go index 927c223fc..6a1c571b1 100755 --- a/internal/crypto/signatures/bbs/pok_signature_proof_test.go +++ b/crypto/signatures/bbs/pok_signature_proof_test.go @@ -13,8 +13,8 @@ import ( "github.com/gtank/merlin" "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/signatures/common" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/signatures/common" ) func TestPokSignatureProofSomeMessagesRevealed(t *testing.T) { diff --git a/internal/crypto/signatures/bbs/public_key.go b/crypto/signatures/bbs/public_key.go similarity index 96% rename from internal/crypto/signatures/bbs/public_key.go rename to crypto/signatures/bbs/public_key.go index 8d686200c..57d80a611 100755 --- a/internal/crypto/signatures/bbs/public_key.go +++ b/crypto/signatures/bbs/public_key.go @@ -10,7 +10,7 @@ import ( "errors" "fmt" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) // PublicKey is a BBS+ verification key diff --git a/internal/crypto/signatures/bbs/secret_key.go b/crypto/signatures/bbs/secret_key.go similarity index 98% rename from internal/crypto/signatures/bbs/secret_key.go rename to crypto/signatures/bbs/secret_key.go index fadd9ff50..a1d24df7a 100755 --- a/internal/crypto/signatures/bbs/secret_key.go +++ b/crypto/signatures/bbs/secret_key.go @@ -16,7 +16,7 @@ import ( "golang.org/x/crypto/hkdf" "golang.org/x/crypto/sha3" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) // SecretKey is a BBS+ signing key diff --git a/internal/crypto/signatures/bbs/signature.go b/crypto/signatures/bbs/signature.go similarity index 96% rename from internal/crypto/signatures/bbs/signature.go rename to crypto/signatures/bbs/signature.go index 9be6f41e3..5964e58d6 100755 --- a/internal/crypto/signatures/bbs/signature.go +++ b/crypto/signatures/bbs/signature.go @@ -11,7 +11,7 @@ import ( "errors" "fmt" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) // Signature is a BBS+ signature diff --git a/internal/crypto/signatures/bbs/signature_test.go b/crypto/signatures/bbs/signature_test.go similarity index 97% rename from internal/crypto/signatures/bbs/signature_test.go rename to crypto/signatures/bbs/signature_test.go index ed4a492d0..6ff1159d7 100755 --- a/internal/crypto/signatures/bbs/signature_test.go +++ b/crypto/signatures/bbs/signature_test.go @@ -11,7 +11,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) func TestSignatureWorks(t *testing.T) { diff --git a/internal/crypto/signatures/bls/README.md b/crypto/signatures/bls/README.md similarity index 100% rename from internal/crypto/signatures/bls/README.md rename to crypto/signatures/bls/README.md diff --git a/internal/crypto/signatures/bls/bls_sig/lib.go b/crypto/signatures/bls/bls_sig/lib.go similarity index 95% rename from internal/crypto/signatures/bls/bls_sig/lib.go rename to crypto/signatures/bls/bls_sig/lib.go index 0323234e2..23802563e 100755 --- a/internal/crypto/signatures/bls/bls_sig/lib.go +++ b/crypto/signatures/bls/bls_sig/lib.go @@ -15,11 +15,11 @@ import ( "golang.org/x/crypto/hkdf" - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/core/curves/native" - "github.com/onsonr/sonr/internal/crypto/core/curves/native/bls12381" - "github.com/onsonr/sonr/internal/crypto/internal" - "github.com/onsonr/sonr/internal/crypto/sharing" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves/native" + "github.com/onsonr/sonr/crypto/core/curves/native/bls12381" + "github.com/onsonr/sonr/crypto/internal" + "github.com/onsonr/sonr/crypto/sharing" ) // Secret key in Fr diff --git a/internal/crypto/signatures/bls/bls_sig/lib_test.go b/crypto/signatures/bls/bls_sig/lib_test.go similarity index 98% rename from internal/crypto/signatures/bls/bls_sig/lib_test.go rename to crypto/signatures/bls/bls_sig/lib_test.go index 4e872f116..57f41c082 100755 --- a/internal/crypto/signatures/bls/bls_sig/lib_test.go +++ b/crypto/signatures/bls/bls_sig/lib_test.go @@ -13,8 +13,8 @@ import ( "math/big" "testing" - "github.com/onsonr/sonr/internal/crypto/core/curves/native/bls12381" - "github.com/onsonr/sonr/internal/crypto/internal" + "github.com/onsonr/sonr/crypto/core/curves/native/bls12381" + "github.com/onsonr/sonr/crypto/internal" ) func genSecretKey(t *testing.T) *SecretKey { diff --git a/internal/crypto/signatures/bls/bls_sig/tiny_bls.go b/crypto/signatures/bls/bls_sig/tiny_bls.go similarity index 100% rename from internal/crypto/signatures/bls/bls_sig/tiny_bls.go rename to crypto/signatures/bls/bls_sig/tiny_bls.go diff --git a/internal/crypto/signatures/bls/bls_sig/tiny_bls_sig.go b/crypto/signatures/bls/bls_sig/tiny_bls_sig.go similarity index 98% rename from internal/crypto/signatures/bls/bls_sig/tiny_bls_sig.go rename to crypto/signatures/bls/bls_sig/tiny_bls_sig.go index 4bddd1eff..ed1a6721f 100755 --- a/internal/crypto/signatures/bls/bls_sig/tiny_bls_sig.go +++ b/crypto/signatures/bls/bls_sig/tiny_bls_sig.go @@ -9,9 +9,9 @@ package bls_sig import ( "fmt" - "github.com/onsonr/sonr/internal/crypto/core/curves/native" - "github.com/onsonr/sonr/internal/crypto/core/curves/native/bls12381" - "github.com/onsonr/sonr/internal/crypto/internal" + "github.com/onsonr/sonr/crypto/core/curves/native" + "github.com/onsonr/sonr/crypto/core/curves/native/bls12381" + "github.com/onsonr/sonr/crypto/internal" ) // Implement BLS signatures on the BLS12-381 curve diff --git a/internal/crypto/signatures/bls/bls_sig/tiny_bls_sig_aug_test.go b/crypto/signatures/bls/bls_sig/tiny_bls_sig_aug_test.go similarity index 99% rename from internal/crypto/signatures/bls/bls_sig/tiny_bls_sig_aug_test.go rename to crypto/signatures/bls/bls_sig/tiny_bls_sig_aug_test.go index 5b2873540..6421022c2 100755 --- a/internal/crypto/signatures/bls/bls_sig/tiny_bls_sig_aug_test.go +++ b/crypto/signatures/bls/bls_sig/tiny_bls_sig_aug_test.go @@ -9,7 +9,7 @@ package bls_sig import ( "testing" - "github.com/onsonr/sonr/internal/crypto/core/curves/native/bls12381" + "github.com/onsonr/sonr/crypto/core/curves/native/bls12381" ) func generateAugSignatureG1(sk *SecretKey, msg []byte, t *testing.T) *SignatureVt { diff --git a/internal/crypto/signatures/bls/bls_sig/tiny_bls_sig_basic_test.go b/crypto/signatures/bls/bls_sig/tiny_bls_sig_basic_test.go similarity index 99% rename from internal/crypto/signatures/bls/bls_sig/tiny_bls_sig_basic_test.go rename to crypto/signatures/bls/bls_sig/tiny_bls_sig_basic_test.go index e05dd3b80..d7f48d4b8 100755 --- a/internal/crypto/signatures/bls/bls_sig/tiny_bls_sig_basic_test.go +++ b/crypto/signatures/bls/bls_sig/tiny_bls_sig_basic_test.go @@ -9,7 +9,7 @@ package bls_sig import ( "testing" - "github.com/onsonr/sonr/internal/crypto/core/curves/native/bls12381" + "github.com/onsonr/sonr/crypto/core/curves/native/bls12381" ) func generateBasicSignatureG1(sk *SecretKey, msg []byte, t *testing.T) *SignatureVt { diff --git a/internal/crypto/signatures/bls/bls_sig/tiny_bls_sig_pop_test.go b/crypto/signatures/bls/bls_sig/tiny_bls_sig_pop_test.go similarity index 99% rename from internal/crypto/signatures/bls/bls_sig/tiny_bls_sig_pop_test.go rename to crypto/signatures/bls/bls_sig/tiny_bls_sig_pop_test.go index 22ab0b541..82d737012 100755 --- a/internal/crypto/signatures/bls/bls_sig/tiny_bls_sig_pop_test.go +++ b/crypto/signatures/bls/bls_sig/tiny_bls_sig_pop_test.go @@ -12,7 +12,7 @@ import ( "math/rand" "testing" - "github.com/onsonr/sonr/internal/crypto/core/curves/native/bls12381" + "github.com/onsonr/sonr/crypto/core/curves/native/bls12381" ) const numAggregateG1 = 10 diff --git a/internal/crypto/signatures/bls/bls_sig/usual_bls.go b/crypto/signatures/bls/bls_sig/usual_bls.go similarity index 100% rename from internal/crypto/signatures/bls/bls_sig/usual_bls.go rename to crypto/signatures/bls/bls_sig/usual_bls.go diff --git a/internal/crypto/signatures/bls/bls_sig/usual_bls_sig.go b/crypto/signatures/bls/bls_sig/usual_bls_sig.go similarity index 98% rename from internal/crypto/signatures/bls/bls_sig/usual_bls_sig.go rename to crypto/signatures/bls/bls_sig/usual_bls_sig.go index ad45bf130..284393eda 100755 --- a/internal/crypto/signatures/bls/bls_sig/usual_bls_sig.go +++ b/crypto/signatures/bls/bls_sig/usual_bls_sig.go @@ -9,9 +9,9 @@ package bls_sig import ( "fmt" - "github.com/onsonr/sonr/internal/crypto/core/curves/native" - "github.com/onsonr/sonr/internal/crypto/core/curves/native/bls12381" - "github.com/onsonr/sonr/internal/crypto/internal" + "github.com/onsonr/sonr/crypto/core/curves/native" + "github.com/onsonr/sonr/crypto/core/curves/native/bls12381" + "github.com/onsonr/sonr/crypto/internal" ) // Implement BLS signatures on the BLS12-381 curve diff --git a/internal/crypto/signatures/bls/bls_sig/usual_bls_sig_aug_test.go b/crypto/signatures/bls/bls_sig/usual_bls_sig_aug_test.go similarity index 99% rename from internal/crypto/signatures/bls/bls_sig/usual_bls_sig_aug_test.go rename to crypto/signatures/bls/bls_sig/usual_bls_sig_aug_test.go index 35fb0a6a5..b70f8a316 100755 --- a/internal/crypto/signatures/bls/bls_sig/usual_bls_sig_aug_test.go +++ b/crypto/signatures/bls/bls_sig/usual_bls_sig_aug_test.go @@ -9,7 +9,7 @@ package bls_sig import ( "testing" - "github.com/onsonr/sonr/internal/crypto/core/curves/native/bls12381" + "github.com/onsonr/sonr/crypto/core/curves/native/bls12381" ) func generateAugSignatureG2(sk *SecretKey, msg []byte, t *testing.T) *Signature { diff --git a/internal/crypto/signatures/bls/bls_sig/usual_bls_sig_basic_test.go b/crypto/signatures/bls/bls_sig/usual_bls_sig_basic_test.go similarity index 99% rename from internal/crypto/signatures/bls/bls_sig/usual_bls_sig_basic_test.go rename to crypto/signatures/bls/bls_sig/usual_bls_sig_basic_test.go index 3194abca1..0b9682973 100755 --- a/internal/crypto/signatures/bls/bls_sig/usual_bls_sig_basic_test.go +++ b/crypto/signatures/bls/bls_sig/usual_bls_sig_basic_test.go @@ -9,7 +9,7 @@ package bls_sig import ( "testing" - "github.com/onsonr/sonr/internal/crypto/core/curves/native/bls12381" + "github.com/onsonr/sonr/crypto/core/curves/native/bls12381" ) func generateBasicSignatureG2(sk *SecretKey, msg []byte, t *testing.T) *Signature { diff --git a/internal/crypto/signatures/bls/bls_sig/usual_bls_sig_pop_test.go b/crypto/signatures/bls/bls_sig/usual_bls_sig_pop_test.go similarity index 99% rename from internal/crypto/signatures/bls/bls_sig/usual_bls_sig_pop_test.go rename to crypto/signatures/bls/bls_sig/usual_bls_sig_pop_test.go index 0e7d26fac..4a6157d83 100755 --- a/internal/crypto/signatures/bls/bls_sig/usual_bls_sig_pop_test.go +++ b/crypto/signatures/bls/bls_sig/usual_bls_sig_pop_test.go @@ -12,7 +12,7 @@ import ( "math/rand" "testing" - "github.com/onsonr/sonr/internal/crypto/core/curves/native/bls12381" + "github.com/onsonr/sonr/crypto/core/curves/native/bls12381" ) const numAggregateG2 = 10 diff --git a/internal/crypto/signatures/bls/rust/Cargo.toml b/crypto/signatures/bls/rust/Cargo.toml similarity index 100% rename from internal/crypto/signatures/bls/rust/Cargo.toml rename to crypto/signatures/bls/rust/Cargo.toml diff --git a/internal/crypto/signatures/bls/rust/README.md b/crypto/signatures/bls/rust/README.md similarity index 100% rename from internal/crypto/signatures/bls/rust/README.md rename to crypto/signatures/bls/rust/README.md diff --git a/internal/crypto/signatures/bls/rust/src/main.rs b/crypto/signatures/bls/rust/src/main.rs similarity index 100% rename from internal/crypto/signatures/bls/rust/src/main.rs rename to crypto/signatures/bls/rust/src/main.rs diff --git a/internal/crypto/signatures/bls/tests/bls/main.go b/crypto/signatures/bls/tests/bls/main.go similarity index 98% rename from internal/crypto/signatures/bls/tests/bls/main.go rename to crypto/signatures/bls/tests/bls/main.go index 40cefe5f9..14c6cc4f9 100755 --- a/internal/crypto/signatures/bls/tests/bls/main.go +++ b/crypto/signatures/bls/tests/bls/main.go @@ -15,7 +15,7 @@ import ( "io/ioutil" "os" - bls "github.com/onsonr/sonr/internal/crypto/signatures/bls/bls_sig" + bls "github.com/onsonr/sonr/crypto/signatures/bls/bls_sig" ) type signOp struct { diff --git a/internal/crypto/signatures/bls/tmp.json b/crypto/signatures/bls/tmp.json similarity index 100% rename from internal/crypto/signatures/bls/tmp.json rename to crypto/signatures/bls/tmp.json diff --git a/internal/crypto/signatures/common/challenge.go b/crypto/signatures/common/challenge.go similarity index 79% rename from internal/crypto/signatures/common/challenge.go rename to crypto/signatures/common/challenge.go index 7fc67e2e1..1a8db7f6e 100755 --- a/internal/crypto/signatures/common/challenge.go +++ b/crypto/signatures/common/challenge.go @@ -7,7 +7,7 @@ package common import ( - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) // Challenge generated by fiat-shamir heuristic diff --git a/internal/crypto/signatures/common/commitment.go b/crypto/signatures/common/commitment.go similarity index 82% rename from internal/crypto/signatures/common/commitment.go rename to crypto/signatures/common/commitment.go index 67f854759..62a190054 100755 --- a/internal/crypto/signatures/common/commitment.go +++ b/crypto/signatures/common/commitment.go @@ -7,7 +7,7 @@ package common import ( - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) // Commitment represents a point Pedersen commitment of one or more diff --git a/internal/crypto/signatures/common/hmacdrbg.go b/crypto/signatures/common/hmacdrbg.go similarity index 100% rename from internal/crypto/signatures/common/hmacdrbg.go rename to crypto/signatures/common/hmacdrbg.go diff --git a/internal/crypto/signatures/common/nonce.go b/crypto/signatures/common/nonce.go similarity index 81% rename from internal/crypto/signatures/common/nonce.go rename to crypto/signatures/common/nonce.go index 5fbd93707..4b117258c 100755 --- a/internal/crypto/signatures/common/nonce.go +++ b/crypto/signatures/common/nonce.go @@ -7,7 +7,7 @@ package common import ( - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) // Nonce is used for zero-knowledge proofs to prevent replay attacks diff --git a/internal/crypto/signatures/common/proof_committed_builder.go b/crypto/signatures/common/proof_committed_builder.go similarity index 97% rename from internal/crypto/signatures/common/proof_committed_builder.go rename to crypto/signatures/common/proof_committed_builder.go index 2447c37b7..8e19f8b36 100755 --- a/internal/crypto/signatures/common/proof_committed_builder.go +++ b/crypto/signatures/common/proof_committed_builder.go @@ -10,7 +10,7 @@ import ( "fmt" "io" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) const limit = 65535 diff --git a/internal/crypto/signatures/common/proof_message.go b/crypto/signatures/common/proof_message.go similarity index 97% rename from internal/crypto/signatures/common/proof_message.go rename to crypto/signatures/common/proof_message.go index 1025a480f..4c60b9bd0 100755 --- a/internal/crypto/signatures/common/proof_message.go +++ b/crypto/signatures/common/proof_message.go @@ -9,7 +9,7 @@ package common import ( "io" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) // ProofMessage classifies how a message is presented in a proof diff --git a/internal/crypto/signatures/common/signature_blinding.go b/crypto/signatures/common/signature_blinding.go similarity index 81% rename from internal/crypto/signatures/common/signature_blinding.go rename to crypto/signatures/common/signature_blinding.go index e6f385472..741ec9ee6 100755 --- a/internal/crypto/signatures/common/signature_blinding.go +++ b/crypto/signatures/common/signature_blinding.go @@ -7,7 +7,7 @@ package common import ( - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) // SignatureBlinding is a value used for computing blind signatures diff --git a/internal/crypto/signatures/schnorr/mina/bitvector.go b/crypto/signatures/schnorr/mina/bitvector.go similarity index 100% rename from internal/crypto/signatures/schnorr/mina/bitvector.go rename to crypto/signatures/schnorr/mina/bitvector.go diff --git a/internal/crypto/signatures/schnorr/mina/challenge_derive.go b/crypto/signatures/schnorr/mina/challenge_derive.go similarity index 93% rename from internal/crypto/signatures/schnorr/mina/challenge_derive.go rename to crypto/signatures/schnorr/mina/challenge_derive.go index 08a118183..5e3111d76 100755 --- a/internal/crypto/signatures/schnorr/mina/challenge_derive.go +++ b/crypto/signatures/schnorr/mina/challenge_derive.go @@ -9,7 +9,7 @@ package mina import ( "fmt" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) type MinaTSchnorrHandler struct{} diff --git a/internal/crypto/signatures/schnorr/mina/keys.go b/crypto/signatures/schnorr/mina/keys.go similarity index 97% rename from internal/crypto/signatures/schnorr/mina/keys.go rename to crypto/signatures/schnorr/mina/keys.go index ce4d20752..afc7177df 100755 --- a/internal/crypto/signatures/schnorr/mina/keys.go +++ b/crypto/signatures/schnorr/mina/keys.go @@ -17,9 +17,9 @@ import ( "github.com/mr-tron/base58" "golang.org/x/crypto/blake2b" - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/core/curves/native/pasta/fp" - "github.com/onsonr/sonr/internal/crypto/core/curves/native/pasta/fq" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves/native/pasta/fp" + "github.com/onsonr/sonr/crypto/core/curves/native/pasta/fq" ) const ( diff --git a/internal/crypto/signatures/schnorr/mina/keys_test.go b/crypto/signatures/schnorr/mina/keys_test.go similarity index 98% rename from internal/crypto/signatures/schnorr/mina/keys_test.go rename to crypto/signatures/schnorr/mina/keys_test.go index a531791ee..8b9764965 100755 --- a/internal/crypto/signatures/schnorr/mina/keys_test.go +++ b/crypto/signatures/schnorr/mina/keys_test.go @@ -11,7 +11,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core/curves/native/pasta/fq" + "github.com/onsonr/sonr/crypto/core/curves/native/pasta/fq" ) func TestNewKeys(t *testing.T) { diff --git a/internal/crypto/signatures/schnorr/mina/poseidon_config.go b/crypto/signatures/schnorr/mina/poseidon_config.go similarity index 96% rename from internal/crypto/signatures/schnorr/mina/poseidon_config.go rename to crypto/signatures/schnorr/mina/poseidon_config.go index aa722c7d6..5eb9da8c3 100755 --- a/internal/crypto/signatures/schnorr/mina/poseidon_config.go +++ b/crypto/signatures/schnorr/mina/poseidon_config.go @@ -7,7 +7,7 @@ package mina import ( - "github.com/onsonr/sonr/internal/crypto/core/curves/native/pasta/fp" + "github.com/onsonr/sonr/crypto/core/curves/native/pasta/fp" ) // SBox is the type of exponentiation to perform diff --git a/internal/crypto/signatures/schnorr/mina/poseidon_hash.go b/crypto/signatures/schnorr/mina/poseidon_hash.go similarity index 99% rename from internal/crypto/signatures/schnorr/mina/poseidon_hash.go rename to crypto/signatures/schnorr/mina/poseidon_hash.go index 2a40e2596..17573d86a 100755 --- a/internal/crypto/signatures/schnorr/mina/poseidon_hash.go +++ b/crypto/signatures/schnorr/mina/poseidon_hash.go @@ -7,8 +7,8 @@ package mina import ( - "github.com/onsonr/sonr/internal/crypto/core/curves/native/pasta/fp" - "github.com/onsonr/sonr/internal/crypto/core/curves/native/pasta/fq" + "github.com/onsonr/sonr/crypto/core/curves/native/pasta/fp" + "github.com/onsonr/sonr/crypto/core/curves/native/pasta/fq" ) type Context struct { diff --git a/internal/crypto/signatures/schnorr/mina/poseidon_hash_test.go b/crypto/signatures/schnorr/mina/poseidon_hash_test.go similarity index 96% rename from internal/crypto/signatures/schnorr/mina/poseidon_hash_test.go rename to crypto/signatures/schnorr/mina/poseidon_hash_test.go index 1376a4daa..739c03182 100755 --- a/internal/crypto/signatures/schnorr/mina/poseidon_hash_test.go +++ b/crypto/signatures/schnorr/mina/poseidon_hash_test.go @@ -12,8 +12,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core/curves/native/pasta/fp" - "github.com/onsonr/sonr/internal/crypto/core/curves/native/pasta/fq" + "github.com/onsonr/sonr/crypto/core/curves/native/pasta/fp" + "github.com/onsonr/sonr/crypto/core/curves/native/pasta/fq" ) func TestPoseidonHash(t *testing.T) { diff --git a/internal/crypto/signatures/schnorr/mina/roinput.go b/crypto/signatures/schnorr/mina/roinput.go similarity index 95% rename from internal/crypto/signatures/schnorr/mina/roinput.go rename to crypto/signatures/schnorr/mina/roinput.go index 90a4ebf71..df172ddc1 100755 --- a/internal/crypto/signatures/schnorr/mina/roinput.go +++ b/crypto/signatures/schnorr/mina/roinput.go @@ -7,8 +7,8 @@ package mina import ( - "github.com/onsonr/sonr/internal/crypto/core/curves/native/pasta/fp" - "github.com/onsonr/sonr/internal/crypto/core/curves/native/pasta/fq" + "github.com/onsonr/sonr/crypto/core/curves/native/pasta/fp" + "github.com/onsonr/sonr/crypto/core/curves/native/pasta/fq" ) // Handles the packing of bits and fields according to Mina spec diff --git a/internal/crypto/signatures/schnorr/mina/signature.go b/crypto/signatures/schnorr/mina/signature.go similarity index 85% rename from internal/crypto/signatures/schnorr/mina/signature.go rename to crypto/signatures/schnorr/mina/signature.go index 87069c354..63c008b45 100755 --- a/internal/crypto/signatures/schnorr/mina/signature.go +++ b/crypto/signatures/schnorr/mina/signature.go @@ -9,8 +9,8 @@ package mina import ( "fmt" - "github.com/onsonr/sonr/internal/crypto/core/curves/native/pasta/fp" - "github.com/onsonr/sonr/internal/crypto/core/curves/native/pasta/fq" + "github.com/onsonr/sonr/crypto/core/curves/native/pasta/fp" + "github.com/onsonr/sonr/crypto/core/curves/native/pasta/fq" ) // Signature is a Mina compatible signature either for payment or delegation diff --git a/internal/crypto/signatures/schnorr/mina/txn.go b/crypto/signatures/schnorr/mina/txn.go similarity index 99% rename from internal/crypto/signatures/schnorr/mina/txn.go rename to crypto/signatures/schnorr/mina/txn.go index 298a3d7cf..246aa7e53 100755 --- a/internal/crypto/signatures/schnorr/mina/txn.go +++ b/crypto/signatures/schnorr/mina/txn.go @@ -13,7 +13,7 @@ import ( "github.com/cosmos/btcutil/base58" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) // Transaction is a Mina transaction for payments or delegations diff --git a/internal/crypto/signatures/schnorr/nem/ed25519_keccak.go b/crypto/signatures/schnorr/nem/ed25519_keccak.go similarity index 99% rename from internal/crypto/signatures/schnorr/nem/ed25519_keccak.go rename to crypto/signatures/schnorr/nem/ed25519_keccak.go index 816a90137..541601afd 100755 --- a/internal/crypto/signatures/schnorr/nem/ed25519_keccak.go +++ b/crypto/signatures/schnorr/nem/ed25519_keccak.go @@ -28,7 +28,7 @@ import ( "filippo.io/edwards25519" "golang.org/x/crypto/sha3" - "github.com/onsonr/sonr/internal/crypto/internal" + "github.com/onsonr/sonr/crypto/internal" ) const ( diff --git a/internal/crypto/signatures/schnorr/nem/ed25519_keccak_test.go b/crypto/signatures/schnorr/nem/ed25519_keccak_test.go similarity index 100% rename from internal/crypto/signatures/schnorr/nem/ed25519_keccak_test.go rename to crypto/signatures/schnorr/nem/ed25519_keccak_test.go diff --git a/internal/crypto/subtle/hkdf.go b/crypto/subtle/hkdf.go similarity index 100% rename from internal/crypto/subtle/hkdf.go rename to crypto/subtle/hkdf.go diff --git a/internal/crypto/subtle/random/random.go b/crypto/subtle/random/random.go similarity index 100% rename from internal/crypto/subtle/random/random.go rename to crypto/subtle/random/random.go diff --git a/internal/crypto/subtle/subtle.go b/crypto/subtle/subtle.go similarity index 100% rename from internal/crypto/subtle/subtle.go rename to crypto/subtle/subtle.go diff --git a/internal/crypto/subtle/x25519.go b/crypto/subtle/x25519.go similarity index 100% rename from internal/crypto/subtle/x25519.go rename to crypto/subtle/x25519.go diff --git a/internal/crypto/tecdsa/dklsv1/README.md b/crypto/tecdsa/dklsv1/README.md similarity index 100% rename from internal/crypto/tecdsa/dklsv1/README.md rename to crypto/tecdsa/dklsv1/README.md diff --git a/internal/crypto/tecdsa/dklsv1/boilerplate.go b/crypto/tecdsa/dklsv1/boilerplate.go similarity index 97% rename from internal/crypto/tecdsa/dklsv1/boilerplate.go rename to crypto/tecdsa/dklsv1/boilerplate.go index a6adf223b..4f8def1bc 100755 --- a/internal/crypto/tecdsa/dklsv1/boilerplate.go +++ b/crypto/tecdsa/dklsv1/boilerplate.go @@ -5,11 +5,11 @@ import ( "github.com/pkg/errors" - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/core/protocol" - "github.com/onsonr/sonr/internal/crypto/tecdsa/dklsv1/dkg" - "github.com/onsonr/sonr/internal/crypto/tecdsa/dklsv1/refresh" - "github.com/onsonr/sonr/internal/crypto/tecdsa/dklsv1/sign" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/protocol" + "github.com/onsonr/sonr/crypto/tecdsa/dklsv1/dkg" + "github.com/onsonr/sonr/crypto/tecdsa/dklsv1/refresh" + "github.com/onsonr/sonr/crypto/tecdsa/dklsv1/sign" ) // AliceDkg DKLS DKG implementation that satisfies the protocol iterator interface. diff --git a/internal/crypto/tecdsa/dklsv1/dealer/dealer.go b/crypto/tecdsa/dklsv1/dealer/dealer.go similarity index 93% rename from internal/crypto/tecdsa/dklsv1/dealer/dealer.go rename to crypto/tecdsa/dklsv1/dealer/dealer.go index f69201912..3f257a387 100755 --- a/internal/crypto/tecdsa/dklsv1/dealer/dealer.go +++ b/crypto/tecdsa/dklsv1/dealer/dealer.go @@ -15,10 +15,10 @@ import ( "github.com/pkg/errors" - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/ot/base/simplest" - "github.com/onsonr/sonr/internal/crypto/ot/extension/kos" - "github.com/onsonr/sonr/internal/crypto/tecdsa/dklsv1/dkg" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/ot/base/simplest" + "github.com/onsonr/sonr/crypto/ot/extension/kos" + "github.com/onsonr/sonr/crypto/tecdsa/dklsv1/dkg" ) // GenerateAndDeal produces private key material for alice and bob which they can later use in signing. diff --git a/internal/crypto/tecdsa/dklsv1/dealer/dealer_test.go b/crypto/tecdsa/dklsv1/dealer/dealer_test.go similarity index 89% rename from internal/crypto/tecdsa/dklsv1/dealer/dealer_test.go rename to crypto/tecdsa/dklsv1/dealer/dealer_test.go index 906a6549e..3c836775a 100755 --- a/internal/crypto/tecdsa/dklsv1/dealer/dealer_test.go +++ b/crypto/tecdsa/dklsv1/dealer/dealer_test.go @@ -6,9 +6,9 @@ import ( "github.com/stretchr/testify/require" "golang.org/x/crypto/sha3" - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/tecdsa/dklsv1/dealer" - "github.com/onsonr/sonr/internal/crypto/tecdsa/dklsv1/sign" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/tecdsa/dklsv1/dealer" + "github.com/onsonr/sonr/crypto/tecdsa/dklsv1/sign" ) func Test_DealerCanGenerateKeysThatSign(t *testing.T) { diff --git a/internal/crypto/tecdsa/dklsv1/dkg/dkg.go b/crypto/tecdsa/dklsv1/dkg/dkg.go similarity index 98% rename from internal/crypto/tecdsa/dklsv1/dkg/dkg.go rename to crypto/tecdsa/dklsv1/dkg/dkg.go index f3d6b9f20..667fb2797 100755 --- a/internal/crypto/tecdsa/dklsv1/dkg/dkg.go +++ b/crypto/tecdsa/dklsv1/dkg/dkg.go @@ -15,10 +15,10 @@ import ( "github.com/gtank/merlin" "github.com/pkg/errors" - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/ot/base/simplest" - "github.com/onsonr/sonr/internal/crypto/ot/extension/kos" - "github.com/onsonr/sonr/internal/crypto/zkp/schnorr" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/ot/base/simplest" + "github.com/onsonr/sonr/crypto/ot/extension/kos" + "github.com/onsonr/sonr/crypto/zkp/schnorr" ) // AliceOutput is the result of running DKG for Alice. It contains both the public and secret values that are needed diff --git a/internal/crypto/tecdsa/dklsv1/dkg/dkg_test.go b/crypto/tecdsa/dklsv1/dkg/dkg_test.go similarity index 96% rename from internal/crypto/tecdsa/dklsv1/dkg/dkg_test.go rename to crypto/tecdsa/dklsv1/dkg/dkg_test.go index 2ba6103a1..24d6501bb 100755 --- a/internal/crypto/tecdsa/dklsv1/dkg/dkg_test.go +++ b/crypto/tecdsa/dklsv1/dkg/dkg_test.go @@ -12,8 +12,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/ot/extension/kos" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/ot/extension/kos" ) func TestDkg(t *testing.T) { diff --git a/internal/crypto/tecdsa/dklsv1/dkgserializers.go b/crypto/tecdsa/dklsv1/dkgserializers.go similarity index 97% rename from internal/crypto/tecdsa/dklsv1/dkgserializers.go rename to crypto/tecdsa/dklsv1/dkgserializers.go index fa85b8212..b408bfe43 100755 --- a/internal/crypto/tecdsa/dklsv1/dkgserializers.go +++ b/crypto/tecdsa/dklsv1/dkgserializers.go @@ -6,11 +6,11 @@ import ( "github.com/pkg/errors" - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/core/protocol" - "github.com/onsonr/sonr/internal/crypto/ot/base/simplest" - "github.com/onsonr/sonr/internal/crypto/tecdsa/dklsv1/dkg" - "github.com/onsonr/sonr/internal/crypto/zkp/schnorr" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/protocol" + "github.com/onsonr/sonr/crypto/ot/base/simplest" + "github.com/onsonr/sonr/crypto/tecdsa/dklsv1/dkg" + "github.com/onsonr/sonr/crypto/zkp/schnorr" ) const payloadKey = "direct" diff --git a/internal/crypto/tecdsa/dklsv1/protocol.go b/crypto/tecdsa/dklsv1/protocol.go similarity index 94% rename from internal/crypto/tecdsa/dklsv1/protocol.go rename to crypto/tecdsa/dklsv1/protocol.go index c0b167fc0..50e73a184 100755 --- a/internal/crypto/tecdsa/dklsv1/protocol.go +++ b/crypto/tecdsa/dklsv1/protocol.go @@ -3,7 +3,7 @@ package dklsv1 import ( - "github.com/onsonr/sonr/internal/crypto/core/protocol" + "github.com/onsonr/sonr/crypto/core/protocol" ) // Basic protocol interface implementation that calls the next step func in a pre-defined list diff --git a/internal/crypto/tecdsa/dklsv1/protocol_test.go b/crypto/tecdsa/dklsv1/protocol_test.go similarity index 98% rename from internal/crypto/tecdsa/dklsv1/protocol_test.go rename to crypto/tecdsa/dklsv1/protocol_test.go index f4e70a881..214edb6b8 100755 --- a/internal/crypto/tecdsa/dklsv1/protocol_test.go +++ b/crypto/tecdsa/dklsv1/protocol_test.go @@ -13,10 +13,10 @@ import ( "github.com/stretchr/testify/require" "golang.org/x/crypto/sha3" - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/core/protocol" - "github.com/onsonr/sonr/internal/crypto/ot/extension/kos" - "github.com/onsonr/sonr/internal/crypto/tecdsa/dklsv1/dkg" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/protocol" + "github.com/onsonr/sonr/crypto/ot/extension/kos" + "github.com/onsonr/sonr/crypto/tecdsa/dklsv1/dkg" ) // For DKG bob starts first. For refresh and sign, Alice starts first. diff --git a/internal/crypto/tecdsa/dklsv1/refresh/refresh.go b/crypto/tecdsa/dklsv1/refresh/refresh.go similarity index 95% rename from internal/crypto/tecdsa/dklsv1/refresh/refresh.go rename to crypto/tecdsa/dklsv1/refresh/refresh.go index 35c81e6a3..f2488293d 100755 --- a/internal/crypto/tecdsa/dklsv1/refresh/refresh.go +++ b/crypto/tecdsa/dklsv1/refresh/refresh.go @@ -19,11 +19,11 @@ import ( "github.com/gtank/merlin" "github.com/pkg/errors" - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/ot/base/simplest" - "github.com/onsonr/sonr/internal/crypto/ot/extension/kos" - "github.com/onsonr/sonr/internal/crypto/tecdsa/dklsv1/dkg" - "github.com/onsonr/sonr/internal/crypto/zkp/schnorr" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/ot/base/simplest" + "github.com/onsonr/sonr/crypto/ot/extension/kos" + "github.com/onsonr/sonr/crypto/tecdsa/dklsv1/dkg" + "github.com/onsonr/sonr/crypto/zkp/schnorr" ) // Alice struct encoding Alice's state during one execution of the overall signing algorithm. diff --git a/internal/crypto/tecdsa/dklsv1/refresh/refresh_test.go b/crypto/tecdsa/dklsv1/refresh/refresh_test.go similarity index 95% rename from internal/crypto/tecdsa/dklsv1/refresh/refresh_test.go rename to crypto/tecdsa/dklsv1/refresh/refresh_test.go index 5f14c16b3..89eafede4 100755 --- a/internal/crypto/tecdsa/dklsv1/refresh/refresh_test.go +++ b/crypto/tecdsa/dklsv1/refresh/refresh_test.go @@ -13,11 +13,11 @@ import ( "github.com/stretchr/testify/require" "golang.org/x/crypto/sha3" - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/ot/extension/kos" - "github.com/onsonr/sonr/internal/crypto/tecdsa/dklsv1/dkg" - "github.com/onsonr/sonr/internal/crypto/tecdsa/dklsv1/refresh" - "github.com/onsonr/sonr/internal/crypto/tecdsa/dklsv1/sign" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/ot/extension/kos" + "github.com/onsonr/sonr/crypto/tecdsa/dklsv1/dkg" + "github.com/onsonr/sonr/crypto/tecdsa/dklsv1/refresh" + "github.com/onsonr/sonr/crypto/tecdsa/dklsv1/sign" ) func performDKG(t *testing.T, curve *curves.Curve) (*dkg.Alice, *dkg.Bob) { diff --git a/internal/crypto/tecdsa/dklsv1/refreshserializers.go b/crypto/tecdsa/dklsv1/refreshserializers.go similarity index 96% rename from internal/crypto/tecdsa/dklsv1/refreshserializers.go rename to crypto/tecdsa/dklsv1/refreshserializers.go index 4aaec6279..53f065364 100755 --- a/internal/crypto/tecdsa/dklsv1/refreshserializers.go +++ b/crypto/tecdsa/dklsv1/refreshserializers.go @@ -6,11 +6,11 @@ import ( "github.com/pkg/errors" - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/core/protocol" - "github.com/onsonr/sonr/internal/crypto/ot/base/simplest" - "github.com/onsonr/sonr/internal/crypto/tecdsa/dklsv1/dkg" - "github.com/onsonr/sonr/internal/crypto/tecdsa/dklsv1/refresh" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/protocol" + "github.com/onsonr/sonr/crypto/ot/base/simplest" + "github.com/onsonr/sonr/crypto/tecdsa/dklsv1/dkg" + "github.com/onsonr/sonr/crypto/tecdsa/dklsv1/refresh" ) func newRefreshProtocolMessage(payload []byte, round string, version uint) *protocol.Message { diff --git a/internal/crypto/tecdsa/dklsv1/sign/multiply.go b/crypto/tecdsa/dklsv1/sign/multiply.go similarity index 98% rename from internal/crypto/tecdsa/dklsv1/sign/multiply.go rename to crypto/tecdsa/dklsv1/sign/multiply.go index 9c3b79062..353faef65 100755 --- a/internal/crypto/tecdsa/dklsv1/sign/multiply.go +++ b/crypto/tecdsa/dklsv1/sign/multiply.go @@ -16,10 +16,10 @@ import ( "github.com/pkg/errors" "golang.org/x/crypto/sha3" - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/internal" - "github.com/onsonr/sonr/internal/crypto/ot/base/simplest" - "github.com/onsonr/sonr/internal/crypto/ot/extension/kos" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/internal" + "github.com/onsonr/sonr/crypto/ot/base/simplest" + "github.com/onsonr/sonr/crypto/ot/extension/kos" ) // This implements the Multiplication protocol of DKLs, protocol 5. https://eprint.iacr.org/2018/499.pdf diff --git a/internal/crypto/tecdsa/dklsv1/sign/multiply_test.go b/crypto/tecdsa/dklsv1/sign/multiply_test.go similarity index 83% rename from internal/crypto/tecdsa/dklsv1/sign/multiply_test.go rename to crypto/tecdsa/dklsv1/sign/multiply_test.go index 45c0a89ec..1bfede1bd 100755 --- a/internal/crypto/tecdsa/dklsv1/sign/multiply_test.go +++ b/crypto/tecdsa/dklsv1/sign/multiply_test.go @@ -12,10 +12,10 @@ import ( "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/ot/base/simplest" - "github.com/onsonr/sonr/internal/crypto/ot/extension/kos" - "github.com/onsonr/sonr/internal/crypto/ot/ottest" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/ot/base/simplest" + "github.com/onsonr/sonr/crypto/ot/extension/kos" + "github.com/onsonr/sonr/crypto/ot/ottest" ) func TestMultiply(t *testing.T) { diff --git a/internal/crypto/tecdsa/dklsv1/sign/sign.go b/crypto/tecdsa/dklsv1/sign/sign.go similarity index 98% rename from internal/crypto/tecdsa/dklsv1/sign/sign.go rename to crypto/tecdsa/dklsv1/sign/sign.go index 3f2258f34..6d81add20 100755 --- a/internal/crypto/tecdsa/dklsv1/sign/sign.go +++ b/crypto/tecdsa/dklsv1/sign/sign.go @@ -20,11 +20,11 @@ import ( "github.com/pkg/errors" "golang.org/x/crypto/sha3" - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/ot/base/simplest" - "github.com/onsonr/sonr/internal/crypto/ot/extension/kos" - "github.com/onsonr/sonr/internal/crypto/tecdsa/dklsv1/dkg" - "github.com/onsonr/sonr/internal/crypto/zkp/schnorr" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/ot/base/simplest" + "github.com/onsonr/sonr/crypto/ot/extension/kos" + "github.com/onsonr/sonr/crypto/tecdsa/dklsv1/dkg" + "github.com/onsonr/sonr/crypto/zkp/schnorr" ) const multiplicationCount = 2 diff --git a/internal/crypto/tecdsa/dklsv1/sign/sign_test.go b/crypto/tecdsa/dklsv1/sign/sign_test.go similarity index 90% rename from internal/crypto/tecdsa/dklsv1/sign/sign_test.go rename to crypto/tecdsa/dklsv1/sign/sign_test.go index 0f44908df..71427b084 100755 --- a/internal/crypto/tecdsa/dklsv1/sign/sign_test.go +++ b/crypto/tecdsa/dklsv1/sign/sign_test.go @@ -13,11 +13,11 @@ import ( "github.com/stretchr/testify/require" "golang.org/x/crypto/sha3" - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/ot/base/simplest" - "github.com/onsonr/sonr/internal/crypto/ot/extension/kos" - "github.com/onsonr/sonr/internal/crypto/ot/ottest" - "github.com/onsonr/sonr/internal/crypto/tecdsa/dklsv1/dkg" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/ot/base/simplest" + "github.com/onsonr/sonr/crypto/ot/extension/kos" + "github.com/onsonr/sonr/crypto/ot/ottest" + "github.com/onsonr/sonr/crypto/tecdsa/dklsv1/dkg" ) func TestSign(t *testing.T) { diff --git a/internal/crypto/tecdsa/dklsv1/signserializers.go b/crypto/tecdsa/dklsv1/signserializers.go similarity index 95% rename from internal/crypto/tecdsa/dklsv1/signserializers.go rename to crypto/tecdsa/dklsv1/signserializers.go index 7a647b8d3..14b5a26bf 100755 --- a/internal/crypto/tecdsa/dklsv1/signserializers.go +++ b/crypto/tecdsa/dklsv1/signserializers.go @@ -6,9 +6,9 @@ import ( "github.com/pkg/errors" - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/core/protocol" - "github.com/onsonr/sonr/internal/crypto/tecdsa/dklsv1/sign" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/protocol" + "github.com/onsonr/sonr/crypto/tecdsa/dklsv1/sign" ) func newSignProtocolMessage(payload []byte, round string, version uint) *protocol.Message { diff --git a/internal/crypto/tecdsa/dklsv1/testdata/alice-dkls-v1-dkg.bin b/crypto/tecdsa/dklsv1/testdata/alice-dkls-v1-dkg.bin similarity index 100% rename from internal/crypto/tecdsa/dklsv1/testdata/alice-dkls-v1-dkg.bin rename to crypto/tecdsa/dklsv1/testdata/alice-dkls-v1-dkg.bin diff --git a/internal/crypto/tecdsa/dklsv1/testdata/bob-dkls-v1-dkg.bin b/crypto/tecdsa/dklsv1/testdata/bob-dkls-v1-dkg.bin similarity index 100% rename from internal/crypto/tecdsa/dklsv1/testdata/bob-dkls-v1-dkg.bin rename to crypto/tecdsa/dklsv1/testdata/bob-dkls-v1-dkg.bin diff --git a/internal/crypto/ted25519/frost/README.md b/crypto/ted25519/frost/README.md similarity index 100% rename from internal/crypto/ted25519/frost/README.md rename to crypto/ted25519/frost/README.md diff --git a/internal/crypto/ted25519/frost/challenge_derive.go b/crypto/ted25519/frost/challenge_derive.go similarity index 91% rename from internal/crypto/ted25519/frost/challenge_derive.go rename to crypto/ted25519/frost/challenge_derive.go index a00793a4e..cbd138703 100755 --- a/internal/crypto/ted25519/frost/challenge_derive.go +++ b/crypto/ted25519/frost/challenge_derive.go @@ -9,7 +9,7 @@ package frost import ( "crypto/sha512" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) type ChallengeDerive interface { diff --git a/internal/crypto/ted25519/frost/participant.go b/crypto/ted25519/frost/participant.go similarity index 94% rename from internal/crypto/ted25519/frost/participant.go rename to crypto/ted25519/frost/participant.go index cb626d05f..1ede7f2d4 100755 --- a/internal/crypto/ted25519/frost/participant.go +++ b/crypto/ted25519/frost/participant.go @@ -10,9 +10,9 @@ package frost import ( "fmt" - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/dkg/frost" - "github.com/onsonr/sonr/internal/crypto/internal" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/dkg/frost" + "github.com/onsonr/sonr/crypto/internal" ) // Signer is a tSchnorr player performing the signing operation. diff --git a/internal/crypto/ted25519/frost/round1.go b/crypto/ted25519/frost/round1.go similarity index 94% rename from internal/crypto/ted25519/frost/round1.go rename to crypto/ted25519/frost/round1.go index 9487faee9..71736e7ea 100755 --- a/internal/crypto/ted25519/frost/round1.go +++ b/crypto/ted25519/frost/round1.go @@ -13,8 +13,8 @@ import ( "github.com/pkg/errors" - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/internal" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/internal" ) // Round1Bcast contains values to be broadcast to all players after the completion of signing round 1. diff --git a/internal/crypto/ted25519/frost/round2.go b/crypto/ted25519/frost/round2.go similarity index 97% rename from internal/crypto/ted25519/frost/round2.go rename to crypto/ted25519/frost/round2.go index 19aad421a..bdf2adaa6 100755 --- a/internal/crypto/ted25519/frost/round2.go +++ b/crypto/ted25519/frost/round2.go @@ -13,8 +13,8 @@ import ( "github.com/pkg/errors" - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/internal" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/internal" ) // Round2Bcast contains values that will be broadcast to other signers after completion of round 2. diff --git a/internal/crypto/ted25519/frost/round3.go b/crypto/ted25519/frost/round3.go similarity index 97% rename from internal/crypto/ted25519/frost/round3.go rename to crypto/ted25519/frost/round3.go index 76cd50ab7..62cfa0d78 100755 --- a/internal/crypto/ted25519/frost/round3.go +++ b/crypto/ted25519/frost/round3.go @@ -9,8 +9,8 @@ package frost import ( "fmt" - "github.com/onsonr/sonr/internal/crypto/core/curves" - "github.com/onsonr/sonr/internal/crypto/internal" + "github.com/onsonr/sonr/crypto/core/curves" + "github.com/onsonr/sonr/crypto/internal" ) // Round3Bcast contains the output of FROST signature, i.e., it contains FROST signature (z,c) and the diff --git a/internal/crypto/ted25519/frost/rounds_test.go b/crypto/ted25519/frost/rounds_test.go similarity index 98% rename from internal/crypto/ted25519/frost/rounds_test.go rename to crypto/ted25519/frost/rounds_test.go index 71fc4cde0..de4443109 100755 --- a/internal/crypto/ted25519/frost/rounds_test.go +++ b/crypto/ted25519/frost/rounds_test.go @@ -11,9 +11,9 @@ import ( "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core/curves" - dkg "github.com/onsonr/sonr/internal/crypto/dkg/frost" - "github.com/onsonr/sonr/internal/crypto/sharing" + "github.com/onsonr/sonr/crypto/core/curves" + dkg "github.com/onsonr/sonr/crypto/dkg/frost" + "github.com/onsonr/sonr/crypto/sharing" ) var ( diff --git a/internal/crypto/ted25519/ted25519/ed25519.go b/crypto/ted25519/ted25519/ed25519.go similarity index 99% rename from internal/crypto/ted25519/ted25519/ed25519.go rename to crypto/ted25519/ted25519/ed25519.go index ef92b983b..fb4943e8c 100755 --- a/internal/crypto/ted25519/ted25519/ed25519.go +++ b/crypto/ted25519/ted25519/ed25519.go @@ -22,7 +22,7 @@ import ( "io" "strconv" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) const ( diff --git a/internal/crypto/ted25519/ted25519/ed25519_test.go b/crypto/ted25519/ted25519/ed25519_test.go similarity index 98% rename from internal/crypto/ted25519/ted25519/ed25519_test.go rename to crypto/ted25519/ted25519/ed25519_test.go index be84c93a5..f1dbda4da 100755 --- a/internal/crypto/ted25519/ted25519/ed25519_test.go +++ b/crypto/ted25519/ted25519/ed25519_test.go @@ -16,7 +16,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) // sign.input.gz is a selection of test cases from diff --git a/internal/crypto/ted25519/ted25519/ext.go b/crypto/ted25519/ted25519/ext.go similarity index 98% rename from internal/crypto/ted25519/ted25519/ext.go rename to crypto/ted25519/ted25519/ext.go index 8051d72a8..27c0edda9 100755 --- a/internal/crypto/ted25519/ted25519/ext.go +++ b/crypto/ted25519/ted25519/ext.go @@ -10,7 +10,7 @@ import ( "crypto/sha512" "strconv" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) // GeAdd returns the sum of two public keys, a and b. diff --git a/internal/crypto/ted25519/ted25519/ext_test.go b/crypto/ted25519/ted25519/ext_test.go similarity index 96% rename from internal/crypto/ted25519/ted25519/ext_test.go rename to crypto/ted25519/ted25519/ext_test.go index 173f5797d..e1bb83296 100755 --- a/internal/crypto/ted25519/ted25519/ext_test.go +++ b/crypto/ted25519/ted25519/ext_test.go @@ -14,8 +14,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core/curves" - v1 "github.com/onsonr/sonr/internal/crypto/sharing/v1" + "github.com/onsonr/sonr/crypto/core/curves" + v1 "github.com/onsonr/sonr/crypto/sharing/v1" ) const ( diff --git a/internal/crypto/ted25519/ted25519/keygen.go b/crypto/ted25519/ted25519/keygen.go similarity index 98% rename from internal/crypto/ted25519/ted25519/keygen.go rename to crypto/ted25519/ted25519/keygen.go index 727add214..58d21fe1e 100755 --- a/internal/crypto/ted25519/ted25519/keygen.go +++ b/crypto/ted25519/ted25519/keygen.go @@ -10,8 +10,8 @@ import ( "encoding/binary" "fmt" - "github.com/onsonr/sonr/internal/crypto/core/curves" - v1 "github.com/onsonr/sonr/internal/crypto/sharing/v1" + "github.com/onsonr/sonr/crypto/core/curves" + v1 "github.com/onsonr/sonr/crypto/sharing/v1" ) // PublicKeyFromBytes converts byte array into PublicKey byte array diff --git a/internal/crypto/ted25519/ted25519/keygen_test.go b/crypto/ted25519/ted25519/keygen_test.go similarity index 96% rename from internal/crypto/ted25519/ted25519/keygen_test.go rename to crypto/ted25519/ted25519/keygen_test.go index 16bbdde0f..ead13126f 100755 --- a/internal/crypto/ted25519/ted25519/keygen_test.go +++ b/crypto/ted25519/ted25519/keygen_test.go @@ -12,8 +12,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core/curves" - v1 "github.com/onsonr/sonr/internal/crypto/sharing/v1" + "github.com/onsonr/sonr/crypto/core/curves" + v1 "github.com/onsonr/sonr/crypto/sharing/v1" ) func TestGenerateEd25519Key(t *testing.T) { diff --git a/internal/crypto/ted25519/ted25519/noncegen.go b/crypto/ted25519/ted25519/noncegen.go similarity index 98% rename from internal/crypto/ted25519/ted25519/noncegen.go rename to crypto/ted25519/ted25519/noncegen.go index 17b262099..ed5d56096 100755 --- a/internal/crypto/ted25519/ted25519/noncegen.go +++ b/crypto/ted25519/ted25519/noncegen.go @@ -13,7 +13,7 @@ import ( "golang.org/x/crypto/hkdf" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) // NonceShare represents a share of a generated nonce. diff --git a/internal/crypto/ted25519/ted25519/noncegen_test.go b/crypto/ted25519/ted25519/noncegen_test.go similarity index 96% rename from internal/crypto/ted25519/ted25519/noncegen_test.go rename to crypto/ted25519/ted25519/noncegen_test.go index f78856c26..cd9c7ce65 100755 --- a/internal/crypto/ted25519/ted25519/noncegen_test.go +++ b/crypto/ted25519/ted25519/noncegen_test.go @@ -12,8 +12,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core/curves" - v1 "github.com/onsonr/sonr/internal/crypto/sharing/v1" + "github.com/onsonr/sonr/crypto/core/curves" + v1 "github.com/onsonr/sonr/crypto/sharing/v1" ) func TestNonceShareFromBytes(t *testing.T) { diff --git a/internal/crypto/ted25519/ted25519/partialsig.go b/crypto/ted25519/ted25519/partialsig.go similarity index 100% rename from internal/crypto/ted25519/ted25519/partialsig.go rename to crypto/ted25519/ted25519/partialsig.go diff --git a/internal/crypto/ted25519/ted25519/partialsig_test.go b/crypto/ted25519/ted25519/partialsig_test.go similarity index 96% rename from internal/crypto/ted25519/ted25519/partialsig_test.go rename to crypto/ted25519/ted25519/partialsig_test.go index 5baf64c54..c19530cdc 100755 --- a/internal/crypto/ted25519/ted25519/partialsig_test.go +++ b/crypto/ted25519/ted25519/partialsig_test.go @@ -12,7 +12,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) func TestPartialSignNormalSignature(t *testing.T) { diff --git a/internal/crypto/ted25519/ted25519/sigagg.go b/crypto/ted25519/ted25519/sigagg.go similarity index 92% rename from internal/crypto/ted25519/ted25519/sigagg.go rename to crypto/ted25519/ted25519/sigagg.go index 2645015e4..78c48a4d4 100755 --- a/internal/crypto/ted25519/ted25519/sigagg.go +++ b/crypto/ted25519/ted25519/sigagg.go @@ -10,8 +10,8 @@ import ( "bytes" "fmt" - "github.com/onsonr/sonr/internal/crypto/core/curves" - v1 "github.com/onsonr/sonr/internal/crypto/sharing/v1" + "github.com/onsonr/sonr/crypto/core/curves" + v1 "github.com/onsonr/sonr/crypto/sharing/v1" ) type Signature = []byte diff --git a/internal/crypto/ted25519/ted25519/sigagg_test.go b/crypto/ted25519/ted25519/sigagg_test.go similarity index 100% rename from internal/crypto/ted25519/ted25519/sigagg_test.go rename to crypto/ted25519/ted25519/sigagg_test.go diff --git a/internal/crypto/ted25519/ted25519/twobytwo_test.go b/crypto/ted25519/ted25519/twobytwo_test.go similarity index 96% rename from internal/crypto/ted25519/ted25519/twobytwo_test.go rename to crypto/ted25519/ted25519/twobytwo_test.go index a15ed7912..85a58c1ad 100755 --- a/internal/crypto/ted25519/ted25519/twobytwo_test.go +++ b/crypto/ted25519/ted25519/twobytwo_test.go @@ -15,7 +15,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) func AggregateSignatures(sig1, sig2 *PartialSignature) []byte { diff --git a/internal/crypto/ucan/README.md b/crypto/ucan/README.md similarity index 100% rename from internal/crypto/ucan/README.md rename to crypto/ucan/README.md diff --git a/internal/crypto/ucan/attenuation.go b/crypto/ucan/attenuation.go similarity index 100% rename from internal/crypto/ucan/attenuation.go rename to crypto/ucan/attenuation.go diff --git a/internal/crypto/ucan/context.go b/crypto/ucan/context.go similarity index 100% rename from internal/crypto/ucan/context.go rename to crypto/ucan/context.go diff --git a/internal/crypto/ucan/proof.go b/crypto/ucan/proof.go similarity index 100% rename from internal/crypto/ucan/proof.go rename to crypto/ucan/proof.go diff --git a/internal/crypto/ucan/store.go b/crypto/ucan/store.go similarity index 100% rename from internal/crypto/ucan/store.go rename to crypto/ucan/store.go diff --git a/internal/crypto/ucan/token.go b/crypto/ucan/token.go similarity index 99% rename from internal/crypto/ucan/token.go rename to crypto/ucan/token.go index ca27aa3be..fc24f3063 100644 --- a/internal/crypto/ucan/token.go +++ b/crypto/ucan/token.go @@ -21,7 +21,7 @@ import ( "github.com/ipfs/go-cid" "github.com/libp2p/go-libp2p/core/crypto" mh "github.com/multiformats/go-multihash" - "github.com/onsonr/sonr/internal/crypto/keys" + "github.com/onsonr/sonr/crypto/keys" ) // ErrInvalidToken indicates an access token is invalid diff --git a/internal/crypto/zkp/schnorr/schnorr.go b/crypto/zkp/schnorr/schnorr.go similarity index 98% rename from internal/crypto/zkp/schnorr/schnorr.go rename to crypto/zkp/schnorr/schnorr.go index c8f1ec3dd..756133c1d 100755 --- a/internal/crypto/zkp/schnorr/schnorr.go +++ b/crypto/zkp/schnorr/schnorr.go @@ -16,7 +16,7 @@ import ( "github.com/pkg/errors" "golang.org/x/crypto/sha3" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) type Commitment = []byte diff --git a/internal/crypto/zkp/schnorr/schnorr_test.go b/crypto/zkp/schnorr/schnorr_test.go similarity index 94% rename from internal/crypto/zkp/schnorr/schnorr_test.go rename to crypto/zkp/schnorr/schnorr_test.go index 7ab317153..defa7a76b 100755 --- a/internal/crypto/zkp/schnorr/schnorr_test.go +++ b/crypto/zkp/schnorr/schnorr_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/require" "golang.org/x/crypto/sha3" - "github.com/onsonr/sonr/internal/crypto/core/curves" + "github.com/onsonr/sonr/crypto/core/curves" ) func TestZKPOverMultipleCurves(t *testing.T) { diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 000000000..ef8236517 --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1,3 @@ +site +.DS_Store +tmp diff --git a/docs/CNAME b/docs/CNAME new file mode 100644 index 000000000..4d10b1251 --- /dev/null +++ b/docs/CNAME @@ -0,0 +1 @@ +onsonr.dev diff --git a/docs/docs/changelog.md b/docs/docs/changelog.md new file mode 100644 index 000000000..dfbc66aeb --- /dev/null +++ b/docs/docs/changelog.md @@ -0,0 +1,631 @@ +## v0.5.27 (2024-12-16) + +## v0.5.26 (2024-12-13) + +### Fix + +- Correct regular expression for version tags in release workflow + +## v0.5.25 (2024-12-11) + +### Feat + +- enable GoReleaser releases on tags and snapshots +- automate release on tag and workflow dispatch + +## v0.5.24 (2024-12-11) + +### Feat + +- prevent duplicate releases + +## v0.5.23 (2024-12-11) + +### Refactor + +- rename scheduled release workflow to versioned release +- remove changelog from release artifacts + +## v0.5.22 (2024-12-11) + +### Feat + +- Implement passkey-based authentication and registration flow + +## v0.5.21 (2024-12-11) + +### Feat + +- allow manual triggering of deployment workflow +- add start-tui command for interactive mode +- add coin selection and update passkey input in registration form +- add hway command for Sonr DID gateway +- Conditionally install process-compose only if binary not found +- Add process-compose support with custom start and down commands +- implement passkey registration flow +- Improve createProfile form layout with wider max-width and enhanced spacing +- improve index page UI with new navigation buttons and remove redundant settings buttons +- Make input rows responsive with grid layout for mobile and desktop +- enhance index page with additional settings buttons and style adjustments +- implement passkey-based authentication +- add support for Cloudsmith releases +- add go dependency and enhance devbox environment variables +- update create profile form placeholders and handle +- add DID-based authentication middleware +- Add validation for human verification slider sum in CreateProfile form +- implement passkey registration flow +- Update WebAuthn credential handling with modern browser standards +- Streamline passkey registration with automatic form submission +- Add credential parsing and logging in register finish handler +- Add credential details row with icon after passkey creation +- Add form validation for passkey credential input +- implement passkey registration flow +- Add hidden input to store passkey credential data for form submission +- add CI workflow for deploying network +- add hway binary support and Homebrew formula +- remove username from passkey creation +- implement passkey registration flow +- add passkey creation functionality +- add CNAME for onsonr.dev domain + +### Fix + +- use Unix domain sockets for devnet processes +- correct workflow name and improve devnet deployment process +- correct title of profile creation page +- rename devbox start script to up and remove stop script +- Consolidate archive configuration and add LICENSE file +- Improve cross-browser passkey credential handling and encoding +- Remove commented-out code in passkey registration script +- remove line-clamp from tailwind config +- remove unnecessary background and restart settings from process-compose.yaml +- suppress process-compose server output and log to file + +### Refactor + +- remove unnecessary git fetch step in deploy workflow +- remove obsolete interchain test dependencies +- update index views to use new nebula components +- move Wasm related code to pkg/common/wasm +- migrate config package to pkg directory +- migrate to new configuration system and model definitions +- move session package to pkg directory +- Refactor registration forms to use UI components +- move gateway config to vault package +- improve command line flag descriptions and variable names +- refactor hway command to use echo framework for server +- Update root command to load EnvImpl from cobra flags +- Modify command flags and environment loading logic in cmds.go +- improve build process and move process-compose.yaml +- remove unused devbox.json and related configurations +- Improve mobile layout responsiveness for Rows and Columns components +- Remove max-w-fit from Rows component +- replace session package with context package +- rename database initialization function +- move session management to dedicated database module +- remove unused UI components related to wallet and index pages +- consolidate handlers into single files +- move gateway and vault packages to internal directory +- Move registration form components to dedicated directory +- remove unused devbox package +- remove devbox configuration +- move vault package to app directory +- improve code structure within gateway package +- move gateway package to app directory +- move vault package internal components to root +- migrate layout imports to common styles package +- Move form templates and styles to common directory +- consolidate authentication and DID handling logic +- Improve WebAuthn credential handling and validation in register finish route +- remove profile card component +- Simplify passkey registration UI and move profile component inline +- Update credential logging with transport and ID type +- Update register handler to use protocol.CredentialDescriptor struct +- Update credential handling to use protocol.CredentialDescriptor +- improve profile card styling and functionality +- Simplify session management and browser information extraction +- Update PeerInfo to extract and store comprehensive device information +- improve address display in property details +- remove unused documentation generation script +- replace sonr/pkg/styles/layout with nebula/ui/layout +- migrate UI components to nebula module +- improve scopes.json structure and update scripts for better usability + +## v0.5.20 (2024-12-07) + +### Refactor + +- simplify CI workflow by removing redundant asset publishing steps + +## v0.5.19 (2024-12-06) + +### Feat + +- add support for parent field and resources list in Capability message +- add fast reflection methods for Capability and Resource +- add gum package and update devbox configuration +- add new button components and layout improvements + +### Fix + +- adjust fullscreen modal close button margin +- update devbox lockfile +- resolve rendering issue in login modal + +### Refactor + +- rename accaddr package to address +- Update Credential table to match WebAuthn Credential Descriptor +- Deployment setup +- migrate build system from Taskfile to Makefile +- rename Assertion to Account and update related code +- remove unused TUI components +- Move IPFS interaction functions to common package +- remove dependency on DWN.pkl +- remove unused dependencies and simplify module imports +- Rename x/vault -> x/dwn and x/service -> x/svc +- move resolver formatter to services package +- remove web documentation +- update devbox configuration and scripts +- rename layout component to root +- refactor authentication pages into their own modules +- update templ version to v0.2.778 and remove unused air config +- move signer implementation to mpc package + +## v0.5.18 (2024-11-06) + +## v0.5.17 (2024-11-05) + +### Feat + +- add remote client constructor +- add avatar image components +- add SVG CDN Illustrations to marketing architecture +- **marketing**: refactor marketing page components +- Refactor intro video component to use a proper script template +- Move Alpine.js script initialization to separate component +- Add intro video modal component +- add homepage architecture section +- add Hero section component with stats and buttons +- **css**: add new utility classes for group hover +- implement authentication register finish endpoint +- add controller creation step to allocate +- Update service module README based on protobuf files +- Update x/macaroon/README.md with details from protobuf files +- update Vault README with details from proto files + +### Fix + +- update file paths in error messages +- update intro video modal script +- include assets generation in wasm build + +### Refactor + +- update marketing section architecture +- change verification table id +- **proto**: remove macaroon proto +- rename ValidateBasic to Validate +- rename session cookie key +- remove unused sync-initial endpoint +- remove formatter.go from service module + +## v0.5.16 (2024-10-21) + +## v0.5.15 (2024-10-21) + +## v0.5.14 (2024-10-21) + +### Refactor + +- remove StakingKeeper dependency from GlobalFeeDecorator + +## v0.5.13 (2024-10-21) + +### Feat + +- add custom secp256k1 pubkey + +### Refactor + +- update gRPC client to use new request types +- use RawPublicKey instead of PublicKey in macaroon issuer +- improve error handling in DID module + +## v0.5.12 (2024-10-18) + +### Feat + +- add User-Agent and Platform to session +- introduce AuthState enum for authentication state + +### Fix + +- **version**: revert version bump to 0.5.11 +- **version**: update version to 0.5.12 + +### Refactor + +- remove dependency on proto change detection +- update asset publishing configuration + +## v0.5.11 (2024-10-10) + +### Feat + +- nebula assets served from CDN +- use CDN for nebula frontend assets +- add static hero section content to homepage +- add wrangler scripts for development, build, and deployment +- remove build configuration +- move gateway web code to dedicated directory +- add PubKey fast reflection +- **macaroon**: add transaction allowlist/denylist caveats +- add PR labeler +- **devbox**: remove hway start command +- add GitHub Actions workflow for running tests +- add workflow for deploying Hway to Cloudflare Workers +- Publish configs to R2 +- integrate nebula UI with worker-assets-gen +- extract reusable layout components +- Implement service worker for IPFS vault +- implement CDN support for assets +- add payment method support +- add support for public key management +- add ModalForm component +- add LoginStart and RegisterStart routes +- implement authentication views +- add json tags to config structs +- implement templ forms for consent privacy, credential assert, credential register, and profile details +- **vault**: introduce assembly of the initial vault +- add client logos to homepage +- add tailwind utility classes +- implement new profile card component + +### Fix + +- Correct source directory for asset publishing +- install dependencies before nebula build +- update Schema service to use new API endpoint +- fix broken logo image path + +### Refactor + +- remove unnecessary branch configuration from scheduled release workflow +- update dwn configuration generation import path +- use nebula/routes instead of nebula/global +- move index template to routes package +- remove cdn package and move assets to global styles +- move nebula assets to hway build directory +- remove docker build and deployment +- rename internal/session package to internal/ctx +- remove unused fields from +- rename PR_TEMPLATE to PULL_REQUEST_TEMPLATE +- remove devbox.json init hook +- rename sonrd dockerfile to Dockerfile +- remove unused dependency +- rename 'global/cdn' to 'assets' +- move CDN assets to separate folder +- move Pkl module definitions to dedicated package +- move CDN assets to js/ folder +- remove unused component templates +- move ui components to global +- move view handlers to router package + +## v0.5.10 (2024-10-07) + +### Feat + +- **blocks**: remove button component + +## v0.5.9 (2024-10-06) + +### Feat + +- add Motr support +- update UIUX PKL to utilize optional fields + +### Fix + +- Update source directory for asset publishing + +## v0.5.8 (2024-10-04) + +### Refactor + +- Remove unused logs configuration + +## v0.5.7 (2024-10-04) + +### Feat + +- **devbox**: use process-compose for testnet services +- remove motr.mjs dependency +- add markdown rendering to issue templates +- update issue templates for better clarity +- add issue templates for tracking and task issues +- add issue templates for bug report and tracking +- introduce docker-compose based setup + +### Refactor + +- update issue template headings +- rename bug-report issue template to bug + +## v0.5.6 (2024-10-03) + +### Feat + +- add hway and sonr processes to dev environment + +## v0.5.5 (2024-10-03) + +### Feat + +- add rudimentary DidController table +- update home section with new features +- introduce Home model and refactor views +- **nebula**: create Home model for home page + +### Refactor + +- reorganize pkl files for better separation of concerns +- rename msg_server_test.go to rpc_test.go + +## v0.5.4 (2024-10-02) + +## v0.5.3 (2024-10-02) + +### Fix + +- remove unnecessary telegram message template + +## v0.5.2 (2024-10-02) + +### Feat + +- **service**: integrate group module (#1104) + +### Refactor + +- revert version bump to 0.5.1 + +## v0.5.1 (2024-10-02) + +### Refactor + +- move Motr API to state package + +## v0.5.0 (2024-10-02) + +### Feat + +- allow multiple macaroons with the same id + +## v0.4.5 (2024-10-02) + +### Fix + +- use correct secret for docker login + +## v0.4.4 (2024-10-02) + +## v0.4.3 (2024-10-02) + +### Feat + +- **release**: add docker images for sonrd and motr +- update homepage with new visual design +- add DID to vault genesis schema +- add video component +- add video component +- add hx-get attribute to primary button in hero section + +### Fix + +- **layout**: add missing favicon +- **hero**: Use hx-swap for primary button to prevent flicker + +### Refactor + +- use single GITHUB_TOKEN for release workflow +- update workflow variables + +## v0.4.2 (2024-10-01) + +### Refactor + +- use single GITHUB_TOKEN for release workflow + +## v0.4.1 (2024-10-01) + +### Feat + +- Implement session management +- allow manual release triggers +- add Input and RegistrationForm models +- add new utility classes +- add login and registration pages +- add tailwindcss utilities +- add support for ARM64 architecture +- add DWN resolver field +- add stats section to homepage +- implement hero section using Pkl +- add PKL schema for message formats +- add Homebrew tap for sonr +- update release workflow to use latest tag + +### Fix + +- **version**: update version number to 0.4.0 +- update release workflow to use latest tag +- **versioning**: revert version to 0.9.0 +- **cta**: Fix typo in CTA title +- change bento section title to reflect security focus +- adjust hero image dimensions +- **Input**: Change type from to +- update hero image height in config.pkl + +### Refactor + +- move home page sections to home package +- rename motrd to motr +- update hero image dimensions +- move nebula configuration to static file +- rename buf-publish.yml to publish-assets.yml +- remove unused field from + +## v0.4.0 (2024-09-30) + +### Feat + +- **dwn**: add wasm build for dwn +- add macaroon and oracle genesis states +- add scheduled binary release workflow +- introduce process-compose for process management +- add counter animation to hero section +- add registration page + +### Fix + +- Enable scheduled release workflow + +### Refactor + +- remove old changelog entries +- remove unnecessary checkout in scheduled-release workflow +- rename build ID to sonr +- remove unnecessary release existence check +- move dwn wasm build to pkg directory + +## v0.3.1 (2024-09-29) + +### Refactor + +- move nebula/pages to pkg/nebula/pages + +## v0.3.0 (2024-09-29) + +### Feat + +- add buf.lock for proto definitions + +### Fix + +- remove unused linting rules +- update proto breaking check target to master branch + +### Refactor + +- remove unused lock files and configurations + +## v0.2.0 (2024-09-29) + +### Feat + +- disable goreleaser workflow +- update workflows to include master branch +- remove global style declaration +- **oracle**: add oracle module +- optimize IPFS configuration for better performance +- add local IPFS bootstrap script and refactor devbox config +- add AllocateVault HTTP endpoint +- add WebAuthn credential management functionality +- remove unused coins interface +- remove global integrity proof from genesis state +- add vault module +- enable buf.build publishing on master and develop branches +- add Gitflow workflow for syncing branches +- add automated production release workflow +- **ui**: implement profile page +- add automated production release workflow +- **did**: remove unused proto files +- add enums.pulsar.go file for PermissionScope enum (#4) +- add initial DID implementation +- remove builder interface +- add basic UI for block explorer +- add Usage: pkl [OPTIONS] COMMAND [ARGS]... +- use SQLite embedded driver +- add DID method for each coin +- Expand KeyType enum and update KeyInfo message in genesis.proto +- Add whitelisted key types to genesis params +- Add DID grants protobuf definition +- Add fields to KeyInfo struct to distinguish CBOR and standard blockchain key types +- Add new message types for AssetInfo, ChainInfo, Endpoint, ExplorerInfo, FeeInfo, and KeyInfo +- run sonr-node container in testnet network and make network external +- Add docker-compose.yaml file to start a Sonr testnet node +- configure Sonr testnet environment +- Update Dockerfile to start and run a testnet +- add Equal methods for AssetInfo and ChainInfo types +- Add ProveWitness and SyncVault RPCs +- Add MsgRegisterService to handle service registration +- Add MsgRegisterService to handle service registration +- add enums.pulsar.go file for PermissionScope enum + +### Fix + +- ensure go version is up-to-date +- use GITHUB_TOKEN for version bump workflow +- update account table interface to use address, chain and network +- **ci**: update docker vm release workflow with new token +- use mnemonic phrases for test account keys +- reduce motr proxy shutdown timeout +- **nebula**: use bunx for tailwindcss build +- **proto**: update protobuf message index numbers +- **ante**: reduce POA rate floor and ceiling +- Update proc_list_width in mprocs.yaml +- Add service to database when registering +- pin added did documents to local ipfs node +- remove extra spaces in typeUrl +- **release**: remove unnecessary quotes in tag pattern +- remove unused imports and simplify KeyInfo message +- bind node ports to localhost +- Update docker-compose network name to dokploy-network +- Update network name to dokploy +- remove unused port mapping +- Update docker-compose.yaml to use correct volume path +- update docker-compose volume name +- Update docker-compose.yaml to use shell directly for sonrd command +- replace "sh" with "/bin/sh" in docker-compose.yaml command +- Update runner image dependencies for debian-11 +- **deps**: update golang image to 1.21 +- **chains**: update nomic chain build target +- Remove unused `Meta` message from `genesis.proto` +- Add ProveWitness and SyncVault RPCs + +### Refactor + +- adjust source directory for config files (#1102) +- Use actions/checkout@v4 +- remove unused master branch from CI workflow +- rename github token secret +- remove unnecessary x-cloak styles +- optimize oracle genesis proto +- remove unused code related to whitelisted assets +- update buf publish source directory +- adjust devbox configuration to reflect nebula changes +- rename msg_server.go to rpc.go +- remove devbox integration +- move dwn package to app/config +- move configuration files to app directory +- extract root command creation to separate file +- move ipfs setup to function +- remove unnecessary proxy config +- rename script to +- move DWN proxy server logic to separate file +- use htmx instead of dwn for vault client +- remove unused environment variables +- simplify verification method structure +- use staking keeper in DID keeper +- remove unused dependencies +- remove unused image building workflow +- add field to +- Update KeyKind Enum to have proper naming conventions +- Update `DIDNamespace` to have proper naming convention +- expose ports directly in docker-compose +- remove unused port mappings +- streamline script execution +- use CMD instead of ENTRYPOINT in Dockerfile +- **deps**: Upgrade Debian base image to 11 +- Simplify the types and properties to keep a consistent structure for the blockchain +- remove PERMISSION_SCOPE_IDENTIFIERS_ENS enum value diff --git a/docs/docs/guides/Chain-Modules.md b/docs/docs/guides/Chain-Modules.md new file mode 100644 index 000000000..e8d293492 --- /dev/null +++ b/docs/docs/guides/Chain-Modules.md @@ -0,0 +1,104 @@ +## `x/did` - Auth & AuthZ + +> The DID module is responsible for managing the creation and management of DIDs. +> Controllers represent on-chain accounts backed by a MPC keypair. Controllers +> provide methods for Wallet Account Abstraction (WAA) and are responsible for +> managing the creation and management of DIDs for an individual user. + +### Features + +- DID Controllers leverage the Cosmos SDK's `x/accounts` std interface for WAA. +- DIDs are represented by a `x/did` controller and are required to state the + controller's public key, and which map to the controller's capabilities. +- General Sign/Verify methods are provides from the QueryServer for HTTP requests. +- The Execute method is used to broadcast transactions across the network. (TODO) +- Biscuits are used to authenticate and authorize requests between services. (TODO) + +### References + +- [State](https://github.com/onsonr/sonr/tree/develop/x/did#state) +- [State Transitions](https://github.com/onsonr/sonr/tree/develop/x/did#state-transitions) +- [Messages](https://github.com/onsonr/sonr/tree/develop/x/did#messages) +- [Queries](https://github.com/onsonr/sonr/tree/develop/x/did#query) +- [Params](https://github.com/onsonr/sonr/tree/develop/x/did#params) +- [Client](https://github.com/onsonr/sonr/tree/develop/x/did#client) +- [Future Improvements](https://github.com/onsonr/sonr/tree/develop/x/did#future-improvements) +- [Tests](https://github.com/onsonr/sonr/tree/develop/x/did#tests) +- [Appendix](https://github.com/onsonr/sonr/tree/develop/x/did#appendix) + +--- + +## `x/macaroon` + +> The macaroon module is responsible for issuing and verifying macaroons. Macaroons +> are used to authenticate and authorize requests between services. +> Macaroons are requested by NFT Records from [`x/service`](2-‐-Modules-Overview.md#x-service) and granted by controllers from [`x/did`](2-‐-Modules-Overview.md#x/did) + +### Features + +- On Controller creation, a macaroon is created with an admin scope and a default expiry of _315,569,520 blocks (or ~10 years)_. +- On Service registration, a macaroon is created with a service scope and a default expiry of _31,556,952 blocks (or ~1 year)_. +- Macaroons contain the scope of access for a service and the expiry of the permissions in `blockHeight`. + +### References + +- [State](https://github.com/onsonr/sonr/tree/develop/x/macaroon#state) +- [State Transitions](https://github.com/onsonr/sonr/tree/develop/x/macaroon#state-transitions) +- [Messages](https://github.com/onsonr/sonr/tree/develop/x/macaroon#messages) +- [Queries](https://github.com/onsonr/sonr/tree/develop/x/macaroon#query) +- [Params](https://github.com/onsonr/sonr/tree/develop/x/macaroon#params) +- [Client](https://github.com/onsonr/sonr/tree/develop/x/macaroon#client) +- [Future Improvements](https://github.com/onsonr/sonr/tree/develop/x/macaroon#future-improvements) +- [Tests](https://github.com/onsonr/sonr/tree/develop/x/macaroon#tests) +- [Appendix](https://github.com/onsonr/sonr/tree/develop/x/macaroon#appendix) + +--- + +## `x/service` + +> The service module is responsible for managing decentralized services. Services +> on the Sonr network are essentially on-chain MultiSig wallets that are +> represented by a NFT. Service admins are represented by +> a [`x/did`](2-‐-Modules-Overview.md#x-did) controller and are required to state +> the service's scope of access, and which map to the services' capabilities. + +### Features + +- Needs a Valid Domain with .htaccess file to be whitelisted. + +### References + +- [State](https://github.com/onsonr/sonr/tree/develop/x/service#state) +- [State Transitions](https://github.com/onsonr/sonr/tree/develop/x/service#state-transitions) +- [Messages](https://github.com/onsonr/sonr/tree/develop/x/service#messages) +- [Queries](https://github.com/onsonr/sonr/tree/develop/x/service#query) +- [Params](https://github.com/onsonr/sonr/tree/develop/x/service#params) +- [Client](https://github.com/onsonr/sonr/tree/develop/x/service#client) +- [Future Improvements](https://github.com/onsonr/sonr/tree/develop/x/service#future-improvements) +- [Tests](https://github.com/onsonr/sonr/tree/develop/x/service#tests) +- [Appendix](https://github.com/onsonr/sonr/tree/develop/x/service#appendix) + +--- + +## `x/vault` + +> The vault module is responsible for managing the storage and acccess-control of +> Decentralized Web Nodes (DWNs) from IPFS. Vaults contain user-facing keys and +> are represented by a [`x/did`](2-‐-Modules-Overview.md#x-did) controller. + +### Features + +- Vaults can be created by anyone, but efforts are made to restrict 1 per user. +- Vaults are stored in IPFS and when claimed, the bech32 Sonr Address is pinned to IPFS. + +### References + +- [State](https://github.com/onsonr/sonr/tree/develop/x/vault#state) +- [State Transitions](https://github.com/onsonr/sonr/tree/develop/x/vault#state-transitions) +- [Messages](https://github.com/onsonr/sonr/tree/develop/x/vault#messages) +- [Queries](https://github.com/onsonr/sonr/tree/develop/x/vault#query) +- [Params](https://github.com/onsonr/sonr/tree/develop/x/vault#params) +- [Client](https://github.com/onsonr/sonr/tree/develop/x/vault#client) +- [Future Improvements](https://github.com/onsonr/sonr/tree/develop/x/vault#future-improvements) +- [Tests](https://github.com/onsonr/sonr/tree/develop/x/vault#tests) +- [Appendix](https://github.com/onsonr/sonr/tree/develop/x/vault#appendix) diff --git a/docs/docs/guides/Consumer-Launch.md b/docs/docs/guides/Consumer-Launch.md new file mode 100644 index 000000000..ea947bba7 --- /dev/null +++ b/docs/docs/guides/Consumer-Launch.md @@ -0,0 +1,170 @@ +# Consumer Chain Launch Process + +This guide is intended for consumer chain teams that are looking to be onboarded on to the Interchain Security testnet. + +## Interchain Security Testnet Overview + +- The Interchain Security (ICS) testnet is to be used to launch and test consumer chains. We recommend consumer chains to launch on the testnet before launching on the mainnet. +- All information about the ICS testnet is available in this [repository](https://github.com/cosmos/testnets/tree/master/interchain-security). +- The testnet coordinators (Hypha) have majority voting power in the ICS testnet. This means we need to work with you to bring your chain live and also to successfully pass any governance proposals you make. + +## Chain Onboarding Process + +For teams looking to join the ICS testnet, the onboarding process can be broken down in four phases: + +- Testing and Integration +- Planning with Testnet Coordinators +- Proposal Submission +- Chain Launch + +### Local Testing and Integration + +During this phase, your team will run integration tests with the following elements of an Interchain Security testnet: + +- Gaia provider chain + - Visit the provider chain [page](./provider/) for details on which Gaia version is currently being used. +- Relayers + - You will be responsible for running the relayer that relays the first set of Validator Set Change packets between provider and consumer chain. You should be proficient in setting up and running either [Hermes](https://github.com/informalsystems/hermes) or [rly](https://github.com/cosmos/relayer). + +By the end of this phase, you are able to launch a consumer chain within a local testnet or CI workflow that resembles the testnet (or mainnet) environment. + +### Planning with Testnet Coordinators + +Once you have a binary release ready, you can begin planning the launch with the testnet coordinators (Hypha). + +The goals of this phase are to update this repository with all the information validators need to join the network and to produce a `consumer-addition` proposal to be submitted in the provider chain. + +We expect you to run the minimum infrastructure required to make your consumer chain usable by testnet participants. This means running: + +1. **Seed/persistent nodes** +2. **Relayer** it must be launched before the chain times out, preferably right after blocks start being produced. + - **IMPORTANT**: Make sure you have funds to pay gas fees for the relayer. You will likely need to set up an adequately funded genesis account for this purpose. + +Additionally, you may want to run: + +- a faucet such as this simple [REST faucet](https://github.com/hyphacoop/cosmos-rest-faucet) (it may need a separate funded account in the genesis file as well) +- a block explorer such as [ping.pub](https://github.com/ping-pub/explorer) + +## ✍️ Submitting a PR for a new chain + +Each consumer chain gets its own directory. You can use the [`slasher`](./stopped/slasher/) chain as reference. Feel free to clone the slasher directory, modify it for your consumer chain, and make a PR with the relevant information. + +Hypha will be reviewing the PR to ensure it meets the following criteria: + +#### README includes: + +- [ ] Consumer chain repo and release or tag name. +- [ ] Build instructions for chain binary. +- [ ] Checksum of genesis file without CCV. +- [ ] Checksum of reference binary. +- [ ] Instructions on to join +- [ ] Installation steps +- Endpoints + - [ ] Seeds OR persistent peers + - [ ] State sync nodes (if any) + +See the `slasher` chain [page](./stopped/slasher) for reference. + +#### `chain_id` must be identical in the following places: + +- [ ] `README` +- [ ] genesis file +- [ ] consumer addition proposal +- [ ] bash script + +We recommend choosing a `chain_id` with the suffix `-1`, even if it's a subsequent test of the same chain, e.g. `testchain-second-rehearsal-1`. + +#### Binary checksum validation + +- [ ] `shasum -a 256 ` matches the checksum in the proposal +- [ ] `shasum -a 256 ` matches `README` + +#### Bash script + +- [ ] version built in script must match `README` +- [ ] seeds or persistent peers must match `README` + +#### Genesis file + +- [ ] Genesis time must match spawn time in the `consumer-addition` proposal +- [ ] Accounts and balances: Properly funded accounts (e.g., gas fees for relayer, faucet, etc.) +- [ ] Bank balance denom matches denom in `README` +- [ ] Slashing parameters: Set `signed_blocks_window` and `min_signed_per_window` adequately to ensure validators have at least 12 hours to join the chain after launch without getting jailed +- [ ] `shasum -a 256 ` matches the checksum in the proposal +- [ ] `shasum -a 256 ` matches the checksum in the `README` +- [ ] The genesis file is correctly formed: ` validate-genesis /path/to/genesis-without-ccv.json` returns without error + +See the `slasher` chain [genesis](./stopped/slasher/slasher-genesis-without-ccv.json) for reference. + +#### `consumer-addition` proposal + +- [ ] Spawn time must match genesis time +- [ ] Spawn time must be later than voting period +- [ ] `revision_height: 1` +- [ ] `revision_number: 1` (only if the `chain_id` ends in `-1`) +- [ ] `transfer_timeout_period: 1800000000000`. This value should be smaller than `blocks_per_distribution_transmission * block_time`. +- [ ] `ccv_timeout_period: 2419200000000000`. This value must be larger than the unbonding period, the default is 28 days. +- [ ] `unbonding_period: 1728000000000000` (given current provider params) + +See the `slasher` chain consumer-addition [proposal](./stopped/slasher/proposal-slasher.json) and [Interchain Security time-based parameters](https://github.com/cosmos/interchain-security/blob/main/docs/params.md#time-based-parameters) for reference. + +#### Node configurations + +- [ ] `minimum_gas_prices` +- [ ] Check with Hypha about any other chain-specific params + +--- + +### On-chain Proposal Submission + +When you make your proposal, please let us know well in advance. The current voting period is five minutes, which means we’ll need to vote right after you submit your proposal. We recommend submitting the proposal together with us on a call. + +The following will take place during the proposal submission phase: + +- Your team will submit the `consumer-addition` proposal with a command that looks like this: + ``` + gaiad tx gov submit-legacy-proposal consumer-addition proposal.json --from --chain-id provider --gas auto --fees 500uatom -b block -y + ``` +- Testnet coordinators will vote on it shortly afterwards to make sure it passes. +- You will open a pull request to add the new consumer chain entry to this repo and update the [schedule page](SCHEDULE.md) with the launch date. +- You will announce the upcoming launch, including the spawn time, in the Interchain Security `announcements` channel of the Cosmos Network Discord Server. If you need permissions for posting, please reach out to us. + +### Chain Launch + +After the spawn time is reached, the Cross-Chain Validation (CCV) state will be available on the provider chain and the new IBC client will be created. At this point, you will be able to: + +- Collect the Cross-Chain Validation (CCV) state from the provider chain. + ``` + gaiad q provider consumer-genesis -o json > ccv-state.json + ``` +- Update the genesis file with the CCV state. + ``` + jq -s '.[0].app_state.ccvconsumer = .[1] | .[0]' ccv-state.json > + ``` +- Publish the genesis file with CCV state to the testnets repo. +- Post the link to the genesis file and the SHA256 hash to the Interchain Security `interchain-security-testnet` channel of the Cosmos Network Discord Server. +- Ensure the required peers are online for people to connect to. + +The consumer chain will start producing blocks as soon as 66.67% of the provider chain's voting power comes online. You will be able to start the relayer afterwards: + +- Query the IBC client ID of the provider chain. + ``` + gaiad q provider list-consumer-chains + ``` +- Create the required IBC connections and channels for the CCV channel to be established. Using Hermes: + ``` + hermes create connection --a-chain --a-client 07-tendermint-0 --b-client + hermes create channel --a-chain --a-port consumer --b-port provider --order ordered --a-connection connection-0 --channel-version 1 + ``` +- Start the relayer + - The trusting period fraction is set to `0.25` on the provider chain, so you should use a trusting period of 5 days in your relayer configuration. + +Finally, the testnet coordinators will: + +- Trigger a validator set update in the provider chain to establish the CCV channel and verify the validator set has been updated in the consumer chain. +- Announce the chain is interchain secured. +- Update the testnets repo with the IBC information. + +## Talk to us + +If you're a consumer chain looking to launch, please get in touch with Hypha. You can reach Lexa Michaelides at `lexa@hypha.coop` or on Telegram. diff --git a/docs/docs/guides/Self-Custody.md b/docs/docs/guides/Self-Custody.md new file mode 100644 index 000000000..61f51ec9d --- /dev/null +++ b/docs/docs/guides/Self-Custody.md @@ -0,0 +1,10 @@ +> With increasingly sensitive information being stored in centralized databases, we +> believe that a decentralized anonymity mechanism is the only way to protect user data. +> Sonr is at its core a peer-to-peer identity system, which means that users can choose +> to share their identity with others in a way that is private and secure. + +# Decentralized Identifiers + +# Cross-chain Interoperability + +# W3C Web APIs diff --git a/docs/docs/guides/System-Architecture.md b/docs/docs/guides/System-Architecture.md new file mode 100644 index 000000000..79da6012b --- /dev/null +++ b/docs/docs/guides/System-Architecture.md @@ -0,0 +1,21 @@ +> Sonr is a decentralized platform that allows users to create and manage their own decentralized identity. + +# Blockchain: Sonr + +Sonr stores Decentralized Identifiers (DIDs) on its Cosmos-sdk based blockchain. The blockchain's role is to act as the +persistent pointer store for locations of User owned data. + +# User Key Vault: Motr + +The Motr node is a service-worker which functions as a personal encrypted key-enclave for users stored on IPFS. They can be allocated and persisted on the +Sonr blockchain for Smart Wallet functionality. + +# Network Gateway: Hway + +The Hway protocol is a network proxy which routes network requests to the appropriate service endpoint. This is used for seamless communication between +Blockchain Nodes, Decentralized Applications, and User Nodes. + +# Design System: Nebula + +Built with Golang-Templ, TailwindCSS, HTMX, and Service Workers - Nebula is a component library which allows for +consistent UX across the entire ecosystem. diff --git a/docs/docs/guides/Token-Economy.md b/docs/docs/guides/Token-Economy.md new file mode 100644 index 000000000..3219d20c2 --- /dev/null +++ b/docs/docs/guides/Token-Economy.md @@ -0,0 +1,13 @@ +> The `$SNR` token is the native platform token of the Sonr network. It is used by services to +> pay for Authentication and Authorization services. The system is designed for developers to +> be similar to centralized authentication providers like Google, Facebook, Okta, etc. + +# Usage + +The Sonr blockchain is a Delegated Proof of Stake (DPoS) blockchain built with the Cosmos-sdk. + +# Supply + +> The total supply of `$SNR` is fixed at 1 billion. + +![image](https://github.com/user-attachments/assets/8b9d6e6b-f3e5-464a-9032-6d8fe257a748) diff --git a/docs/docs/guides/nebula-ui.md b/docs/docs/guides/nebula-ui.md new file mode 100644 index 000000000..26f175e8b --- /dev/null +++ b/docs/docs/guides/nebula-ui.md @@ -0,0 +1,11 @@ +> In order to maintain a tight-knit experience, we designed Sonr to operate completely +> in the point-of-view of the user. This led to us building a Component Library which +> creates consistent UX across the entire ecosystem. + +# Overview + +The Sonr blockchain is a Delegated Proof of Stake (DPoS) blockchain built with the Cosmos-sdk. + +# Nebula Package + +> The total supply of `$SNR` is fixed at 1 billion. diff --git a/docs/docs/guides/sdk-usage.md b/docs/docs/guides/sdk-usage.md new file mode 100644 index 000000000..e8d293492 --- /dev/null +++ b/docs/docs/guides/sdk-usage.md @@ -0,0 +1,104 @@ +## `x/did` - Auth & AuthZ + +> The DID module is responsible for managing the creation and management of DIDs. +> Controllers represent on-chain accounts backed by a MPC keypair. Controllers +> provide methods for Wallet Account Abstraction (WAA) and are responsible for +> managing the creation and management of DIDs for an individual user. + +### Features + +- DID Controllers leverage the Cosmos SDK's `x/accounts` std interface for WAA. +- DIDs are represented by a `x/did` controller and are required to state the + controller's public key, and which map to the controller's capabilities. +- General Sign/Verify methods are provides from the QueryServer for HTTP requests. +- The Execute method is used to broadcast transactions across the network. (TODO) +- Biscuits are used to authenticate and authorize requests between services. (TODO) + +### References + +- [State](https://github.com/onsonr/sonr/tree/develop/x/did#state) +- [State Transitions](https://github.com/onsonr/sonr/tree/develop/x/did#state-transitions) +- [Messages](https://github.com/onsonr/sonr/tree/develop/x/did#messages) +- [Queries](https://github.com/onsonr/sonr/tree/develop/x/did#query) +- [Params](https://github.com/onsonr/sonr/tree/develop/x/did#params) +- [Client](https://github.com/onsonr/sonr/tree/develop/x/did#client) +- [Future Improvements](https://github.com/onsonr/sonr/tree/develop/x/did#future-improvements) +- [Tests](https://github.com/onsonr/sonr/tree/develop/x/did#tests) +- [Appendix](https://github.com/onsonr/sonr/tree/develop/x/did#appendix) + +--- + +## `x/macaroon` + +> The macaroon module is responsible for issuing and verifying macaroons. Macaroons +> are used to authenticate and authorize requests between services. +> Macaroons are requested by NFT Records from [`x/service`](2-‐-Modules-Overview.md#x-service) and granted by controllers from [`x/did`](2-‐-Modules-Overview.md#x/did) + +### Features + +- On Controller creation, a macaroon is created with an admin scope and a default expiry of _315,569,520 blocks (or ~10 years)_. +- On Service registration, a macaroon is created with a service scope and a default expiry of _31,556,952 blocks (or ~1 year)_. +- Macaroons contain the scope of access for a service and the expiry of the permissions in `blockHeight`. + +### References + +- [State](https://github.com/onsonr/sonr/tree/develop/x/macaroon#state) +- [State Transitions](https://github.com/onsonr/sonr/tree/develop/x/macaroon#state-transitions) +- [Messages](https://github.com/onsonr/sonr/tree/develop/x/macaroon#messages) +- [Queries](https://github.com/onsonr/sonr/tree/develop/x/macaroon#query) +- [Params](https://github.com/onsonr/sonr/tree/develop/x/macaroon#params) +- [Client](https://github.com/onsonr/sonr/tree/develop/x/macaroon#client) +- [Future Improvements](https://github.com/onsonr/sonr/tree/develop/x/macaroon#future-improvements) +- [Tests](https://github.com/onsonr/sonr/tree/develop/x/macaroon#tests) +- [Appendix](https://github.com/onsonr/sonr/tree/develop/x/macaroon#appendix) + +--- + +## `x/service` + +> The service module is responsible for managing decentralized services. Services +> on the Sonr network are essentially on-chain MultiSig wallets that are +> represented by a NFT. Service admins are represented by +> a [`x/did`](2-‐-Modules-Overview.md#x-did) controller and are required to state +> the service's scope of access, and which map to the services' capabilities. + +### Features + +- Needs a Valid Domain with .htaccess file to be whitelisted. + +### References + +- [State](https://github.com/onsonr/sonr/tree/develop/x/service#state) +- [State Transitions](https://github.com/onsonr/sonr/tree/develop/x/service#state-transitions) +- [Messages](https://github.com/onsonr/sonr/tree/develop/x/service#messages) +- [Queries](https://github.com/onsonr/sonr/tree/develop/x/service#query) +- [Params](https://github.com/onsonr/sonr/tree/develop/x/service#params) +- [Client](https://github.com/onsonr/sonr/tree/develop/x/service#client) +- [Future Improvements](https://github.com/onsonr/sonr/tree/develop/x/service#future-improvements) +- [Tests](https://github.com/onsonr/sonr/tree/develop/x/service#tests) +- [Appendix](https://github.com/onsonr/sonr/tree/develop/x/service#appendix) + +--- + +## `x/vault` + +> The vault module is responsible for managing the storage and acccess-control of +> Decentralized Web Nodes (DWNs) from IPFS. Vaults contain user-facing keys and +> are represented by a [`x/did`](2-‐-Modules-Overview.md#x-did) controller. + +### Features + +- Vaults can be created by anyone, but efforts are made to restrict 1 per user. +- Vaults are stored in IPFS and when claimed, the bech32 Sonr Address is pinned to IPFS. + +### References + +- [State](https://github.com/onsonr/sonr/tree/develop/x/vault#state) +- [State Transitions](https://github.com/onsonr/sonr/tree/develop/x/vault#state-transitions) +- [Messages](https://github.com/onsonr/sonr/tree/develop/x/vault#messages) +- [Queries](https://github.com/onsonr/sonr/tree/develop/x/vault#query) +- [Params](https://github.com/onsonr/sonr/tree/develop/x/vault#params) +- [Client](https://github.com/onsonr/sonr/tree/develop/x/vault#client) +- [Future Improvements](https://github.com/onsonr/sonr/tree/develop/x/vault#future-improvements) +- [Tests](https://github.com/onsonr/sonr/tree/develop/x/vault#tests) +- [Appendix](https://github.com/onsonr/sonr/tree/develop/x/vault#appendix) diff --git a/docs/docs/guides/svc-management.md b/docs/docs/guides/svc-management.md new file mode 100644 index 000000000..defd0740a --- /dev/null +++ b/docs/docs/guides/svc-management.md @@ -0,0 +1,11 @@ +> The `$SNR` token is the native platform token of the Sonr network. It is used by services to +> pay for Authentication and Authorization services. The system is designed for developers to +> be similar to centralized authentication providers like Google, Facebook, Okta, etc. + +# Usage + +The Sonr blockchain is a Delegated Proof of Stake (DPoS) blockchain built with the Cosmos-sdk. + +# Supply + +> The total supply of `$SNR` is fixed at 1 billion. diff --git a/docs/docs/guides/tools/cosmos-proto.md b/docs/docs/guides/tools/cosmos-proto.md new file mode 100644 index 000000000..9f44a5262 --- /dev/null +++ b/docs/docs/guides/tools/cosmos-proto.md @@ -0,0 +1,569 @@ +# Protocol Buffers in Cosmos SDK + +## Overview + +The Cosmos SDK uses Protocol Buffers for serialization and API definitions. Generation is handled via a Docker image: `ghcr.io/cosmos/proto-builder:0.15.x`. + +## Generation Tools + +- **Buf**: Primary tool for protobuf management +- **protocgen.sh**: Core generation script in `scripts/` +- **Makefile Commands**: Standard commands for generate, lint, format + +## Key Components + +### Buf Configuration + +1. **Workspace Setup** + - Root level buf workspace configuration + - Manages multiple protobuf directories + +2. **Directory Structure** + ``` + proto/ + ├── buf.gen.gogo.yaml # GoGo Protobuf generation + ├── buf.gen.pulsar.yaml # Pulsar API generation + ├── buf.gen.swagger.yaml # OpenAPI/Swagger docs + ├── buf.lock # Dependencies + ├── buf.yaml # Core configuration + ├── cosmos/ # Core protos + └── tendermint/ # Consensus protos + ``` + +3. **Module Protos** + - Located in `x/{moduleName}/proto` + - Module-specific message definitions + +#### `buf.gen.gogo.yaml` + +`buf.gen.gogo.yaml` defines how the protobuf files should be generated for use with in the module. This file uses [gogoproto](https://github.com/gogo/protobuf), a separate generator from the google go-proto generator that makes working with various objects more ergonomic, and it has more performant encode and decode steps + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/main/proto/buf.gen.gogo.yaml#L1-L9 +``` + +#### `buf.gen.pulsar.yaml` + +`buf.gen.pulsar.yaml` defines how protobuf files should be generated using the [new golang apiv2 of protobuf](https://go.dev/blog/protobuf-apiv2). This generator is used instead of the google go-proto generator because it has some extra helpers for Cosmos SDK applications and will have more performant encode and decode than the google go-proto generator. You can follow the development of this generator [here](https://github.com/cosmos/cosmos-proto). + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/main/proto/buf.gen.pulsar.yaml#L1-L18 +``` + +#### `buf.gen.swagger.yaml` + +`buf.gen.swagger.yaml` generates the swagger documentation for the query and messages of the chain. This will only define the REST API end points that were defined in the query and msg servers. You can find examples of this [here](https://github.com/cosmos/cosmos-sdk/blob/main/x/bank/proto/cosmos/bank/v1beta1/query.proto) + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/main/proto/buf.gen.swagger.yaml#L1-L6 +``` + +#### `buf.lock` + +This is an autogenerated file based off the dependencies required by the `.gen` files. There is no need to copy the current one. If you depend on cosmos-sdk proto definitions a new entry for the Cosmos SDK will need to be provided. The dependency you will need to use is `buf.build/cosmos/cosmos-sdk`. + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/main/proto/buf.lock#L1-L16 +``` + +#### `buf.yaml` + +`buf.yaml` defines the [name of your package](https://github.com/cosmos/cosmos-sdk/blob/main/proto/buf.yaml#L3), which [breakage checker](https://buf.build/docs/tutorials/getting-started-with-buf-cli#detect-breaking-changes) to use and how to [lint your protobuf files](https://buf.build/docs/tutorials/getting-started-with-buf-cli#lint-your-api). + +It is advised to use a tagged version of the buf modules corresponding to the version of the Cosmos SDK being are used. + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/main/proto/buf.yaml#L1-L24 +``` + +We use a variety of linters for the Cosmos SDK protobuf files. The repo also checks this in ci. +A reference to the github actions can be found [here](https://github.com/cosmos/cosmos-sdk/blob/main/.github/workflows/proto.yml#L1-L32) + +# ORM + +The Cosmos SDK ORM is a state management library that provides a rich, but opinionated set of tools for managing a +module's state. It provides support for: + +- type safe management of state +- multipart keys +- secondary indexes +- unique indexes +- easy prefix and range queries +- automatic genesis import/export +- automatic query services for clients, including support for light client proofs (still in development) +- indexing state data in external databases (still in development) + +## Design and Philosophy + +The ORM's data model is inspired by the relational data model found in SQL databases. The core abstraction is a table +with a primary key and optional secondary indexes. + +Because the Cosmos SDK uses protobuf as its encoding layer, ORM tables are defined directly in .proto files using +protobuf options. Each table is defined by a single protobuf `message` type and a schema of multiple tables is +represented by a single .proto file. + +Table structure is specified in the same file where messages are defined in order to make it easy to focus on better +design of the state layer. Because blockchain state layout is part of the public API for clients (TODO: link to docs on +light client proofs), it is important to think about the state layout as being part of the public API of a module. +Changing the state layout actually breaks clients, so it is ideal to think through it carefully up front and to aim for +a design that will eliminate or minimize breaking changes down the road. Also, good design of state enables building +more performant and sophisticated applications. Providing users with a set of tools inspired by relational databases +which have a long history of database design best practices and allowing schema to be specified declaratively in a +single place are design choices the ORM makes to enable better design and more durable APIs. + +Also, by only supporting the table abstraction as opposed to key-value pair maps, it is easy to add to new +columns/fields to any data structure without causing a breaking change and the data structures can easily be indexed in +any off-the-shelf SQL database for more sophisticated queries. + +The encoding of fields in keys is designed to support ordered iteration for all protobuf primitive field types +except for `bytes` as well as the well-known types `google.protobuf.Timestamp` and `google.protobuf.Duration`. Encodings +are optimized for storage space when it makes sense (see the documentation in `cosmos/orm/v1/orm.proto` for more details) +and table rows do not use extra storage space to store key fields in the value. + +We recommend that users of the ORM attempt to follow database design best practices such as +[normalization](https://en.wikipedia.org/wiki/Database_normalization) (at least 1NF). +For instance, defining `repeated` fields in a table is considered an anti-pattern because breaks first normal form (1NF). +Although we support `repeated` fields in tables, they cannot be used as key fields for this reason. This may seem +restrictive but years of best practice (and also experience in the SDK) have shown that following this pattern +leads to easier to maintain schemas. + +To illustrate the motivation for these principles with an example from the SDK, historically balances were stored +as a mapping from account -> map of denom to amount. This did not scale well because an account with 100 token balances +needed to be encoded/decoded every time a single coin balance changed. Now balances are stored as account,denom -> amount +as in the example above. With the ORM's data model, if we wanted to add a new field to `Balance` such as +`unlocked_balance` (if vesting accounts were redesigned in this way), it would be easy to add it to this table without +requiring a data migration. Because of the ORM's optimizations, the account and denom are only stored in the key part +of storage and not in the value leading to both a flexible data model and efficient usage of storage. + +## Defining Tables + +To define a table: + +1. create a .proto file to describe the module's state (naming it `state.proto` is recommended for consistency), + and import "cosmos/orm/v1/orm.proto", ex: + +```protobuf +syntax = "proto3"; +package bank_example; + +import "cosmos/orm/v1/orm.proto"; +``` + +2. define a `message` for the table, ex: + +```protobuf +message Balance { + bytes account = 1; + string denom = 2; + uint64 balance = 3; +} +``` + +3. add the `cosmos.orm.v1.table` option to the table and give the table an `id` unique within this .proto file: + +```protobuf +message Balance { + option (cosmos.orm.v1.table) = { + id: 1 + }; + + bytes account = 1; + string denom = 2; + uint64 balance = 3; +} +``` + +4. define the primary key field or fields, as a comma-separated list of the fields from the message which should make + up the primary key: + +```protobuf +message Balance { + option (cosmos.orm.v1.table) = { + id: 1 + primary_key: { fields: "account,denom" } + }; + + bytes account = 1; + string denom = 2; + uint64 balance = 3; +} +``` + +5. add any desired secondary indexes by specifying an `id` unique within the table and a comma-separate list of the + index fields: + +```protobuf +message Balance { + option (cosmos.orm.v1.table) = { + id: 1; + primary_key: { fields: "account,denom" } + index: { id: 1 fields: "denom" } // this allows querying for the accounts which own a denom + }; + + bytes account = 1; + string denom = 2; + uint64 amount = 3; +} +``` + +### Auto-incrementing Primary Keys + +A common pattern in SDK modules and in database design is to define tables with a single integer `id` field with an +automatically generated primary key. In the ORM we can do this by setting the `auto_increment` option to `true` on the +primary key, ex: + +```protobuf +message Account { + option (cosmos.orm.v1.table) = { + id: 2; + primary_key: { fields: "id", auto_increment: true } + }; + + uint64 id = 1; + bytes address = 2; +} +``` + +### Unique Indexes + +A unique index can be added by setting the `unique` option to `true` on an index, ex: + +```protobuf +message Account { + option (cosmos.orm.v1.table) = { + id: 2; + primary_key: { fields: "id", auto_increment: true } + index: {id: 1, fields: "address", unique: true} + }; + + uint64 id = 1; + bytes address = 2; +} +``` + +### Singletons + +The ORM also supports a special type of table with only one row called a `singleton`. This can be used for storing +module parameters. Singletons only need to define a unique `id` and that cannot conflict with the id of other +tables or singletons in the same .proto file. Ex: + +```protobuf +message Params { + option (cosmos.orm.v1.singleton) = { + id: 3; + }; + + google.protobuf.Duration voting_period = 1; + uint64 min_threshold = 2; +} +``` + +## Running Codegen + +NOTE: the ORM will only work with protobuf code that implements the [google.golang.org/protobuf](https://pkg.go.dev/google.golang.org/protobuf) +API. That means it will not work with code generated using gogo-proto. + +To install the ORM's code generator, run: + +```shell +go install cosmossdk.io/orm/cmd/protoc-gen-go-cosmos-orm@latest +``` + +The recommended way to run the code generator is to use [buf build](https://docs.buf.build/build/usage). +This is an example `buf.gen.yaml` that runs `protoc-gen-go`, `protoc-gen-go-grpc` and `protoc-gen-go-cosmos-orm` +using buf managed mode: + +```yaml +version: v1 +managed: + enabled: true + go_package_prefix: + default: foo.bar/api # the go package prefix of your package + override: + buf.build/cosmos/cosmos-sdk: cosmossdk.io/api # required to import the Cosmos SDK api module +plugins: + - name: go + out: . + opt: paths=source_relative + - name: go-grpc + out: . + opt: paths=source_relative + - name: go-cosmos-orm + out: . + opt: paths=source_relative +``` + +## Using the ORM in a module + +### Initialization + +To use the ORM in a module, first create a `ModuleSchemaDescriptor`. This tells the ORM which .proto files have defined +an ORM schema and assigns them all a unique non-zero id. Ex: + +```go +var MyModuleSchema = &ormv1alpha1.ModuleSchemaDescriptor{ + SchemaFile: []*ormv1alpha1.ModuleSchemaDescriptor_FileEntry{ + { + Id: 1, + ProtoFileName: mymodule.File_my_module_state_proto.Path(), + }, + }, +} +``` + +In the ORM generated code for a file named `state.proto`, there should be an interface `StateStore` that got generated +with a constructor `NewStateStore` that takes a parameter of type `ormdb.ModuleDB`. Add a reference to `StateStore` +to your module's keeper struct. Ex: + +```go +type Keeper struct { + db StateStore +} +``` + +Then instantiate the `StateStore` instance via an `ormdb.ModuleDB` that is instantiated from the `SchemaDescriptor` +above and one or more store services from `cosmossdk.io/core/store`. Ex: + +```go +func NewKeeper(storeService store.KVStoreService) (*Keeper, error) { + modDb, err := ormdb.NewModuleDB(MyModuleSchema, ormdb.ModuleDBOptions{KVStoreService: storeService}) + if err != nil { + return nil, err + } + db, err := NewStateStore(modDb) + if err != nil { + return nil, err + } + return Keeper{db: db}, nil +} +``` + +### Using the generated code + +The generated code for the ORM contains methods for inserting, updating, deleting and querying table entries. +For each table in a .proto file, there is a type-safe table interface implemented in generated code. For instance, +for a table named `Balance` there should be a `BalanceTable` interface that looks like this: + +```go +type BalanceTable interface { + Insert(ctx context.Context, balance *Balance) error + Update(ctx context.Context, balance *Balance) error + Save(ctx context.Context, balance *Balance) error + Delete(ctx context.Context, balance *Balance) error + Has(ctx context.Context, account []byte, denom string) (found bool, err error) + // Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. + Get(ctx context.Context, account []byte, denom string) (*Balance, error) + List(ctx context.Context, prefixKey BalanceIndexKey, opts ...ormlist.Option) (BalanceIterator, error) + ListRange(ctx context.Context, from, to BalanceIndexKey, opts ...ormlist.Option) (BalanceIterator, error) + DeleteBy(ctx context.Context, prefixKey BalanceIndexKey) error + DeleteRange(ctx context.Context, from, to BalanceIndexKey) error + + doNotImplement() +} +``` + +This `BalanceTable` should be accessible from the `StateStore` interface (assuming our file is named `state.proto`) +via a `BalanceTable()` accessor method. If all the above example tables/singletons were in the same `state.proto`, +then `StateStore` would get generated like this: + +```go +type BankStore interface { + BalanceTable() BalanceTable + AccountTable() AccountTable + ParamsTable() ParamsTable + + doNotImplement() +} +``` + +So to work with the `BalanceTable` in a keeper method we could use code like this: + +```go +func (k keeper) AddBalance(ctx context.Context, acct []byte, denom string, amount uint64) error { + balance, err := k.db.BalanceTable().Get(ctx, acct, denom) + if err != nil && !ormerrors.IsNotFound(err) { + return err + } + + if balance == nil { + balance = &Balance{ + Account: acct, + Denom: denom, + Amount: amount, + } + } else { + balance.Amount = balance.Amount + amount + } + + return k.db.BalanceTable().Save(ctx, balance) +} +``` + +`List` methods take `IndexKey` parameters. For instance, `BalanceTable.List` takes `BalanceIndexKey`. `BalanceIndexKey` +let's represent index keys for the different indexes (primary and secondary) on the `Balance` table. The primary key +in the `Balance` table gets a struct `BalanceAccountDenomIndexKey` and the first index gets an index key `BalanceDenomIndexKey`. +If we wanted to list all the denoms and amounts that an account holds, we would use `BalanceAccountDenomIndexKey` +with a `List` query just on the account prefix. Ex: + +```go +it, err := keeper.db.BalanceTable().List(ctx, BalanceAccountDenomIndexKey{}.WithAccount(acct)) +``` + +--- + +## sidebar_position: 1 + +# ProtocolBuffer Annotations + +This document explains the various protobuf scalars that have been added to make working with protobuf easier for Cosmos SDK application developers + +## Signer + +Signer specifies which field should be used to determine the signer of a message for the Cosmos SDK. This field can be used for clients as well to infer which field should be used to determine the signer of a message. + +Read more about the signer field [here](./02-messages-and-queries.md). + +```protobuf reference +https://github.com/cosmos/cosmos-sdk/blob/e6848d99b55a65d014375b295bdd7f9641aac95e/proto/cosmos/bank/v1beta1/tx.proto#L40 +``` + +```proto +option (cosmos.msg.v1.signer) = "from_address"; +``` + +## Scalar + +The scalar type defines a way for clients to understand how to construct protobuf messages according to what is expected by the module and sdk. + +```proto +(cosmos_proto.scalar) = "cosmos.AddressString" +``` + +Example of account address string scalar: + +```proto reference +https://github.com/cosmos/cosmos-sdk/blob/e6848d99b55a65d014375b295bdd7f9641aac95e/proto/cosmos/bank/v1beta1/tx.proto#L46 +``` + +Example of validator address string scalar: + +```proto reference +https://github.com/cosmos/cosmos-sdk/blob/e8f28bf5db18b8d6b7e0d94b542ce4cf48fed9d6/proto/cosmos/distribution/v1beta1/query.proto#L87 +``` + +Example of pubkey scalar: + +```proto reference +https://github.com/cosmos/cosmos-sdk/blob/11068bfbcd44a7db8af63b6a8aa079b1718f6040/proto/cosmos/staking/v1beta1/tx.proto#L94 +``` + +Example of Decimals scalar: + +```proto reference +https://github.com/cosmos/cosmos-sdk/blob/e8f28bf5db18b8d6b7e0d94b542ce4cf48fed9d6/proto/cosmos/distribution/v1beta1/distribution.proto#L26 +``` + +Example of Int scalar: + +```proto reference +https://github.com/cosmos/cosmos-sdk/blob/e8f28bf5db18b8d6b7e0d94b542ce4cf48fed9d6/proto/cosmos/gov/v1/gov.proto#L137 +``` + +There are a few options for what can be provided as a scalar: `cosmos.AddressString`, `cosmos.ValidatorAddressString`, `cosmos.ConsensusAddressString`, `cosmos.Int`, `cosmos.Dec`. + +## Implements_Interface + +Implement interface is used to provide information to client tooling like [telescope](https://github.com/cosmology-tech/telescope) on how to encode and decode protobuf messages. + +```proto +option (cosmos_proto.implements_interface) = "cosmos.auth.v1beta1.AccountI"; +``` + +## Method,Field,Message Added In + +`method_added_in`, `field_added_in` and `message_added_in` are annotations to denotate to clients that a field has been supported in a later version. This is useful when new methods or fields are added in later versions and that the client needs to be aware of what it can call. + +The annotation should be worded as follow: + +```proto +option (cosmos_proto.method_added_in) = "cosmos-sdk v0.50.1"; +option (cosmos_proto.method_added_in) = "x/epochs v1.0.0"; +option (cosmos_proto.method_added_in) = "simapp v24.0.0"; +``` + +## Amino + +The amino codec was removed in `v0.50+`, this means there is not a need register `legacyAminoCodec`. To replace the amino codec, Amino protobuf annotations are used to provide information to the amino codec on how to encode and decode protobuf messages. + +:::note +Amino annotations are only used for backwards compatibility with amino. New modules are not required use amino annotations. +::: + +The below annotations are used to provide information to the amino codec on how to encode and decode protobuf messages in a backwards compatible manner. + +### Name + +Name specifies the amino name that would show up for the user in order for them see which message they are signing. + +```proto +option (amino.name) = "cosmos-sdk/BaseAccount"; +``` + +```proto reference +https://github.com/cosmos/cosmos-sdk/blob/e8f28bf5db18b8d6b7e0d94b542ce4cf48fed9d6/proto/cosmos/bank/v1beta1/tx.proto#L41 +``` + +### Field_Name + +Field name specifies the amino name that would show up for the user in order for them see which field they are signing. + +```proto +uint64 height = 1 [(amino.field_name) = "public_key"]; +``` + +```proto reference +https://github.com/cosmos/cosmos-sdk/blob/e8f28bf5db18b8d6b7e0d94b542ce4cf48fed9d6/proto/cosmos/distribution/v1beta1/distribution.proto#L166 +``` + +### Dont_OmitEmpty + +Dont omitempty specifies that the field should not be omitted when encoding to amino. + +```proto +repeated cosmos.base.v1beta1.Coin amount = 3 [(amino.dont_omitempty) = true]; +``` + +```proto reference +https://github.com/cosmos/cosmos-sdk/blob/e8f28bf5db18b8d6b7e0d94b542ce4cf48fed9d6/proto/cosmos/bank/v1beta1/bank.proto#L56 +``` + +### Encoding + +Encoding instructs the amino json marshaler how to encode certain fields that may differ from the standard encoding behaviour. The most common example of this is how `repeated cosmos.base.v1beta1.Coin` is encoded when using the amino json encoding format. The `legacy_coins` option tells the json marshaler [how to encode a null slice](https://github.com/cosmos/cosmos-sdk/blob/e8f28bf5db18b8d6b7e0d94b542ce4cf48fed9d6/x/tx/signing/aminojson/json_marshal.go#L65) of `cosmos.base.v1beta1.Coin`. + +```proto +(amino.encoding) = "legacy_coins", +``` + +```proto reference +https://github.com/cosmos/cosmos-sdk/blob/e8f28bf5db18b8d6b7e0d94b542ce4cf48fed9d6/proto/cosmos/bank/v1beta1/genesis.proto#L23 +``` + +Another example is a protobuf `bytes` that contains a valid JSON document. +The `inline_json` option tells the json marshaler to embed the JSON bytes into the wrapping document without escaping. + +```proto +(amino.encoding) = "inline_json", +``` + +E.g. the bytes containing `{"foo":123}` in the `envelope` field would lead to the following JSON: + +```json +{ + "envelope": { + "foo": 123 + } +} +``` + +If the bytes are not valid JSON, this leads to JSON broken documents. Thus a JSON validity check needs to be in place at some point of the process. diff --git a/docs/docs/guides/tools/cosmos-rfc.md b/docs/docs/guides/tools/cosmos-rfc.md new file mode 100644 index 000000000..d1b9704c9 --- /dev/null +++ b/docs/docs/guides/tools/cosmos-rfc.md @@ -0,0 +1,627 @@ +# RFC 004: Account System Refactor + +## Status +- Draft v2 (May 2023) + +## Current Limitations + +1. **Account Representation**: Limited by `google.Protobuf.Any` encapsulation and basic authentication methods +2. **Interface Constraints**: Lacks support for advanced functionalities like vesting and complex auth systems +3. **Implementation Rigidity**: Poor differentiation between account types (e.g., `ModuleAccount`) +4. **Authorization System**: Basic `x/auth` module with limited scope beyond `x/bank` functionality +5. **Dependency Issues**: Cyclic dependencies between modules (e.g., `x/auth` ↔ `x/bank` for vesting) + +## Proposal + +This proposal aims to transform the way accounts are managed within the Cosmos SDK by introducing significant changes to +their structure and functionality. + +### Rethinking Account Representation and Business Logic + +Instead of representing accounts as simple `google.Protobuf.Any` structures stored in state with no business logic +attached, this proposal suggests a more sophisticated account representation that is closer to module entities. +In fact, accounts should be able to receive messages and process them in the same way modules do, and be capable of storing +state in a isolated (prefixed) portion of state belonging only to them, in the same way as modules do. + +### Account Message Reception + +We propose that accounts should be able to receive messages in the same way modules can, allowing them to manage their +own state modifications without relying on other modules. This change would enable more advanced account functionality, such as the +`VestingAccount` example, where the x/bank module previously needed to change the vestingState by casting the abstracted +account to `VestingAccount` and triggering the `TrackDelegation` call. Accounts are already capable of sending messages when +a state transition, originating from a transaction, is executed. + +When accounts receive messages, they will be able to identify the sender of the message and decide how to process the +state transition, if at all. + +### Consequences + +These changes would have significant implications for the Cosmos SDK, resulting in a system of actors that are equal from +the runtime perspective. The runtime would only be responsible for propagating messages between actors and would not +manage the authorization system. Instead, actors would manage their own authorizations. For instance, there would be no +need for the `x/auth` module to manage minting or burning of coins permissions, as it would fall within the scope of the +`x/bank` module. + +The key difference between accounts and modules would lie in the origin of the message (state transition). Accounts +(ExternallyOwnedAccount), which have credentials (e.g., a public/private key pairing), originate state transitions from +transactions. In contrast, module state transitions do not have authentication credentials backing them and can be +caused by two factors: either as a consequence of a state transition coming from a transaction or triggered by a scheduler +(e.g., the runtime's Begin/EndBlock). + +By implementing these proposed changes, the Cosmos SDK will benefit from a more extensible, versatile, and efficient account +management system that is better suited to address the requirements of the Cosmos ecosystem. + +#### Standardization + +With `x/accounts` allowing a modular api there becomes a need for standardization of accounts or the interfaces wallets and other clients should expect to use. For this reason we will be using the [`CIP` repo](https://github.com/cosmos/cips) in order to standardize interfaces in order for wallets to know what to expect when interacting with accounts. + +## Implementation + +### Account Definition + +We define the new `Account` type, which is what an account needs to implement to be treated as such. +An `Account` type is defined at APP level, so it cannot be dynamically loaded as the chain is running without upgrading the +node code, unless we create something like a `CosmWasmAccount` which is an account backed by an `x/wasm` contract. + +```go +// Account is what the developer implements to define an account. +type Account[InitMsg proto.Message] interface { + // Init is the function that initialises an account instance of a given kind. + // InitMsg is used to initialise the initial state of an account. + Init(ctx *Context, msg InitMsg) error + // RegisterExecuteHandlers registers an account's execution messages. + RegisterExecuteHandlers(executeRouter *ExecuteRouter) + // RegisterQueryHandlers registers an account's query messages. + RegisterQueryHandlers(queryRouter *QueryRouter) + // RegisterMigrationHandlers registers an account's migration messages. + RegisterMigrationHandlers(migrationRouter *MigrationRouter) +} +``` + +### The InternalAccount definition + +The public `Account` interface implementation is then converted by the runtime into an `InternalAccount` implementation, +which contains all the information and business logic needed to operate the account. + +```go +type Schema struct { + state StateSchema // represents the state of an account + init InitSchema // represents the init msg schema + exec ExecSchema // represents the multiple execution msg schemas, containing also responses + query QuerySchema // represents the multiple query msg schemas, containing also responses + migrate *MigrateSchema // represents the multiple migrate msg schemas, containing also responses, it's optional +} + +type InternalAccount struct { + init func(ctx *Context, msg proto.Message) (*InitResponse, error) + execute func(ctx *Context, msg proto.Message) (*ExecuteResponse, error) + query func(ctx *Context, msg proto.Message) (proto.Message, error) + schema func() *Schema + migrate func(ctx *Context, msg proto.Message) (*MigrateResponse, error) +} +``` + +This is an internal view of the account as intended by the system. It is not meant to be what developers implement. An +example implementation of the `InternalAccount` type can be found in [this](https://github.com/testinginprod/accounts-poc/blob/main/examples/recover/recover.go) +example of account whose credentials can be recovered. In fact, even if the `Internal` implementation is untyped (with +respect to `proto.Message`), the concrete implementation is fully typed. + +During any of the execution methods of `InternalAccount`, `schema` excluded, the account is given a `Context` which provides: + +- A namespaced `KVStore` for the account, which isolates the account state from others (NOTE: no `store keys` needed, + the account address serves as `store key`). +- Information regarding itself (its address) +- Information regarding the sender. +- ... + +#### Init + +Init defines the entrypoint that allows for a new account instance of a given kind to be initialised. +The account is passed some opaque protobuf message which is then interpreted and contains the instructions that +constitute the initial state of an account once it is deployed. + +An `Account` code can be deployed multiple times through the `Init` function, similar to how a `CosmWasm` contract code +can be deployed (Instantiated) multiple times. + +#### Execute + +Execute defines the entrypoint that allows an `Account` to process a state transition, the account can decide then how to +process the state transition based on the message provided and the sender of the transition. + +#### Query + +Query defines a read-only entrypoint that provides a stable interface that links an account with its state. The reason for +which `Query` is still being preferred as an addition to raw state reflection is to: + +- Provide a stable interface for querying (state can be optimised and change more frequently than a query) +- Provide a way to define an account `Interface` with respect to its `Read/Write` paths. +- Provide a way to query information that cannot be processed from raw state reflection, ex: compute information from lazy + state that has not been yet concretely processed (eg: balances with respect to lazy inputs/outputs) + +#### Schema + +Schema provides the definition of an account from `API` perspective, and it's the only thing that should be taken into account +when interacting with an account from another account or module, for example: an account is an `authz-interface` account if +it has the following message in its execution messages `MsgProxyStateTransition{ state_transition: google.Protobuf.Any }`. + +### Migrate + +Migrate defines the entrypoint that allows an `Account` to migrate its state from a previous version to a new one. Migrations +can be initiated only by the account itself, concretely this means that the migrate action sender can only be the account address +itself, if the account wants to allow another address to migrate it on its behalf then it could create an execution message +that makes the account migrate itself. + +### x/accounts module + +In order to create accounts we define a new module `x/accounts`, note that `x/accounts` deploys account with no authentication +credentials attached to it which means no action of an account can be incepted from a TX, we will later explore how the +`x/authn` module uses `x/accounts` to deploy authenticated accounts. + +This also has another important implication for which account addresses are now fully decoupled from the authentication mechanism +which makes in turn off-chain operations a little more complex, as the chain becomes the real link between account identifier +and credentials. + +We could also introduce a way to deterministically compute the account address. + +Note, from the transaction point of view, the `init_message` and `execute_message` are opaque `google.Protobuf.Any`. + +The module protobuf definition for `x/accounts` are the following: + +```protobuf +// Msg defines the Msg service. +service Msg { + rpc Deploy(MsgDeploy) returns (MsgDeployResponse); + rpc Execute(MsgExecute) returns (MsgExecuteResponse); + rpc Migrate(MsgMigrate) returns (MsgMigrateResponse); +} + +message MsgDeploy { + string sender = 1; + string kind = 2; + google.Protobuf.Any init_message = 3; + repeated google.Protobuf.Any authorize_messages = 4 [(gogoproto.nullable) = false]; +} + +message MsgDeployResponse { + string address = 1; + uint64 id = 2; + google.Protobuf.Any data = 3; +} + +message MsgExecute { + string sender = 1; + string address = 2; + google.Protobuf.Any message = 3; + repeated google.Protobuf.Any authorize_messages = 4 [(gogoproto.nullable) = false]; +} + +message MsgExecuteResponse { + google.Protobuf.Any data = 1; +} + +message MsgMigrate { + string sender = 1; + string new_account_kind = 2; + google.Protobuf.Any migrate_message = 3; +} + +message MsgMigrateResponse { + google.Protobuf.Any data = 1; +} + +``` + +#### MsgDeploy + +Deploys a new instance of the given account `kind` with initial settings represented by the `init_message` which is a `google.Protobuf.Any`. +Of course the `init_message` can be empty. A response is returned containing the account ID and humanised address, alongside some response +that the account instantiation might produce. + +#### Address derivation + +In order to decouple public keys from account addresses, we introduce a new address derivation mechanism which is + +#### MsgExecute + +Sends a `StateTransition` execution request, where the state transition is represented by the `message` which is a `google.Protobuf.Any`. +The account can then decide if to process it or not based on the `sender`. + +### MsgMigrate + +Migrates an account to a new version of itself, the new version is represented by the `new_account_kind`. The state transition +can only be incepted by the account itself, which means that the `sender` must be the account address itself. During the migration +the account current state is given to the new version of the account, which then executes the migration logic using the `migrate_message`, +it might change state or not, it's up to the account to decide. The response contains possible data that the account might produce +after the migration. + +#### Authorize Messages + +The `Deploy` and `Execute` messages have a field in common called `authorize_messages`, these messages are messages that the account +can execute on behalf of the sender. For example, in case an account is expecting some funds to be sent from the sender, +the sender can attach a `MsgSend` that the account can execute on the sender's behalf. These authorizations are short-lived, +they live only for the duration of the `Deploy` or `Execute` message execution, or until they are consumed. + +An alternative would have been to add a `funds` field, like it happens in cosmwasm, which guarantees the called contract that +the funds are available and sent in the context of the message execution. This would have been a simpler approach, but it would +have been limited to the context of `MsgSend` only, where the asset is `sdk.Coins`. The proposed generic way, instead, allows +the account to execute any message on behalf of the sender, which is more flexible, it could include NFT send execution, or +more complex things like `MsgMultiSend` or `MsgDelegate`, etc. + +### Further discussion + +#### Sub-accounts + +We could provide a way to link accounts to other accounts. Maybe during deployment the sender could decide to link the +newly created to its own account, although there might be use-cases for which the deployer is different from the account +that needs to be linked, in this case a handshake protocol on linking would need to be defined. + +#### Predictable address creation + +We need to provide a way to create an account with a predictable address, this might serve a lot of purposes, like accounts +wanting to generate an address that: + +- nobody else can claim besides the account used to generate the new account +- is predictable + +For example: + +```protobuf + +message MsgDeployPredictable { + string sender = 1; + uint32 nonce = 2; + ... +} +``` + +And then the address becomes `bechify(concat(sender, nonce))` + +`x/accounts` would still use the monotonically increasing sequence as account number. + +#### Joining Multiple Accounts + +As developers are building new kinds of accounts, it becomes necessary to provide a default way to combine the +functionalities of different account types. This allows developers to avoid duplicating code and enables end-users to +create or migrate to accounts with multiple functionalities without requiring custom development. + +To address this need, we propose the inclusion of a default account type called "MultiAccount". The MultiAccount type is +designed to merge the functionalities of other accounts by combining their execution, query, and migration APIs. +The account joining process would only fail in the case of API (intended as non-state Schema APIs) conflicts, ensuring +compatibility and consistency. + +With the introduction of the MultiAccount type, users would have the option to either migrate their existing accounts to +a MultiAccount type or extend an existing MultiAccount with newer APIs. This flexibility empowers users to leverage +various account functionalities without compromising compatibility or resorting to manual code duplication. + +The MultiAccount type serves as a standardized solution for combining different account functionalities within the +cosmos-sdk ecosystem. By adopting this approach, developers can streamline the development process and users can benefit +from a modular and extensible account system. + +# ADR 071: Cryptography v2- Multi-curve support + +## Change log + +- May 7th 2024: Initial Draft (Zondax AG: @raynaudoe @juliantoledano @jleni @educlerici-zondax @lucaslopezf) +- June 13th 2024: Add CometBFT implementation proposal (Zondax AG: @raynaudoe @juliantoledano @jleni @educlerici-zondax @lucaslopezf) +- July 2nd 2024: Split ADR proposal, add link to ADR in cosmos/crypto (Zondax AG: @raynaudoe @juliantoledano @jleni @educlerici-zondax @lucaslopezf) + +## Status + +DRAFT + +## Abstract + +This ADR proposes the refactoring of the existing `Keyring` and `cosmos-sdk/crypto` code to implement [ADR-001-CryptoProviders](https://github.com/cosmos/crypto/blob/main/docs/architecture/adr-001-crypto-provider.md). + +For in-depth details of the `CryptoProviders` and their design please refer to ADR mentioned above. + +## Introduction + +The introduction of multi-curve support in the cosmos-sdk cryptographic package offers significant advantages. By not being restricted to a single cryptographic curve, developers can choose the most appropriate curve based on security, performance, and compatibility requirements. This flexibility enhances the application's ability to adapt to evolving security standards and optimizes performance for specific use cases, helping to future-proofing the sdk's cryptographic capabilities. + +The enhancements in this proposal not only render the ["Keyring ADR"](https://github.com/cosmos/cosmos-sdk/issues/14940) obsolete, but also encompass its key aspects, replacing it with a more flexible and comprehensive approach. Furthermore, the gRPC service proposed in the mentioned ADR can be easily implemented as a specialized `CryptoProvider`. + +### Glossary + +1. **Interface**: In the context of this document, "interface" refers to Go's interface. + +2. **Module**: In this document, "module" refers to a Go module. + +3. **Package**: In the context of Go, a "package" refers to a unit of code organization. + +## Context + +In order to fully understand the need for changes and the proposed improvements, it's crucial to consider the current state of affairs: + +- The Cosmos SDK currently lacks a comprehensive ADR for the cryptographic package. + +- If a blockchain project requires a cryptographic curve that is not supported by the current SDK, the most likely scenario is that they will need to fork the SDK repository and make modifications. These modifications could potentially make the fork incompatible with future updates from the upstream SDK, complicating maintenance and integration. + +- Type leakage of specific crypto data types expose backward compatibility and extensibility challenges. + +- The demand for a more flexible and extensible approach to cryptography and address management is high. + +- Architectural changes are necessary to resolve many of the currently open issues related to new curves support. + +- There is a current trend towards modularity in the Interchain stack (e.g., runtime modules). + +- Security implications are a critical consideration during the redesign work. + +## Objectives + +The key objectives for this proposal are: + +- Leverage `CryptoProviders`: Utilize them as APIs for cryptographic tools, ensuring modularity, flexibility, and ease of integration. + +Developer-Centric Approach + +- Prioritize clear, intuitive interfaces and best-practice design principles. + +Quality Assurance + +- Enhanced Test Coverage: Improve testing methodologies to ensure the robustness and reliability of the module. + +## Technical Goals + +New Keyring: + +- Design a new `Keyring` interface with modular backends injection system to support hardware devices and cloud-based HSMs. This feature is optional and tied to complexity; if it proves too complex, it will be deferred to a future release as an enhancement. + +## Proposed architecture + +### Components + +The main components to be used will be the same as those found in the [ADR-001](https://github.com/cosmos/crypto/blob/main/docs/architecture/adr-001-crypto-provider.md#components). + +#### Storage and persistence + +The storage and persistence layer is tasked with storing a `CryptoProvider`s. Specifically, this layer must: + +- Securely store the crypto provider's associated private key (only if stored locally, otherwise a reference to the private key will be stored instead). +- Store the [`ProviderMetadata`](https://github.com/cosmos/crypto/blob/main/docs/architecture/adr-001-crypto-provider.md#metadata) struct which contains the data that distinguishes that provider. + +The purpose of this layer is to ensure that upon retrieval of the persisted data, we can access the provider's type, version, and specific configuration (which varies based on the provider type). This information will subsequently be utilized to initialize the appropriate factory, as detailed in the following section on the factory pattern. + +The storage proposal involves using a modified version of the [Record](https://github.com/cosmos/cosmos-sdk/blob/main/proto/cosmos/crypto/keyring/v1/record.proto) struct, which is already defined in **Keyring/v1**. Additionally, we propose utilizing the existing keyring backends (keychain, filesystem, memory, etc.) to store these `Record`s in the same manner as the current **Keyring/v1**. + +_Note: This approach will facilitate a smoother migration path from the current Keyring/v1 to the proposed architecture._ + +Below is the proposed protobuf message to be included in the modified `Record.proto` file + +##### Protobuf message structure + +The [record.proto](https://github.com/cosmos/cosmos-sdk/blob/main/proto/cosmos/crypto/keyring/v1/record.proto) file will be modified to include the `CryptoProvider` message as an optional field as follows. + +```protobuf + +// record.proto + +message Record { + string name = 1; + google.protobuf.Any pub_key = 2; + + oneof item { + Local local = 3; + Ledger ledger = 4; + Multi multi = 5; + Offline offline = 6; + CryptoProvider crypto_provider = 7; // <- New + } + + message Local { + google.protobuf.Any priv_key = 1; + } + + message Ledger { + hd.v1.BIP44Params path = 1; + } + + message Multi {} + + message Offline {} +} +``` + +##### Creating and loading a `CryptoProvider` + +For creating providers, we propose a _factory pattern_ and a _registry_ for these builders. Examples of these +patterns can be found [here](https://github.com/cosmos/crypto/blob/main/docs/architecture/adr-001-crypto-provider.md#illustrative-code-snippets) + +##### Keyring + +The new `Keyring` interface will serve as a central hub for managing and fetching `CryptoProviders`. To ensure a smoother migration path, the new Keyring will be backward compatible with the previous version. Since this will be the main API from which applications will obtain their `CryptoProvider` instances, the proposal is to extend the Keyring interface to include the methods: + +```go +type KeyringV2 interface { + // methods from Keyring/v1 + + // ListCryptoProviders returns a list of all the stored CryptoProvider metadata. + ListCryptoProviders() ([]ProviderMetadata, error) + + // GetCryptoProvider retrieves a specific CryptoProvider by its id. + GetCryptoProvider(id string) (CryptoProvider, error) +} +``` + +_Note_: Methods to obtain a provider from a public key or other means that make it easier to load the desired provider can be added. + +##### Especial use case: remote signers + +It's important to note that the `CryptoProvider` interface is versatile enough to be implemented as a remote signer. This capability allows for the integration of remote cryptographic operations, which can be particularly useful in distributed or cloud-based environments where local cryptographic resources are limited or need to be managed centrally. + +## Alternatives + +It is important to note that all the code presented in this document is not in its final form and could be subject to changes at the time of implementation. The examples and implementations discussed should be interpreted as alternatives, providing a conceptual framework rather than definitive solutions. This flexibility allows for adjustments based on further insights, technical evaluations, or changing requirements as development progresses. + +## Decision + +We will: + +- Leverage crypto providers +- Refactor the module structure as described above. +- Define types and interfaces as the code attached. +- Refactor existing code into new structure and interfaces. +- Implement Unit Tests to ensure no backward compatibility issues. + +## Consequences + +### Impact on the SDK codebase + +We can divide the impact of this ADR into two main categories: state machine code and client related code. + +#### Client + +The major impact will be on the client side, where the current `Keyring` interface will be replaced by the new `KeyringV2` interface. At first, the impact will be low since `CryptoProvider` is an optional field in the `Record` message, so there's no mandatory requirement for migrating to this new concept right away. This allows a progressive transition where the risks of breaking changes or regressions are minimized. + +#### State Machine + +The impact on the state machine code will be minimal, the modules affected (at the time of writing this ADR) +are the `x/accounts` module, specifically the `Authenticate` function and the `x/auth/ante` module. This function will need to be adapted to use a `CryptoProvider` service to make use of the `Verifier` instance. + +Worth mentioning that there's also the alternative of using `Verifier` instances in a standalone fashion (see note below). + +The specific way to adapt these modules will be deeply analyzed and decided at implementation time of this ADR. + +_Note_: All cryptographic tools (hashers, verifiers, signers, etc.) will continue to be available as standalone packages that can be imported and utilized directly without the need for a `CryptoProvider` instance. However, the `CryptoProvider` is the recommended method for using these tools as it offers a more secure way to handle sensitive data, enhanced modularity, and the ability to store configurations and metadata within the `CryptoProvider` definition. + +### Backwards Compatibility + +The proposed migration path is similar to what the cosmos-sdk has done in the past. To ensure a smooth transition, the following steps will be taken: + +Once ADR-001 is implemented with a stable release: + +- Deprecate the old crypto package. The old crypto package will still be usable, but it will be marked as deprecated and users can opt to use the new package. +- Migrate the codebase to use the new cosmos/crypto package and remove the old crypto one. + +### Positive + +- Single place of truth +- Easier to use interfaces +- Easier to extend +- Unit test for each crypto package +- Greater maintainability +- Incentivize addition of implementations instead of forks +- Decoupling behavior from implementation +- Sanitization of code + +### Negative + +- It will involve an effort to adapt existing code. +- It will require attention to detail and audition. + +### Neutral + +- It will involve extensive testing. + +## Test Cases + +- The code will be unit tested to ensure a high code coverage +- There should be integration tests around Keyring and CryptoProviders. + +> While an ADR is in the DRAFT or PROPOSED stage, this section should contain a +> summary of issues to be solved in future iterations (usually referencing comments +> from a pull-request discussion). +> +> Later, this section can optionally list ideas or improvements the author or +> reviewers found during the analysis of this ADR. + +# ADR-71 Bank V2 + +## Status + +DRAFT + +## Changelog + +- 2024-05-08: Initial Draft (@samricotta, @julienrbrt) + +## Abstract + +The primary objective of refactoring the bank module is to simplify and enhance the functionality of the Cosmos SDK. Over time the bank module has been burdened with numerous responsibilities including transaction handling, account restrictions, delegation counting, and the minting and burning of coins. + +In addition to the above, the bank module is currently too rigid and handles too many tasks, so this proposal aims to streamline the module by focusing on core functions `Send`, `Mint`, and `Burn`. + +Currently, the module is split across different keepers with scattered and duplicates functionalities (with 4 send functions for instance). + +Additionally, the integration of the token factory into the bank module allows for standardization, and better integration within the core modules. + +This rewrite will reduce complexity and enhance the efficiency and UX of the bank module. + +## Context + +The current implementation of the bank module is characterised by its handling of a broad array of functions, leading to significant complexity in using and extending the bank module. + +These issues have underscored the need for a refactoring strategy that simplifies the module’s architecture and focuses on its most essential operations. + +Additionally, there is an overlap in functionality with a Token Factory module, which could be integrated to streamline oper. + +## Decision + +**Permission Tightening**: Access to the module can be restricted to selected denominations only, ensuring that it operates within designated boundaries and does not exceed its intended scope. Currently, the permissions allow all denoms, so this should be changed. Send restrictions functionality will be maintained. + +**Simplification of Logic**: The bank module will focus on core functionalities `Send`, `Mint`, and `Burn`. This refinement aims to streamline the architecture, enhancing both maintainability and performance. + +**Integration of Token Factory**: The Token Factory will be merged into the bank module. This consolidation of related functionalities aims to reduce redundancy and enhance coherence within the system. Migrations functions will be provided for migrating from Osmosis' Token Factory module to bank/v2. + +**Legacy Support**: A legacy wrapper will be implemented to ensure compatibility with about 90% of existing functions. This measure will facilitate a smooth transition while keeping older systems functional. + +**Denom Implementation**: A asset interface will be added to standardise interactions such as transfers, balance inquiries, minting, and burning across different tokens. This will allow the bank module to support arbitrary asset types, enabling developers to implement custom, ERC20-like denominations. + +For example, currently if a team would like to extend the transfer method the changes would apply universally, affecting all denom’s. With the proposed Asset Interface, it allows teams to customise or extend the transfer method specifically for their own tokens without impacting others. + +These improvements are expected to enhance the flexibility of the bank module, allowing for the creation of custom tokens similar to ERC20 standards and assets backed by CosmWasm (CW) contracts. The integration efforts will also aim to unify CW20 with bank coins across the Cosmos chains. + +Example of denom interface: + +```go +type AssetInterface interface { + Transfer(ctx sdk.Context, from sdk.AccAddress, to sdk.AccAddress, amount sdk.Coin) error + Mint(ctx sdk.Context, to sdk.AccAddress, amount sdk.Coin) error + Burn(ctx sdk.Context, from sdk.AccAddress, amount sdk.Coin) error + QueryBalance(ctx sdk.Context, account sdk.AccAddress) (sdk.Coin, error) +} +``` + +Overview of flow: + +1. Alice initiates a transfer by entering Bob's address and the amount (100 ATOM) +2. The Bank module verifies that the ATOM token implements the `AssetInterface` by querying the `ATOM_Denom_Account`, which is an `x/account` denom account. +3. The Bank module executes the transfer by subtracting 100 ATOM from Alice’s balance and adding 100 ATOM to Bob’s balance. +4. The Bank module calls the Transfer method on the `ATOM_Denom_Account`. The Transfer method, defined in the `AssetInterface`, handles the logic to subtract 100 ATOM from Alice’s balance and add 100 ATOM to Bob’s balance. +5. The Bank module updates the chain and returns the new balances. +6. Both Alice and Bob successfully receive the updated balances. + +## Migration Plans + +Bank is a widely used module, so getting a v2 needs to be thought thoroughly. In order to not force all dependencies to immediately migrate to bank/v2, the same _upgrading_ path will be taken as for the `gov` module. + +This means `cosmossdk.io/bank` will stay one module and there won't be a new `cosmossdk.io/bank/v2` go module. Instead the bank protos will be versioned from `v1beta1` (current bank) to `v2`. + +Bank `v1beta1` endpoints will use the new bank v2 implementation for maximum backward compatibility. + +The bank `v1beta1` keepers will be deprecated and potentially eventually removed, but its proto and messages definitions will remain. + +Additionally, as bank plans to integrate token factory, migrations functions will be provided to migrate from Osmosis token factory implementation (most widely used implementation) to the new bank/v2 token factory. + +## Consequences + +### Positive + +- Simplified interaction with bank APIs +- Backward compatible changes (no contracts or apis broken) +- Optional migration (note: bank `v1beta1` won't get any new feature after bank `v2` release) + +### Neutral + +- Asset implementation not available cross-chain (IBC-ed custom asset should possibly fallback to the default implementation) +- Many assets may slow down bank balances requests + +### Negative + +- Temporarily duplicate functionalities as bank `v1beta1` are `v2` are living alongside +- Difficultity to ever completely remove bank `v1beta1` + +### References + +- Current bank module implementation: https://github.com/cosmos/cosmos-sdk/blob/v0.50.6/x/bank/keeper/keeper.go#L22-L53 +- Osmosis token factory: https://github.com/osmosis-labs/osmosis/tree/v25.0.0/x/tokenfactory/keeper diff --git a/docs/docs/guides/tools/cosmos-sdk.md b/docs/docs/guides/tools/cosmos-sdk.md new file mode 100644 index 000000000..6679af362 --- /dev/null +++ b/docs/docs/guides/tools/cosmos-sdk.md @@ -0,0 +1,685 @@ +# Cosmos SDK Core Components + +## Overview + +The Cosmos SDK is a framework for building secure blockchain applications on CometBFT. It provides: + +- ABCI implementation in Go +- Multi-store persistence layer +- Transaction routing system + +## Transaction Flow + +1. CometBFT consensus delivers transaction bytes +2. SDK decodes transactions and extracts messages +3. Messages routed to appropriate modules +4. State changes committed to stores + +```mermaid +graph TD + A[CometBFT] -->|Tx Bytes| B[SDK Decode] + B -->|Messages| C[Module Router] + C -->|State Changes| D[Multi-store] +``` + +## `baseapp` + +`baseapp` is the boilerplate implementation of a Cosmos SDK application. It comes with an implementation of the ABCI to handle the connection with the underlying consensus engine. Typically, a Cosmos SDK application extends `baseapp` by embedding it in [`app.go`](../beginner/00-app-anatomy.md#core-application-file). + +Here is an example of this from `simapp`, the Cosmos SDK demonstration app: + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/v0.52.0-beta.1/simapp/app.go#L145-L186 +``` + +The goal of `baseapp` is to provide a secure interface between the store and the extensible state machine while defining as little about the state machine as possible (staying true to the ABCI). + +For more on `baseapp`, please click [here](../advanced/00-baseapp.md). + +## Multistore + +The Cosmos SDK provides a [`multistore`](../advanced/04-store.md#multistore) for persisting state. The multistore allows developers to declare any number of [`KVStores`](../advanced/04-store.md#base-layer-kvstores). These `KVStores` only accept the `[]byte` type as value and therefore any custom structure needs to be marshalled using [a codec](../advanced/05-encoding.md) before being stored. + +The multistore abstraction is used to divide the state in distinct compartments, each managed by its own module. For more on the multistore, click [here](../advanced/04-store.md#multistore). + +## Modules + +The power of the Cosmos SDK lies in its modularity. Cosmos SDK applications are built by aggregating a collection of interoperable modules. Each module defines a subset of the state and contains its own message/transaction processor, while the Cosmos SDK is responsible for routing each message to its respective module. + +Here is a simplified view of how a transaction is processed by the application of each full-node when it is received in a valid block: + +```mermaid + flowchart TD + A[Transaction relayed from the full-node's CometBFT engine to the node's application via DeliverTx] --> B[APPLICATION] + B -->|"Using baseapp's methods: Decode the Tx, extract and route the message(s)"| C[Message routed to the correct module to be processed] + C --> D1[AUTH MODULE] + C --> D2[BANK MODULE] + C --> D3[STAKING MODULE] + C --> D4[GOV MODULE] + D1 -->|Handle message, Update state| E["Return result to CometBFT (0=Ok, 1=Err)"] + D2 -->|Handle message, Update state| E["Return result to CometBFT (0=Ok, 1=Err)"] + D3 -->|Handle message, Update state| E["Return result to CometBFT (0=Ok, 1=Err)"] + D4 -->|Handle message, Update state| E["Return result to CometBFT (0=Ok, 1=Err)"] +``` + +Each module can be seen as a little state-machine. Developers need to define the subset of the state handled by the module, as well as custom message types that modify the state (_Note:_ `messages` are extracted from `transactions` by `baseapp`). In general, each module declares its own `KVStore` in the `multistore` to persist the subset of the state it defines. Most developers will need to access other 3rd party modules when building their own modules. Given that the Cosmos SDK is an open framework, some of the modules may be malicious, which means there is a need for security principles to reason about inter-module interactions. These principles are based on [object-capabilities](../advanced/10-ocap.md). In practice, this means that instead of having each module keep an access control list for other modules, each module implements special objects called `keepers` that can be passed to other modules to grant a pre-defined set of capabilities. + +Cosmos SDK modules are defined in the `x/` folder of the Cosmos SDK. Some core modules include: + +- `x/auth`: Used to manage accounts and signatures. +- `x/bank`: Used to enable tokens and token transfers. +- `x/staking` + `x/slashing`: Used to build Proof-of-Stake blockchains. + +In addition to the already existing modules in `x/`, which anyone can use in their app, the Cosmos SDK lets you build your own custom modules. You can check an [example of that in the tutorial](https://tutorials.cosmos.network/).# Keepers + +:::note Synopsis +`Keeper`s refer to a Cosmos SDK abstraction whose role is to manage access to the subset of the state defined by various modules. `Keeper`s are module-specific, i.e. the subset of state defined by a module can only be accessed by a `keeper` defined in said module. If a module needs to access the subset of state defined by another module, a reference to the second module's internal `keeper` needs to be passed to the first one. This is done in `app.go` during the instantiation of module keepers. +::: + +:::note Pre-requisite Readings + +- [Introduction to Cosmos SDK Modules](./00-intro.md) + +::: + +## Motivation + +The Cosmos SDK is a framework that makes it easy for developers to build complex decentralized applications from scratch, mainly by composing modules together. As the ecosystem of open-source modules for the Cosmos SDK expands, it will become increasingly likely that some of these modules contain vulnerabilities, as a result of the negligence or malice of their developer. + +The Cosmos SDK adopts an [object-capabilities-based approach](https://docs.cosmos.network/main/learn/advanced/ocap#ocaps-in-practice) to help developers better protect their application from unwanted inter-module interactions, and `keeper`s are at the core of this approach. A `keeper` can be considered quite literally to be the gatekeeper of a module's store(s). Each store (typically an [`IAVL` Store](../../learn/advanced/04-store.md#iavl-store)) defined within a module comes with a `storeKey`, which grants unlimited access to it. The module's `keeper` holds this `storeKey` (which should otherwise remain unexposed), and defines [methods](#implementing-methods) for reading and writing to the store(s). + +The core idea behind the object-capabilities approach is to only reveal what is necessary to get the work done. In practice, this means that instead of handling permissions of modules through access-control lists, module `keeper`s are passed a reference to the specific instance of the other modules' `keeper`s that they need to access (this is done in the [application's constructor function](../../learn/beginner/00-app-anatomy.md#constructor-function)). As a consequence, a module can only interact with the subset of state defined in another module via the methods exposed by the instance of the other module's `keeper`. This is a great way for developers to control the interactions that their own module can have with modules developed by external developers. + +## Type Definition + +`keeper`s are generally implemented in a `/keeper/keeper.go` file located in the module's folder. By convention, the type `keeper` of a module is simply named `Keeper` and usually follows the following structure: + +```go +type Keeper struct { + // External keepers, if any + + // Store key(s) + + // codec + + // authority +} +``` + +For example, here is the type definition of the `keeper` from the `staking` module: + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/v0.52.0-beta.1/x/staking/keeper/keeper.go#L54-L115 +``` + +Let us go through the different parameters: + +- An expected `keeper` is a `keeper` external to a module that is required by the internal `keeper` of said module. External `keeper`s are listed in the internal `keeper`'s type definition as interfaces. These interfaces are themselves defined in an `expected_keepers.go` file in the root of the module's folder. In this context, interfaces are used to reduce the number of dependencies, as well as to facilitate the maintenance of the module itself. +- `KVStoreService`s grant access to the store(s) of the [multistore](../../learn/advanced/04-store.md) managed by the module. They should always remain unexposed to external modules. +- `cdc` is the [codec](../../learn/advanced/05-encoding.md) used to marshal and unmarshal structs to/from `[]byte`. The `cdc` can be any of `codec.BinaryCodec`, `codec.JSONCodec` or `codec.Codec` based on your requirements. It can be either a proto or amino codec as long as they implement these interfaces. +- The authority listed is a module account or user account that has the right to change module level parameters. Previously this was handled by the param module, which has been deprecated. + +Of course, it is possible to define different types of internal `keeper`s for the same module (e.g. a read-only `keeper`). Each type of `keeper` comes with its own constructor function, which is called from the [application's constructor function](../../learn/beginner/00-app-anatomy.md). This is where `keeper`s are instantiated, and where developers make sure to pass correct instances of modules' `keeper`s to other modules that require them. + +## Implementing Methods + +`Keeper`s primarily expose methods for business logic, as validity checks should have already been performed by the [`Msg` server](./03-msg-services.md) when `keeper`s' methods are called. + + + +State management is recommended to be done via [Collections](../packages/collections) + + + +## State Management + +In the Cosmos SDK, it is crucial to be methodical and selective when managing state within a module, as improper state management can lead to inefficiency, security risks, and scalability issues. Not all data belongs in the on-chain state; it's important to store only essential blockchain data that needs to be verified by consensus. Storing unnecessary information, especially client-side data, can bloat the state and slow down performance. Instead, developers should focus on using an off-chain database to handle supplementary data, extending the API as needed. This approach minimizes on-chain complexity, optimizes resource usage, and keeps the blockchain state lean and efficient, ensuring scalability and smooth operations. + +The Cosmos SDK leverages Protocol Buffers (protobuf) for efficient state management, providing a well-structured, binary encoding format that ensures compatibility and performance across different modules. The SDK’s recommended approach for managing state is through the [collections package](../pacakges/02-collections.md), which simplifies state handling by offering predefined data structures like maps and indexed sets, reducing the complexity of managing raw state data. While users can opt for custom encoding schemes if they need more flexibility or have specialized requirements, they should be aware that such custom implementations may not integrate seamlessly with indexers that decode state data on the fly. This could lead to challenges in data retrieval, querying, and interoperability, making protobuf a safer and more future-proof choice for most use cases. + +# Folder Structure + +:::note Synopsis +This document outlines the structure of Cosmos SDK modules. These ideas are meant to be applied as suggestions. Application developers are encouraged to improve upon and contribute to module structure and development design. + +The required interface for a module is located in the module.go. Everything beyond this is suggestive. +::: + +## Structure + +A typical Cosmos SDK module can be structured as follows: + +```shell +proto +└── {project_name} +    └── {module_name} +    └── {proto_version} +       ├── {module_name}.proto +       ├── genesis.proto +       ├── query.proto +       └── tx.proto +``` + +- `{module_name}.proto`: The module's common message type definitions. +- `genesis.proto`: The module's message type definitions related to genesis state. +- `query.proto`: The module's Query service and related message type definitions. +- `tx.proto`: The module's Msg service and related message type definitions. + +```shell +x/{module_name} +├── client +│   ├── cli +│   │ ├── query.go +│   │   └── tx.go +│   └── testutil +│   ├── cli_test.go +│   └── suite.go +├── exported +│   └── exported.go +├── keeper +│   ├── genesis.go +│   ├── grpc_query.go +│   ├── hooks.go +│   ├── invariants.go +│   ├── keeper.go +│   ├── keys.go +│   ├── msg_server.go +│   └── querier.go +├── simulation +│   ├── decoder.go +│   ├── genesis.go +│   ├── operations.go +│   └── params.go +├── types +│   ├── {module_name}.pb.go +│ ├── codec.go +│ ├── errors.go +│ ├── events.go +│ ├── events.pb.go +│ ├── expected_keepers.go +│ ├── genesis.go +│ ├── genesis.pb.go +│ ├── keys.go +│ ├── msgs.go +│ ├── params.go +│ ├── query.pb.go +│ └── tx.pb.go +├── module.go +├── abci.go +├── autocli.go +├── depinject.go +└── README.md +``` + +- `client/`: The module's CLI client functionality implementation and the module's CLI testing suite. +- `exported/`: The module's exported types - typically interface types. If a module relies on keepers from another module, it is expected to receive the keepers as interface contracts through the `expected_keepers.go` file (see below) in order to avoid a direct dependency on the module implementing the keepers. However, these interface contracts can define methods that operate on and/or return types that are specific to the module that is implementing the keepers and this is where `exported/` comes into play. The interface types that are defined in `exported/` use canonical types, allowing for the module to receive the keepers as interface contracts through the `expected_keepers.go` file. This pattern allows for code to remain DRY and also alleviates import cycle chaos. +- `keeper/`: The module's `Keeper` and `MsgServer` implementation. + - `abci.go`: The module's `BeginBlocker` and `EndBlocker` implementations (this file is only required if `BeginBlocker` and/or `EndBlocker` need to be defined). +- `simulation/`: The module's [simulation](./14-simulator.md) package defines functions used by the blockchain simulator application (`simapp`). +- `README.md`: The module's specification documents outlining important concepts, state storage structure, and message and event type definitions. Learn more how to write module specs in the [spec guidelines](../spec/SPEC_MODULE.md). +- `types/`: includes type definitions for messages, events, and genesis state, including the type definitions generated by Protocol Buffers. + - `codec.go`: The module's registry methods for interface types. + - `errors.go`: The module's sentinel errors. + - `events.go`: The module's event types and constructors. + - `expected_keepers.go`: The module's [expected keeper](./06-keeper.md#type-definition) interfaces. + - `genesis.go`: The module's genesis state methods and helper functions. + - `keys.go`: The module's store keys and associated helper functions. + - `msgs.go`: The module's message type definitions and associated methods. + - `params.go`: The module's parameter type definitions and associated methods. + - `*.pb.go`: The module's type definitions generated by Protocol Buffers (as defined in the respective `*.proto` files above). +- The root directory includes the module's `AppModule` implementation. + - `autocli.go`: The module [autocli](https://docs.cosmos.network/main/core/autocli) options. + - `depinject.go`: The module [depinject](./15-depinject.md#type-definition) options. + +> Note: although the above pattern is followed by most of the Cosmos SDK modules, there are some modules that don't follow this pattern. E.g `x/group` and `x/nft` dont have a `types` folder, instead all of the type definitions for messages, events, and genesis state are live in the root directory and the module's `AppModule` implementation lives in the `module` folder. + +--- + +## sidebar_position: 1 + +# `Msg` Services + +:::note Synopsis +A Protobuf `Msg` service processes [messages](./02-messages-and-queries.md#messages). Protobuf `Msg` services are specific to the module in which they are defined, and only process messages defined within the said module. They are called from `BaseApp` during [`FinalizeBlock`](../../learn/advanced/00-baseapp.md#finalizeblock). +::: + +:::note Pre-requisite Readings + +- [Module Manager](./01-module-manager.md) +- [Messages and Queries](./02-messages-and-queries.md) + +::: + +## Implementation of a module `Msg` service + +Each module should define a Protobuf `Msg` service, which will be responsible for processing requests (implementing `sdk.Msg`) and returning responses. + +As further described in [ADR 031](../architecture/adr-031-msg-service.md), this approach has the advantage of clearly specifying return types and generating server and client code. + +Protobuf generates a `MsgServer` interface based on the definition of `Msg` service. It is the role of the module developer to implement this interface, by implementing the state transition logic that should happen upon receival of each `transaction.Msg`. As an example, here is the generated `MsgServer` interface for `x/bank`, which exposes two `transaction.Msg`s: + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/28fa3b8/x/bank/types/tx.pb.go#L564-L579 +``` + +When possible, the existing module's [`Keeper`](./06-keeper.md) should implement `MsgServer`, otherwise a `msgServer` struct that embeds the `Keeper` can be created, typically in `./keeper/msg_server.go`: + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/28fa3b8/x/bank/keeper/msg_server.go#L16-L19 +``` + +`msgServer` methods can retrieve the auxiliary information or services using the environment variable, it is always located in the keeper: + +Environment: + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/07151304e2ec6a185243d083f59a2d543253cb15/core/appmodule/v2/environment.go#L14-L29 +``` + +Keeper Example: + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/07151304e2ec6a185243d083f59a2d543253cb15/x/bank/keeper/keeper.go#L56-L58 +``` + +`transaction.Msg` processing usually follows these 3 steps: + +### Validation + +The message server must perform all validation required (both _stateful_ and _stateless_) to make sure the `message` is valid. +The `signer` is charged for the gas cost of this validation. + +For example, a `msgServer` method for a `transfer` message should check that the sending account has enough funds to actually perform the transfer. + +It is recommended to implement all validation checks in a separate function that passes state values as arguments. This implementation simplifies testing. As expected, expensive validation functions charge additional gas. Example: + +```go +ValidateMsgA(msg MsgA, now Time, gm GasMeter) error { + if now.Before(msg.Expire) { + return sdkerrors.ErrInvalidRequest.Wrap("msg expired") + } + gm.ConsumeGas(1000, "signature verification") + return signatureVerificaton(msg.Prover, msg.Data) +} +``` + +:::warning +Previously, the `ValidateBasic` method was used to perform simple and stateless validation checks. +This way of validating is deprecated, this means the `msgServer` must perform all validation checks. +::: + +### State Transition + +After the validation is successful, the `msgServer` method uses the [`keeper`](./06-keeper.md) functions to access the state and perform a state transition. + +### Events + +Before returning, `msgServer` methods generally emit one or more [events](../../learn/advanced/08-events.md) by using the `EventManager` held in `environment`. + +There are two ways to emit events, typed events using protobuf or arbitrary key & values. + +Typed Events: + +```go +ctx.EventManager().EmitTypedEvent( + &group.EventABC{Key1: Value1, Key2, Value2}) +``` + +Arbitrary Events: + +```go +ctx.EventManager().EmitEvent( + sdk.NewEvent( + eventType, // e.g. sdk.EventTypeMessage for a message, types.CustomEventType for a custom event defined in the module + sdk.NewAttribute(key1, value1), + sdk.NewAttribute(key2, value2), + ), +) +``` + +These events are relayed back to the underlying consensus engine and can be used by service providers to implement services around the application. Click [here](../../learn/advanced/08-events.md) to learn more about events. + +The invoked `msgServer` method returns a `proto.Message` response and an `error`. These return values are then wrapped into an `*sdk.Result` or an `error`: + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/baseapp/msg_service_router.go#L160 +``` + +This method takes care of marshaling the `res` parameter to protobuf and attaching any events on the `EventManager()` to the `sdk.Result`. + +```protobuf reference +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/proto/cosmos/base/abci/v1beta1/abci.proto#L93-L113 +``` + +This diagram shows a typical structure of a Protobuf `Msg` service, and how the message propagates through the module. + +```mermaid +sequenceDiagram + participant User + participant baseApp + participant router + participant handler + participant msgServer + participant keeper + participant EventManager + + User->>baseApp: Transaction Type + baseApp->>router: Route(ctx, msgRoute) + router->>handler: handler + handler->>msgServer: Msg(Context, Msg(..)) + + alt addresses invalid, denominations wrong, etc. + msgServer->>handler: error + handler->>router: error + router->>baseApp: result, error code + else + msgServer->>keeper: perform action, update context + keeper->>msgServer: results, error code + msgServer->>EventManager: Emit relevant events + msgServer->>msgServer: maybe wrap results in more structure + msgServer->>handler: result, error code + handler->>router: result, error code + router->>baseApp: result, error code + end + + baseApp->>User: result, error code +``` + +## Telemetry + +New [telemetry metrics](../../learn/advanced/09-telemetry.md) can be created from `msgServer` methods when handling messages. + +This is an example from the `x/auth/vesting` module: + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/auth/vesting/msg_server.go#L76-L88 +``` + +:::Warning +Telemetry adds a performance overhead to the chain. It is recommended to only use this in critical paths +::: + +--- + +## sidebar_position: 1 + +# Query Services + +:::note Synopsis +A Protobuf Query service processes [`queries`](./02-messages-and-queries.md#queries). Query services are specific to the module in which they are defined, and only process `queries` defined within said module. They are called from `BaseApp`'s [`Query` method](../../learn/advanced/00-baseapp.md#query). +::: + +:::note Pre-requisite Readings + +- [Module Manager](./01-module-manager.md) +- [Messages and Queries](./02-messages-and-queries.md) + +::: + +## Implementation of a module query service + +### gRPC Service + +When defining a Protobuf `Query` service, a `QueryServer` interface is generated for each module with all the service methods: + +```go +type QueryServer interface { + QueryBalance(context.Context, *QueryBalanceParams) (*types.Coin, error) + QueryAllBalances(context.Context, *QueryAllBalancesParams) (*QueryAllBalancesResponse, error) +} +``` + +These custom queries methods should be implemented by a module's keeper, typically in `./keeper/grpc_query.go`. The first parameter of these methods is a generic `context.Context`. Therefore, the Cosmos SDK provides a function `sdk.UnwrapSDKContext` to retrieve the `context.Context` from the provided +`context.Context`. + +Here's an example implementation for the bank module: + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/bank/keeper/grpc_query.go +``` + +### Calling queries from the State Machine + +The Cosmos SDK v0.47 introduces a new `cosmos.query.v1.module_query_safe` Protobuf annotation which is used to state that a query that is safe to be called from within the state machine, for example: + +- a Keeper's query function can be called from another module's Keeper, +- ADR-033 intermodule query calls, +- CosmWasm contracts can also directly interact with these queries. + +If the `module_query_safe` annotation set to `true`, it means: + +- The query is deterministic: given a block height it will return the same response upon multiple calls, and doesn't introduce any state-machine breaking changes across SDK patch versions. +- Gas consumption never fluctuates across calls and across patch versions. + +If you are a module developer and want to use `module_query_safe` annotation for your own query, you have to ensure the following things: + +- the query is deterministic and won't introduce state-machine-breaking changes without coordinated upgrades +- it has its gas tracked, to avoid the attack vector where no gas is accounted for + on potentially high-computation queries. + + *** + + sidebar_position: 1 + +--- + +# Blockchain Architecture + +## Introduction + +Blockchain architecture is a complex topic that involves many different components. In this section, we will cover the main layers of a blockchain application built with the Cosmos SDK. + +At its core, a blockchain is a replicated deterministic state machine. This document explores the various layers of blockchain architecture, focusing on the execution, settlement, consensus, data availability, and interoperability layers. + +```mermaid +graph TD + A[Modular SDK Blockchain Architecture] + A --> B[Execution Layer] + A --> C[Settlement Layer] + A --> D[Consensus Layer] + D --> E[Data Availability Layer] + A --> F[Interoperability Layer] +``` + +## Layered Architecture + +Understanding blockchain architecture through the lens of different layers helps in comprehending its complex functionalities. We will give a high-level overview of the execution layer, settlement layer, consensus layer, data availability layer, and interoperability layer. + +## Execution Layer + +The Execution Layer is where the blockchain processes and executes transactions. The state machine within the blockchain handles the execution of transaction logic. This is done by the blockchain itself, ensuring that every transaction follows the predefined rules and state transitions. When a transaction is submitted, the execution layer processes it, updates the state, and ensures that the output is deterministic and consistent across all nodes. In the context of the Cosmos SDK, this typically involves predefined modules and transaction types rather than general-purpose smart contracts, which are used in chains with CosmWasm. + +### State machine + +At its core, a blockchain is a [replicated deterministic state machine](https://en.wikipedia.org/wiki/State_machine_replication). + +A state machine is a computer science concept whereby a machine can have multiple states, but only one at any given time. There is a `state`, which describes the current state of the system, and `transactions`, that trigger state transitions. + +Given a state S and a transaction T, the state machine will return a new state S'. + +```mermaid +flowchart LR + A[S] + B[S'] + A -->|"apply(T)"| B +``` + +In practice, the transactions are bundled in blocks to make the process more efficient. Given a state S and a block of transactions B, the state machine will return a new state S'. + +```mermaid +flowchart LR + A[S] + B[S'] + A -->|"For each T in B: apply(T)"| B +``` + +In a blockchain context, the state machine is [deterministic](https://en.wikipedia.org/wiki/Deterministic_system). This means that if a node is started at a given state and replays the same sequence of transactions, it will always end up with the same final state. + +The Cosmos SDK gives developers maximum flexibility to define the state of their application, transaction types and state transition functions. The process of building state machines with the Cosmos SDK will be described more in-depth in the following sections. But first, let us see how the state machine is replicated using various consensus engines, such as CometBFT. + +## Settlement Layer + +The Settlement Layer is responsible for finalising and recording transactions on the blockchain. This layer ensures that all transactions are accurately settled and immutable, providing a verifiable record of all activities on the blockchain. It is critical for maintaining the integrity and trustworthiness of the blockchain. + +The settlement layer can be performed on the chain itself or it can be externalised, allowing for the possibility of plugging in a different settlement layer as needed. For example if we were to use Rollkit and celestia for our Data Availability and Consensus, we could separate our settlement layer by introducing fraud or validity proofs. From there the settlement layer can create trust-minimised light clients, further enhancing security and efficiency. This process ensures that all transactions are accurately finalized and immutable, providing a verifiable record of all activities. + +## Consensus Layer + +The Consensus Layer ensures that all nodes in the network agree on the order and validity of transactions. This layer uses consensus algorithms like Byzantine Fault Tolerance (BFT) or Proof of Stake (PoS) to achieve agreement, even in the presence of malicious nodes. Consensus is crucial for maintaining the security and reliability of the blockchain. + +What has been a default consensus engine in the Cosmos SDK has been CometBFT. In the most recent releases we have been moving away from this and allowing users to plug and play their own consensus engines. This is a big step forward for the Cosmos SDK as it allows for more flexibility and customisation. Other consensus engine options for example can be Rollkit with Celestias Data Availability Layer. + +Here is an example of how the consensus layer works with CometBFT in the context of the Cosmos SDK: + +### CometBFT + +Thanks to the Cosmos SDK, developers just have to define the state machine, and [_CometBFT_](https://docs.cometbft.com/v1.0/explanation/introduction/) will handle replication over the network for them. + +```mermaid +flowchart TD + subgraph Blockchain_Node[Blockchain Node] + subgraph SM[State-machine] + direction TB + SM1[Cosmos SDK] + end + subgraph CometBFT[CometBFT] + direction TB + Consensus + Networking + end + end + + SM <--> CometBFT + + + Blockchain_Node -->|Includes| SM + Blockchain_Node -->|Includes| CometBFT +``` + +[CometBFT](https://docs.cometbft.com/v1.0/explanation/introduction/) is an application-agnostic engine that is responsible for handling the _networking_ and _consensus_ layers of a blockchain. In practice, this means that CometBFT is responsible for propagating and ordering transaction bytes. CometBFT relies on an eponymous Byzantine-Fault-Tolerant (BFT) algorithm to reach consensus on the order of transactions. + +The [consensus algorithm adopted by CometBFT](https://docs.cometbft.com/v1.0/explanation/introduction/#consensus-overview) works with a set of special nodes called _Validators_. Validators are responsible for adding blocks of transactions to the blockchain. At any given block, there is a validator set V. A validator in V is chosen by the algorithm to be the proposer of the next block. This block is considered valid if more than two thirds of V signed a `prevote` and a `precommit` on it, and if all the transactions that it contains are valid. The validator set can be changed by rules written in the state-machine. + +## ABCI + +CometBFT passes transactions to the application through an interface called the [ABCI](https://docs.cometbft.com/v1.0/spec/abci/), which the application must implement. + +```mermaid +graph TD + A[Application] + B[CometBFT] + A <-->|ABCI| B + +``` + +Note that **CometBFT only handles transaction bytes**. It has no knowledge of what these bytes mean. All CometBFT does is order these transaction bytes deterministically. CometBFT passes the bytes to the application via the ABCI, and expects a return code to inform it if the messages contained in the transactions were successfully processed or not. + +Here are the most important messages of the ABCI: + +- `CheckTx`: When a transaction is received by CometBFT, it is passed to the application to check if a few basic requirements are met. `CheckTx` is used to protect the mempool of full-nodes against spam transactions. A special handler called the [`AnteHandler`](../beginner/04-gas-fees.md#antehandler) is used to execute a series of validation steps such as checking for sufficient fees and validating the signatures. If the checks are valid, the transaction is added to the [mempool](https://docs.cometbft.com/v1.0/explanation/core/mempool) and relayed to peer nodes. Note that transactions are not processed (i.e. no modification of the state occurs) with `CheckTx` since they have not been included in a block yet. +- `DeliverTx`: When a [valid block](https://docs.cometbft.com/v1.0/spec/core/data_structures#block) is received by CometBFT, each transaction in the block is passed to the application via `DeliverTx` in order to be processed. It is during this stage that the state transitions occur. The `AnteHandler` executes again, along with the actual [`Msg` service](../../build/building-modules/03-msg-services.md) RPC for each message in the transaction. +- `BeginBlock`/`EndBlock`: These messages are executed at the beginning and the end of each block, whether the block contains transactions or not. It is useful to trigger automatic execution of logic. Proceed with caution though, as computationally expensive loops could slow down your blockchain, or even freeze it if the loop is infinite. + +Find a more detailed view of the ABCI methods from the [CometBFT docs](https://docs.cometbft.com/v1.0/spec/abci/). + +Any application built on CometBFT needs to implement the ABCI interface in order to communicate with the underlying local CometBFT engine. Fortunately, you do not have to implement the ABCI interface. The Cosmos SDK provides a boilerplate implementation of it in the form of [baseapp](./03-sdk-design.md#baseapp). + +## Data Availability Layer + +The Data Availability (DA) Layer is a critical component of within the umbrella of the consensus layer that ensures all necessary data for transactions is available to all network participants. This layer is essential for preventing data withholding attacks, where some nodes might attempt to disrupt the network by not sharing critical transaction data. + +If we use the example of Rollkit, a user initiates a transaction, which is then propagated through the rollup network by a light node. The transaction is validated by full nodes and aggregated into a block by the sequencer. This block is posted to a data availability layer like Celestia, ensuring the data is accessible and correctly ordered. The rollup light node verifies data availability from the DA layer. Full nodes then validate the block and generate necessary proofs, such as fraud proofs for optimistic rollups or zk-SNARKs/zk-STARKs for zk-rollups. These proofs are shared across the network and verified by other nodes, ensuring the rollup's integrity. Once all validations are complete, the rollup's state is updated, finalising the transaction + +## Interoperability Layer + +The Interoperability Layer enables communication and interaction between different blockchains. This layer facilitates cross-chain transactions and data sharing, allowing various blockchain networks to interoperate seamlessly. Interoperability is key for building a connected ecosystem of blockchains, enhancing their functionality and reach. + +In this case we have separated the layers even further to really illustrate the components that make-up the blockchain architecture and it is important to note that the Cosmos SDK is designed to be interoperable with other blockchains. This is achieved through the use of the [Inter-Blockchain Communication (IBC) protocol](https://www.ibcprotocol.dev/), which allows different blockchains to communicate and transfer assets between each other. + +--- + +## sidebar_position: 1 + +# Application-Specific Blockchains + +:::note Synopsis +This document explains what application-specific blockchains are, and why developers would want to build one as opposed to writing Smart Contracts. +::: + +## What are application-specific blockchains + +Application-specific blockchains are blockchains customized to operate a single application. Instead of building a decentralized application on top of an underlying blockchain like Ethereum, developers build their own blockchain from the ground up. This means building a full-node client, a light-client, and all the necessary interfaces (CLI, REST, ...) to interact with the nodes. + +```mermaid +flowchart TD + subgraph Blockchain_Node[Blockchain Node] + subgraph SM[State-machine] + direction TB + SM1[Cosmos SDK] + end + subgraph Consensus[Consensus] + direction TB + end + subgraph Networking[Networking] + direction TB + end + end + + SM <--> Consensus + Consensus <--> Networking + + + Blockchain_Node -->|Includes| SM + Blockchain_Node -->|Includes| Consensus + Blockchain_Node -->|Includes| Networking +``` + +## What are the shortcomings of Smart Contracts + +Virtual-machine blockchains like Ethereum addressed the demand for more programmability back in 2014. At the time, the options available for building decentralized applications were quite limited. Most developers would build on top of the complex and limited Bitcoin scripting language, or fork the Bitcoin codebase which was hard to work with and customize. + +Virtual-machine blockchains came in with a new value proposition. Their state-machine incorporates a virtual-machine that is able to interpret turing-complete programs called Smart Contracts. These Smart Contracts are very good for use cases like one-time events (e.g. ICOs), but they can fall short for building complex decentralized platforms. Here is why: + +- Smart Contracts are generally developed with specific programming languages that can be interpreted by the underlying virtual-machine. These programming languages are often immature and inherently limited by the constraints of the virtual-machine itself. For example, the Ethereum Virtual Machine does not allow developers to implement automatic execution of code. Developers are also limited to the account-based system of the EVM, and they can only choose from a limited set of functions for their cryptographic operations. These are examples, but they hint at the lack of **flexibility** that a smart contract environment often entails. +- Smart Contracts are all run by the same virtual machine. This means that they compete for resources, which can severely restrain **performance**. And even if the state-machine were to be split in multiple subsets (e.g. via sharding), Smart Contracts would still need to be interpreted by a virtual machine, which would limit performance compared to a native application implemented at state-machine level (our benchmarks show an improvement on the order of 10x in performance when the virtual-machine is removed). +- Another issue with the fact that Smart Contracts share the same underlying environment is the resulting limitation in **sovereignty**. A decentralized application is an ecosystem that involves multiple players. If the application is built on a general-purpose virtual-machine blockchain, stakeholders have very limited sovereignty over their application, and are ultimately superseded by the governance of the underlying blockchain. If there is a bug in the application, very little can be done about it. + +Application-Specific Blockchains are designed to address these shortcomings. + +## Application-Specific Blockchains Benefits + +### Flexibility + +Application-specific blockchains give maximum flexibility to developers: + +- In Cosmos blockchains, the state-machine is typically connected to the underlying consensus engine via an interface called the [ABCI](https://docs.cometbft.com/v1.0/spec/abci/) (Application Blockchain Interface). This interface can be wrapped in any programming language, meaning developers can build their state-machine in the programming language of their choice. + +- Developers can choose among multiple frameworks to build their state-machine. The most widely used today is the Cosmos SDK, but others exist (e.g. [Lotion](https://github.com/nomic-io/lotion), [Weave](https://github.com/iov-one/weave), ...). Typically the choice will be made based on the programming language they want to use (Cosmos SDK and Weave are in Golang, Lotion is in Javascript, ...). +- The ABCI also allows developers to swap the consensus engine of their application-specific blockchain. Today, only CometBFT is production-ready, but in the future other consensus engines are expected to emerge. +- Even when they settle for a framework and consensus engine, developers still have the freedom to tweak them if they don't perfectly match their requirements in their pristine forms. +- Developers are free to explore the full spectrum of tradeoffs (e.g. number of validators vs transaction throughput, safety vs availability in asynchrony, ...) and design choices (DB or IAVL tree for storage, UTXO or account model, ...). +- Developers can implement automatic execution of code. In the Cosmos SDK, logic can be automatically triggered at the beginning and the end of each block. They are also free to choose the cryptographic library used in their application, as opposed to being constrained by what is made available by the underlying environment in the case of virtual-machine blockchains. + +The list above contains a few examples that show how much flexibility application-specific blockchains give to developers. The goal of Cosmos and the Cosmos SDK is to make developer tooling as generic and composable as possible, so that each part of the stack can be forked, tweaked and improved without losing compatibility. As the community grows, more alternatives for each of the core building blocks will emerge, giving more options to developers. + +### Performance + +Decentralized applications built with Smart Contracts are inherently capped in performance by the underlying environment. For a decentralized application to optimise performance, it needs to be built as an application-specific blockchain. Next are some of the benefits an application-specific blockchain brings in terms of performance: + +- Developers of application-specific blockchains can choose to operate with a novel consensus engine such as CometBFT. +- An application-specific blockchain only operates a single application, so that the application does not compete with others for computation and storage. This is the opposite of most non-sharded virtual-machine blockchains today, where smart contracts all compete for computation and storage. +- Even if a virtual-machine blockchain offered application-based sharding coupled with an efficient consensus algorithm, performance would still be limited by the virtual-machine itself. The real throughput bottleneck is the state-machine, and requiring transactions to be interpreted by a virtual-machine significantly increases the computational complexity of processing them. + +### Security + +Security is hard to quantify, and greatly varies from platform to platform. That said here are some important benefits an application-specific blockchain can bring in terms of security: + +- Developers can choose proven programming languages like Go when building their application-specific blockchains, as opposed to smart contract programming languages that are often more immature. +- Developers are not constrained by the cryptographic functions made available by the underlying virtual-machines. They can use their own custom cryptography, and rely on well-audited crypto libraries. +- Developers do not have to worry about potential bugs or exploitable mechanisms in the underlying virtual-machine, making it easier to reason about the security of the application. + +### Sovereignty + +One of the major benefits of application-specific blockchains is sovereignty. A decentralized application is an ecosystem that involves many actors: users, developers, third-party services, and more. When developers build on virtual-machine blockchain where many decentralized applications coexist, the community of the application is different than the community of the underlying blockchain, and the latter supersedes the former in the governance process. If there is a bug or if a new feature is needed, stakeholders of the application have very little leeway to upgrade the code. If the community of the underlying blockchain refuses to act, nothing can happen. + +The fundamental issue here is that the governance of the application and the governance of the network are not aligned. This issue is solved by application-specific blockchains. Because application-specific blockchains specialize to operate a single application, stakeholders of the application have full control over the entire chain. This ensures that the community will not be stuck if a bug is discovered, and that it has the freedom to choose how it is going to evolve. diff --git a/docs/docs/guides/tools/ibc-accounts.md b/docs/docs/guides/tools/ibc-accounts.md new file mode 100644 index 000000000..1dbcdd1eb --- /dev/null +++ b/docs/docs/guides/tools/ibc-accounts.md @@ -0,0 +1,40 @@ +# Interchain Accounts + +:::note Synopsis +Learn about what the Interchain Accounts module is +::: + +## What is the Interchain Accounts module? + +Interchain Accounts is the Cosmos SDK implementation of the ICS-27 protocol, which enables cross-chain account management built upon IBC. + +- How does an interchain account differ from a regular account? + +Regular accounts use a private key to sign transactions. Interchain Accounts are instead controlled programmatically by counterparty chains via IBC packets. + +## Concepts + +`Host Chain`: The chain where the interchain account is registered. The host chain listens for IBC packets from a controller chain which should contain instructions (e.g. Cosmos SDK messages) for which the interchain account will execute. + +`Controller Chain`: The chain registering and controlling an account on a host chain. The controller chain sends IBC packets to the host chain to control the account. + +`Interchain Account`: An account on a host chain created using the ICS-27 protocol. An interchain account has all the capabilities of a normal account. However, rather than signing transactions with a private key, a controller chain will send IBC packets to the host chain which signals what transactions the interchain account should execute. + +`Authentication Module`: A custom application module on the controller chain that uses the Interchain Accounts module to build custom logic for the creation & management of interchain accounts. It can be either an IBC application module using the [legacy API](10-legacy/03-keeper-api.md), or a regular Cosmos SDK application module sending messages to the controller submodule's `MsgServer` (this is the recommended approach from ibc-go v6 if access to packet callbacks is not needed). Please note that the legacy API will eventually be removed and IBC applications will not be able to use them in later releases. + +## SDK security model + +SDK modules on a chain are assumed to be trustworthy. For example, there are no checks to prevent an untrustworthy module from accessing the bank keeper. + +The implementation of ICS-27 in ibc-go uses this assumption in its security considerations. + +The implementation assumes other IBC application modules will not bind to ports within the ICS-27 namespace. + +## Channel Closure + +The provided interchain account host and controller implementations do not support `ChanCloseInit`. However, they do support `ChanCloseConfirm`. +This means that the host and controller modules cannot close channels, but they will confirm channel closures initiated by other implementations of ICS-27. + +In the event of a channel closing (due to a packet timeout in an ordered channel, for example), the interchain account associated with that channel can become accessible again if a new channel is created with a (JSON-formatted) version string that encodes the exact same `Metadata` information of the previous channel. The channel can be reopened using either [`MsgRegisterInterchainAccount`](./05-messages.md#msgregisterinterchainaccount) or `MsgChannelOpenInit`. If `MsgRegisterInterchainAccount` is used, then it is possible to leave the `version` field of the message empty, since it will be filled in by the controller submodule. If `MsgChannelOpenInit` is used, then the `version` field must be provided with the correct JSON-encoded `Metadata` string. See section [Understanding Active Channels](./09-active-channels.md#understanding-active-channels) for more information. + +When reopening a channel with the default controller submodule, the ordering of the channel cannot be changed. In order to change the ordering of the channel, the channel has to go through a [channel upgrade handshake](../../01-ibc/06-channel-upgrades.md) or reopen the channel with a custom controller implementation. diff --git a/docs/docs/guides/tools/ibc-fee-middleware.md b/docs/docs/guides/tools/ibc-fee-middleware.md new file mode 100644 index 000000000..10bd6b5db --- /dev/null +++ b/docs/docs/guides/tools/ibc-fee-middleware.md @@ -0,0 +1,310 @@ +--- +title: Overview +--- + +# Overview + +:::note Synopsis +Learn about what the Fee Middleware module is, and how to build custom modules that utilize the Fee Middleware functionality +::: + +## What is the Fee Middleware module? + +IBC does not depend on relayer operators for transaction verification. However, the relayer infrastructure ensures liveness of the Interchain network — operators listen for packets sent through channels opened between chains, and perform the vital service of ferrying these packets (and proof of the transaction on the sending chain/receipt on the receiving chain) to the clients on each side of the channel. + +Though relaying is permissionless and completely decentralized and accessible, it does come with operational costs. Running full nodes to query transaction proofs and paying for transaction fees associated with IBC packets are two of the primary cost burdens which have driven the overall discussion on **a general, in-protocol incentivization mechanism for relayers**. + +Initially, a [simple proposal](https://github.com/cosmos/ibc/pull/577/files) was created to incentivize relaying on ICS20 token transfers on the destination chain. However, the proposal was specific to ICS20 token transfers and would have to be reimplemented in this format on every other IBC application module. + +After much discussion, the proposal was expanded to a [general incentivisation design](https://github.com/cosmos/ibc/tree/master/spec/app/ics-029-fee-payment) that can be adopted by any ICS application protocol as [middleware](../../01-ibc/04-middleware/02-develop.md). + +## Concepts + +ICS29 fee payments in this middleware design are built on the assumption that sender chains are the source of incentives — the chain on which packets are incentivized is the chain that distributes fees to relayer operators. However, as part of the IBC packet flow, messages have to be submitted on both sender and destination chains. This introduces the requirement of a mapping of relayer operator's addresses on both chains. + +To achieve the stated requirements, the **fee middleware module has two main groups of functionality**: + +- Registering of relayer addresses associated with each party involved in relaying the packet on the source chain. This registration process can be automated on start up of relayer infrastructure and happens only once, not every packet flow. + + This is described in the [Fee distribution section](04-fee-distribution.md). + +- Escrowing fees by any party which will be paid out to each rightful party on completion of the packet lifecycle. + + This is described in the [Fee messages section](03-msgs.md). + +We complete the introduction by giving a list of definitions of relevant terminology. + +`Forward relayer`: The relayer that submits the `MsgRecvPacket` message for a given packet (on the destination chain). + +`Reverse relayer`: The relayer that submits the `MsgAcknowledgement` message for a given packet (on the source chain). + +`Timeout relayer`: The relayer that submits the `MsgTimeout` or `MsgTimeoutOnClose` messages for a given packet (on the source chain). + +`Payee`: The account address on the source chain to be paid on completion of the packet lifecycle. The packet lifecycle on the source chain completes with the receipt of a `MsgTimeout`/`MsgTimeoutOnClose` or a `MsgAcknowledgement`. + +`Counterparty payee`: The account address to be paid on completion of the packet lifecycle on the destination chain. The package lifecycle on the destination chain completes with a successful `MsgRecvPacket`. + +`Refund address`: The address of the account paying for the incentivization of packet relaying. The account is refunded timeout fees upon successful acknowledgement. In the event of a packet timeout, both acknowledgement and receive fees are refunded. + +## Known Limitations + +- At the time of the release of the feature (ibc-go v4) fee payments middleware only supported incentivisation of new channels; however, with the release of channel upgradeability (ibc-go v8.1) it is possible to enable incentivisation of all existing channels. +- Even though unlikely, there exists a DoS attack vector on a fee-enabled channel if 1) there exists a relayer software implementation that is incentivised to timeout packets if the timeout fee is greater than the sum of the fees to receive and acknowledge the packet, and 2) only this type of implementation is used by operators relaying on the channel. In this situation, an attacker could continuously incentivise the relayers to never deliver the packets by incrementing the timeout fee of the packets above the sum of the receive and acknowledge fees. However, this situation is unlikely to occur because 1) another relayer behaving honestly could relay the packets before they timeout, and 2) the attack would be costly because the attacker would need to incentivise the timeout fee of the packets with their own funds. Given the low impact and unlikelihood of the attack we have decided to accept this risk and not implement any mitigation mesaures. + + +## Module Integration + +The Fee Middleware module, as the name suggests, plays the role of an IBC middleware and as such must be configured by chain developers to route and handle IBC messages correctly. +For Cosmos SDK chains this setup is done via the `app/app.go` file, where modules are constructed and configured in order to bootstrap the blockchain application. + +## Example integration of the Fee Middleware module + +```go +// app.go + +// Register the AppModule for the fee middleware module +ModuleBasics = module.NewBasicManager( + ... + ibcfee.AppModuleBasic{}, + ... +) + +... + +// Add module account permissions for the fee middleware module +maccPerms = map[string][]string{ + ... + ibcfeetypes.ModuleName: nil, +} + +... + +// Add fee middleware Keeper +type App struct { + ... + + IBCFeeKeeper ibcfeekeeper.Keeper + + ... +} + +... + +// Create store keys +keys := sdk.NewKVStoreKeys( + ... + ibcfeetypes.StoreKey, + ... +) + +... + +app.IBCFeeKeeper = ibcfeekeeper.NewKeeper( + appCodec, keys[ibcfeetypes.StoreKey], + app.IBCKeeper.ChannelKeeper, // may be replaced with IBC middleware + app.IBCKeeper.ChannelKeeper, + &app.IBCKeeper.PortKeeper, app.AccountKeeper, app.BankKeeper, +) + + +// See the section below for configuring an application stack with the fee middleware module + +... + +// Register fee middleware AppModule +app.moduleManager = module.NewManager( + ... + ibcfee.NewAppModule(app.IBCFeeKeeper), +) + +... + +// Add fee middleware to begin blocker logic +app.moduleManager.SetOrderBeginBlockers( + ... + ibcfeetypes.ModuleName, + ... +) + +// Add fee middleware to end blocker logic +app.moduleManager.SetOrderEndBlockers( + ... + ibcfeetypes.ModuleName, + ... +) + +// Add fee middleware to init genesis logic +app.moduleManager.SetOrderInitGenesis( + ... + ibcfeetypes.ModuleName, + ... +) +``` + +## Configuring an application stack with Fee Middleware + +As mentioned in [IBC middleware development](../../01-ibc/04-middleware/02-develop.md) an application stack may be composed of many or no middlewares that nest a base application. +These layers form the complete set of application logic that enable developers to build composable and flexible IBC application stacks. +For example, an application stack may be just a single base application like `transfer`, however, the same application stack composed with `29-fee` will nest the `transfer` base application +by wrapping it with the Fee Middleware module. + +### Transfer + +See below for an example of how to create an application stack using `transfer` and `29-fee`. +The following `transferStack` is configured in `app/app.go` and added to the IBC `Router`. +The in-line comments describe the execution flow of packets between the application stack and IBC core. + +```go +// Create Transfer Stack +// SendPacket, since it is originating from the application to core IBC: +// transferKeeper.SendPacket -> fee.SendPacket -> channel.SendPacket + +// RecvPacket, message that originates from core IBC and goes down to app, the flow is the other way +// channel.RecvPacket -> fee.OnRecvPacket -> transfer.OnRecvPacket + +// transfer stack contains (from top to bottom): +// - IBC Fee Middleware +// - Transfer + +// create IBC module from bottom to top of stack +var transferStack porttypes.IBCModule +transferStack = transfer.NewIBCModule(app.TransferKeeper) +transferStack = ibcfee.NewIBCMiddleware(transferStack, app.IBCFeeKeeper) + +// Add transfer stack to IBC Router +ibcRouter.AddRoute(ibctransfertypes.ModuleName, transferStack) +``` + +### Interchain Accounts + +See below for an example of how to create an application stack using `27-interchain-accounts` and `29-fee`. +The following `icaControllerStack` and `icaHostStack` are configured in `app/app.go` and added to the IBC `Router` with the associated authentication module. +The in-line comments describe the execution flow of packets between the application stack and IBC core. + +```go +// Create Interchain Accounts Stack +// SendPacket, since it is originating from the application to core IBC: +// icaAuthModuleKeeper.SendTx -> icaController.SendPacket -> fee.SendPacket -> channel.SendPacket + +// initialize ICA module with mock module as the authentication module on the controller side +var icaControllerStack porttypes.IBCModule +icaControllerStack = ibcmock.NewIBCModule(&mockModule, ibcmock.NewMockIBCApp("", scopedICAMockKeeper)) +app.ICAAuthModule = icaControllerStack.(ibcmock.IBCModule) +icaControllerStack = icacontroller.NewIBCMiddleware(icaControllerStack, app.ICAControllerKeeper) +icaControllerStack = ibcfee.NewIBCMiddleware(icaControllerStack, app.IBCFeeKeeper) + +// RecvPacket, message that originates from core IBC and goes down to app, the flow is: +// channel.RecvPacket -> fee.OnRecvPacket -> icaHost.OnRecvPacket + +var icaHostStack porttypes.IBCModule +icaHostStack = icahost.NewIBCModule(app.ICAHostKeeper) +icaHostStack = ibcfee.NewIBCMiddleware(icaHostStack, app.IBCFeeKeeper) + +// Add authentication module, controller and host to IBC router +ibcRouter. + // the ICA Controller middleware needs to be explicitly added to the IBC Router because the + // ICA controller module owns the port capability for ICA. The ICA authentication module + // owns the channel capability. + AddRoute(ibcmock.ModuleName+icacontrollertypes.SubModuleName, icaControllerStack) // ica with mock auth module stack route to ica (top level of middleware stack) + AddRoute(icacontrollertypes.SubModuleName, icaControllerStack). + AddRoute(icahosttypes.SubModuleName, icaHostStack). +``` + +## Fee Distribution + +Packet fees are divided into 3 distinct amounts in order to compensate relayer operators for packet relaying on fee enabled IBC channels. + +- `RecvFee`: The sum of all packet receive fees distributed to a payee for successful execution of `MsgRecvPacket`. +- `AckFee`: The sum of all packet acknowledgement fees distributed to a payee for successful execution of `MsgAcknowledgement`. +- `TimeoutFee`: The sum of all packet timeout fees distributed to a payee for successful execution of `MsgTimeout`. + +## Register a counterparty payee address for forward relaying + +As mentioned in [ICS29 Concepts](01-overview.md#concepts), the forward relayer describes the actor who performs the submission of `MsgRecvPacket` on the destination chain. +Fee distribution for incentivized packet relays takes place on the packet source chain. + +> Relayer operators are expected to register a counterparty payee address, in order to be compensated accordingly with `RecvFee`s upon completion of a packet lifecycle. + +The counterparty payee address registered on the destination chain is encoded into the packet acknowledgement and communicated as such to the source chain for fee distribution. +**If a counterparty payee is not registered for the forward relayer on the destination chain, the escrowed fees will be refunded upon fee distribution.** + +### Relayer operator actions + +A transaction must be submitted **to the destination chain** including a `CounterpartyPayee` address of an account on the source chain. +The transaction must be signed by the `Relayer`. + +Note: If a module account address is used as the `CounterpartyPayee` but the module has been set as a blocked address in the `BankKeeper`, the refunding to the module account will fail. This is because many modules use invariants to compare internal tracking of module account balances against the actual balance of the account stored in the `BankKeeper`. If a token transfer to the module account occurs without going through this module and updating the account balance of the module on the `BankKeeper`, then invariants may break and unknown behaviour could occur depending on the module implementation. Therefore, if it is desirable to use a module account that is currently blocked, the module developers should be consulted to gauge to possibility of removing the module account from the blocked list. + +```go +type MsgRegisterCounterpartyPayee struct { + // unique port identifier + PortId string + // unique channel identifier + ChannelId string + // the relayer address + Relayer string + // the counterparty payee address + CounterpartyPayee string +} +``` + +> This message is expected to fail if: +> +> - `PortId` is invalid (see [24-host naming requirements](https://github.com/cosmos/ibc/blob/master/spec/core/ics-024-host-requirements/README.md#paths-identifiers-separators). +> - `ChannelId` is invalid (see [24-host naming requirements](https://github.com/cosmos/ibc/blob/master/spec/core/ics-024-host-requirements/README.md#paths-identifiers-separators)). +> - `Relayer` is an invalid address (see [Cosmos SDK Addresses](https://github.com/cosmos/cosmos-sdk/blob/main/docs/learn/beginner/03-accounts.md#addresses)). +> - `CounterpartyPayee` is empty or contains more than 2048 bytes. + +See below for an example CLI command: + +```bash +simd tx ibc-fee register-counterparty-payee transfer channel-0 \ + cosmos1rsp837a4kvtgp2m4uqzdge0zzu6efqgucm0qdh \ + osmo1v5y0tz01llxzf4c2afml8s3awue0ymju22wxx2 \ + --from cosmos1rsp837a4kvtgp2m4uqzdge0zzu6efqgucm0qdh +``` + +## Register an alternative payee address for reverse and timeout relaying + +As mentioned in [ICS29 Concepts](01-overview.md#concepts), the reverse relayer describes the actor who performs the submission of `MsgAcknowledgement` on the source chain. +Similarly the timeout relayer describes the actor who performs the submission of `MsgTimeout` (or `MsgTimeoutOnClose`) on the source chain. + +> Relayer operators **may choose** to register an optional payee address, in order to be compensated accordingly with `AckFee`s and `TimeoutFee`s upon completion of a packet life cycle. + +If a payee is not registered for the reverse or timeout relayer on the source chain, then fee distribution assumes the default behaviour, where fees are paid out to the relayer account which delivers `MsgAcknowledgement` or `MsgTimeout`/`MsgTimeoutOnClose`. + +### Relayer operator actions + +A transaction must be submitted **to the source chain** including a `Payee` address of an account on the source chain. +The transaction must be signed by the `Relayer`. + +Note: If a module account address is used as the `Payee` it is recommended to [turn off invariant checks](https://github.com/cosmos/ibc-go/blob/v7.0.0/testing/simapp/app.go#L727) for that module. + +```go +type MsgRegisterPayee struct { + // unique port identifier + PortId string + // unique channel identifier + ChannelId string + // the relayer address + Relayer string + // the payee address + Payee string +} +``` + +> This message is expected to fail if: +> +> - `PortId` is invalid (see [24-host naming requirements](https://github.com/cosmos/ibc/blob/master/spec/core/ics-024-host-requirements/README.md#paths-identifiers-separators). +> - `ChannelId` is invalid (see [24-host naming requirements](https://github.com/cosmos/ibc/blob/master/spec/core/ics-024-host-requirements/README.md#paths-identifiers-separators)). +> - `Relayer` is an invalid address (see [Cosmos SDK Addresses](https://github.com/cosmos/cosmos-sdk/blob/main/docs/learn/beginner/03-accounts.md#addresses)). +> - `Payee` is an invalid address (see [Cosmos SDK Addresses](https://github.com/cosmos/cosmos-sdk/blob/main/docs/learn/beginner/03-accounts.md#addresses)). + +See below for an example CLI command: + +```bash +simd tx ibc-fee register-payee transfer channel-0 \ + cosmos1rsp837a4kvtgp2m4uqzdge0zzu6efqgucm0qdh \ + cosmos153lf4zntqt33a4v0sm5cytrxyqn78q7kz8j8x5 \ + --from cosmos1rsp837a4kvtgp2m4uqzdge0zzu6efqgucm0qdh +``` diff --git a/docs/docs/guides/tools/ibc-transfer.md b/docs/docs/guides/tools/ibc-transfer.md new file mode 100644 index 000000000..e64718e84 --- /dev/null +++ b/docs/docs/guides/tools/ibc-transfer.md @@ -0,0 +1,178 @@ +--- +title: Overview +--- + +# Overview + +:::note Synopsis +Learn about what the token Transfer module is +::: + +## What is the Transfer module? + +Transfer is the Cosmos SDK implementation of the [ICS-20](https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer) protocol, which enables cross-chain fungible token transfers. + +## Concepts + +### Acknowledgements + +ICS20 uses the recommended acknowledgement format as specified by [ICS 04](https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#acknowledgement-envelope). + +A successful receive of a transfer packet will result in a Result Acknowledgement being written +with the value `[]byte{byte(1)}` in the `Response` field. + +An unsuccessful receive of a transfer packet will result in an Error Acknowledgement being written +with the error message in the `Response` field. + +### Denomination trace + +The denomination trace corresponds to the information that allows a token to be traced back to its +origin chain. It contains a sequence of port and channel identifiers ordered from the most recent to +the oldest in the timeline of transfers. + +This information is included on the token's base denomination field in the form of a hash to prevent an +unbounded denomination length. For example, the token `transfer/channelToA/uatom` will be displayed +as `ibc/7F1D3FCF4AE79E1554D670D1AD949A9BA4E4A3C76C63093E17E446A46061A7A2`. The human readable denomination +is stored using `x/bank` module's [denom metadata](https://docs.cosmos.network/main/build/modules/bank#denom-metadata) +feature. You may display the human readable denominations by querying balances with the `--resolve-denom` flag, as in: + +```shell +simd query bank balances [address] --resolve-denom +``` + +Each send to any chain other than the one it was previously received from is a movement forwards in +the token's timeline. This causes trace to be added to the token's history and the destination port +and destination channel to be prefixed to the denomination. In these instances the sender chain is +acting as the "source zone". When the token is sent back to the chain it previously received from, the +prefix is removed. This is a backwards movement in the token's timeline and the sender chain is +acting as the "sink zone". + +It is strongly recommended to read the full details of [ADR 001: Coin Source Tracing](/architecture/adr-001-coin-source-tracing) to understand the implications and context of the IBC token representations. + +## UX suggestions for clients + +For clients (wallets, exchanges, applications, block explorers, etc) that want to display the source of the token, it is recommended to use the following alternatives for each of the cases below: + +### Direct connection + +If the denomination trace contains a single identifier prefix pair (as in the example above), then +the easiest way to retrieve the chain and light client identifier is to map the trace information +directly. In summary, this requires querying the channel from the denomination trace identifiers, +and then the counterparty client state using the counterparty port and channel identifiers from the +retrieved channel. + +A general pseudo algorithm would look like the following: + +1. Query the full denomination trace. +2. Query the channel with the `portID/channelID` pair, which corresponds to the first destination of the + token. +3. Query the client state using the identifiers pair. Note that this query will return a `"Not +Found"` response if the current chain is not connected to this channel. +4. Retrieve the client identifier or chain identifier from the client state (eg: on + Tendermint clients) and store it locally. + +Using the gRPC gateway client service the steps above would be, with a given IBC token `ibc/7F1D3FCF4AE79E1554D670D1AD949A9BA4E4A3C76C63093E17E446A46061A7A2` stored on `chainB`: + +1. `GET /ibc/apps/transfer/v1/denom_traces/7F1D3FCF4AE79E1554D670D1AD949A9BA4E4A3C76C63093E17E446A46061A7A2` -> `{"path": "transfer/channelToA", "base_denom": "uatom"}` +2. `GET /ibc/apps/transfer/v1/channels/channelToA/ports/transfer/client_state"` -> `{"client_id": "clientA", "chain-id": "chainA", ...}` +3. `GET /ibc/apps/transfer/v1/channels/channelToA/ports/transfer"` -> `{"channel_id": "channelToA", port_id": "transfer", counterparty: {"channel_id": "channelToB", port_id": "transfer"}, ...}` +4. `GET /ibc/apps/transfer/v1/channels/channelToB/ports/transfer/client_state" -> {"client_id": "clientB", "chain-id": "chainB", ...}` + +Then, the token transfer chain path for the `uatom` denomination would be: `chainA` -> `chainB`. + +### Multiple hops + +The multiple channel hops case applies when the token has passed through multiple chains between the original source and final destination chains. + +The IBC protocol doesn't know the topology of the overall network (i.e connections between chains and identifier names between them). For this reason, in the multiple hops case, a particular chain in the timeline of the individual transfers can't query the chain and client identifiers of the other chains. + +Take for example the following sequence of transfers `A -> B -> C` for an IBC token, with a final prefix path (trace info) of `transfer/channelChainC/transfer/channelChainB`. What the paragraph above means is that even in the case that chain `C` is directly connected to chain `A`, querying the port and channel identifiers that chain `B` uses to connect to chain `A` (eg: `transfer/channelChainA`) can be completely different from the one that chain `C` uses to connect to chain `A` (eg: `transfer/channelToChainA`). + +Thus the proposed solution for clients that the IBC team recommends are the following: + +- **Connect to all chains**: Connecting to all the chains in the timeline would allow clients to + perform the queries outlined in the [direct connection](#direct-connection) section to each + relevant chain. By repeatedly following the port and channel denomination trace transfer timeline, + clients should always be able to find all the relevant identifiers. This comes at the tradeoff + that the client must connect to nodes on each of the chains in order to perform the queries. +- **Relayer as a Service (RaaS)**: A longer term solution is to use/create a relayer service that + could map the denomination trace to the chain path timeline for each token (i.e `origin chain -> +chain #1 -> ... -> chain #(n-1) -> final chain`). These services could provide merkle proofs in + order to allow clients to optionally verify the path timeline correctness for themselves by + running light clients. If the proofs are not verified, they should be considered as trusted third + parties services. Additionally, client would be advised in the future to use RaaS that support the + largest number of connections between chains in the ecosystem. Unfortunately, none of the existing + public relayers (in [Golang](https://github.com/cosmos/relayer) and + [Rust](https://github.com/informalsystems/ibc-rs)), provide this service to clients. + +:::tip +The only viable alternative for clients (at the time of writing) to tokens with multiple connection hops, is to connect to all chains directly and perform relevant queries to each of them in the sequence. +::: + +## Forwarding + +:::info +Token forwarding and unwinding is supported only on ICS20 v2 transfer channels. +::: + +Forwarding allows tokens to be routed to a final destination through multiple (up to 8) intermediary +chains. With forwarding, it's also possible to unwind IBC vouchers to their native chain, and forward +them afterwards to another destination, all with just a single transfer transaction on the sending chain. + +### Forward tokens + +Native tokens or IBC vouchers on any chain can be forwarded through intermediary chains to reach their +final destination. For example, given the topology below, with 3 chains and a transfer channel between +chains A and B and between chains B and C: + +![Light Mode Forwarding](./images/forwarding-3-chains-light.png#gh-light-mode-only)![Dark Mode Forwarding](./images/forwarding-3-chains-dark.png#gh-dark-mode-only) + +Native tokens on chain `A` can be sent to chain `C` through chain `B`. The routing is specified by the +source port ID and channel ID of choice on every intermediary chain. In this example, there is only one +forwarding hop on chain `B` and the port ID, channel ID pair is `transfer`, `channelBToC`. Forwarding of +a multi-denom collections of tokens is also allowed (i.e. forwarding of tokens of different denominations). + +### Unwind tokens + +Taking again as an example the topology from the previous section, we assume that native tokens on chain `A` +have been transferred to chain `C`. The IBC vouchers on chain `C` have the denomination trace +`transfer/channelCtoB/transfer/channelBtoA`, and with forwarding it is possible to submit a transfer message +on chain `C` and automatically unwind the vouchers through chain `B` to chain `A`, so that the tokens recovered +on the origin chain regain their native denomination. In order to execute automatic unwinding, the transfer +module does not require extra user input: the unwind route is encoded in the denomination trace with the +pairs of destination port ID, channel ID that are added on every chain where the tokens are received. + +Please note that unwinding of vouchers is only allowed when vouchers transferred all share the same denomination +trace (signifying coins that all originate from the same source). It is not possible to unwind vouchers of two different +IBC denominations, since they come from different source chains. + +### Unwind tokens and then forward + +Unwinding and forwarding can be used in combination, so that vouchers are first unwound to their origin chain +and then forwarded to a final destination. The same restriction as in the unwinding case applies: only vouchers +of a single IBC denomination can be used. + +## Locked funds + +In some [exceptional cases](/architecture/adr-026-ibc-client-recovery-mechanisms#exceptional-cases), a client state associated with a given channel cannot be updated. This causes that funds from fungible tokens in that channel will be permanently locked and thus can no longer be transferred. + +To mitigate this, a client update governance proposal can be submitted to update the frozen client +with a new valid header. Once the proposal passes the client state will be unfrozen and the funds +from the associated channels will then be unlocked. This mechanism only applies to clients that +allow updates via governance, such as Tendermint clients. + +In addition to this, it's important to mention that a token must be sent back along the exact route +that it took originally in order to return it to its original form on the source chain (eg: the +Cosmos Hub for the `uatom`). Sending a token back to the same chain across a different channel will +**not** move the token back across its timeline. If a channel in the chain history closes before the +token can be sent back across that channel, then the token will not be returnable to its original +form. + +## Security considerations + +For safety, no other module must be capable of minting tokens with the `ibc/` prefix. The IBC +transfer module needs a subset of the denomination space that only it can create tokens in. + +## Channel Closure + +The IBC transfer module does not support channel closure. diff --git a/docs/docs/index.md b/docs/docs/index.md new file mode 100644 index 000000000..10ba47ff9 --- /dev/null +++ b/docs/docs/index.md @@ -0,0 +1,47 @@ +# Introduction + +Sonr is a decentralized identity network built on the Cosmos-sdk. It has early origins as a peer-to-peer file sharing network, but has since evolved into a platform for decentralized authentication and authorization. The early lessons taught from our file sharing roots are used as our theology for building the Sonr Blockchain. + +1. [Cosmos-SDK](./concepts/Cosmos-SDK.md) +2. [Chain-Modules](./concepts/Chain-Modules.md) +3. [System-Architecture](./concepts/System-Architecture.md) +4. [Token-Economy](./concepts/Token-Economy.md) +5. [Service-Management](./concepts/Service-Management.md) +6. [Design-System](./concepts/Design-System.md) +7. [Self-Custody](./concepts/Self-Custody.md) +8. [Consumer Launch](./concepts/Consumer-Launch.md) + +## Principles + +1. Bitcoin is digital gold +2. Blockchains are programmable databases with functional operations +3. Staking is essentially a savings account +4. The Sonr Network conducts all operations in the $SNR token +5. Service Delegation subsidizes user wallet operations. +6. Cryptocurrency has the potential to break the software innovation ceiling + +## The Problem + +Centralized identity has led to internet monopolies abusing your trust and privacy. + +## The Solution + +A peer-to-peer system for decentralized personal identity with Authentication and Authorization capabilities. + +## What is Sonr? + +A privacy preserving, identity system managed by user controlled decentralized vaults which have the flexibility of +software wallets with the security of hardware wallets. + +## The End Goal + +A Data sharing economy where human-specific information has intrinsic value. Services are incentivized to act in +good faith in order to obtain quality user data. + +## How do we do it? + +Provide Internet Citizens with a robust easy to use WebVault which features a crypto wallet, passkey authenticator, and encrypted messages. The WebVault serves as a wrapper over every sensitive intent-based user interaction. The Smart blockchain is responsible for keeping a record of where WebVaults are located, when authorization activity occurs, and which services are allowed over what permissions. + +## The User Incentive + +Data is the byproduct of currency exchange in the Information age. Meaning services pay other services for user data or profits in order to enrich their database with complete user personas. diff --git a/docs/docs/modules/sonr-did.md b/docs/docs/modules/sonr-did.md new file mode 100644 index 000000000..e687d0d40 --- /dev/null +++ b/docs/docs/modules/sonr-did.md @@ -0,0 +1,141 @@ +# `x/did` + +The Decentralized Identity module is responsible for managing native Sonr Accounts, their derived wallets, and associated user identification information. + +## State + +The DID module maintains several key state structures: + +### Controller State + +The Controller state represents a Sonr DWN Vault. It includes: +- Unique identifier (number) +- DID +- Sonr address +- Ethereum address +- Bitcoin address +- Public key +- Keyshares pointer +- Claimed block +- Creation block + +### Assertion State + +The Assertion state includes: +- DID +- Controller +- Subject +- Public key +- Assertion type +- Accumulator (metadata) +- Creation block + +### Authentication State + +The Authentication state includes: +- DID +- Controller +- Subject +- Public key +- Credential ID +- Metadata +- Creation block + +### Verification State + +The Verification state includes: +- DID +- Controller +- DID method +- Issuer +- Subject +- Public key +- Verification type +- Metadata +- Creation block + +## State Transitions + +State transitions are triggered by the following messages: +- LinkAssertion +- LinkAuthentication +- UnlinkAssertion +- UnlinkAuthentication +- ExecuteTx +- UpdateParams + +## Messages + +The DID module defines the following messages: + +1. MsgLinkAuthentication +2. MsgLinkAssertion +3. MsgExecuteTx +4. MsgUnlinkAssertion +5. MsgUnlinkAuthentication +6. MsgUpdateParams + +Each message triggers specific state machine behaviors related to managing DIDs, authentications, assertions, and module parameters. + +## Query + +The DID module provides the following query endpoints: + +1. Params: Query all parameters of the module +2. Resolve: Query the DID document by its ID +3. Sign: Sign a message with the DID document +4. Verify: Verify a message with the DID document + +## Params + +The module parameters include: +- Allowed public keys (map of KeyInfo) +- Conveyance preference +- Attestation formats + +## Client + +The module provides gRPC and REST endpoints for all defined messages and queries. + +## Future Improvements + +Potential future improvements could include: +1. Enhanced privacy features for DID operations +2. Integration with more blockchain networks +3. Support for additional key types and cryptographic algorithms +4. Improved revocation mechanisms for credentials and assertions + +## Tests + +Acceptance tests should cover all major functionality, including: +- Creating and managing DIDs +- Linking and unlinking assertions and authentications +- Executing transactions with DIDs +- Querying and resolving DIDs +- Parameter updates + +## Appendix + +### Account + +An Account represents a user's identity within the Sonr ecosystem. It includes information such as the user's public key, associated wallets, and other identification details. + +### Decentralized Identifier (DID) + +A Decentralized Identifier (DID) is a unique identifier that is created, owned, and controlled by the user. It is used to establish a secure and verifiable digital identity. + +### Verifiable Credential (VC) + +A Verifiable Credential (VC) is a digital statement that can be cryptographically verified. It contains claims about a subject (e.g., a user) and is issued by a trusted authority. + +### Key Types + +The module supports various key types, including: +- Role +- Algorithm (e.g., ES256, EdDSA, ES256K) +- Encoding (e.g., hex, base64, multibase) +- Curve (e.g., P256, P384, P521, X25519, X448, Ed25519, Ed448, secp256k1) + +### JSON Web Key (JWK) + +The module supports JSON Web Keys (JWK) for representing cryptographic keys, including properties such as key type (kty), curve (crv), and coordinates (x, y) for EC and OKP keys, as well as modulus (n) and exponent (e) for RSA keys. diff --git a/docs/docs/modules/sonr-dwn.md b/docs/docs/modules/sonr-dwn.md new file mode 100644 index 000000000..ecca8c15a --- /dev/null +++ b/docs/docs/modules/sonr-dwn.md @@ -0,0 +1,145 @@ +# `x/dwn` + +The DWN module is responsible for the management of IPFS deployed Decentralized Web Nodes (DWNs) and their associated data. + +## Concepts + +The DWN module introduces several key concepts: + +1. Decentralized Web Node (DWN): A distributed network for storing and sharing data. +2. Schema: A structure defining the format of various data types in the dwn. +3. IPFS Integration: The module can interact with IPFS for decentralized data storage. + +## State + +The DWN module maintains the following state: + +### DWN State + +The DWN state is stored using the following structure: + +```protobuf +message DWN { + uint64 id = 1; + string alias = 2; + string cid = 3; + string resolver = 4; +} +``` + +This state is indexed by ID, alias, and CID for efficient querying. + +### Params State + +The module parameters are stored in the following structure: + +```protobuf +message Params { + bool ipfs_active = 1; + bool local_registration_enabled = 2; + Schema schema = 4; +} +``` + +### Schema State + +The Schema state defines the structure for various data types: + +```protobuf +message Schema { + int32 version = 1; + string account = 2; + string asset = 3; + string chain = 4; + string credential = 5; + string did = 6; + string jwk = 7; + string grant = 8; + string keyshare = 9; + string profile = 10; +} +``` + +## State Transitions + +State transitions in the DWN module are primarily triggered by: + +1. Updating module parameters +2. Allocating new dwns +3. Syncing DID documents + +## Messages + +The DWN module defines the following message: + +1. `MsgUpdateParams`: Used to update the module parameters. + +```protobuf +message MsgUpdateParams { + string authority = 1; + Params params = 2; +} +``` + +## Begin Block + +No specific begin-block operations are defined for this module. + +## End Block + +No specific end-block operations are defined for this module. + +## Hooks + +The DWN module does not define any hooks. + +## Events + +The DWN module does not explicitly define any events. However, standard Cosmos SDK events may be emitted during state transitions. + +## Client + +The DWN module provides the following gRPC query endpoints: + +1. `Params`: Queries all parameters of the module. +2. `Schema`: Queries the DID document schema. +3. `Allocate`: Initializes a Target DWN available for claims. +4. `Sync`: Queries the DID document by its ID and returns required information. + +## Params + +The module parameters include: + +- `ipfs_active` (bool): Indicates if IPFS integration is active. +- `local_registration_enabled` (bool): Indicates if local registration is enabled. +- `schema` (Schema): Defines the structure for various data types in the dwn. + +## Future Improvements + +Potential future improvements could include: + +1. Enhanced IPFS integration features. +2. Additional authentication mechanisms beyond WebAuthn. +3. Improved DID document management and querying capabilities. + +## Tests + +Acceptance tests should cover: + +1. Parameter updates +2. DWN state management +3. Schema queries +4. DWN allocation process +5. DID document syncing + +## Appendix + +| Concept | Description | +| ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Decentralized Web Node (DWN) | A decentralized, distributed, and secure network of nodes that store and share data. It is a decentralized alternative to traditional web hosting services. | +| Decentralized Identifier (DID) | A unique identifier that is created, owned, and controlled by the user. It is used to establish a secure and verifiable digital identity. | +| HTMX (Hypertext Markup Language eXtensions) | A set of extensions to HTML that allow for the creation of interactive web pages. It is used to enhance the user experience and provide additional functionality to web applications. | +| IPFS (InterPlanetary File System) | A decentralized, peer-to-peer network for storing and sharing data. It is a distributed file system that allows for the creation and sharing of content across a network of nodes. | +| WebAuthn (Web Authentication) | A set of APIs that allow websites to request user authentication using biometric or non-biometric factors. | +| WebAssembly (Web Assembly) | A binary instruction format for a stack-based virtual machine. | +| Verifiable Credential (VC) | A digital statement that can be cryptographically verified. | diff --git a/docs/docs/modules/sonr-service.md b/docs/docs/modules/sonr-service.md new file mode 100644 index 000000000..079760c07 --- /dev/null +++ b/docs/docs/modules/sonr-service.md @@ -0,0 +1,91 @@ +# `x/svc` + +The svc module is responsible for managing the registration and authorization of services within the Sonr ecosystem. It provides a secure and verifiable mechanism for registering and authorizing services using Decentralized Identifiers (DIDs). + +## Concepts + +- **Service**: A decentralized svc on the Sonr Blockchain with properties such as ID, authority, origin, name, description, category, tags, and expiry height. +- **Profile**: Represents a DID alias with properties like ID, subject, origin, and controller. +- **Metadata**: Contains information about a svc, including name, description, category, icon, and tags. + +### Dependencies + +- [x/did](https://github.com/onsonr/sonr/tree/master/x/did) +- [x/group](https://github.com/onsonr/sonr/tree/master/x/group) +- [x/nft](https://github.com/onsonr/sonr/tree/master/x/nft) + +## State + +The module uses the following state structures: + +### Metadata + +Stores information about services: + +- Primary key: `id` (auto-increment) +- Unique index: `origin` +- Fields: id, origin, name, description, category, icon (URI), tags + +### Profile + +Stores DID alias information: + +- Primary key: `id` +- Unique index: `subject,origin` +- Fields: id, subject, origin, controller + +## Messages + +### MsgUpdateParams + +Updates the module parameters. Can only be executed by the governance account. + +### MsgRegisterService + +Registers a new svc on the blockchain. Requires a valid TXT record in DNS for the origin. + +## Params + +The module has the following parameters: + +- `categories`: List of allowed svc categories +- `types`: List of allowed svc types + +## Query + +The module provides the following query: + +### Params + +Retrieves all parameters of the module. + +## Client + +### gRPC + +The module provides a gRPC Query svc with the following RPC: + +- `Params`: Get all parameters of the module + +### CLI + +(TODO: Add CLI commands for interacting with the module) + +## Events + +(TODO: List and describe event tags used by the module) + +## Future Improvements + +- Implement svc discovery mechanisms +- Add support for svc reputation and rating systems +- Enhance svc metadata with more detailed information +- Implement svc update and deactivation functionality + +## Tests + +(TODO: Add acceptance tests for the module) + +## Appendix + +This module is part of the Sonr blockchain project and interacts with other modules such as DID and NFT modules to provide a comprehensive decentralized svc ecosystem. diff --git a/docs/docs/modules/sonr-token.md b/docs/docs/modules/sonr-token.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/docs/modules/ucan-spec.md b/docs/docs/modules/ucan-spec.md new file mode 100644 index 000000000..79c5745a6 --- /dev/null +++ b/docs/docs/modules/ucan-spec.md @@ -0,0 +1,873 @@ +# User Controlled Authorization Network (UCAN) Specification + +# Abstract + +User-Controlled Authorization Network (UCAN) is a [trustless], secure, [local-first], user-originated, distributed authorization scheme. This document provides a high level overview of the components of the system, concepts, and motivation. Exact formats are given in [sub-specifications]. + +# Introduction + +User-Controlled Authorization Network (UCAN) is a [trustless], secure, [local-first], user-originated, distributed authorization scheme. It provides public-key verifiable, delegable, expressive, openly extensible [capabilities]. UCANs achieve public verifiability with late-bound certificate chains and principals represented by [decentralized identifiers (DIDs)][DID]. + +UCAN improves the familiarity and adoptability of schemes like [SPKI/SDSI][SPKI] for web and native application contexts. UCAN allows for the creation, delegation, and invocation of authority by any agent with a DID, including traditional systems and peer-to-peer architectures beyond traditional cloud computing. + +## Motivation + +> If we practice our principles, we could have both security and functionality. Treating security as a separate concern has not succeeded in bridging the gap between principle and practice, because it operates without knowledge of what constitutes least authority. +> +> — [Miller][Mark Miller] et al, [The Structure of Authority] + +Since at least [Multics], access control lists ([ACL]s) have been the most popular form of digital authorization, where a list of what each user is allowed to do is maintained on the resource. ACLs (and later [RBAC]) have been a successful model suited to architectures where persistent access to a single list is viable. ACLs require that rules are sufficiently well specified, such as in a centralized database with rules covering all possible permutations of scenario. This both imposes a very high maintenance burden on programmers as a systems grows in complexity, and is a key vector for [confused deputies][confused deputy problem]. + +With increasing interconnectivity between machines becoming commonplace, authorization needs to scale to meet the load demands of distributed systems while providing partition tolerance. However, it is not always practical to maintain a single central authorization source. Even when copies of the authorization list are distributed to the relevant servers, latency and partitions introduce troublesome challenges with conflicting updates, to say nothing of storage requirements. + +A large portion of personal information now also moves through connected systems. As a result, data privacy is a prominent theme when considering the design of modern applications, to the point of being legislated in parts of the world. + +Ahead-of-time coordination is often a barrier to development in many projects. Flexibility to define specialized authorization semantics for resources and the ability to integrate with external systems trustlessly are essential as the number of autonomous, specialized, and coordinated applications increases. + +Many high-value applications run in hostile environments. In recognition of this, many vendors now include public key functionality, such as [non-extractable keys in browsers][browser api crypto key], [certificate systems for external keys][fido], [platform keys][passkey], and [secure hardware enclaves] in widespread consumer devices. + +Two related models that work exceptionally well in the above context are Simple Public Key Infrastructure ([SPKI][spki rfc]) and object capabilities ([OCAP]). Since offline operation and self-verifiability are two requirements, UCAN adopts a [certificate capability model] related to [SPKI]. + +## Intuition for Auth System Differences + +The following analogies illustrate several significant trade-offs between these systems but are only accurate enough to build intuition. A good resource for a more thorough presentation of these trade-offs is [Capability Myths Demolished]. In this framework, UCAN approximates SPKI with some dynamic features. + +### Access Control Lists + +By analogy, ACLs are like a bouncer at an exclusive event. This bouncer has a list attendees allowed in and which of those are VIPs that get extra access. People trying to get in show their government-issued ID and are accepted or rejected. In addition, they may get a lanyard to identify that they have previously been allowed in. If someone is disruptive, they can simply be crossed off the list and denied further entry. + +If there are many such events at many venues, the organizers need to coordinate ahead of time, denials need to be synchronized, and attendees need to show their ID cards to many bouncers. The likelihood of the bouncer letting in the wrong person due to synchronization lag or confusion by someone sharing a name is nonzero. + +### Certificate Capabilities + +UCANs work more like [movie tickets][caps as keys] or a festival pass. No one needs to check your ID; who you are is irrelevant. For example, if you have a ticket issued by the theater to see Citizen Kane, you are admitted to Theater 3. If you cannot attend an event, you can hand this ticket to a friend who wants to see the film instead, and there is no coordination required with the theater ahead of time. However, if the theater needs to cancel tickets for some reason, they need a way of uniquely identifying them and sharing this information between them. + +### Object Capabilities + +Object capability ("ocap") systems use a combination of references, encapsulated state, and proxy forwarding. As the name implies, this is fairly close to object-oriented or actor-based systems. Object capabilities are [robust][Robust Composition], flexible, and expressive. + +To achieve these properties, object capabilities have two requirements: [fail-safe], and locality preservation. The emphasis on consistency rules out partition tolerance[^pcec]. + +## Security Considerations + +Each UCAN includes an assertions of what it is allowed to do. "Proofs" are positive evidence (elsewhere called "witnesses") of the possession of rights. They are cryptographically verifiable chains showing that the UCAN issuer either claims to directly own a resource, or that it was delegated to them by some claimed owner. In the most common case, the root owner's ID is the only globally unique identity for the resource. + +Root capability issuers function as verifiable, distributed roots of trust. The delegation chain is by definition a provenance log. Private keys themselves SHOULD NOT move from one context to another. Keeping keys unique to each physical device and unique per use case is RECOMMENDED to reduce opportunity for keys to leak, and limit blast radius in the case of compromises. "Sharing authority without sharing keys" is provided by capabilities, so there is no reason to share keys directly. + +Note that a structurally and cryptographically valid UCAN chain can be semantically invalid. The executor MUST verify the ownership of any external resources at execution time. While not possible for all use cases (e.g. replicated state machines and eventually consistent data), having the Executor be the resource itself is RECOMMENDED. + +While certificate chains go a long way toward improving security, they do not provide [confinement] on their own. The principle of least authority SHOULD be used when delegating a UCAN: minimizing the amount of time that a UCAN is valid for and reducing authority to the bare minimum required for the delegate to complete their task. This delegate should be trusted as little as is practical since they can further sub-delegate their authority to others without alerting their delegator. UCANs do not offer confinement (as that would require all processes to be online), so it is impossible to guarantee knowledge of all of the sub-delegations that exist. The ability to revoke some or all downstream UCANs exists as a last resort. + +## Inversion of Control + +[Inversion of control] is achieved due to two properties: self-certifying delegation and reference passing. There is no Authorization Server (AS) that sits between requestors and resources. In traditional terms, the owner of a UCAN resource is the resource server (RS) directly. + +This inverts the usual relationship between resources and users: the resource grants some (or all) authority over itself to agents, as opposed to an Authorization Server managing the relationship between them. This has several major advantages: + +- Fully distributed and scalable +- Self-contained request without intermediary +- Partition tolerance, [support for replicated data and machines][overcoming SSI] +- Flexible granularity +- Compositionality: no distinction between resources residing together or apart + +``` +┌─────────────┐ ┌─────────────┐ ┌─────────────┐ +│ │ │ │ │ │ +│ │ │ ┌─────────┐ │ │ │ +│ │ │ │ Bob's │ │ │ │ +│ │ │ │ Photo │ │ │ │ +│ │ │ │ Gallery │ │ │ │ +│ │ │ └─────────┘ │ │ │ +│ │ │ │ │ │ +│ Alice's │ │ Bob's │ │ Carol's │ +│ Stuff │ │ Stuff │ │ Stuff │ +│ │ │ │ │ │ +│ ┌───────┼───┼─────────────┼───┼──┐ │ +│ │ │ │ │ │ │ │ +│ │ │ │ ┌───┼───┼──┼────────┐ │ +│ │ │ │ Alice's │ │ │ │ │ │ +│ │ │ │ Music │ │ │ │Carol's │ │ +│ │ │ │ Player │ │ │ │ Game │ │ +│ │ │ │ │ │ │ │ │ │ +│ │ │ │ └───┼───┼──┼────────┘ │ +│ │ │ │ │ │ │ │ +│ └───────┼───┼─────────────┼───┼──┘ │ +│ │ │ │ │ │ +└─────────────┘ └─────────────┘ └─────────────┘ +``` + +This additionally allows UCAN to model auth for [eventually consistent and replicated state][overcoming SSI]. + +# Roles + +There are several roles that an agent MAY assume: + +| Name | Description | +| --------- | ------------------------------------------------------------------------------------------------ | +| Agent | The general class of entities and principals that interact with a UCAN | +| Audience | The Principal delegated to in the current UCAN. Listed in the `aud` field | +| Executor | The Agent that actually performs the action described in an invocation | +| Invoker | A Principal that requests an Executor perform some action that uses the Invoker's authority | +| Issuer | The Principal of the current UCAN. Listed in the `iss` field | +| Owner | A Subject that controls some external resource | +| Principal | An agent identified by DID (listed in a UCAN's `iss` or `aud` field) | +| Revoker | The Issuer listed in a proof chain that revokes a UCAN | +| Subject | The Principal who's authority is delegated or invoked | +| Validator | Any Agent that interprets a UCAN to determine that it is valid, and which capabilities it grants | + +```mermaid +flowchart TD + subgraph Agent + subgraph Principal + direction TB + + subgraph Issuer + direction TB + + subgraph Subject + direction TB + + Executor + Owner + end + + Revoker + end + + subgraph Audience + Invoker + end + end + + Validator + end +``` + +## Subject + +> At the very least every object should have a URL +> +> — [Alan Kay], [The computer revolution hasn't happened yet] + +> Every Erlang process in the universe should be addressable and introspective +> +> — [Joe Armstrong], [Code Mesh 2016] + +A [Subject] represents the Agent that a capability is for. A Subject MUST be referenced by [DID]. This behaves much like a [GUID], with the addition of public key verifiability. This unforgeability prevents malicious namespace collisions which can lead to [confused deputies][confused deputy problem]. + +### Resource + +A resource is some data or process that can be uniquely identified by a [URI]. It can be anything from a row in a database, a user account, storage quota, email address, etc. Resource MAY be as coarse or fine grained as desired. Finer-grained is RECOMMENDED where possible, as it is easier to model the principle of least authority ([PoLA]). + +A resource describes the noun of a capability. The resource pointer MUST be provided in [URI] format. Arbitrary and custom URIs MAY be used, provided that the intended recipient can decode the URI. The URI is merely a unique identifier to describe the pointer to — and within — a resource. + +Having a unique agent represent a resource (and act as its manager) is RECOMMENDED. However, to help traditional ACL-based systems transition to certificate capabilities, an agent MAY manage multiple resources, and [act as the registrant in the ACL system][wrapping existing systems]. + +Unless explicitly stated, the Resource of a UCAN MUST be the Subject. + +## Issuer & Audience + +The Issuer (`iss`) and Audience (`aud`) can be conceptualized as the sender and receiver (respectively) of a postal letter. Every UCAN MUST be signed with the private key associated with the DID in the `iss` field. + +For example: + +```js +"aud": "did:key:z6MkiTBz1ymuepAQ4HEHYSF1H8quG5GLVVQR3djdX3mDooWp", +"iss": "did:key:zDnaerDaTF5BXEavCrfRZEk316dpbLsfPDZ3WJ5hRTPFU2169", +``` + +Please see the [Cryptosuite] section for more detail on DIDs. + +# Lifecycle + +The UCAN lifecycle has four components: + +| Spec | Description | Requirement Level | +| ------------ | ------------------------------------------------------------------------ | ----------------- | +| [Delegation] | Pass, attenuate, and secure authority in a partition-tolerant way | REQUIRED | +| [Invocation] | Exercise authority that has been delegated through one or more delegates | REQUIRED | +| [Promise] | Await the result of an Invocation inside another Invocation | RECOMMENDED | +| [Revocation] | Undo a delegation, breaking a delegation chain for malicious users | RECOMMENDED | + +```mermaid +flowchart TD + prm(Promise) + inv(Invocation) + del(Delegation) + rev(Revocation) + + prm -->|awaits| inv + del -->|proves| inv + rev -.->|kind of| inv + rev -->|invalidates| del + + click del href "https://github.com/ucan-wg/delegation" "UCAN Delegation Spec" + click inv href "https://github.com/ucan-wg/invocation" "UCAN Invocation Spec" + click rev href "https://github.com/ucan-wg/revocation" "UCAN Revocation Spec" +``` + +## Time + +It is often useful to talk about a UCAN in the context of some action. For example, a UCAN delegation may be valid when it was created, but expired when invoked. + +```mermaid +sequenceDiagram + Alice -->> Bob: Delegate + Bob ->> Bob: Validate + Bob -->> Carol: Delegate + Carol ->> Carol: Validate + Carol ->> Alice: Invoke + Alice ->> Alice: Validate + Alice ->> Alice: Execute +``` + +### Validity Interval + +The period of time that a capability is valid from and until. This is the range from the latest "not before" to the earliest expiry in the UCAN delegation chain. + +### Delegation-Time + +The moment at which a delegation is asserted. This MAY be captured by an `iat` field, but is generally superfluous to capture in the token. + +### Invocation-Time + +The moment a UCAN Invocation is created. It must be within the Validity Interval. + +### Validation-Time + +Validation MAY occur at multiple points during a UCAN's lifecycle. The main two are: + +- On receipt of a delegation +- When executing an invocation + +### Execution-Time + +To avoid the overloaded word "runtime", UCAN adopts the term "execution-time" to express the moment that the executor attempts to use the authority captured in an invocation and associated delegation chain. Validation MUST occur at this time. + +## Time Bounds + +`nbf` and `exp` stand for "not before" and "expires at," respectively. These MUST be expressed as seconds since the Unix epoch in UTC, without time zone or other offset. Taken together, they represent the time bounds for a token. These timestamps MUST be represented as the number of integer seconds since the Unix epoch. Due to limitations[^js-num-size] in numerics for certain common languages, timestamps outside of the range from $-2^{53} – 1$ to $2^{53} – 1$ MUST be rejected as invalid. + +The `nbf` field is OPTIONAL. When omitted, the token MUST be treated as valid beginning from the Unix epoch. Setting the `nbf` field to a time in the future MUST delay invoking a UCAN. For example, pre-provisioning access to conference materials ahead of time but not allowing access until the day it starts is achievable with judicious use of `nbf`. + +The `exp` field is RECOMMENDED. Following the [principle of least authority][PoLA], it is RECOMMENDED to give a timestamp expiry for UCANs. If the token explicitly never expires, the `exp` field MUST be set to `null`. If the time is in the past at validation time, the token MUST be treated as expired and invalid. + +Keeping the window of validity as short as possible is RECOMMENDED. Limiting the time range can mitigate the risk of a malicious user abusing a UCAN. However, this is situationally dependent. It may be desirable to limit the frequency of forced reauthorizations for trusted devices. Due to clock drift, time bounds SHOULD NOT be considered exact. A buffer of ±60 seconds is RECOMMENDED. + +Several named points of time in the UCAN lifecycle can be found in the [high level spec][UCAN]. + +Below are a couple examples: + +```js +{ + // ... + "nbf": 1529496683, + "exp": 1575606941 +} +``` + +```js +{ + // ... + "exp": 1575606941 +} +``` + +```js +{ + // ... + "nbf": 1529496683, + "exp": null +} +``` + +## Lifecycle Example + +Here is a concrete example of all stages of the UCAN lifecycle for database write access. + +```mermaid +sequenceDiagram + participant Database + + actor DBAgent + actor Alice + actor Bob + + Note over Database, DBAgent: Set Up Agent-Owned Resource + DBAgent ->> Database: createDB() + + autonumber 1 + + Note over DBAgent, Bob: Delegation + DBAgent -->> Alice: delegate(DBAgent, write) + Alice -->> Bob: delegate(DBAgent, write) + + Note over Database, Bob: Invocation + Bob ->> DBAgent: invoke(DBAgent, [write, [key, value]], proof: [➊,➋]) + DBAgent ->> Database: write(key, value) + DBAgent ->> Bob: ACK + + Note over DBAgent, Bob: Revocation + Alice ->> DBAgent: revoke(➋, proof: [➊,➋]) + Bob ->> DBAgent: invoke(DBAgent, [write, [key, newValue]], proof: [➊,➋]) + DBAgent -X Bob: NAK(➏) [rejected] +``` + +## Capability + +A capability is the association of an ability to a subject: `subject x command x policy`. + +The Subject and Command fields are REQUIRED. Any non-normative extensions are OPTIONAL. + +For example, a capability may used to represent the ability to send email from a certain address to others at `@example.com`. + +| Field | Example | +| ------- | -------------------------------------------------------------------------------------------- | +| Subject | `did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK` | +| Command | `/msg/send` | +| Policy | `["or", ["==", ".from", "mailto:me@example.com"], ["match", ".cc", "mailto:*@example.com"]]` | + +For a more complete treatment, please see the [UCAN Delegation][delegation] spec. + +## Authority + +> Whether to enable cooperation or to limit vulnerability, we care about _authority_ rather than _permissions._ Permissions determine what actions an individual program may perform on objects it can directly access. Authority describes the effects that a program may cause on objects it can access, either directly by permission, or indirectly by permitted interactions with other programs. +> +> —[Mark Miller], [Robust Composition] + +The set of capabilities delegated by a UCAN is called its "authority." To frame it another way, it's the set of effects that a principal can cause, and acts as a declarative description of delegated abilities. + +Merging capability authorities MUST follow set semantics, where the result includes all capabilities from the input authorities. Since broader capabilities automatically include narrower ones, this process is always additive. Capability authorities can be combined in any order, with the result always being at least as broad as each of the original authorities. + +```plaintext + ┌───────────────────────┐ ┐ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ Subject B │ │ +┌──────────────────┼ ─ ─ x │ │ +│ │ Ability Z │ ├── BxZ +│ │ │ │ Capability +│ │ │ │ +│ │ │ │ +│ Subject A │ │ │ +│ x │ │ │ +│ Ability Y ─ ─┼──────────────────┘ ┘ +│ │ +│ │ +│ │ +│ │ +│ │ +└───────────────────────┘ + +└─────────────────────┬────────────────────┘ + │ + AxY U BxZ + Capability +``` + +The capability authority is the total rights of the authorization space down to the relevant volume of authorizations. Individual capabilities MAY overlap; the authority is the union. Every unique delegated capability MUST have equal or narrower capabilities from their delegator. Inside this content space, you can draw a boundary around some resource(s) (their type, identifiers, and paths or children) and their capabilities. + +## Command + +Commands are concrete messages ("verbs") that MUST be unambiguously interpretable by the Subject of a UCAN. Commands are REQUIRED in invocations. Some examples include `/msg/send`, `/crud/read`, and `/ucan/revoke`. + +Much like other message-passing systems, the specific resource MUST define the behavior for a particular message. For instance, `/crud/update` MAY be used to destructively update a database row, or append to a append-only log. Specific messages MAY be created at will; the only restriction is that the Executor understand how to interpret that message in the context of a specific resource. + +While arbitrary semantics MAY be described, they MUST apply to the target resource. For instance, it does not make sense to apply `/msg/send` to a typical file system. + +### Segment Structure + +Commands MUST be lowercase, and begin with a slash (`/`). Segments MUST be separated by a slash. A trailing slash MUST NOT be present. All of the following are syntactically valid Commands: + +- `/` +- `/crud` +- `/crud/create` +- `/stack/pop` +- `/crypto/sign` +- `/foo/bar/baz/qux/quux` +- `/ほげ/ふが` + +Segment structure is important since shorter Commands prove longer paths. For example, `/` can be used as a proof of _any_ other Command. For example, `/crypto` MAY be used to prove `/crypto/sign` but MUST NOT prove `/stack/pop` or `/cryptocurrency`. + +### `/` AKA "Top" + +_"Top" (`/`) is the most powerful ability, and as such it SHOULD be handled with care and used sparingly._ + +The "top" (or "any", or "wildcard") ability MUST be denoted `/`. This can be thought of as something akin to a super user permission in RBAC. + +The wildcard ability grants access to all other capabilities for the specified resource, across all possible namespaces. The wildcard ability is useful when "linking" agents by delegating all access to another device controlled by the same user, and that should behave as the same agent. It is extremely powerful, and should be used with care. Among other things, it permits the delegate to update a Subject's mutable DID document (change their private keys), revoke UCAN delegations, and use any resources delegated to the Subject by others. + +```mermaid +%%{ init: { 'flowchart': { 'curve': 'linear' } } }%% + +flowchart BT + / + + /msg --> / + subgraph msgGraph [ ] + /msg/send --> /msg + /msg/receive --> /msg + end + + /crud --> / + subgraph crudGraph [ ] + /crud/read --> /crud + /crud/mutate --> /crud + + subgraph mutationGraph [ ] + /crud/mutate/create --> /crud/mutate + /crud/mutate/update --> /crud/mutate + /crud/mutate/destroy --> /crud/mutate + end + end + + ... --> / +``` + +### Reserved Commands + +#### `/ucan` Namespace + +The `/ucan` Command namespace MUST be reserved. This MUST include any ability string matching the regex `^ucan\/.*`. This is important for keeping a space for community-blessed Commands in the future, such as standard library Commands, such as [Revocation]. + +## Attenuation + +Attenuation is the process of constraining the capabilities in a delegation chain. Each direct delegation MUST either directly restate or attenuate (diminish) its capabilities. + +# Token Resolution + +Token resolution is transport specific. The exact format is left to the relevant UCAN transport specification. At minimum, such a specification MUST define at least the following: + +1. Request protocol +2. Response protocol +3. Collections format + +Note that if an instance cannot dereference a CID at runtime, the UCAN MUST fail validation. This is consistent with the [constructive semantics] of UCAN. + +# Nonce + +The REQUIRED nonce parameter `nonce` MAY be any value. A randomly generated string is RECOMMENDED to provide a unique UCAN, though it MAY also be a monotonically increasing count of the number of links in the hash chain. This field helps prevent replay attacks and ensures a unique CID per delegation. The `iss`, `aud`, and `exp` fields together will often ensure that UCANs are unique, but adding the nonce ensures uniqueness. + +The recommended size of the nonce differs by key type. In many cases, a random 12-byte nonce is sufficient. If uncertain, check the nonce in your DID's crypto suite. + +This field SHOULD NOT be used to sign arbitrary data, such as signature challenges. See the [`meta`][Metadata] field for more. + +Here is a simple example. + +```js +{ + // ... + "nonce": {"/": {"bytes": "bGlnaHQgd29yay4"}} +} +``` + +# Metadata + +The OPTIONAL `meta` field contains a map of arbitrary metadata, facts, and proofs of knowledge. The enclosed data MUST be self-evident and externally verifiable. It MAY include information such as hash preimages, server challenges, a Merkle proof, dictionary data, etc. + +The data contained in this map MUST NOT be semantically meaningful to delegation chains. + +Below is an example: + +```js +{ + // ... + "meta": { + "challenges": { + "example.com": "abcdef", + "another.example.net": "12345" + }, + "sha3_256": { + "B94D27B9934D3E08A52E52D7DA7DABFAC484EFE37A5380EE9088F7ACE2EFCDE9": "hello world" + } + } +} +``` + +# Canonicalization + +## Cryptosuite + +Across all UCAN specifications, the following cryptosuite MUST be supported: + +| Role | REQUIRED Algorithms | Notes | +| --------- | --------------------------------- | ------------------------------------ | +| Hash | [SHA-256] | | +| Signature | [Ed25519], [P-256], [`secp256k1`] | Preference of Ed25519 is RECOMMENDED | +| [DID] | [`did:key`] | | + +## Encoding + +All UCANs MUST be canonically encoded with [DAG-CBOR] for signing. A UCAN MAY be presented or stored in other [IPLD] formats (such as [DAG-JSON]), but converted to DAG-CBOR for signature validation. + +## Content Identifiers + +A UCAN token MUST be configured as follows: + +| Parameter | REQUIRED Configuration | +| ------------ | ---------------------- | +| Version | [CIDv1] | +| [Multibase] | [`base58btc`] | +| [Multihash] | [SHA-256] | +| [Multicodec] | [DAG-CBOR] | + +> [!NOTE] +> All CIDs encoded as above start with the characters `zdpu`. + +The resolution of these addresses is left to the implementation and end-user, and MAY (non-exclusively) include the following: local store, a distributed hash table (DHT), gossip network, or RESTful service. + +## Envelope + +All UCAN formats MUST use the following envelope format: + +| Field | Type | Description | +| --------------------------------- | -------------- | -------------------------------------------------------------- | +| `.0` | `Bytes` | A signature by the Payload's `iss` over the `SigPayload` field | +| `.1` | `SigPayload` | The content that was signed | +| `.1.h` | `VarsigHeader` | The [Varsig] v1 header | +| `.1.ucan/@` | `TokenPayload` | The UCAN token payload | + +```mermaid +flowchart TD + subgraph Ucan ["UCAN Envelope"] + SignatureBytes["Signature (raw bytes)"] + + subgraph SigPayload ["Signature Payload"] + VarsigHeader["Varsig Header"] + + subgraph UcanPayload ["Token Payload"] + fields["..."] + end + end + end +``` + +For example: + +```js +[ + { + "/": { + bytes: + "7aEDQLYvb3lygk9yvAbk0OZD0q+iF9c3+wpZC4YlFThkiNShcVriobPFr/wl3akjM18VvIv/Zw2LtA4uUmB5m8PWEAU", + }, + }, + { + h: { "/": { bytes: "NBIFEgEAcQ" } }, + "ucan/example@1.0.0-rc.1": { + hello: "world", + }, + }, +]; +``` + +### Payload + +A UCAN's Payload MUST contain at least the following fields: + +| Field | Type | Required | Description | +| ------- | ----------------------------------------- | -------- | ----------------------------------------------------------- | +| `iss` | `DID` | Yes | Issuer DID (sender) | +| `aud` | `DID` | Yes | Audience DID (receiver) | +| `sub` | `DID` | Yes | Principal that the chain is about (the [Subject]) | +| `cmd` | `String` | Yes | The [Command] to eventually invoke | +| `args` | `{String : Any}` | Yes | Any [Arguments] that MUST be present in the Invocation | +| `nonce` | `Bytes` | Yes | Nonce | +| `meta` | `{String : Any}` | No | [Meta] (asserted, signed data) — is not delegated authority | +| `nbf` | `Integer` (53-bits[^js-num-size]) | No | "Not before" UTC Unix Timestamp in seconds (valid from) | +| `exp` | `Integer \| Null` (53-bits[^js-num-size]) | Yes | Expiration UTC Unix Timestamp in seconds (valid until) | + +# Implementation Recommendations + +## Delegation Store + +A validator MAY keep a local store of UCANs that it has received. UCANs are immutable but also time-bound so that this store MAY evict expired or revoked UCANs. + +This store SHOULD be indexed by CID (content addressing). Multiple indices built on top of this store MAY be used to improve capability search or selection performance. + +## Memoized Validation + +Aside from revocation, capability validation is idempotent. Marking a CID (or capability index inside that CID) as valid acts as memoization, obviating the need to check the entire structure on every validation. This extends to distinct UCANs that share a proof: if the proof was previously reviewed and is not revoked, it is RECOMMENDED to consider it valid immediately. + +Revocation is irreversible. Suppose the validator learns of revocation by UCAN CID. In that case, the UCAN and all of its derivatives in such a cache MUST be marked as invalid, and all validations immediately fail without needing to walk the entire structure. + +## Replay Attack Prevention + +Replay attack prevention is REQUIRED. Every UCAN token MUST hash to a unique [CIDv1]. Some simple strategies for implementing uniqueness tracking include maintaining a set of previously seen CIDs, or requiring that nonces be monotonically increasing per principal. This MAY be the same structure as a validated UCAN memoization table (if one is implemented). + +Maintaining a secondary token expiry index is RECOMMENDED. This enables garbage collection and more efficient search. In cases of very large stores, normal cache performance techniques MAY be used, such as Bloom filters, multi-level caches, and so on. + +## Beyond Single System Image + +> As we continue to increase the number of globally connected devices, we must embrace a design that considers every single member in the system as the primary site for the data that it is generates. It is completely impractical that we can look at a single, or a small number, of globally distributed data centers as the primary site for all global information that we desire to perform computations with. +> +> —[Meiklejohn], [A Certain Tendency Of The Database Community] + +Unlike many authorization systems where a service controls access to resources in their care, location-independent, offline, and leaderless resources require control to live with the user. Therefore, the same data MAY be used across many applications, data stores, and users. Since they don't have a single location, applying UCAN to [RSM]s and [CRDT]s MAY be modelled by lifting the requirement that the Executor be the Subject. + +Ultimately this comes down to a question of push vs pull. In push, the subject MUST be the specific site being pushed to ("I command you to apply the following updates to your state"). + +Pull is the broad class of situations where an Invoker doesn't require that a particular replica apply its state. Applying a change to a local CRDT replica and maintaining a UCAN invocation log is a valid update to "the CRDT": a version of the CRDT Subject exists locally even if the Subject's private key is not present. Gossiping these changes among agents allows each to apply changes that it becomes aware of. Thanks to the invocation log (or equivalent integrated directly into the CRDT), provenance of authority is made transparent. + +```mermaid +sequenceDiagram + participant CRDT as Initial Grow-Only Set (CRDT) + + actor Alice + actor Bob + actor Carol + + autonumber + + Note over CRDT, Bob: Setup + CRDT -->> Alice: delegate(CRDT_ID, merge) + CRDT -->> Bob: delegate(CRDT_ID, merge) + + Note over Bob, Carol: Bob Invites Carol + Bob -->> Carol: delegate(CRDT_ID, merge) + + Note over Alice, Carol: Direct P2P Gossip + Carol ->> Bob: invoke(CRDT_ID, merge, {"Carrot"}, proof: [➋,❸]) + Alice ->> Carol: invoke(CRDT_ID, merge, {"Apple"}}, proof: [➊]) + Bob ->> Alice: invoke(CRDT_ID, merge, {"Banana", "Carrot"}, proof: [➋]) +``` + +## Wrapping Existing Systems + +In the RECOMMENDED scenario, the agent controlling a resource has a unique reference to it. This is always possible in a system that has adopted capabilities end-to-end. + +Interacting with existing systems MAY require relying on ambient authority contained in an ACL, non-unique reference, or other authorization logic. These cases are still compatible with UCAN, but the security guarantees are weaker since 1. the surface area is larger, and 2. part of the auth system lives outside UCAN. + +```mermaid +sequenceDiagram + participant Database + participant ACL as External Auth System + + actor DBAgent + actor Alice + actor Bob + + Note over ACL, DBAgent: Setup + DBAgent ->> ACL: signup(DBAgent) + ACL ->> ACL: register(DBAgent) + + autonumber 1 + + Note over DBAgent, Bob: Delegation + DBAgent -->> Alice: delegate(DBAgent, write) + Alice -->> Bob: delegate(DBAgent, write) + + Note over Database, Bob: Invocation + Bob ->>+ DBAgent: invoke(DBAgent, [write, key, value], proof: [➊,➋]) + + critical External System + DBAgent ->> ACL: getToken(write, key, AuthGrant) + ACL ->> DBAgent: AccessToken + + DBAgent ->> Database: request(write, value, AccessToken) + Database ->> DBAgent: ACK + end + + DBAgent ->>- Bob: ACK +``` + +# FAQ + +## What prevents an unauthorized party from using an intercepted UCAN? + +UCANs always contain information about the sender and receiver. A UCAN is signed by the sender (the `iss` field DID) and can only be created by an agent in possession of the relevant private key. The recipient (the `aud` field DID) is required to check that the field matches their DID. These two checks together secure the certificate against use by an unauthorized party. [UCAN Invocations][invocation] prevent use by an unauthorized party by signing over a request to use the capability granted in a delegation chain. + +## What prevents replay attacks on the invocation use case? + +All UCAN Invocations MUST have a unique CID. The executing agent MUST check this validation uniqueness against a local store of unexpired UCAN hashes. + +This is not a concern when simply delegating since receiving a delegation is idempotent. + +## Is UCAN secure against person-in-the-middle attacks? + +_UCAN does not have any special protection against person-in-the-middle (PITM) attacks._ + +If a PITM attack was successfully performed on a UCAN delegation, the proof chain would contain the attacker's DID(s). It is possible to detect this scenario and revoke the relevant UCAN but this does require special inspection of the topmost `iss` field to check if it is the expected DID. Therefore, it is strongly RECOMMENDED to only delegate UCANs to agents that are both trusted and authenticated and over secure channels. + +## Can my implementation support more cryptographic algorithms? + +It is possible to use other algorithms, but doing so limits interoperability with the broader UCAN ecosystem. This is thus considered "off spec" (i.e. non-interoperable). If you choose to extend UCAN with additional algorithms, you MUST include this metadata in the (self-describing) [Varsig] header. + +# Related Work and Prior Art + +[SPKI/SDSI] is closely related to UCAN. A different encoding format is used, and some details vary (such as a delegation-locking bit), but the core idea and general usage pattern are very close. UCAN can be seen as making these ideas more palatable to a modern audience and adding a few features such as content IDs that were less widespread at the time SPKI/SDSI were written. + +[ZCAP-LD] is closely related to UCAN. The primary differences are in formatting, addressing by URL instead of CID, the mechanism of separating invocation from authorization, and single versus multiple proofs. + +[CACAO] is a translation of many of these ideas to a cross-blockchain delegated bearer token model. It contains the same basic concepts as UCAN delegation, but is aimed at small messages and identities that are rooted in mutable documents rooted on a blockchain and lacks the ability to subdelegate capabilities. + +[Local-First Auth] is a non-certificate-based approach, instead relying on a CRDT to build up a list of group members, devices, and roles. It has a friendly invitation mechanism based on a [Seitan token exchange]. It is also straightforward to see which users have access to what, avoiding the confinement problem seen in many decentralized auth systems. + +[Macaroon] is a MAC-based capability and cookie system aimed at distributing authority across services in a trusted network (typically in the context of a Cloud). By not relying on asymmetric signatures, Macaroons achieve excellent space savings and performance, given that the MAC can be checked against the relevant services during discharge. The authority is rooted in an originating server rather than with an end-user. + +[Biscuit] uses Datalog to describe capabilities. It has a specialized format but is otherwise in line with UCAN. + +[Verifiable credentials] are a solution for data about people or organizations. However, they are aimed at a related-but-distinct problem: asserting attributes about the holder of a DID, including things like work history, age, and membership. + +# Acknowledgments + +Thank you to [Brendan O'Brien] for real-world feedback, technical collaboration, and implementing the first Golang UCAN library. + +Thank you [Blaine Cook] for the real-world feedback, ideas on future features, and lessons from other auth standards. + +Many thanks to [Hugo Dias], [Mikael Rogers], and the entire DAG House team for the real world feedback, and finding inventive new use cases. + +Thank to [Hannah Howard] and [Alan Shaw] at [Storacha] for their team's feedback from real world use cases. + +Many thanks to [Brian Ginsburg] and [Steven Vandevelde] for their many copy edits, feedback from real world usage, maintenance of the TypeScript implementation, and tools such as [ucan.xyz]. + +Many thanks to [Christopher Joel] for his real-world feedback, raising many pragmatic considerations, and the Rust implementation and related crates. + +Many thanks to [Christine Lemmer-Webber] for her handwritten(!) feedback on the design of UCAN, spearheading the [OCapN] initiative, and her related work on [ZCAP-LD]. + +Many thanks to [Alan Karp] for sharing his vast experience with capability-based authorization, patterns, and many right words for us to search for. + +Thanks to [Benjamin Goering] for the many community threads and connections to [W3C] standards. + +Thanks to [Juan Caballero] for the numerous questions, clarifications, and general advice on putting together a comprehensible spec. + +Thank you [Dan Finlay] for being sufficiently passionate about [OCAP] that we realized that capability systems had a real chance of adoption in an ACL-dominated world. + +Thanks to [Peter van Hardenberg][PvH] and [Martin Kleppmann] of [Ink & Switch] for conversations exploring options for access control on CRDTs and [local-first] applications. + +Thanks to the entire [SPKI WG][SPKI/SDSI] for their closely related pioneering work. + +We want to especially recognize [Mark Miller] for his numerous contributions to the field of distributed auth, programming languages, and networked security writ large. + + + +[^js-num-size]: JavaScript has a single numeric type ([`Number`][JS Number]) for both integers and floats. This representation is defined as a [IEEE-754] double-precision floating point number, which has a 53-bit significand. + +[^pcec]: To be precise, this is a [PC/EC][PACELC] system, which is a critical trade-off for many systems. UCAN can be used to model both PC/EC and PA/EL, but is most typically PC/EL. + + + +[Command]: #command +[Cryptosuite]: #cryptosuite +[overcoming SSI]: #beyond-single-system-image +[sub-specifications]: #sub-specifications +[wrapping existing systems]: #wrapping-existing-systems + + + +[IEEE-754]: https://ieeexplore.ieee.org/document/8766229 +[A Certain Tendency Of The Database Community]: https://arxiv.org/pdf/1510.08473.pdf +[ACL]: https://en.wikipedia.org/wiki/Access-control_list +[Alan Karp]: https://github.com/alanhkarp +[Alan Kay]: https://en.wikipedia.org/wiki/Alan_Kay +[Alan Shaw]: https://github.com/alanshaw +[BCP 14]: https://www.rfc-editor.org/info/bcp14 +[BLAKE3]: https://github.com/BLAKE3-team/BLAKE3 +[Benjamin Goering]: https://github.com/gobengo +[Biscuit]: https://github.com/biscuit-auth/biscuit/ +[Blaine Cook]: https://github.com/blaine +[Bluesky]: https://blueskyweb.xyz/ +[Brendan O'Brien]: https://github.com/b5 +[Brian Ginsburg]: https://github.com/bgins +[Brooklyn Zelenka]: https://github.com/expede +[CACAO]: https://blog.ceramic.network/capability-based-data-security-on-ceramic/ +[CIDv1]: https://docs.ipfs.io/concepts/content-addressing/#identifier-formats +[CIDv1]: https://github.com/multiformats/cid +[CRDT]: https://en.wikipedia.org/wiki/Conflict-free_replicated_data_type +[Capability Myths Demolished]: https://srl.cs.jhu.edu/pubs/SRL2003-02.pdf +[Christine Lemmer-Webber]: https://github.com/cwebber +[Christopher Joel]: https://github.com/cdata +[Code Mesh 2016]: https://www.codemesh.io/codemesh2016 +[DAG-CBOR]: https://ipld.io/specs/codecs/dag-cbor/spec/ +[DAG-JSON]: https://ipld.io/specs/codecs/dag-json/spec/ +[DID fragment]: https://www.w3.org/TR/did-core/#fragment +[DID path]: https://www.w3.org/TR/did-core/#path +[DID subject]: https://www.w3.org/TR/did-core/#dfn-did-subjects +[DID]: https://www.w3.org/TR/did-core/ +[Dan Finlay]: https://github.com/danfinlay +[Daniel Holmgren]: https://github.com/dholms +[ECDSA security]: https://en.wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm#Security +[Ed25519]: https://en.wikipedia.org/wiki/EdDSA#Ed25519 +[EdDSA]: https://datatracker.ietf.org/doc/html/rfc8032#section-5.1 +[Email about SPKI]: https://web.archive.org/web/20140724054706/http://wiki.erights.org/wiki/Capability-based_Active_Invocation_Certificates +[FIDO]: https://fidoalliance.org/what-is-fido/ +[Fission]: https://fission.codes +[GUID]: https://en.wikipedia.org/wiki/Universally_unique_identifier +[Hannah Howard]: https://github.com/hannahhoward +[Hugo Dias]: https://github.com/hugomrdias +[IPLD]: https://ipld.io/ +[Ink & Switch]: https://www.inkandswitch.com/ +[Inversion of control]: https://en.wikipedia.org/wiki/Inversion_of_control +[Irakli Gozalishvili]: https://github.com/Gozala +[JWT]: https://www.rfc-editor.org/rfc/rfc7519 +[Joe Armstrong]: https://en.wikipedia.org/wiki/Joe_Armstrong_(programmer) +[Juan Caballero]: https://github.com/bumblefudge +[Local-First Auth]: https://github.com/local-first-web/auth +[Macaroon]: https://storage.googleapis.com/pub-tools-public-publication-data/pdf/41892.pdf +[Mark Miller]: https://github.com/erights +[Martin Kleppmann]: https://martin.kleppmann.com/ +[Meiklejohn]: https://christophermeiklejohn.com/ +[Mikael Rogers]: https://github.com/mikeal/ +[Multibase]: https://github.com/multiformats/multibase +[Multicodec]: https://github.com/multiformats/multicodec +[Multics]: https://en.wikipedia.org/wiki/Multics +[Multihash]: https://www.multiformats.io/multihash/ +[OCAP]: http://erights.org/elib/capability/index.html +[OCapN]: https://github.com/ocapn/ocapn +[P-256]: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-4.pdf#page=111 +[PACELC]: https://en.wikipedia.org/wiki/PACELC_theorem +[Philipp Krüger]: https://github.com/matheus23 +[PoLA]: https://en.wikipedia.org/wiki/Principle_of_least_privilege +[Protocol Labs]: https://protocol.ai/ +[PvH]: https://www.pvh.ca +[RBAC]: https://en.wikipedia.org/wiki/Role-based_access_control +[RFC 2119]: https://datatracker.ietf.org/doc/html/rfc2119 +[RFC 3339]: https://www.rfc-editor.org/rfc/rfc3339 +[RFC 8037]: https://datatracker.ietf.org/doc/html/rfc8037 +[RSM]: https://en.wikipedia.org/wiki/State_machine_replication +[Robust Composition]: http://www.erights.org/talks/thesis/markm-thesis.pdf +[SHA-256]: https://en.wikipedia.org/wiki/SHA-2 +[SPKI/SDSI]: https://datatracker.ietf.org/wg/spki/about/ +[SPKI]: https://theworld.com/~cme/html/spki.html +[Seitan token exchange]: https://book.keybase.io/docs/teams/seitan +[Steven Vandevelde]: https://github.com/icidasset +[Storacha]: https://storacha.network/ +[The Structure of Authority]: http://erights.org/talks/no-sep/secnotsep.pdf +[The computer revolution hasn't happened yet]: https://www.youtube.com/watch?v=oKg1hTOQXoY +[UCAN Promise]: https://github.com/ucan-wg/promise +[URI]: https://www.rfc-editor.org/rfc/rfc3986 +[Varsig]: https://github.com/ChainAgnostic/varsig +[Verifiable credentials]: https://www.w3.org/2017/vc/WG/ +[W3C]: https://www.w3.org/ +[WebCrypto API]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API +[Witchcraft Software]: https://github.com/expede +[ZCAP-LD]: https://w3c-ccg.github.io/zcap-spec/ +[`base58btc`]: https://github.com/multiformats/multibase/blob/master/multibase.csv#L21 +[`did:key`]: https://w3c-ccg.github.io/did-method-key/ +[`secp256k1`]: https://en.bitcoin.it/wiki/Secp256k1 +[browser api crypto key]: https://developer.mozilla.org/en-US/docs/Web/API/CryptoKey +[capabilities]: https://en.wikipedia.org/wiki/Object-capability_model +[caps as keys]: http://www.erights.org/elib/capability/duals/myths.html#caps-as-keys +[certificate capability model]: https://web.archive.org/web/20140724054706/http://wiki.erights.org/wiki/Capability-based_Active_Invocation_Certificates +[confinement]: http://www.erights.org/elib/capability/dist-confine.html +[confused deputy problem]: https://en.wikipedia.org/wiki/Confused_deputy_problem +[constructive semantics]: https://en.wikipedia.org/wiki/Intuitionistic_logic +[content addressable storage]: https://en.wikipedia.org/wiki/Content-addressable_storage +[content addressing]: https://en.wikipedia.org/wiki/Content-addressable_storage +[dag-json multicodec]: https://github.com/multiformats/multicodec/blob/master/table.csv#L104 +[delegation]: https://github.com/ucan-wg/delegation +[fail-safe]: https://en.wikipedia.org/wiki/Fail-safe +[invocation]: https://github.com/ucan-wg/invocation +[local-first]: https://www.inkandswitch.com/local-first/ +[number zero]: https://n0.computer/ +[passkey]: https://www.passkeys.com/ +[promise]: https://github.com/ucan-wg/promise +[raw data multicodec]: https://github.com/multiformats/multicodec/blob/a03169371c0a4aec0083febc996c38c3846a0914/table.csv?plain=1#L41 +[revocation]: https://github.com/ucan-wg/revocation +[secure hardware enclave]: https://support.apple.com/en-ca/guide/security/sec59b0b31ff +[spki rfc]: https://www.rfc-editor.org/rfc/rfc2693.html +[time definition]: https://en.wikipedia.org/wiki/Temporal_database +[trustless]: https://blueskyweb.xyz/blog/3-6-2022-a-self-authenticating-social-protocol +[ucan.xyz]: https://ucan.xyz diff --git a/docs/docs/tools/cosmos-proto.md b/docs/docs/tools/cosmos-proto.md new file mode 100644 index 000000000..9f44a5262 --- /dev/null +++ b/docs/docs/tools/cosmos-proto.md @@ -0,0 +1,569 @@ +# Protocol Buffers in Cosmos SDK + +## Overview + +The Cosmos SDK uses Protocol Buffers for serialization and API definitions. Generation is handled via a Docker image: `ghcr.io/cosmos/proto-builder:0.15.x`. + +## Generation Tools + +- **Buf**: Primary tool for protobuf management +- **protocgen.sh**: Core generation script in `scripts/` +- **Makefile Commands**: Standard commands for generate, lint, format + +## Key Components + +### Buf Configuration + +1. **Workspace Setup** + - Root level buf workspace configuration + - Manages multiple protobuf directories + +2. **Directory Structure** + ``` + proto/ + ├── buf.gen.gogo.yaml # GoGo Protobuf generation + ├── buf.gen.pulsar.yaml # Pulsar API generation + ├── buf.gen.swagger.yaml # OpenAPI/Swagger docs + ├── buf.lock # Dependencies + ├── buf.yaml # Core configuration + ├── cosmos/ # Core protos + └── tendermint/ # Consensus protos + ``` + +3. **Module Protos** + - Located in `x/{moduleName}/proto` + - Module-specific message definitions + +#### `buf.gen.gogo.yaml` + +`buf.gen.gogo.yaml` defines how the protobuf files should be generated for use with in the module. This file uses [gogoproto](https://github.com/gogo/protobuf), a separate generator from the google go-proto generator that makes working with various objects more ergonomic, and it has more performant encode and decode steps + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/main/proto/buf.gen.gogo.yaml#L1-L9 +``` + +#### `buf.gen.pulsar.yaml` + +`buf.gen.pulsar.yaml` defines how protobuf files should be generated using the [new golang apiv2 of protobuf](https://go.dev/blog/protobuf-apiv2). This generator is used instead of the google go-proto generator because it has some extra helpers for Cosmos SDK applications and will have more performant encode and decode than the google go-proto generator. You can follow the development of this generator [here](https://github.com/cosmos/cosmos-proto). + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/main/proto/buf.gen.pulsar.yaml#L1-L18 +``` + +#### `buf.gen.swagger.yaml` + +`buf.gen.swagger.yaml` generates the swagger documentation for the query and messages of the chain. This will only define the REST API end points that were defined in the query and msg servers. You can find examples of this [here](https://github.com/cosmos/cosmos-sdk/blob/main/x/bank/proto/cosmos/bank/v1beta1/query.proto) + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/main/proto/buf.gen.swagger.yaml#L1-L6 +``` + +#### `buf.lock` + +This is an autogenerated file based off the dependencies required by the `.gen` files. There is no need to copy the current one. If you depend on cosmos-sdk proto definitions a new entry for the Cosmos SDK will need to be provided. The dependency you will need to use is `buf.build/cosmos/cosmos-sdk`. + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/main/proto/buf.lock#L1-L16 +``` + +#### `buf.yaml` + +`buf.yaml` defines the [name of your package](https://github.com/cosmos/cosmos-sdk/blob/main/proto/buf.yaml#L3), which [breakage checker](https://buf.build/docs/tutorials/getting-started-with-buf-cli#detect-breaking-changes) to use and how to [lint your protobuf files](https://buf.build/docs/tutorials/getting-started-with-buf-cli#lint-your-api). + +It is advised to use a tagged version of the buf modules corresponding to the version of the Cosmos SDK being are used. + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/main/proto/buf.yaml#L1-L24 +``` + +We use a variety of linters for the Cosmos SDK protobuf files. The repo also checks this in ci. +A reference to the github actions can be found [here](https://github.com/cosmos/cosmos-sdk/blob/main/.github/workflows/proto.yml#L1-L32) + +# ORM + +The Cosmos SDK ORM is a state management library that provides a rich, but opinionated set of tools for managing a +module's state. It provides support for: + +- type safe management of state +- multipart keys +- secondary indexes +- unique indexes +- easy prefix and range queries +- automatic genesis import/export +- automatic query services for clients, including support for light client proofs (still in development) +- indexing state data in external databases (still in development) + +## Design and Philosophy + +The ORM's data model is inspired by the relational data model found in SQL databases. The core abstraction is a table +with a primary key and optional secondary indexes. + +Because the Cosmos SDK uses protobuf as its encoding layer, ORM tables are defined directly in .proto files using +protobuf options. Each table is defined by a single protobuf `message` type and a schema of multiple tables is +represented by a single .proto file. + +Table structure is specified in the same file where messages are defined in order to make it easy to focus on better +design of the state layer. Because blockchain state layout is part of the public API for clients (TODO: link to docs on +light client proofs), it is important to think about the state layout as being part of the public API of a module. +Changing the state layout actually breaks clients, so it is ideal to think through it carefully up front and to aim for +a design that will eliminate or minimize breaking changes down the road. Also, good design of state enables building +more performant and sophisticated applications. Providing users with a set of tools inspired by relational databases +which have a long history of database design best practices and allowing schema to be specified declaratively in a +single place are design choices the ORM makes to enable better design and more durable APIs. + +Also, by only supporting the table abstraction as opposed to key-value pair maps, it is easy to add to new +columns/fields to any data structure without causing a breaking change and the data structures can easily be indexed in +any off-the-shelf SQL database for more sophisticated queries. + +The encoding of fields in keys is designed to support ordered iteration for all protobuf primitive field types +except for `bytes` as well as the well-known types `google.protobuf.Timestamp` and `google.protobuf.Duration`. Encodings +are optimized for storage space when it makes sense (see the documentation in `cosmos/orm/v1/orm.proto` for more details) +and table rows do not use extra storage space to store key fields in the value. + +We recommend that users of the ORM attempt to follow database design best practices such as +[normalization](https://en.wikipedia.org/wiki/Database_normalization) (at least 1NF). +For instance, defining `repeated` fields in a table is considered an anti-pattern because breaks first normal form (1NF). +Although we support `repeated` fields in tables, they cannot be used as key fields for this reason. This may seem +restrictive but years of best practice (and also experience in the SDK) have shown that following this pattern +leads to easier to maintain schemas. + +To illustrate the motivation for these principles with an example from the SDK, historically balances were stored +as a mapping from account -> map of denom to amount. This did not scale well because an account with 100 token balances +needed to be encoded/decoded every time a single coin balance changed. Now balances are stored as account,denom -> amount +as in the example above. With the ORM's data model, if we wanted to add a new field to `Balance` such as +`unlocked_balance` (if vesting accounts were redesigned in this way), it would be easy to add it to this table without +requiring a data migration. Because of the ORM's optimizations, the account and denom are only stored in the key part +of storage and not in the value leading to both a flexible data model and efficient usage of storage. + +## Defining Tables + +To define a table: + +1. create a .proto file to describe the module's state (naming it `state.proto` is recommended for consistency), + and import "cosmos/orm/v1/orm.proto", ex: + +```protobuf +syntax = "proto3"; +package bank_example; + +import "cosmos/orm/v1/orm.proto"; +``` + +2. define a `message` for the table, ex: + +```protobuf +message Balance { + bytes account = 1; + string denom = 2; + uint64 balance = 3; +} +``` + +3. add the `cosmos.orm.v1.table` option to the table and give the table an `id` unique within this .proto file: + +```protobuf +message Balance { + option (cosmos.orm.v1.table) = { + id: 1 + }; + + bytes account = 1; + string denom = 2; + uint64 balance = 3; +} +``` + +4. define the primary key field or fields, as a comma-separated list of the fields from the message which should make + up the primary key: + +```protobuf +message Balance { + option (cosmos.orm.v1.table) = { + id: 1 + primary_key: { fields: "account,denom" } + }; + + bytes account = 1; + string denom = 2; + uint64 balance = 3; +} +``` + +5. add any desired secondary indexes by specifying an `id` unique within the table and a comma-separate list of the + index fields: + +```protobuf +message Balance { + option (cosmos.orm.v1.table) = { + id: 1; + primary_key: { fields: "account,denom" } + index: { id: 1 fields: "denom" } // this allows querying for the accounts which own a denom + }; + + bytes account = 1; + string denom = 2; + uint64 amount = 3; +} +``` + +### Auto-incrementing Primary Keys + +A common pattern in SDK modules and in database design is to define tables with a single integer `id` field with an +automatically generated primary key. In the ORM we can do this by setting the `auto_increment` option to `true` on the +primary key, ex: + +```protobuf +message Account { + option (cosmos.orm.v1.table) = { + id: 2; + primary_key: { fields: "id", auto_increment: true } + }; + + uint64 id = 1; + bytes address = 2; +} +``` + +### Unique Indexes + +A unique index can be added by setting the `unique` option to `true` on an index, ex: + +```protobuf +message Account { + option (cosmos.orm.v1.table) = { + id: 2; + primary_key: { fields: "id", auto_increment: true } + index: {id: 1, fields: "address", unique: true} + }; + + uint64 id = 1; + bytes address = 2; +} +``` + +### Singletons + +The ORM also supports a special type of table with only one row called a `singleton`. This can be used for storing +module parameters. Singletons only need to define a unique `id` and that cannot conflict with the id of other +tables or singletons in the same .proto file. Ex: + +```protobuf +message Params { + option (cosmos.orm.v1.singleton) = { + id: 3; + }; + + google.protobuf.Duration voting_period = 1; + uint64 min_threshold = 2; +} +``` + +## Running Codegen + +NOTE: the ORM will only work with protobuf code that implements the [google.golang.org/protobuf](https://pkg.go.dev/google.golang.org/protobuf) +API. That means it will not work with code generated using gogo-proto. + +To install the ORM's code generator, run: + +```shell +go install cosmossdk.io/orm/cmd/protoc-gen-go-cosmos-orm@latest +``` + +The recommended way to run the code generator is to use [buf build](https://docs.buf.build/build/usage). +This is an example `buf.gen.yaml` that runs `protoc-gen-go`, `protoc-gen-go-grpc` and `protoc-gen-go-cosmos-orm` +using buf managed mode: + +```yaml +version: v1 +managed: + enabled: true + go_package_prefix: + default: foo.bar/api # the go package prefix of your package + override: + buf.build/cosmos/cosmos-sdk: cosmossdk.io/api # required to import the Cosmos SDK api module +plugins: + - name: go + out: . + opt: paths=source_relative + - name: go-grpc + out: . + opt: paths=source_relative + - name: go-cosmos-orm + out: . + opt: paths=source_relative +``` + +## Using the ORM in a module + +### Initialization + +To use the ORM in a module, first create a `ModuleSchemaDescriptor`. This tells the ORM which .proto files have defined +an ORM schema and assigns them all a unique non-zero id. Ex: + +```go +var MyModuleSchema = &ormv1alpha1.ModuleSchemaDescriptor{ + SchemaFile: []*ormv1alpha1.ModuleSchemaDescriptor_FileEntry{ + { + Id: 1, + ProtoFileName: mymodule.File_my_module_state_proto.Path(), + }, + }, +} +``` + +In the ORM generated code for a file named `state.proto`, there should be an interface `StateStore` that got generated +with a constructor `NewStateStore` that takes a parameter of type `ormdb.ModuleDB`. Add a reference to `StateStore` +to your module's keeper struct. Ex: + +```go +type Keeper struct { + db StateStore +} +``` + +Then instantiate the `StateStore` instance via an `ormdb.ModuleDB` that is instantiated from the `SchemaDescriptor` +above and one or more store services from `cosmossdk.io/core/store`. Ex: + +```go +func NewKeeper(storeService store.KVStoreService) (*Keeper, error) { + modDb, err := ormdb.NewModuleDB(MyModuleSchema, ormdb.ModuleDBOptions{KVStoreService: storeService}) + if err != nil { + return nil, err + } + db, err := NewStateStore(modDb) + if err != nil { + return nil, err + } + return Keeper{db: db}, nil +} +``` + +### Using the generated code + +The generated code for the ORM contains methods for inserting, updating, deleting and querying table entries. +For each table in a .proto file, there is a type-safe table interface implemented in generated code. For instance, +for a table named `Balance` there should be a `BalanceTable` interface that looks like this: + +```go +type BalanceTable interface { + Insert(ctx context.Context, balance *Balance) error + Update(ctx context.Context, balance *Balance) error + Save(ctx context.Context, balance *Balance) error + Delete(ctx context.Context, balance *Balance) error + Has(ctx context.Context, account []byte, denom string) (found bool, err error) + // Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. + Get(ctx context.Context, account []byte, denom string) (*Balance, error) + List(ctx context.Context, prefixKey BalanceIndexKey, opts ...ormlist.Option) (BalanceIterator, error) + ListRange(ctx context.Context, from, to BalanceIndexKey, opts ...ormlist.Option) (BalanceIterator, error) + DeleteBy(ctx context.Context, prefixKey BalanceIndexKey) error + DeleteRange(ctx context.Context, from, to BalanceIndexKey) error + + doNotImplement() +} +``` + +This `BalanceTable` should be accessible from the `StateStore` interface (assuming our file is named `state.proto`) +via a `BalanceTable()` accessor method. If all the above example tables/singletons were in the same `state.proto`, +then `StateStore` would get generated like this: + +```go +type BankStore interface { + BalanceTable() BalanceTable + AccountTable() AccountTable + ParamsTable() ParamsTable + + doNotImplement() +} +``` + +So to work with the `BalanceTable` in a keeper method we could use code like this: + +```go +func (k keeper) AddBalance(ctx context.Context, acct []byte, denom string, amount uint64) error { + balance, err := k.db.BalanceTable().Get(ctx, acct, denom) + if err != nil && !ormerrors.IsNotFound(err) { + return err + } + + if balance == nil { + balance = &Balance{ + Account: acct, + Denom: denom, + Amount: amount, + } + } else { + balance.Amount = balance.Amount + amount + } + + return k.db.BalanceTable().Save(ctx, balance) +} +``` + +`List` methods take `IndexKey` parameters. For instance, `BalanceTable.List` takes `BalanceIndexKey`. `BalanceIndexKey` +let's represent index keys for the different indexes (primary and secondary) on the `Balance` table. The primary key +in the `Balance` table gets a struct `BalanceAccountDenomIndexKey` and the first index gets an index key `BalanceDenomIndexKey`. +If we wanted to list all the denoms and amounts that an account holds, we would use `BalanceAccountDenomIndexKey` +with a `List` query just on the account prefix. Ex: + +```go +it, err := keeper.db.BalanceTable().List(ctx, BalanceAccountDenomIndexKey{}.WithAccount(acct)) +``` + +--- + +## sidebar_position: 1 + +# ProtocolBuffer Annotations + +This document explains the various protobuf scalars that have been added to make working with protobuf easier for Cosmos SDK application developers + +## Signer + +Signer specifies which field should be used to determine the signer of a message for the Cosmos SDK. This field can be used for clients as well to infer which field should be used to determine the signer of a message. + +Read more about the signer field [here](./02-messages-and-queries.md). + +```protobuf reference +https://github.com/cosmos/cosmos-sdk/blob/e6848d99b55a65d014375b295bdd7f9641aac95e/proto/cosmos/bank/v1beta1/tx.proto#L40 +``` + +```proto +option (cosmos.msg.v1.signer) = "from_address"; +``` + +## Scalar + +The scalar type defines a way for clients to understand how to construct protobuf messages according to what is expected by the module and sdk. + +```proto +(cosmos_proto.scalar) = "cosmos.AddressString" +``` + +Example of account address string scalar: + +```proto reference +https://github.com/cosmos/cosmos-sdk/blob/e6848d99b55a65d014375b295bdd7f9641aac95e/proto/cosmos/bank/v1beta1/tx.proto#L46 +``` + +Example of validator address string scalar: + +```proto reference +https://github.com/cosmos/cosmos-sdk/blob/e8f28bf5db18b8d6b7e0d94b542ce4cf48fed9d6/proto/cosmos/distribution/v1beta1/query.proto#L87 +``` + +Example of pubkey scalar: + +```proto reference +https://github.com/cosmos/cosmos-sdk/blob/11068bfbcd44a7db8af63b6a8aa079b1718f6040/proto/cosmos/staking/v1beta1/tx.proto#L94 +``` + +Example of Decimals scalar: + +```proto reference +https://github.com/cosmos/cosmos-sdk/blob/e8f28bf5db18b8d6b7e0d94b542ce4cf48fed9d6/proto/cosmos/distribution/v1beta1/distribution.proto#L26 +``` + +Example of Int scalar: + +```proto reference +https://github.com/cosmos/cosmos-sdk/blob/e8f28bf5db18b8d6b7e0d94b542ce4cf48fed9d6/proto/cosmos/gov/v1/gov.proto#L137 +``` + +There are a few options for what can be provided as a scalar: `cosmos.AddressString`, `cosmos.ValidatorAddressString`, `cosmos.ConsensusAddressString`, `cosmos.Int`, `cosmos.Dec`. + +## Implements_Interface + +Implement interface is used to provide information to client tooling like [telescope](https://github.com/cosmology-tech/telescope) on how to encode and decode protobuf messages. + +```proto +option (cosmos_proto.implements_interface) = "cosmos.auth.v1beta1.AccountI"; +``` + +## Method,Field,Message Added In + +`method_added_in`, `field_added_in` and `message_added_in` are annotations to denotate to clients that a field has been supported in a later version. This is useful when new methods or fields are added in later versions and that the client needs to be aware of what it can call. + +The annotation should be worded as follow: + +```proto +option (cosmos_proto.method_added_in) = "cosmos-sdk v0.50.1"; +option (cosmos_proto.method_added_in) = "x/epochs v1.0.0"; +option (cosmos_proto.method_added_in) = "simapp v24.0.0"; +``` + +## Amino + +The amino codec was removed in `v0.50+`, this means there is not a need register `legacyAminoCodec`. To replace the amino codec, Amino protobuf annotations are used to provide information to the amino codec on how to encode and decode protobuf messages. + +:::note +Amino annotations are only used for backwards compatibility with amino. New modules are not required use amino annotations. +::: + +The below annotations are used to provide information to the amino codec on how to encode and decode protobuf messages in a backwards compatible manner. + +### Name + +Name specifies the amino name that would show up for the user in order for them see which message they are signing. + +```proto +option (amino.name) = "cosmos-sdk/BaseAccount"; +``` + +```proto reference +https://github.com/cosmos/cosmos-sdk/blob/e8f28bf5db18b8d6b7e0d94b542ce4cf48fed9d6/proto/cosmos/bank/v1beta1/tx.proto#L41 +``` + +### Field_Name + +Field name specifies the amino name that would show up for the user in order for them see which field they are signing. + +```proto +uint64 height = 1 [(amino.field_name) = "public_key"]; +``` + +```proto reference +https://github.com/cosmos/cosmos-sdk/blob/e8f28bf5db18b8d6b7e0d94b542ce4cf48fed9d6/proto/cosmos/distribution/v1beta1/distribution.proto#L166 +``` + +### Dont_OmitEmpty + +Dont omitempty specifies that the field should not be omitted when encoding to amino. + +```proto +repeated cosmos.base.v1beta1.Coin amount = 3 [(amino.dont_omitempty) = true]; +``` + +```proto reference +https://github.com/cosmos/cosmos-sdk/blob/e8f28bf5db18b8d6b7e0d94b542ce4cf48fed9d6/proto/cosmos/bank/v1beta1/bank.proto#L56 +``` + +### Encoding + +Encoding instructs the amino json marshaler how to encode certain fields that may differ from the standard encoding behaviour. The most common example of this is how `repeated cosmos.base.v1beta1.Coin` is encoded when using the amino json encoding format. The `legacy_coins` option tells the json marshaler [how to encode a null slice](https://github.com/cosmos/cosmos-sdk/blob/e8f28bf5db18b8d6b7e0d94b542ce4cf48fed9d6/x/tx/signing/aminojson/json_marshal.go#L65) of `cosmos.base.v1beta1.Coin`. + +```proto +(amino.encoding) = "legacy_coins", +``` + +```proto reference +https://github.com/cosmos/cosmos-sdk/blob/e8f28bf5db18b8d6b7e0d94b542ce4cf48fed9d6/proto/cosmos/bank/v1beta1/genesis.proto#L23 +``` + +Another example is a protobuf `bytes` that contains a valid JSON document. +The `inline_json` option tells the json marshaler to embed the JSON bytes into the wrapping document without escaping. + +```proto +(amino.encoding) = "inline_json", +``` + +E.g. the bytes containing `{"foo":123}` in the `envelope` field would lead to the following JSON: + +```json +{ + "envelope": { + "foo": 123 + } +} +``` + +If the bytes are not valid JSON, this leads to JSON broken documents. Thus a JSON validity check needs to be in place at some point of the process. diff --git a/docs/docs/tools/cosmos-rfc.md b/docs/docs/tools/cosmos-rfc.md new file mode 100644 index 000000000..d1b9704c9 --- /dev/null +++ b/docs/docs/tools/cosmos-rfc.md @@ -0,0 +1,627 @@ +# RFC 004: Account System Refactor + +## Status +- Draft v2 (May 2023) + +## Current Limitations + +1. **Account Representation**: Limited by `google.Protobuf.Any` encapsulation and basic authentication methods +2. **Interface Constraints**: Lacks support for advanced functionalities like vesting and complex auth systems +3. **Implementation Rigidity**: Poor differentiation between account types (e.g., `ModuleAccount`) +4. **Authorization System**: Basic `x/auth` module with limited scope beyond `x/bank` functionality +5. **Dependency Issues**: Cyclic dependencies between modules (e.g., `x/auth` ↔ `x/bank` for vesting) + +## Proposal + +This proposal aims to transform the way accounts are managed within the Cosmos SDK by introducing significant changes to +their structure and functionality. + +### Rethinking Account Representation and Business Logic + +Instead of representing accounts as simple `google.Protobuf.Any` structures stored in state with no business logic +attached, this proposal suggests a more sophisticated account representation that is closer to module entities. +In fact, accounts should be able to receive messages and process them in the same way modules do, and be capable of storing +state in a isolated (prefixed) portion of state belonging only to them, in the same way as modules do. + +### Account Message Reception + +We propose that accounts should be able to receive messages in the same way modules can, allowing them to manage their +own state modifications without relying on other modules. This change would enable more advanced account functionality, such as the +`VestingAccount` example, where the x/bank module previously needed to change the vestingState by casting the abstracted +account to `VestingAccount` and triggering the `TrackDelegation` call. Accounts are already capable of sending messages when +a state transition, originating from a transaction, is executed. + +When accounts receive messages, they will be able to identify the sender of the message and decide how to process the +state transition, if at all. + +### Consequences + +These changes would have significant implications for the Cosmos SDK, resulting in a system of actors that are equal from +the runtime perspective. The runtime would only be responsible for propagating messages between actors and would not +manage the authorization system. Instead, actors would manage their own authorizations. For instance, there would be no +need for the `x/auth` module to manage minting or burning of coins permissions, as it would fall within the scope of the +`x/bank` module. + +The key difference between accounts and modules would lie in the origin of the message (state transition). Accounts +(ExternallyOwnedAccount), which have credentials (e.g., a public/private key pairing), originate state transitions from +transactions. In contrast, module state transitions do not have authentication credentials backing them and can be +caused by two factors: either as a consequence of a state transition coming from a transaction or triggered by a scheduler +(e.g., the runtime's Begin/EndBlock). + +By implementing these proposed changes, the Cosmos SDK will benefit from a more extensible, versatile, and efficient account +management system that is better suited to address the requirements of the Cosmos ecosystem. + +#### Standardization + +With `x/accounts` allowing a modular api there becomes a need for standardization of accounts or the interfaces wallets and other clients should expect to use. For this reason we will be using the [`CIP` repo](https://github.com/cosmos/cips) in order to standardize interfaces in order for wallets to know what to expect when interacting with accounts. + +## Implementation + +### Account Definition + +We define the new `Account` type, which is what an account needs to implement to be treated as such. +An `Account` type is defined at APP level, so it cannot be dynamically loaded as the chain is running without upgrading the +node code, unless we create something like a `CosmWasmAccount` which is an account backed by an `x/wasm` contract. + +```go +// Account is what the developer implements to define an account. +type Account[InitMsg proto.Message] interface { + // Init is the function that initialises an account instance of a given kind. + // InitMsg is used to initialise the initial state of an account. + Init(ctx *Context, msg InitMsg) error + // RegisterExecuteHandlers registers an account's execution messages. + RegisterExecuteHandlers(executeRouter *ExecuteRouter) + // RegisterQueryHandlers registers an account's query messages. + RegisterQueryHandlers(queryRouter *QueryRouter) + // RegisterMigrationHandlers registers an account's migration messages. + RegisterMigrationHandlers(migrationRouter *MigrationRouter) +} +``` + +### The InternalAccount definition + +The public `Account` interface implementation is then converted by the runtime into an `InternalAccount` implementation, +which contains all the information and business logic needed to operate the account. + +```go +type Schema struct { + state StateSchema // represents the state of an account + init InitSchema // represents the init msg schema + exec ExecSchema // represents the multiple execution msg schemas, containing also responses + query QuerySchema // represents the multiple query msg schemas, containing also responses + migrate *MigrateSchema // represents the multiple migrate msg schemas, containing also responses, it's optional +} + +type InternalAccount struct { + init func(ctx *Context, msg proto.Message) (*InitResponse, error) + execute func(ctx *Context, msg proto.Message) (*ExecuteResponse, error) + query func(ctx *Context, msg proto.Message) (proto.Message, error) + schema func() *Schema + migrate func(ctx *Context, msg proto.Message) (*MigrateResponse, error) +} +``` + +This is an internal view of the account as intended by the system. It is not meant to be what developers implement. An +example implementation of the `InternalAccount` type can be found in [this](https://github.com/testinginprod/accounts-poc/blob/main/examples/recover/recover.go) +example of account whose credentials can be recovered. In fact, even if the `Internal` implementation is untyped (with +respect to `proto.Message`), the concrete implementation is fully typed. + +During any of the execution methods of `InternalAccount`, `schema` excluded, the account is given a `Context` which provides: + +- A namespaced `KVStore` for the account, which isolates the account state from others (NOTE: no `store keys` needed, + the account address serves as `store key`). +- Information regarding itself (its address) +- Information regarding the sender. +- ... + +#### Init + +Init defines the entrypoint that allows for a new account instance of a given kind to be initialised. +The account is passed some opaque protobuf message which is then interpreted and contains the instructions that +constitute the initial state of an account once it is deployed. + +An `Account` code can be deployed multiple times through the `Init` function, similar to how a `CosmWasm` contract code +can be deployed (Instantiated) multiple times. + +#### Execute + +Execute defines the entrypoint that allows an `Account` to process a state transition, the account can decide then how to +process the state transition based on the message provided and the sender of the transition. + +#### Query + +Query defines a read-only entrypoint that provides a stable interface that links an account with its state. The reason for +which `Query` is still being preferred as an addition to raw state reflection is to: + +- Provide a stable interface for querying (state can be optimised and change more frequently than a query) +- Provide a way to define an account `Interface` with respect to its `Read/Write` paths. +- Provide a way to query information that cannot be processed from raw state reflection, ex: compute information from lazy + state that has not been yet concretely processed (eg: balances with respect to lazy inputs/outputs) + +#### Schema + +Schema provides the definition of an account from `API` perspective, and it's the only thing that should be taken into account +when interacting with an account from another account or module, for example: an account is an `authz-interface` account if +it has the following message in its execution messages `MsgProxyStateTransition{ state_transition: google.Protobuf.Any }`. + +### Migrate + +Migrate defines the entrypoint that allows an `Account` to migrate its state from a previous version to a new one. Migrations +can be initiated only by the account itself, concretely this means that the migrate action sender can only be the account address +itself, if the account wants to allow another address to migrate it on its behalf then it could create an execution message +that makes the account migrate itself. + +### x/accounts module + +In order to create accounts we define a new module `x/accounts`, note that `x/accounts` deploys account with no authentication +credentials attached to it which means no action of an account can be incepted from a TX, we will later explore how the +`x/authn` module uses `x/accounts` to deploy authenticated accounts. + +This also has another important implication for which account addresses are now fully decoupled from the authentication mechanism +which makes in turn off-chain operations a little more complex, as the chain becomes the real link between account identifier +and credentials. + +We could also introduce a way to deterministically compute the account address. + +Note, from the transaction point of view, the `init_message` and `execute_message` are opaque `google.Protobuf.Any`. + +The module protobuf definition for `x/accounts` are the following: + +```protobuf +// Msg defines the Msg service. +service Msg { + rpc Deploy(MsgDeploy) returns (MsgDeployResponse); + rpc Execute(MsgExecute) returns (MsgExecuteResponse); + rpc Migrate(MsgMigrate) returns (MsgMigrateResponse); +} + +message MsgDeploy { + string sender = 1; + string kind = 2; + google.Protobuf.Any init_message = 3; + repeated google.Protobuf.Any authorize_messages = 4 [(gogoproto.nullable) = false]; +} + +message MsgDeployResponse { + string address = 1; + uint64 id = 2; + google.Protobuf.Any data = 3; +} + +message MsgExecute { + string sender = 1; + string address = 2; + google.Protobuf.Any message = 3; + repeated google.Protobuf.Any authorize_messages = 4 [(gogoproto.nullable) = false]; +} + +message MsgExecuteResponse { + google.Protobuf.Any data = 1; +} + +message MsgMigrate { + string sender = 1; + string new_account_kind = 2; + google.Protobuf.Any migrate_message = 3; +} + +message MsgMigrateResponse { + google.Protobuf.Any data = 1; +} + +``` + +#### MsgDeploy + +Deploys a new instance of the given account `kind` with initial settings represented by the `init_message` which is a `google.Protobuf.Any`. +Of course the `init_message` can be empty. A response is returned containing the account ID and humanised address, alongside some response +that the account instantiation might produce. + +#### Address derivation + +In order to decouple public keys from account addresses, we introduce a new address derivation mechanism which is + +#### MsgExecute + +Sends a `StateTransition` execution request, where the state transition is represented by the `message` which is a `google.Protobuf.Any`. +The account can then decide if to process it or not based on the `sender`. + +### MsgMigrate + +Migrates an account to a new version of itself, the new version is represented by the `new_account_kind`. The state transition +can only be incepted by the account itself, which means that the `sender` must be the account address itself. During the migration +the account current state is given to the new version of the account, which then executes the migration logic using the `migrate_message`, +it might change state or not, it's up to the account to decide. The response contains possible data that the account might produce +after the migration. + +#### Authorize Messages + +The `Deploy` and `Execute` messages have a field in common called `authorize_messages`, these messages are messages that the account +can execute on behalf of the sender. For example, in case an account is expecting some funds to be sent from the sender, +the sender can attach a `MsgSend` that the account can execute on the sender's behalf. These authorizations are short-lived, +they live only for the duration of the `Deploy` or `Execute` message execution, or until they are consumed. + +An alternative would have been to add a `funds` field, like it happens in cosmwasm, which guarantees the called contract that +the funds are available and sent in the context of the message execution. This would have been a simpler approach, but it would +have been limited to the context of `MsgSend` only, where the asset is `sdk.Coins`. The proposed generic way, instead, allows +the account to execute any message on behalf of the sender, which is more flexible, it could include NFT send execution, or +more complex things like `MsgMultiSend` or `MsgDelegate`, etc. + +### Further discussion + +#### Sub-accounts + +We could provide a way to link accounts to other accounts. Maybe during deployment the sender could decide to link the +newly created to its own account, although there might be use-cases for which the deployer is different from the account +that needs to be linked, in this case a handshake protocol on linking would need to be defined. + +#### Predictable address creation + +We need to provide a way to create an account with a predictable address, this might serve a lot of purposes, like accounts +wanting to generate an address that: + +- nobody else can claim besides the account used to generate the new account +- is predictable + +For example: + +```protobuf + +message MsgDeployPredictable { + string sender = 1; + uint32 nonce = 2; + ... +} +``` + +And then the address becomes `bechify(concat(sender, nonce))` + +`x/accounts` would still use the monotonically increasing sequence as account number. + +#### Joining Multiple Accounts + +As developers are building new kinds of accounts, it becomes necessary to provide a default way to combine the +functionalities of different account types. This allows developers to avoid duplicating code and enables end-users to +create or migrate to accounts with multiple functionalities without requiring custom development. + +To address this need, we propose the inclusion of a default account type called "MultiAccount". The MultiAccount type is +designed to merge the functionalities of other accounts by combining their execution, query, and migration APIs. +The account joining process would only fail in the case of API (intended as non-state Schema APIs) conflicts, ensuring +compatibility and consistency. + +With the introduction of the MultiAccount type, users would have the option to either migrate their existing accounts to +a MultiAccount type or extend an existing MultiAccount with newer APIs. This flexibility empowers users to leverage +various account functionalities without compromising compatibility or resorting to manual code duplication. + +The MultiAccount type serves as a standardized solution for combining different account functionalities within the +cosmos-sdk ecosystem. By adopting this approach, developers can streamline the development process and users can benefit +from a modular and extensible account system. + +# ADR 071: Cryptography v2- Multi-curve support + +## Change log + +- May 7th 2024: Initial Draft (Zondax AG: @raynaudoe @juliantoledano @jleni @educlerici-zondax @lucaslopezf) +- June 13th 2024: Add CometBFT implementation proposal (Zondax AG: @raynaudoe @juliantoledano @jleni @educlerici-zondax @lucaslopezf) +- July 2nd 2024: Split ADR proposal, add link to ADR in cosmos/crypto (Zondax AG: @raynaudoe @juliantoledano @jleni @educlerici-zondax @lucaslopezf) + +## Status + +DRAFT + +## Abstract + +This ADR proposes the refactoring of the existing `Keyring` and `cosmos-sdk/crypto` code to implement [ADR-001-CryptoProviders](https://github.com/cosmos/crypto/blob/main/docs/architecture/adr-001-crypto-provider.md). + +For in-depth details of the `CryptoProviders` and their design please refer to ADR mentioned above. + +## Introduction + +The introduction of multi-curve support in the cosmos-sdk cryptographic package offers significant advantages. By not being restricted to a single cryptographic curve, developers can choose the most appropriate curve based on security, performance, and compatibility requirements. This flexibility enhances the application's ability to adapt to evolving security standards and optimizes performance for specific use cases, helping to future-proofing the sdk's cryptographic capabilities. + +The enhancements in this proposal not only render the ["Keyring ADR"](https://github.com/cosmos/cosmos-sdk/issues/14940) obsolete, but also encompass its key aspects, replacing it with a more flexible and comprehensive approach. Furthermore, the gRPC service proposed in the mentioned ADR can be easily implemented as a specialized `CryptoProvider`. + +### Glossary + +1. **Interface**: In the context of this document, "interface" refers to Go's interface. + +2. **Module**: In this document, "module" refers to a Go module. + +3. **Package**: In the context of Go, a "package" refers to a unit of code organization. + +## Context + +In order to fully understand the need for changes and the proposed improvements, it's crucial to consider the current state of affairs: + +- The Cosmos SDK currently lacks a comprehensive ADR for the cryptographic package. + +- If a blockchain project requires a cryptographic curve that is not supported by the current SDK, the most likely scenario is that they will need to fork the SDK repository and make modifications. These modifications could potentially make the fork incompatible with future updates from the upstream SDK, complicating maintenance and integration. + +- Type leakage of specific crypto data types expose backward compatibility and extensibility challenges. + +- The demand for a more flexible and extensible approach to cryptography and address management is high. + +- Architectural changes are necessary to resolve many of the currently open issues related to new curves support. + +- There is a current trend towards modularity in the Interchain stack (e.g., runtime modules). + +- Security implications are a critical consideration during the redesign work. + +## Objectives + +The key objectives for this proposal are: + +- Leverage `CryptoProviders`: Utilize them as APIs for cryptographic tools, ensuring modularity, flexibility, and ease of integration. + +Developer-Centric Approach + +- Prioritize clear, intuitive interfaces and best-practice design principles. + +Quality Assurance + +- Enhanced Test Coverage: Improve testing methodologies to ensure the robustness and reliability of the module. + +## Technical Goals + +New Keyring: + +- Design a new `Keyring` interface with modular backends injection system to support hardware devices and cloud-based HSMs. This feature is optional and tied to complexity; if it proves too complex, it will be deferred to a future release as an enhancement. + +## Proposed architecture + +### Components + +The main components to be used will be the same as those found in the [ADR-001](https://github.com/cosmos/crypto/blob/main/docs/architecture/adr-001-crypto-provider.md#components). + +#### Storage and persistence + +The storage and persistence layer is tasked with storing a `CryptoProvider`s. Specifically, this layer must: + +- Securely store the crypto provider's associated private key (only if stored locally, otherwise a reference to the private key will be stored instead). +- Store the [`ProviderMetadata`](https://github.com/cosmos/crypto/blob/main/docs/architecture/adr-001-crypto-provider.md#metadata) struct which contains the data that distinguishes that provider. + +The purpose of this layer is to ensure that upon retrieval of the persisted data, we can access the provider's type, version, and specific configuration (which varies based on the provider type). This information will subsequently be utilized to initialize the appropriate factory, as detailed in the following section on the factory pattern. + +The storage proposal involves using a modified version of the [Record](https://github.com/cosmos/cosmos-sdk/blob/main/proto/cosmos/crypto/keyring/v1/record.proto) struct, which is already defined in **Keyring/v1**. Additionally, we propose utilizing the existing keyring backends (keychain, filesystem, memory, etc.) to store these `Record`s in the same manner as the current **Keyring/v1**. + +_Note: This approach will facilitate a smoother migration path from the current Keyring/v1 to the proposed architecture._ + +Below is the proposed protobuf message to be included in the modified `Record.proto` file + +##### Protobuf message structure + +The [record.proto](https://github.com/cosmos/cosmos-sdk/blob/main/proto/cosmos/crypto/keyring/v1/record.proto) file will be modified to include the `CryptoProvider` message as an optional field as follows. + +```protobuf + +// record.proto + +message Record { + string name = 1; + google.protobuf.Any pub_key = 2; + + oneof item { + Local local = 3; + Ledger ledger = 4; + Multi multi = 5; + Offline offline = 6; + CryptoProvider crypto_provider = 7; // <- New + } + + message Local { + google.protobuf.Any priv_key = 1; + } + + message Ledger { + hd.v1.BIP44Params path = 1; + } + + message Multi {} + + message Offline {} +} +``` + +##### Creating and loading a `CryptoProvider` + +For creating providers, we propose a _factory pattern_ and a _registry_ for these builders. Examples of these +patterns can be found [here](https://github.com/cosmos/crypto/blob/main/docs/architecture/adr-001-crypto-provider.md#illustrative-code-snippets) + +##### Keyring + +The new `Keyring` interface will serve as a central hub for managing and fetching `CryptoProviders`. To ensure a smoother migration path, the new Keyring will be backward compatible with the previous version. Since this will be the main API from which applications will obtain their `CryptoProvider` instances, the proposal is to extend the Keyring interface to include the methods: + +```go +type KeyringV2 interface { + // methods from Keyring/v1 + + // ListCryptoProviders returns a list of all the stored CryptoProvider metadata. + ListCryptoProviders() ([]ProviderMetadata, error) + + // GetCryptoProvider retrieves a specific CryptoProvider by its id. + GetCryptoProvider(id string) (CryptoProvider, error) +} +``` + +_Note_: Methods to obtain a provider from a public key or other means that make it easier to load the desired provider can be added. + +##### Especial use case: remote signers + +It's important to note that the `CryptoProvider` interface is versatile enough to be implemented as a remote signer. This capability allows for the integration of remote cryptographic operations, which can be particularly useful in distributed or cloud-based environments where local cryptographic resources are limited or need to be managed centrally. + +## Alternatives + +It is important to note that all the code presented in this document is not in its final form and could be subject to changes at the time of implementation. The examples and implementations discussed should be interpreted as alternatives, providing a conceptual framework rather than definitive solutions. This flexibility allows for adjustments based on further insights, technical evaluations, or changing requirements as development progresses. + +## Decision + +We will: + +- Leverage crypto providers +- Refactor the module structure as described above. +- Define types and interfaces as the code attached. +- Refactor existing code into new structure and interfaces. +- Implement Unit Tests to ensure no backward compatibility issues. + +## Consequences + +### Impact on the SDK codebase + +We can divide the impact of this ADR into two main categories: state machine code and client related code. + +#### Client + +The major impact will be on the client side, where the current `Keyring` interface will be replaced by the new `KeyringV2` interface. At first, the impact will be low since `CryptoProvider` is an optional field in the `Record` message, so there's no mandatory requirement for migrating to this new concept right away. This allows a progressive transition where the risks of breaking changes or regressions are minimized. + +#### State Machine + +The impact on the state machine code will be minimal, the modules affected (at the time of writing this ADR) +are the `x/accounts` module, specifically the `Authenticate` function and the `x/auth/ante` module. This function will need to be adapted to use a `CryptoProvider` service to make use of the `Verifier` instance. + +Worth mentioning that there's also the alternative of using `Verifier` instances in a standalone fashion (see note below). + +The specific way to adapt these modules will be deeply analyzed and decided at implementation time of this ADR. + +_Note_: All cryptographic tools (hashers, verifiers, signers, etc.) will continue to be available as standalone packages that can be imported and utilized directly without the need for a `CryptoProvider` instance. However, the `CryptoProvider` is the recommended method for using these tools as it offers a more secure way to handle sensitive data, enhanced modularity, and the ability to store configurations and metadata within the `CryptoProvider` definition. + +### Backwards Compatibility + +The proposed migration path is similar to what the cosmos-sdk has done in the past. To ensure a smooth transition, the following steps will be taken: + +Once ADR-001 is implemented with a stable release: + +- Deprecate the old crypto package. The old crypto package will still be usable, but it will be marked as deprecated and users can opt to use the new package. +- Migrate the codebase to use the new cosmos/crypto package and remove the old crypto one. + +### Positive + +- Single place of truth +- Easier to use interfaces +- Easier to extend +- Unit test for each crypto package +- Greater maintainability +- Incentivize addition of implementations instead of forks +- Decoupling behavior from implementation +- Sanitization of code + +### Negative + +- It will involve an effort to adapt existing code. +- It will require attention to detail and audition. + +### Neutral + +- It will involve extensive testing. + +## Test Cases + +- The code will be unit tested to ensure a high code coverage +- There should be integration tests around Keyring and CryptoProviders. + +> While an ADR is in the DRAFT or PROPOSED stage, this section should contain a +> summary of issues to be solved in future iterations (usually referencing comments +> from a pull-request discussion). +> +> Later, this section can optionally list ideas or improvements the author or +> reviewers found during the analysis of this ADR. + +# ADR-71 Bank V2 + +## Status + +DRAFT + +## Changelog + +- 2024-05-08: Initial Draft (@samricotta, @julienrbrt) + +## Abstract + +The primary objective of refactoring the bank module is to simplify and enhance the functionality of the Cosmos SDK. Over time the bank module has been burdened with numerous responsibilities including transaction handling, account restrictions, delegation counting, and the minting and burning of coins. + +In addition to the above, the bank module is currently too rigid and handles too many tasks, so this proposal aims to streamline the module by focusing on core functions `Send`, `Mint`, and `Burn`. + +Currently, the module is split across different keepers with scattered and duplicates functionalities (with 4 send functions for instance). + +Additionally, the integration of the token factory into the bank module allows for standardization, and better integration within the core modules. + +This rewrite will reduce complexity and enhance the efficiency and UX of the bank module. + +## Context + +The current implementation of the bank module is characterised by its handling of a broad array of functions, leading to significant complexity in using and extending the bank module. + +These issues have underscored the need for a refactoring strategy that simplifies the module’s architecture and focuses on its most essential operations. + +Additionally, there is an overlap in functionality with a Token Factory module, which could be integrated to streamline oper. + +## Decision + +**Permission Tightening**: Access to the module can be restricted to selected denominations only, ensuring that it operates within designated boundaries and does not exceed its intended scope. Currently, the permissions allow all denoms, so this should be changed. Send restrictions functionality will be maintained. + +**Simplification of Logic**: The bank module will focus on core functionalities `Send`, `Mint`, and `Burn`. This refinement aims to streamline the architecture, enhancing both maintainability and performance. + +**Integration of Token Factory**: The Token Factory will be merged into the bank module. This consolidation of related functionalities aims to reduce redundancy and enhance coherence within the system. Migrations functions will be provided for migrating from Osmosis' Token Factory module to bank/v2. + +**Legacy Support**: A legacy wrapper will be implemented to ensure compatibility with about 90% of existing functions. This measure will facilitate a smooth transition while keeping older systems functional. + +**Denom Implementation**: A asset interface will be added to standardise interactions such as transfers, balance inquiries, minting, and burning across different tokens. This will allow the bank module to support arbitrary asset types, enabling developers to implement custom, ERC20-like denominations. + +For example, currently if a team would like to extend the transfer method the changes would apply universally, affecting all denom’s. With the proposed Asset Interface, it allows teams to customise or extend the transfer method specifically for their own tokens without impacting others. + +These improvements are expected to enhance the flexibility of the bank module, allowing for the creation of custom tokens similar to ERC20 standards and assets backed by CosmWasm (CW) contracts. The integration efforts will also aim to unify CW20 with bank coins across the Cosmos chains. + +Example of denom interface: + +```go +type AssetInterface interface { + Transfer(ctx sdk.Context, from sdk.AccAddress, to sdk.AccAddress, amount sdk.Coin) error + Mint(ctx sdk.Context, to sdk.AccAddress, amount sdk.Coin) error + Burn(ctx sdk.Context, from sdk.AccAddress, amount sdk.Coin) error + QueryBalance(ctx sdk.Context, account sdk.AccAddress) (sdk.Coin, error) +} +``` + +Overview of flow: + +1. Alice initiates a transfer by entering Bob's address and the amount (100 ATOM) +2. The Bank module verifies that the ATOM token implements the `AssetInterface` by querying the `ATOM_Denom_Account`, which is an `x/account` denom account. +3. The Bank module executes the transfer by subtracting 100 ATOM from Alice’s balance and adding 100 ATOM to Bob’s balance. +4. The Bank module calls the Transfer method on the `ATOM_Denom_Account`. The Transfer method, defined in the `AssetInterface`, handles the logic to subtract 100 ATOM from Alice’s balance and add 100 ATOM to Bob’s balance. +5. The Bank module updates the chain and returns the new balances. +6. Both Alice and Bob successfully receive the updated balances. + +## Migration Plans + +Bank is a widely used module, so getting a v2 needs to be thought thoroughly. In order to not force all dependencies to immediately migrate to bank/v2, the same _upgrading_ path will be taken as for the `gov` module. + +This means `cosmossdk.io/bank` will stay one module and there won't be a new `cosmossdk.io/bank/v2` go module. Instead the bank protos will be versioned from `v1beta1` (current bank) to `v2`. + +Bank `v1beta1` endpoints will use the new bank v2 implementation for maximum backward compatibility. + +The bank `v1beta1` keepers will be deprecated and potentially eventually removed, but its proto and messages definitions will remain. + +Additionally, as bank plans to integrate token factory, migrations functions will be provided to migrate from Osmosis token factory implementation (most widely used implementation) to the new bank/v2 token factory. + +## Consequences + +### Positive + +- Simplified interaction with bank APIs +- Backward compatible changes (no contracts or apis broken) +- Optional migration (note: bank `v1beta1` won't get any new feature after bank `v2` release) + +### Neutral + +- Asset implementation not available cross-chain (IBC-ed custom asset should possibly fallback to the default implementation) +- Many assets may slow down bank balances requests + +### Negative + +- Temporarily duplicate functionalities as bank `v1beta1` are `v2` are living alongside +- Difficultity to ever completely remove bank `v1beta1` + +### References + +- Current bank module implementation: https://github.com/cosmos/cosmos-sdk/blob/v0.50.6/x/bank/keeper/keeper.go#L22-L53 +- Osmosis token factory: https://github.com/osmosis-labs/osmosis/tree/v25.0.0/x/tokenfactory/keeper diff --git a/docs/docs/tools/cosmos-sdk.md b/docs/docs/tools/cosmos-sdk.md new file mode 100644 index 000000000..6679af362 --- /dev/null +++ b/docs/docs/tools/cosmos-sdk.md @@ -0,0 +1,685 @@ +# Cosmos SDK Core Components + +## Overview + +The Cosmos SDK is a framework for building secure blockchain applications on CometBFT. It provides: + +- ABCI implementation in Go +- Multi-store persistence layer +- Transaction routing system + +## Transaction Flow + +1. CometBFT consensus delivers transaction bytes +2. SDK decodes transactions and extracts messages +3. Messages routed to appropriate modules +4. State changes committed to stores + +```mermaid +graph TD + A[CometBFT] -->|Tx Bytes| B[SDK Decode] + B -->|Messages| C[Module Router] + C -->|State Changes| D[Multi-store] +``` + +## `baseapp` + +`baseapp` is the boilerplate implementation of a Cosmos SDK application. It comes with an implementation of the ABCI to handle the connection with the underlying consensus engine. Typically, a Cosmos SDK application extends `baseapp` by embedding it in [`app.go`](../beginner/00-app-anatomy.md#core-application-file). + +Here is an example of this from `simapp`, the Cosmos SDK demonstration app: + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/v0.52.0-beta.1/simapp/app.go#L145-L186 +``` + +The goal of `baseapp` is to provide a secure interface between the store and the extensible state machine while defining as little about the state machine as possible (staying true to the ABCI). + +For more on `baseapp`, please click [here](../advanced/00-baseapp.md). + +## Multistore + +The Cosmos SDK provides a [`multistore`](../advanced/04-store.md#multistore) for persisting state. The multistore allows developers to declare any number of [`KVStores`](../advanced/04-store.md#base-layer-kvstores). These `KVStores` only accept the `[]byte` type as value and therefore any custom structure needs to be marshalled using [a codec](../advanced/05-encoding.md) before being stored. + +The multistore abstraction is used to divide the state in distinct compartments, each managed by its own module. For more on the multistore, click [here](../advanced/04-store.md#multistore). + +## Modules + +The power of the Cosmos SDK lies in its modularity. Cosmos SDK applications are built by aggregating a collection of interoperable modules. Each module defines a subset of the state and contains its own message/transaction processor, while the Cosmos SDK is responsible for routing each message to its respective module. + +Here is a simplified view of how a transaction is processed by the application of each full-node when it is received in a valid block: + +```mermaid + flowchart TD + A[Transaction relayed from the full-node's CometBFT engine to the node's application via DeliverTx] --> B[APPLICATION] + B -->|"Using baseapp's methods: Decode the Tx, extract and route the message(s)"| C[Message routed to the correct module to be processed] + C --> D1[AUTH MODULE] + C --> D2[BANK MODULE] + C --> D3[STAKING MODULE] + C --> D4[GOV MODULE] + D1 -->|Handle message, Update state| E["Return result to CometBFT (0=Ok, 1=Err)"] + D2 -->|Handle message, Update state| E["Return result to CometBFT (0=Ok, 1=Err)"] + D3 -->|Handle message, Update state| E["Return result to CometBFT (0=Ok, 1=Err)"] + D4 -->|Handle message, Update state| E["Return result to CometBFT (0=Ok, 1=Err)"] +``` + +Each module can be seen as a little state-machine. Developers need to define the subset of the state handled by the module, as well as custom message types that modify the state (_Note:_ `messages` are extracted from `transactions` by `baseapp`). In general, each module declares its own `KVStore` in the `multistore` to persist the subset of the state it defines. Most developers will need to access other 3rd party modules when building their own modules. Given that the Cosmos SDK is an open framework, some of the modules may be malicious, which means there is a need for security principles to reason about inter-module interactions. These principles are based on [object-capabilities](../advanced/10-ocap.md). In practice, this means that instead of having each module keep an access control list for other modules, each module implements special objects called `keepers` that can be passed to other modules to grant a pre-defined set of capabilities. + +Cosmos SDK modules are defined in the `x/` folder of the Cosmos SDK. Some core modules include: + +- `x/auth`: Used to manage accounts and signatures. +- `x/bank`: Used to enable tokens and token transfers. +- `x/staking` + `x/slashing`: Used to build Proof-of-Stake blockchains. + +In addition to the already existing modules in `x/`, which anyone can use in their app, the Cosmos SDK lets you build your own custom modules. You can check an [example of that in the tutorial](https://tutorials.cosmos.network/).# Keepers + +:::note Synopsis +`Keeper`s refer to a Cosmos SDK abstraction whose role is to manage access to the subset of the state defined by various modules. `Keeper`s are module-specific, i.e. the subset of state defined by a module can only be accessed by a `keeper` defined in said module. If a module needs to access the subset of state defined by another module, a reference to the second module's internal `keeper` needs to be passed to the first one. This is done in `app.go` during the instantiation of module keepers. +::: + +:::note Pre-requisite Readings + +- [Introduction to Cosmos SDK Modules](./00-intro.md) + +::: + +## Motivation + +The Cosmos SDK is a framework that makes it easy for developers to build complex decentralized applications from scratch, mainly by composing modules together. As the ecosystem of open-source modules for the Cosmos SDK expands, it will become increasingly likely that some of these modules contain vulnerabilities, as a result of the negligence or malice of their developer. + +The Cosmos SDK adopts an [object-capabilities-based approach](https://docs.cosmos.network/main/learn/advanced/ocap#ocaps-in-practice) to help developers better protect their application from unwanted inter-module interactions, and `keeper`s are at the core of this approach. A `keeper` can be considered quite literally to be the gatekeeper of a module's store(s). Each store (typically an [`IAVL` Store](../../learn/advanced/04-store.md#iavl-store)) defined within a module comes with a `storeKey`, which grants unlimited access to it. The module's `keeper` holds this `storeKey` (which should otherwise remain unexposed), and defines [methods](#implementing-methods) for reading and writing to the store(s). + +The core idea behind the object-capabilities approach is to only reveal what is necessary to get the work done. In practice, this means that instead of handling permissions of modules through access-control lists, module `keeper`s are passed a reference to the specific instance of the other modules' `keeper`s that they need to access (this is done in the [application's constructor function](../../learn/beginner/00-app-anatomy.md#constructor-function)). As a consequence, a module can only interact with the subset of state defined in another module via the methods exposed by the instance of the other module's `keeper`. This is a great way for developers to control the interactions that their own module can have with modules developed by external developers. + +## Type Definition + +`keeper`s are generally implemented in a `/keeper/keeper.go` file located in the module's folder. By convention, the type `keeper` of a module is simply named `Keeper` and usually follows the following structure: + +```go +type Keeper struct { + // External keepers, if any + + // Store key(s) + + // codec + + // authority +} +``` + +For example, here is the type definition of the `keeper` from the `staking` module: + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/v0.52.0-beta.1/x/staking/keeper/keeper.go#L54-L115 +``` + +Let us go through the different parameters: + +- An expected `keeper` is a `keeper` external to a module that is required by the internal `keeper` of said module. External `keeper`s are listed in the internal `keeper`'s type definition as interfaces. These interfaces are themselves defined in an `expected_keepers.go` file in the root of the module's folder. In this context, interfaces are used to reduce the number of dependencies, as well as to facilitate the maintenance of the module itself. +- `KVStoreService`s grant access to the store(s) of the [multistore](../../learn/advanced/04-store.md) managed by the module. They should always remain unexposed to external modules. +- `cdc` is the [codec](../../learn/advanced/05-encoding.md) used to marshal and unmarshal structs to/from `[]byte`. The `cdc` can be any of `codec.BinaryCodec`, `codec.JSONCodec` or `codec.Codec` based on your requirements. It can be either a proto or amino codec as long as they implement these interfaces. +- The authority listed is a module account or user account that has the right to change module level parameters. Previously this was handled by the param module, which has been deprecated. + +Of course, it is possible to define different types of internal `keeper`s for the same module (e.g. a read-only `keeper`). Each type of `keeper` comes with its own constructor function, which is called from the [application's constructor function](../../learn/beginner/00-app-anatomy.md). This is where `keeper`s are instantiated, and where developers make sure to pass correct instances of modules' `keeper`s to other modules that require them. + +## Implementing Methods + +`Keeper`s primarily expose methods for business logic, as validity checks should have already been performed by the [`Msg` server](./03-msg-services.md) when `keeper`s' methods are called. + + + +State management is recommended to be done via [Collections](../packages/collections) + + + +## State Management + +In the Cosmos SDK, it is crucial to be methodical and selective when managing state within a module, as improper state management can lead to inefficiency, security risks, and scalability issues. Not all data belongs in the on-chain state; it's important to store only essential blockchain data that needs to be verified by consensus. Storing unnecessary information, especially client-side data, can bloat the state and slow down performance. Instead, developers should focus on using an off-chain database to handle supplementary data, extending the API as needed. This approach minimizes on-chain complexity, optimizes resource usage, and keeps the blockchain state lean and efficient, ensuring scalability and smooth operations. + +The Cosmos SDK leverages Protocol Buffers (protobuf) for efficient state management, providing a well-structured, binary encoding format that ensures compatibility and performance across different modules. The SDK’s recommended approach for managing state is through the [collections package](../pacakges/02-collections.md), which simplifies state handling by offering predefined data structures like maps and indexed sets, reducing the complexity of managing raw state data. While users can opt for custom encoding schemes if they need more flexibility or have specialized requirements, they should be aware that such custom implementations may not integrate seamlessly with indexers that decode state data on the fly. This could lead to challenges in data retrieval, querying, and interoperability, making protobuf a safer and more future-proof choice for most use cases. + +# Folder Structure + +:::note Synopsis +This document outlines the structure of Cosmos SDK modules. These ideas are meant to be applied as suggestions. Application developers are encouraged to improve upon and contribute to module structure and development design. + +The required interface for a module is located in the module.go. Everything beyond this is suggestive. +::: + +## Structure + +A typical Cosmos SDK module can be structured as follows: + +```shell +proto +└── {project_name} +    └── {module_name} +    └── {proto_version} +       ├── {module_name}.proto +       ├── genesis.proto +       ├── query.proto +       └── tx.proto +``` + +- `{module_name}.proto`: The module's common message type definitions. +- `genesis.proto`: The module's message type definitions related to genesis state. +- `query.proto`: The module's Query service and related message type definitions. +- `tx.proto`: The module's Msg service and related message type definitions. + +```shell +x/{module_name} +├── client +│   ├── cli +│   │ ├── query.go +│   │   └── tx.go +│   └── testutil +│   ├── cli_test.go +│   └── suite.go +├── exported +│   └── exported.go +├── keeper +│   ├── genesis.go +│   ├── grpc_query.go +│   ├── hooks.go +│   ├── invariants.go +│   ├── keeper.go +│   ├── keys.go +│   ├── msg_server.go +│   └── querier.go +├── simulation +│   ├── decoder.go +│   ├── genesis.go +│   ├── operations.go +│   └── params.go +├── types +│   ├── {module_name}.pb.go +│ ├── codec.go +│ ├── errors.go +│ ├── events.go +│ ├── events.pb.go +│ ├── expected_keepers.go +│ ├── genesis.go +│ ├── genesis.pb.go +│ ├── keys.go +│ ├── msgs.go +│ ├── params.go +│ ├── query.pb.go +│ └── tx.pb.go +├── module.go +├── abci.go +├── autocli.go +├── depinject.go +└── README.md +``` + +- `client/`: The module's CLI client functionality implementation and the module's CLI testing suite. +- `exported/`: The module's exported types - typically interface types. If a module relies on keepers from another module, it is expected to receive the keepers as interface contracts through the `expected_keepers.go` file (see below) in order to avoid a direct dependency on the module implementing the keepers. However, these interface contracts can define methods that operate on and/or return types that are specific to the module that is implementing the keepers and this is where `exported/` comes into play. The interface types that are defined in `exported/` use canonical types, allowing for the module to receive the keepers as interface contracts through the `expected_keepers.go` file. This pattern allows for code to remain DRY and also alleviates import cycle chaos. +- `keeper/`: The module's `Keeper` and `MsgServer` implementation. + - `abci.go`: The module's `BeginBlocker` and `EndBlocker` implementations (this file is only required if `BeginBlocker` and/or `EndBlocker` need to be defined). +- `simulation/`: The module's [simulation](./14-simulator.md) package defines functions used by the blockchain simulator application (`simapp`). +- `README.md`: The module's specification documents outlining important concepts, state storage structure, and message and event type definitions. Learn more how to write module specs in the [spec guidelines](../spec/SPEC_MODULE.md). +- `types/`: includes type definitions for messages, events, and genesis state, including the type definitions generated by Protocol Buffers. + - `codec.go`: The module's registry methods for interface types. + - `errors.go`: The module's sentinel errors. + - `events.go`: The module's event types and constructors. + - `expected_keepers.go`: The module's [expected keeper](./06-keeper.md#type-definition) interfaces. + - `genesis.go`: The module's genesis state methods and helper functions. + - `keys.go`: The module's store keys and associated helper functions. + - `msgs.go`: The module's message type definitions and associated methods. + - `params.go`: The module's parameter type definitions and associated methods. + - `*.pb.go`: The module's type definitions generated by Protocol Buffers (as defined in the respective `*.proto` files above). +- The root directory includes the module's `AppModule` implementation. + - `autocli.go`: The module [autocli](https://docs.cosmos.network/main/core/autocli) options. + - `depinject.go`: The module [depinject](./15-depinject.md#type-definition) options. + +> Note: although the above pattern is followed by most of the Cosmos SDK modules, there are some modules that don't follow this pattern. E.g `x/group` and `x/nft` dont have a `types` folder, instead all of the type definitions for messages, events, and genesis state are live in the root directory and the module's `AppModule` implementation lives in the `module` folder. + +--- + +## sidebar_position: 1 + +# `Msg` Services + +:::note Synopsis +A Protobuf `Msg` service processes [messages](./02-messages-and-queries.md#messages). Protobuf `Msg` services are specific to the module in which they are defined, and only process messages defined within the said module. They are called from `BaseApp` during [`FinalizeBlock`](../../learn/advanced/00-baseapp.md#finalizeblock). +::: + +:::note Pre-requisite Readings + +- [Module Manager](./01-module-manager.md) +- [Messages and Queries](./02-messages-and-queries.md) + +::: + +## Implementation of a module `Msg` service + +Each module should define a Protobuf `Msg` service, which will be responsible for processing requests (implementing `sdk.Msg`) and returning responses. + +As further described in [ADR 031](../architecture/adr-031-msg-service.md), this approach has the advantage of clearly specifying return types and generating server and client code. + +Protobuf generates a `MsgServer` interface based on the definition of `Msg` service. It is the role of the module developer to implement this interface, by implementing the state transition logic that should happen upon receival of each `transaction.Msg`. As an example, here is the generated `MsgServer` interface for `x/bank`, which exposes two `transaction.Msg`s: + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/28fa3b8/x/bank/types/tx.pb.go#L564-L579 +``` + +When possible, the existing module's [`Keeper`](./06-keeper.md) should implement `MsgServer`, otherwise a `msgServer` struct that embeds the `Keeper` can be created, typically in `./keeper/msg_server.go`: + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/28fa3b8/x/bank/keeper/msg_server.go#L16-L19 +``` + +`msgServer` methods can retrieve the auxiliary information or services using the environment variable, it is always located in the keeper: + +Environment: + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/07151304e2ec6a185243d083f59a2d543253cb15/core/appmodule/v2/environment.go#L14-L29 +``` + +Keeper Example: + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/07151304e2ec6a185243d083f59a2d543253cb15/x/bank/keeper/keeper.go#L56-L58 +``` + +`transaction.Msg` processing usually follows these 3 steps: + +### Validation + +The message server must perform all validation required (both _stateful_ and _stateless_) to make sure the `message` is valid. +The `signer` is charged for the gas cost of this validation. + +For example, a `msgServer` method for a `transfer` message should check that the sending account has enough funds to actually perform the transfer. + +It is recommended to implement all validation checks in a separate function that passes state values as arguments. This implementation simplifies testing. As expected, expensive validation functions charge additional gas. Example: + +```go +ValidateMsgA(msg MsgA, now Time, gm GasMeter) error { + if now.Before(msg.Expire) { + return sdkerrors.ErrInvalidRequest.Wrap("msg expired") + } + gm.ConsumeGas(1000, "signature verification") + return signatureVerificaton(msg.Prover, msg.Data) +} +``` + +:::warning +Previously, the `ValidateBasic` method was used to perform simple and stateless validation checks. +This way of validating is deprecated, this means the `msgServer` must perform all validation checks. +::: + +### State Transition + +After the validation is successful, the `msgServer` method uses the [`keeper`](./06-keeper.md) functions to access the state and perform a state transition. + +### Events + +Before returning, `msgServer` methods generally emit one or more [events](../../learn/advanced/08-events.md) by using the `EventManager` held in `environment`. + +There are two ways to emit events, typed events using protobuf or arbitrary key & values. + +Typed Events: + +```go +ctx.EventManager().EmitTypedEvent( + &group.EventABC{Key1: Value1, Key2, Value2}) +``` + +Arbitrary Events: + +```go +ctx.EventManager().EmitEvent( + sdk.NewEvent( + eventType, // e.g. sdk.EventTypeMessage for a message, types.CustomEventType for a custom event defined in the module + sdk.NewAttribute(key1, value1), + sdk.NewAttribute(key2, value2), + ), +) +``` + +These events are relayed back to the underlying consensus engine and can be used by service providers to implement services around the application. Click [here](../../learn/advanced/08-events.md) to learn more about events. + +The invoked `msgServer` method returns a `proto.Message` response and an `error`. These return values are then wrapped into an `*sdk.Result` or an `error`: + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/baseapp/msg_service_router.go#L160 +``` + +This method takes care of marshaling the `res` parameter to protobuf and attaching any events on the `EventManager()` to the `sdk.Result`. + +```protobuf reference +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/proto/cosmos/base/abci/v1beta1/abci.proto#L93-L113 +``` + +This diagram shows a typical structure of a Protobuf `Msg` service, and how the message propagates through the module. + +```mermaid +sequenceDiagram + participant User + participant baseApp + participant router + participant handler + participant msgServer + participant keeper + participant EventManager + + User->>baseApp: Transaction Type + baseApp->>router: Route(ctx, msgRoute) + router->>handler: handler + handler->>msgServer: Msg(Context, Msg(..)) + + alt addresses invalid, denominations wrong, etc. + msgServer->>handler: error + handler->>router: error + router->>baseApp: result, error code + else + msgServer->>keeper: perform action, update context + keeper->>msgServer: results, error code + msgServer->>EventManager: Emit relevant events + msgServer->>msgServer: maybe wrap results in more structure + msgServer->>handler: result, error code + handler->>router: result, error code + router->>baseApp: result, error code + end + + baseApp->>User: result, error code +``` + +## Telemetry + +New [telemetry metrics](../../learn/advanced/09-telemetry.md) can be created from `msgServer` methods when handling messages. + +This is an example from the `x/auth/vesting` module: + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/auth/vesting/msg_server.go#L76-L88 +``` + +:::Warning +Telemetry adds a performance overhead to the chain. It is recommended to only use this in critical paths +::: + +--- + +## sidebar_position: 1 + +# Query Services + +:::note Synopsis +A Protobuf Query service processes [`queries`](./02-messages-and-queries.md#queries). Query services are specific to the module in which they are defined, and only process `queries` defined within said module. They are called from `BaseApp`'s [`Query` method](../../learn/advanced/00-baseapp.md#query). +::: + +:::note Pre-requisite Readings + +- [Module Manager](./01-module-manager.md) +- [Messages and Queries](./02-messages-and-queries.md) + +::: + +## Implementation of a module query service + +### gRPC Service + +When defining a Protobuf `Query` service, a `QueryServer` interface is generated for each module with all the service methods: + +```go +type QueryServer interface { + QueryBalance(context.Context, *QueryBalanceParams) (*types.Coin, error) + QueryAllBalances(context.Context, *QueryAllBalancesParams) (*QueryAllBalancesResponse, error) +} +``` + +These custom queries methods should be implemented by a module's keeper, typically in `./keeper/grpc_query.go`. The first parameter of these methods is a generic `context.Context`. Therefore, the Cosmos SDK provides a function `sdk.UnwrapSDKContext` to retrieve the `context.Context` from the provided +`context.Context`. + +Here's an example implementation for the bank module: + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/bank/keeper/grpc_query.go +``` + +### Calling queries from the State Machine + +The Cosmos SDK v0.47 introduces a new `cosmos.query.v1.module_query_safe` Protobuf annotation which is used to state that a query that is safe to be called from within the state machine, for example: + +- a Keeper's query function can be called from another module's Keeper, +- ADR-033 intermodule query calls, +- CosmWasm contracts can also directly interact with these queries. + +If the `module_query_safe` annotation set to `true`, it means: + +- The query is deterministic: given a block height it will return the same response upon multiple calls, and doesn't introduce any state-machine breaking changes across SDK patch versions. +- Gas consumption never fluctuates across calls and across patch versions. + +If you are a module developer and want to use `module_query_safe` annotation for your own query, you have to ensure the following things: + +- the query is deterministic and won't introduce state-machine-breaking changes without coordinated upgrades +- it has its gas tracked, to avoid the attack vector where no gas is accounted for + on potentially high-computation queries. + + *** + + sidebar_position: 1 + +--- + +# Blockchain Architecture + +## Introduction + +Blockchain architecture is a complex topic that involves many different components. In this section, we will cover the main layers of a blockchain application built with the Cosmos SDK. + +At its core, a blockchain is a replicated deterministic state machine. This document explores the various layers of blockchain architecture, focusing on the execution, settlement, consensus, data availability, and interoperability layers. + +```mermaid +graph TD + A[Modular SDK Blockchain Architecture] + A --> B[Execution Layer] + A --> C[Settlement Layer] + A --> D[Consensus Layer] + D --> E[Data Availability Layer] + A --> F[Interoperability Layer] +``` + +## Layered Architecture + +Understanding blockchain architecture through the lens of different layers helps in comprehending its complex functionalities. We will give a high-level overview of the execution layer, settlement layer, consensus layer, data availability layer, and interoperability layer. + +## Execution Layer + +The Execution Layer is where the blockchain processes and executes transactions. The state machine within the blockchain handles the execution of transaction logic. This is done by the blockchain itself, ensuring that every transaction follows the predefined rules and state transitions. When a transaction is submitted, the execution layer processes it, updates the state, and ensures that the output is deterministic and consistent across all nodes. In the context of the Cosmos SDK, this typically involves predefined modules and transaction types rather than general-purpose smart contracts, which are used in chains with CosmWasm. + +### State machine + +At its core, a blockchain is a [replicated deterministic state machine](https://en.wikipedia.org/wiki/State_machine_replication). + +A state machine is a computer science concept whereby a machine can have multiple states, but only one at any given time. There is a `state`, which describes the current state of the system, and `transactions`, that trigger state transitions. + +Given a state S and a transaction T, the state machine will return a new state S'. + +```mermaid +flowchart LR + A[S] + B[S'] + A -->|"apply(T)"| B +``` + +In practice, the transactions are bundled in blocks to make the process more efficient. Given a state S and a block of transactions B, the state machine will return a new state S'. + +```mermaid +flowchart LR + A[S] + B[S'] + A -->|"For each T in B: apply(T)"| B +``` + +In a blockchain context, the state machine is [deterministic](https://en.wikipedia.org/wiki/Deterministic_system). This means that if a node is started at a given state and replays the same sequence of transactions, it will always end up with the same final state. + +The Cosmos SDK gives developers maximum flexibility to define the state of their application, transaction types and state transition functions. The process of building state machines with the Cosmos SDK will be described more in-depth in the following sections. But first, let us see how the state machine is replicated using various consensus engines, such as CometBFT. + +## Settlement Layer + +The Settlement Layer is responsible for finalising and recording transactions on the blockchain. This layer ensures that all transactions are accurately settled and immutable, providing a verifiable record of all activities on the blockchain. It is critical for maintaining the integrity and trustworthiness of the blockchain. + +The settlement layer can be performed on the chain itself or it can be externalised, allowing for the possibility of plugging in a different settlement layer as needed. For example if we were to use Rollkit and celestia for our Data Availability and Consensus, we could separate our settlement layer by introducing fraud or validity proofs. From there the settlement layer can create trust-minimised light clients, further enhancing security and efficiency. This process ensures that all transactions are accurately finalized and immutable, providing a verifiable record of all activities. + +## Consensus Layer + +The Consensus Layer ensures that all nodes in the network agree on the order and validity of transactions. This layer uses consensus algorithms like Byzantine Fault Tolerance (BFT) or Proof of Stake (PoS) to achieve agreement, even in the presence of malicious nodes. Consensus is crucial for maintaining the security and reliability of the blockchain. + +What has been a default consensus engine in the Cosmos SDK has been CometBFT. In the most recent releases we have been moving away from this and allowing users to plug and play their own consensus engines. This is a big step forward for the Cosmos SDK as it allows for more flexibility and customisation. Other consensus engine options for example can be Rollkit with Celestias Data Availability Layer. + +Here is an example of how the consensus layer works with CometBFT in the context of the Cosmos SDK: + +### CometBFT + +Thanks to the Cosmos SDK, developers just have to define the state machine, and [_CometBFT_](https://docs.cometbft.com/v1.0/explanation/introduction/) will handle replication over the network for them. + +```mermaid +flowchart TD + subgraph Blockchain_Node[Blockchain Node] + subgraph SM[State-machine] + direction TB + SM1[Cosmos SDK] + end + subgraph CometBFT[CometBFT] + direction TB + Consensus + Networking + end + end + + SM <--> CometBFT + + + Blockchain_Node -->|Includes| SM + Blockchain_Node -->|Includes| CometBFT +``` + +[CometBFT](https://docs.cometbft.com/v1.0/explanation/introduction/) is an application-agnostic engine that is responsible for handling the _networking_ and _consensus_ layers of a blockchain. In practice, this means that CometBFT is responsible for propagating and ordering transaction bytes. CometBFT relies on an eponymous Byzantine-Fault-Tolerant (BFT) algorithm to reach consensus on the order of transactions. + +The [consensus algorithm adopted by CometBFT](https://docs.cometbft.com/v1.0/explanation/introduction/#consensus-overview) works with a set of special nodes called _Validators_. Validators are responsible for adding blocks of transactions to the blockchain. At any given block, there is a validator set V. A validator in V is chosen by the algorithm to be the proposer of the next block. This block is considered valid if more than two thirds of V signed a `prevote` and a `precommit` on it, and if all the transactions that it contains are valid. The validator set can be changed by rules written in the state-machine. + +## ABCI + +CometBFT passes transactions to the application through an interface called the [ABCI](https://docs.cometbft.com/v1.0/spec/abci/), which the application must implement. + +```mermaid +graph TD + A[Application] + B[CometBFT] + A <-->|ABCI| B + +``` + +Note that **CometBFT only handles transaction bytes**. It has no knowledge of what these bytes mean. All CometBFT does is order these transaction bytes deterministically. CometBFT passes the bytes to the application via the ABCI, and expects a return code to inform it if the messages contained in the transactions were successfully processed or not. + +Here are the most important messages of the ABCI: + +- `CheckTx`: When a transaction is received by CometBFT, it is passed to the application to check if a few basic requirements are met. `CheckTx` is used to protect the mempool of full-nodes against spam transactions. A special handler called the [`AnteHandler`](../beginner/04-gas-fees.md#antehandler) is used to execute a series of validation steps such as checking for sufficient fees and validating the signatures. If the checks are valid, the transaction is added to the [mempool](https://docs.cometbft.com/v1.0/explanation/core/mempool) and relayed to peer nodes. Note that transactions are not processed (i.e. no modification of the state occurs) with `CheckTx` since they have not been included in a block yet. +- `DeliverTx`: When a [valid block](https://docs.cometbft.com/v1.0/spec/core/data_structures#block) is received by CometBFT, each transaction in the block is passed to the application via `DeliverTx` in order to be processed. It is during this stage that the state transitions occur. The `AnteHandler` executes again, along with the actual [`Msg` service](../../build/building-modules/03-msg-services.md) RPC for each message in the transaction. +- `BeginBlock`/`EndBlock`: These messages are executed at the beginning and the end of each block, whether the block contains transactions or not. It is useful to trigger automatic execution of logic. Proceed with caution though, as computationally expensive loops could slow down your blockchain, or even freeze it if the loop is infinite. + +Find a more detailed view of the ABCI methods from the [CometBFT docs](https://docs.cometbft.com/v1.0/spec/abci/). + +Any application built on CometBFT needs to implement the ABCI interface in order to communicate with the underlying local CometBFT engine. Fortunately, you do not have to implement the ABCI interface. The Cosmos SDK provides a boilerplate implementation of it in the form of [baseapp](./03-sdk-design.md#baseapp). + +## Data Availability Layer + +The Data Availability (DA) Layer is a critical component of within the umbrella of the consensus layer that ensures all necessary data for transactions is available to all network participants. This layer is essential for preventing data withholding attacks, where some nodes might attempt to disrupt the network by not sharing critical transaction data. + +If we use the example of Rollkit, a user initiates a transaction, which is then propagated through the rollup network by a light node. The transaction is validated by full nodes and aggregated into a block by the sequencer. This block is posted to a data availability layer like Celestia, ensuring the data is accessible and correctly ordered. The rollup light node verifies data availability from the DA layer. Full nodes then validate the block and generate necessary proofs, such as fraud proofs for optimistic rollups or zk-SNARKs/zk-STARKs for zk-rollups. These proofs are shared across the network and verified by other nodes, ensuring the rollup's integrity. Once all validations are complete, the rollup's state is updated, finalising the transaction + +## Interoperability Layer + +The Interoperability Layer enables communication and interaction between different blockchains. This layer facilitates cross-chain transactions and data sharing, allowing various blockchain networks to interoperate seamlessly. Interoperability is key for building a connected ecosystem of blockchains, enhancing their functionality and reach. + +In this case we have separated the layers even further to really illustrate the components that make-up the blockchain architecture and it is important to note that the Cosmos SDK is designed to be interoperable with other blockchains. This is achieved through the use of the [Inter-Blockchain Communication (IBC) protocol](https://www.ibcprotocol.dev/), which allows different blockchains to communicate and transfer assets between each other. + +--- + +## sidebar_position: 1 + +# Application-Specific Blockchains + +:::note Synopsis +This document explains what application-specific blockchains are, and why developers would want to build one as opposed to writing Smart Contracts. +::: + +## What are application-specific blockchains + +Application-specific blockchains are blockchains customized to operate a single application. Instead of building a decentralized application on top of an underlying blockchain like Ethereum, developers build their own blockchain from the ground up. This means building a full-node client, a light-client, and all the necessary interfaces (CLI, REST, ...) to interact with the nodes. + +```mermaid +flowchart TD + subgraph Blockchain_Node[Blockchain Node] + subgraph SM[State-machine] + direction TB + SM1[Cosmos SDK] + end + subgraph Consensus[Consensus] + direction TB + end + subgraph Networking[Networking] + direction TB + end + end + + SM <--> Consensus + Consensus <--> Networking + + + Blockchain_Node -->|Includes| SM + Blockchain_Node -->|Includes| Consensus + Blockchain_Node -->|Includes| Networking +``` + +## What are the shortcomings of Smart Contracts + +Virtual-machine blockchains like Ethereum addressed the demand for more programmability back in 2014. At the time, the options available for building decentralized applications were quite limited. Most developers would build on top of the complex and limited Bitcoin scripting language, or fork the Bitcoin codebase which was hard to work with and customize. + +Virtual-machine blockchains came in with a new value proposition. Their state-machine incorporates a virtual-machine that is able to interpret turing-complete programs called Smart Contracts. These Smart Contracts are very good for use cases like one-time events (e.g. ICOs), but they can fall short for building complex decentralized platforms. Here is why: + +- Smart Contracts are generally developed with specific programming languages that can be interpreted by the underlying virtual-machine. These programming languages are often immature and inherently limited by the constraints of the virtual-machine itself. For example, the Ethereum Virtual Machine does not allow developers to implement automatic execution of code. Developers are also limited to the account-based system of the EVM, and they can only choose from a limited set of functions for their cryptographic operations. These are examples, but they hint at the lack of **flexibility** that a smart contract environment often entails. +- Smart Contracts are all run by the same virtual machine. This means that they compete for resources, which can severely restrain **performance**. And even if the state-machine were to be split in multiple subsets (e.g. via sharding), Smart Contracts would still need to be interpreted by a virtual machine, which would limit performance compared to a native application implemented at state-machine level (our benchmarks show an improvement on the order of 10x in performance when the virtual-machine is removed). +- Another issue with the fact that Smart Contracts share the same underlying environment is the resulting limitation in **sovereignty**. A decentralized application is an ecosystem that involves multiple players. If the application is built on a general-purpose virtual-machine blockchain, stakeholders have very limited sovereignty over their application, and are ultimately superseded by the governance of the underlying blockchain. If there is a bug in the application, very little can be done about it. + +Application-Specific Blockchains are designed to address these shortcomings. + +## Application-Specific Blockchains Benefits + +### Flexibility + +Application-specific blockchains give maximum flexibility to developers: + +- In Cosmos blockchains, the state-machine is typically connected to the underlying consensus engine via an interface called the [ABCI](https://docs.cometbft.com/v1.0/spec/abci/) (Application Blockchain Interface). This interface can be wrapped in any programming language, meaning developers can build their state-machine in the programming language of their choice. + +- Developers can choose among multiple frameworks to build their state-machine. The most widely used today is the Cosmos SDK, but others exist (e.g. [Lotion](https://github.com/nomic-io/lotion), [Weave](https://github.com/iov-one/weave), ...). Typically the choice will be made based on the programming language they want to use (Cosmos SDK and Weave are in Golang, Lotion is in Javascript, ...). +- The ABCI also allows developers to swap the consensus engine of their application-specific blockchain. Today, only CometBFT is production-ready, but in the future other consensus engines are expected to emerge. +- Even when they settle for a framework and consensus engine, developers still have the freedom to tweak them if they don't perfectly match their requirements in their pristine forms. +- Developers are free to explore the full spectrum of tradeoffs (e.g. number of validators vs transaction throughput, safety vs availability in asynchrony, ...) and design choices (DB or IAVL tree for storage, UTXO or account model, ...). +- Developers can implement automatic execution of code. In the Cosmos SDK, logic can be automatically triggered at the beginning and the end of each block. They are also free to choose the cryptographic library used in their application, as opposed to being constrained by what is made available by the underlying environment in the case of virtual-machine blockchains. + +The list above contains a few examples that show how much flexibility application-specific blockchains give to developers. The goal of Cosmos and the Cosmos SDK is to make developer tooling as generic and composable as possible, so that each part of the stack can be forked, tweaked and improved without losing compatibility. As the community grows, more alternatives for each of the core building blocks will emerge, giving more options to developers. + +### Performance + +Decentralized applications built with Smart Contracts are inherently capped in performance by the underlying environment. For a decentralized application to optimise performance, it needs to be built as an application-specific blockchain. Next are some of the benefits an application-specific blockchain brings in terms of performance: + +- Developers of application-specific blockchains can choose to operate with a novel consensus engine such as CometBFT. +- An application-specific blockchain only operates a single application, so that the application does not compete with others for computation and storage. This is the opposite of most non-sharded virtual-machine blockchains today, where smart contracts all compete for computation and storage. +- Even if a virtual-machine blockchain offered application-based sharding coupled with an efficient consensus algorithm, performance would still be limited by the virtual-machine itself. The real throughput bottleneck is the state-machine, and requiring transactions to be interpreted by a virtual-machine significantly increases the computational complexity of processing them. + +### Security + +Security is hard to quantify, and greatly varies from platform to platform. That said here are some important benefits an application-specific blockchain can bring in terms of security: + +- Developers can choose proven programming languages like Go when building their application-specific blockchains, as opposed to smart contract programming languages that are often more immature. +- Developers are not constrained by the cryptographic functions made available by the underlying virtual-machines. They can use their own custom cryptography, and rely on well-audited crypto libraries. +- Developers do not have to worry about potential bugs or exploitable mechanisms in the underlying virtual-machine, making it easier to reason about the security of the application. + +### Sovereignty + +One of the major benefits of application-specific blockchains is sovereignty. A decentralized application is an ecosystem that involves many actors: users, developers, third-party services, and more. When developers build on virtual-machine blockchain where many decentralized applications coexist, the community of the application is different than the community of the underlying blockchain, and the latter supersedes the former in the governance process. If there is a bug or if a new feature is needed, stakeholders of the application have very little leeway to upgrade the code. If the community of the underlying blockchain refuses to act, nothing can happen. + +The fundamental issue here is that the governance of the application and the governance of the network are not aligned. This issue is solved by application-specific blockchains. Because application-specific blockchains specialize to operate a single application, stakeholders of the application have full control over the entire chain. This ensures that the community will not be stuck if a bug is discovered, and that it has the freedom to choose how it is going to evolve. diff --git a/docs/docs/tools/ibc-accounts.md b/docs/docs/tools/ibc-accounts.md new file mode 100644 index 000000000..1dbcdd1eb --- /dev/null +++ b/docs/docs/tools/ibc-accounts.md @@ -0,0 +1,40 @@ +# Interchain Accounts + +:::note Synopsis +Learn about what the Interchain Accounts module is +::: + +## What is the Interchain Accounts module? + +Interchain Accounts is the Cosmos SDK implementation of the ICS-27 protocol, which enables cross-chain account management built upon IBC. + +- How does an interchain account differ from a regular account? + +Regular accounts use a private key to sign transactions. Interchain Accounts are instead controlled programmatically by counterparty chains via IBC packets. + +## Concepts + +`Host Chain`: The chain where the interchain account is registered. The host chain listens for IBC packets from a controller chain which should contain instructions (e.g. Cosmos SDK messages) for which the interchain account will execute. + +`Controller Chain`: The chain registering and controlling an account on a host chain. The controller chain sends IBC packets to the host chain to control the account. + +`Interchain Account`: An account on a host chain created using the ICS-27 protocol. An interchain account has all the capabilities of a normal account. However, rather than signing transactions with a private key, a controller chain will send IBC packets to the host chain which signals what transactions the interchain account should execute. + +`Authentication Module`: A custom application module on the controller chain that uses the Interchain Accounts module to build custom logic for the creation & management of interchain accounts. It can be either an IBC application module using the [legacy API](10-legacy/03-keeper-api.md), or a regular Cosmos SDK application module sending messages to the controller submodule's `MsgServer` (this is the recommended approach from ibc-go v6 if access to packet callbacks is not needed). Please note that the legacy API will eventually be removed and IBC applications will not be able to use them in later releases. + +## SDK security model + +SDK modules on a chain are assumed to be trustworthy. For example, there are no checks to prevent an untrustworthy module from accessing the bank keeper. + +The implementation of ICS-27 in ibc-go uses this assumption in its security considerations. + +The implementation assumes other IBC application modules will not bind to ports within the ICS-27 namespace. + +## Channel Closure + +The provided interchain account host and controller implementations do not support `ChanCloseInit`. However, they do support `ChanCloseConfirm`. +This means that the host and controller modules cannot close channels, but they will confirm channel closures initiated by other implementations of ICS-27. + +In the event of a channel closing (due to a packet timeout in an ordered channel, for example), the interchain account associated with that channel can become accessible again if a new channel is created with a (JSON-formatted) version string that encodes the exact same `Metadata` information of the previous channel. The channel can be reopened using either [`MsgRegisterInterchainAccount`](./05-messages.md#msgregisterinterchainaccount) or `MsgChannelOpenInit`. If `MsgRegisterInterchainAccount` is used, then it is possible to leave the `version` field of the message empty, since it will be filled in by the controller submodule. If `MsgChannelOpenInit` is used, then the `version` field must be provided with the correct JSON-encoded `Metadata` string. See section [Understanding Active Channels](./09-active-channels.md#understanding-active-channels) for more information. + +When reopening a channel with the default controller submodule, the ordering of the channel cannot be changed. In order to change the ordering of the channel, the channel has to go through a [channel upgrade handshake](../../01-ibc/06-channel-upgrades.md) or reopen the channel with a custom controller implementation. diff --git a/docs/docs/tools/ibc-fee-middleware.md b/docs/docs/tools/ibc-fee-middleware.md new file mode 100644 index 000000000..10bd6b5db --- /dev/null +++ b/docs/docs/tools/ibc-fee-middleware.md @@ -0,0 +1,310 @@ +--- +title: Overview +--- + +# Overview + +:::note Synopsis +Learn about what the Fee Middleware module is, and how to build custom modules that utilize the Fee Middleware functionality +::: + +## What is the Fee Middleware module? + +IBC does not depend on relayer operators for transaction verification. However, the relayer infrastructure ensures liveness of the Interchain network — operators listen for packets sent through channels opened between chains, and perform the vital service of ferrying these packets (and proof of the transaction on the sending chain/receipt on the receiving chain) to the clients on each side of the channel. + +Though relaying is permissionless and completely decentralized and accessible, it does come with operational costs. Running full nodes to query transaction proofs and paying for transaction fees associated with IBC packets are two of the primary cost burdens which have driven the overall discussion on **a general, in-protocol incentivization mechanism for relayers**. + +Initially, a [simple proposal](https://github.com/cosmos/ibc/pull/577/files) was created to incentivize relaying on ICS20 token transfers on the destination chain. However, the proposal was specific to ICS20 token transfers and would have to be reimplemented in this format on every other IBC application module. + +After much discussion, the proposal was expanded to a [general incentivisation design](https://github.com/cosmos/ibc/tree/master/spec/app/ics-029-fee-payment) that can be adopted by any ICS application protocol as [middleware](../../01-ibc/04-middleware/02-develop.md). + +## Concepts + +ICS29 fee payments in this middleware design are built on the assumption that sender chains are the source of incentives — the chain on which packets are incentivized is the chain that distributes fees to relayer operators. However, as part of the IBC packet flow, messages have to be submitted on both sender and destination chains. This introduces the requirement of a mapping of relayer operator's addresses on both chains. + +To achieve the stated requirements, the **fee middleware module has two main groups of functionality**: + +- Registering of relayer addresses associated with each party involved in relaying the packet on the source chain. This registration process can be automated on start up of relayer infrastructure and happens only once, not every packet flow. + + This is described in the [Fee distribution section](04-fee-distribution.md). + +- Escrowing fees by any party which will be paid out to each rightful party on completion of the packet lifecycle. + + This is described in the [Fee messages section](03-msgs.md). + +We complete the introduction by giving a list of definitions of relevant terminology. + +`Forward relayer`: The relayer that submits the `MsgRecvPacket` message for a given packet (on the destination chain). + +`Reverse relayer`: The relayer that submits the `MsgAcknowledgement` message for a given packet (on the source chain). + +`Timeout relayer`: The relayer that submits the `MsgTimeout` or `MsgTimeoutOnClose` messages for a given packet (on the source chain). + +`Payee`: The account address on the source chain to be paid on completion of the packet lifecycle. The packet lifecycle on the source chain completes with the receipt of a `MsgTimeout`/`MsgTimeoutOnClose` or a `MsgAcknowledgement`. + +`Counterparty payee`: The account address to be paid on completion of the packet lifecycle on the destination chain. The package lifecycle on the destination chain completes with a successful `MsgRecvPacket`. + +`Refund address`: The address of the account paying for the incentivization of packet relaying. The account is refunded timeout fees upon successful acknowledgement. In the event of a packet timeout, both acknowledgement and receive fees are refunded. + +## Known Limitations + +- At the time of the release of the feature (ibc-go v4) fee payments middleware only supported incentivisation of new channels; however, with the release of channel upgradeability (ibc-go v8.1) it is possible to enable incentivisation of all existing channels. +- Even though unlikely, there exists a DoS attack vector on a fee-enabled channel if 1) there exists a relayer software implementation that is incentivised to timeout packets if the timeout fee is greater than the sum of the fees to receive and acknowledge the packet, and 2) only this type of implementation is used by operators relaying on the channel. In this situation, an attacker could continuously incentivise the relayers to never deliver the packets by incrementing the timeout fee of the packets above the sum of the receive and acknowledge fees. However, this situation is unlikely to occur because 1) another relayer behaving honestly could relay the packets before they timeout, and 2) the attack would be costly because the attacker would need to incentivise the timeout fee of the packets with their own funds. Given the low impact and unlikelihood of the attack we have decided to accept this risk and not implement any mitigation mesaures. + + +## Module Integration + +The Fee Middleware module, as the name suggests, plays the role of an IBC middleware and as such must be configured by chain developers to route and handle IBC messages correctly. +For Cosmos SDK chains this setup is done via the `app/app.go` file, where modules are constructed and configured in order to bootstrap the blockchain application. + +## Example integration of the Fee Middleware module + +```go +// app.go + +// Register the AppModule for the fee middleware module +ModuleBasics = module.NewBasicManager( + ... + ibcfee.AppModuleBasic{}, + ... +) + +... + +// Add module account permissions for the fee middleware module +maccPerms = map[string][]string{ + ... + ibcfeetypes.ModuleName: nil, +} + +... + +// Add fee middleware Keeper +type App struct { + ... + + IBCFeeKeeper ibcfeekeeper.Keeper + + ... +} + +... + +// Create store keys +keys := sdk.NewKVStoreKeys( + ... + ibcfeetypes.StoreKey, + ... +) + +... + +app.IBCFeeKeeper = ibcfeekeeper.NewKeeper( + appCodec, keys[ibcfeetypes.StoreKey], + app.IBCKeeper.ChannelKeeper, // may be replaced with IBC middleware + app.IBCKeeper.ChannelKeeper, + &app.IBCKeeper.PortKeeper, app.AccountKeeper, app.BankKeeper, +) + + +// See the section below for configuring an application stack with the fee middleware module + +... + +// Register fee middleware AppModule +app.moduleManager = module.NewManager( + ... + ibcfee.NewAppModule(app.IBCFeeKeeper), +) + +... + +// Add fee middleware to begin blocker logic +app.moduleManager.SetOrderBeginBlockers( + ... + ibcfeetypes.ModuleName, + ... +) + +// Add fee middleware to end blocker logic +app.moduleManager.SetOrderEndBlockers( + ... + ibcfeetypes.ModuleName, + ... +) + +// Add fee middleware to init genesis logic +app.moduleManager.SetOrderInitGenesis( + ... + ibcfeetypes.ModuleName, + ... +) +``` + +## Configuring an application stack with Fee Middleware + +As mentioned in [IBC middleware development](../../01-ibc/04-middleware/02-develop.md) an application stack may be composed of many or no middlewares that nest a base application. +These layers form the complete set of application logic that enable developers to build composable and flexible IBC application stacks. +For example, an application stack may be just a single base application like `transfer`, however, the same application stack composed with `29-fee` will nest the `transfer` base application +by wrapping it with the Fee Middleware module. + +### Transfer + +See below for an example of how to create an application stack using `transfer` and `29-fee`. +The following `transferStack` is configured in `app/app.go` and added to the IBC `Router`. +The in-line comments describe the execution flow of packets between the application stack and IBC core. + +```go +// Create Transfer Stack +// SendPacket, since it is originating from the application to core IBC: +// transferKeeper.SendPacket -> fee.SendPacket -> channel.SendPacket + +// RecvPacket, message that originates from core IBC and goes down to app, the flow is the other way +// channel.RecvPacket -> fee.OnRecvPacket -> transfer.OnRecvPacket + +// transfer stack contains (from top to bottom): +// - IBC Fee Middleware +// - Transfer + +// create IBC module from bottom to top of stack +var transferStack porttypes.IBCModule +transferStack = transfer.NewIBCModule(app.TransferKeeper) +transferStack = ibcfee.NewIBCMiddleware(transferStack, app.IBCFeeKeeper) + +// Add transfer stack to IBC Router +ibcRouter.AddRoute(ibctransfertypes.ModuleName, transferStack) +``` + +### Interchain Accounts + +See below for an example of how to create an application stack using `27-interchain-accounts` and `29-fee`. +The following `icaControllerStack` and `icaHostStack` are configured in `app/app.go` and added to the IBC `Router` with the associated authentication module. +The in-line comments describe the execution flow of packets between the application stack and IBC core. + +```go +// Create Interchain Accounts Stack +// SendPacket, since it is originating from the application to core IBC: +// icaAuthModuleKeeper.SendTx -> icaController.SendPacket -> fee.SendPacket -> channel.SendPacket + +// initialize ICA module with mock module as the authentication module on the controller side +var icaControllerStack porttypes.IBCModule +icaControllerStack = ibcmock.NewIBCModule(&mockModule, ibcmock.NewMockIBCApp("", scopedICAMockKeeper)) +app.ICAAuthModule = icaControllerStack.(ibcmock.IBCModule) +icaControllerStack = icacontroller.NewIBCMiddleware(icaControllerStack, app.ICAControllerKeeper) +icaControllerStack = ibcfee.NewIBCMiddleware(icaControllerStack, app.IBCFeeKeeper) + +// RecvPacket, message that originates from core IBC and goes down to app, the flow is: +// channel.RecvPacket -> fee.OnRecvPacket -> icaHost.OnRecvPacket + +var icaHostStack porttypes.IBCModule +icaHostStack = icahost.NewIBCModule(app.ICAHostKeeper) +icaHostStack = ibcfee.NewIBCMiddleware(icaHostStack, app.IBCFeeKeeper) + +// Add authentication module, controller and host to IBC router +ibcRouter. + // the ICA Controller middleware needs to be explicitly added to the IBC Router because the + // ICA controller module owns the port capability for ICA. The ICA authentication module + // owns the channel capability. + AddRoute(ibcmock.ModuleName+icacontrollertypes.SubModuleName, icaControllerStack) // ica with mock auth module stack route to ica (top level of middleware stack) + AddRoute(icacontrollertypes.SubModuleName, icaControllerStack). + AddRoute(icahosttypes.SubModuleName, icaHostStack). +``` + +## Fee Distribution + +Packet fees are divided into 3 distinct amounts in order to compensate relayer operators for packet relaying on fee enabled IBC channels. + +- `RecvFee`: The sum of all packet receive fees distributed to a payee for successful execution of `MsgRecvPacket`. +- `AckFee`: The sum of all packet acknowledgement fees distributed to a payee for successful execution of `MsgAcknowledgement`. +- `TimeoutFee`: The sum of all packet timeout fees distributed to a payee for successful execution of `MsgTimeout`. + +## Register a counterparty payee address for forward relaying + +As mentioned in [ICS29 Concepts](01-overview.md#concepts), the forward relayer describes the actor who performs the submission of `MsgRecvPacket` on the destination chain. +Fee distribution for incentivized packet relays takes place on the packet source chain. + +> Relayer operators are expected to register a counterparty payee address, in order to be compensated accordingly with `RecvFee`s upon completion of a packet lifecycle. + +The counterparty payee address registered on the destination chain is encoded into the packet acknowledgement and communicated as such to the source chain for fee distribution. +**If a counterparty payee is not registered for the forward relayer on the destination chain, the escrowed fees will be refunded upon fee distribution.** + +### Relayer operator actions + +A transaction must be submitted **to the destination chain** including a `CounterpartyPayee` address of an account on the source chain. +The transaction must be signed by the `Relayer`. + +Note: If a module account address is used as the `CounterpartyPayee` but the module has been set as a blocked address in the `BankKeeper`, the refunding to the module account will fail. This is because many modules use invariants to compare internal tracking of module account balances against the actual balance of the account stored in the `BankKeeper`. If a token transfer to the module account occurs without going through this module and updating the account balance of the module on the `BankKeeper`, then invariants may break and unknown behaviour could occur depending on the module implementation. Therefore, if it is desirable to use a module account that is currently blocked, the module developers should be consulted to gauge to possibility of removing the module account from the blocked list. + +```go +type MsgRegisterCounterpartyPayee struct { + // unique port identifier + PortId string + // unique channel identifier + ChannelId string + // the relayer address + Relayer string + // the counterparty payee address + CounterpartyPayee string +} +``` + +> This message is expected to fail if: +> +> - `PortId` is invalid (see [24-host naming requirements](https://github.com/cosmos/ibc/blob/master/spec/core/ics-024-host-requirements/README.md#paths-identifiers-separators). +> - `ChannelId` is invalid (see [24-host naming requirements](https://github.com/cosmos/ibc/blob/master/spec/core/ics-024-host-requirements/README.md#paths-identifiers-separators)). +> - `Relayer` is an invalid address (see [Cosmos SDK Addresses](https://github.com/cosmos/cosmos-sdk/blob/main/docs/learn/beginner/03-accounts.md#addresses)). +> - `CounterpartyPayee` is empty or contains more than 2048 bytes. + +See below for an example CLI command: + +```bash +simd tx ibc-fee register-counterparty-payee transfer channel-0 \ + cosmos1rsp837a4kvtgp2m4uqzdge0zzu6efqgucm0qdh \ + osmo1v5y0tz01llxzf4c2afml8s3awue0ymju22wxx2 \ + --from cosmos1rsp837a4kvtgp2m4uqzdge0zzu6efqgucm0qdh +``` + +## Register an alternative payee address for reverse and timeout relaying + +As mentioned in [ICS29 Concepts](01-overview.md#concepts), the reverse relayer describes the actor who performs the submission of `MsgAcknowledgement` on the source chain. +Similarly the timeout relayer describes the actor who performs the submission of `MsgTimeout` (or `MsgTimeoutOnClose`) on the source chain. + +> Relayer operators **may choose** to register an optional payee address, in order to be compensated accordingly with `AckFee`s and `TimeoutFee`s upon completion of a packet life cycle. + +If a payee is not registered for the reverse or timeout relayer on the source chain, then fee distribution assumes the default behaviour, where fees are paid out to the relayer account which delivers `MsgAcknowledgement` or `MsgTimeout`/`MsgTimeoutOnClose`. + +### Relayer operator actions + +A transaction must be submitted **to the source chain** including a `Payee` address of an account on the source chain. +The transaction must be signed by the `Relayer`. + +Note: If a module account address is used as the `Payee` it is recommended to [turn off invariant checks](https://github.com/cosmos/ibc-go/blob/v7.0.0/testing/simapp/app.go#L727) for that module. + +```go +type MsgRegisterPayee struct { + // unique port identifier + PortId string + // unique channel identifier + ChannelId string + // the relayer address + Relayer string + // the payee address + Payee string +} +``` + +> This message is expected to fail if: +> +> - `PortId` is invalid (see [24-host naming requirements](https://github.com/cosmos/ibc/blob/master/spec/core/ics-024-host-requirements/README.md#paths-identifiers-separators). +> - `ChannelId` is invalid (see [24-host naming requirements](https://github.com/cosmos/ibc/blob/master/spec/core/ics-024-host-requirements/README.md#paths-identifiers-separators)). +> - `Relayer` is an invalid address (see [Cosmos SDK Addresses](https://github.com/cosmos/cosmos-sdk/blob/main/docs/learn/beginner/03-accounts.md#addresses)). +> - `Payee` is an invalid address (see [Cosmos SDK Addresses](https://github.com/cosmos/cosmos-sdk/blob/main/docs/learn/beginner/03-accounts.md#addresses)). + +See below for an example CLI command: + +```bash +simd tx ibc-fee register-payee transfer channel-0 \ + cosmos1rsp837a4kvtgp2m4uqzdge0zzu6efqgucm0qdh \ + cosmos153lf4zntqt33a4v0sm5cytrxyqn78q7kz8j8x5 \ + --from cosmos1rsp837a4kvtgp2m4uqzdge0zzu6efqgucm0qdh +``` diff --git a/docs/docs/tools/ibc-transfer.md b/docs/docs/tools/ibc-transfer.md new file mode 100644 index 000000000..e64718e84 --- /dev/null +++ b/docs/docs/tools/ibc-transfer.md @@ -0,0 +1,178 @@ +--- +title: Overview +--- + +# Overview + +:::note Synopsis +Learn about what the token Transfer module is +::: + +## What is the Transfer module? + +Transfer is the Cosmos SDK implementation of the [ICS-20](https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer) protocol, which enables cross-chain fungible token transfers. + +## Concepts + +### Acknowledgements + +ICS20 uses the recommended acknowledgement format as specified by [ICS 04](https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#acknowledgement-envelope). + +A successful receive of a transfer packet will result in a Result Acknowledgement being written +with the value `[]byte{byte(1)}` in the `Response` field. + +An unsuccessful receive of a transfer packet will result in an Error Acknowledgement being written +with the error message in the `Response` field. + +### Denomination trace + +The denomination trace corresponds to the information that allows a token to be traced back to its +origin chain. It contains a sequence of port and channel identifiers ordered from the most recent to +the oldest in the timeline of transfers. + +This information is included on the token's base denomination field in the form of a hash to prevent an +unbounded denomination length. For example, the token `transfer/channelToA/uatom` will be displayed +as `ibc/7F1D3FCF4AE79E1554D670D1AD949A9BA4E4A3C76C63093E17E446A46061A7A2`. The human readable denomination +is stored using `x/bank` module's [denom metadata](https://docs.cosmos.network/main/build/modules/bank#denom-metadata) +feature. You may display the human readable denominations by querying balances with the `--resolve-denom` flag, as in: + +```shell +simd query bank balances [address] --resolve-denom +``` + +Each send to any chain other than the one it was previously received from is a movement forwards in +the token's timeline. This causes trace to be added to the token's history and the destination port +and destination channel to be prefixed to the denomination. In these instances the sender chain is +acting as the "source zone". When the token is sent back to the chain it previously received from, the +prefix is removed. This is a backwards movement in the token's timeline and the sender chain is +acting as the "sink zone". + +It is strongly recommended to read the full details of [ADR 001: Coin Source Tracing](/architecture/adr-001-coin-source-tracing) to understand the implications and context of the IBC token representations. + +## UX suggestions for clients + +For clients (wallets, exchanges, applications, block explorers, etc) that want to display the source of the token, it is recommended to use the following alternatives for each of the cases below: + +### Direct connection + +If the denomination trace contains a single identifier prefix pair (as in the example above), then +the easiest way to retrieve the chain and light client identifier is to map the trace information +directly. In summary, this requires querying the channel from the denomination trace identifiers, +and then the counterparty client state using the counterparty port and channel identifiers from the +retrieved channel. + +A general pseudo algorithm would look like the following: + +1. Query the full denomination trace. +2. Query the channel with the `portID/channelID` pair, which corresponds to the first destination of the + token. +3. Query the client state using the identifiers pair. Note that this query will return a `"Not +Found"` response if the current chain is not connected to this channel. +4. Retrieve the client identifier or chain identifier from the client state (eg: on + Tendermint clients) and store it locally. + +Using the gRPC gateway client service the steps above would be, with a given IBC token `ibc/7F1D3FCF4AE79E1554D670D1AD949A9BA4E4A3C76C63093E17E446A46061A7A2` stored on `chainB`: + +1. `GET /ibc/apps/transfer/v1/denom_traces/7F1D3FCF4AE79E1554D670D1AD949A9BA4E4A3C76C63093E17E446A46061A7A2` -> `{"path": "transfer/channelToA", "base_denom": "uatom"}` +2. `GET /ibc/apps/transfer/v1/channels/channelToA/ports/transfer/client_state"` -> `{"client_id": "clientA", "chain-id": "chainA", ...}` +3. `GET /ibc/apps/transfer/v1/channels/channelToA/ports/transfer"` -> `{"channel_id": "channelToA", port_id": "transfer", counterparty: {"channel_id": "channelToB", port_id": "transfer"}, ...}` +4. `GET /ibc/apps/transfer/v1/channels/channelToB/ports/transfer/client_state" -> {"client_id": "clientB", "chain-id": "chainB", ...}` + +Then, the token transfer chain path for the `uatom` denomination would be: `chainA` -> `chainB`. + +### Multiple hops + +The multiple channel hops case applies when the token has passed through multiple chains between the original source and final destination chains. + +The IBC protocol doesn't know the topology of the overall network (i.e connections between chains and identifier names between them). For this reason, in the multiple hops case, a particular chain in the timeline of the individual transfers can't query the chain and client identifiers of the other chains. + +Take for example the following sequence of transfers `A -> B -> C` for an IBC token, with a final prefix path (trace info) of `transfer/channelChainC/transfer/channelChainB`. What the paragraph above means is that even in the case that chain `C` is directly connected to chain `A`, querying the port and channel identifiers that chain `B` uses to connect to chain `A` (eg: `transfer/channelChainA`) can be completely different from the one that chain `C` uses to connect to chain `A` (eg: `transfer/channelToChainA`). + +Thus the proposed solution for clients that the IBC team recommends are the following: + +- **Connect to all chains**: Connecting to all the chains in the timeline would allow clients to + perform the queries outlined in the [direct connection](#direct-connection) section to each + relevant chain. By repeatedly following the port and channel denomination trace transfer timeline, + clients should always be able to find all the relevant identifiers. This comes at the tradeoff + that the client must connect to nodes on each of the chains in order to perform the queries. +- **Relayer as a Service (RaaS)**: A longer term solution is to use/create a relayer service that + could map the denomination trace to the chain path timeline for each token (i.e `origin chain -> +chain #1 -> ... -> chain #(n-1) -> final chain`). These services could provide merkle proofs in + order to allow clients to optionally verify the path timeline correctness for themselves by + running light clients. If the proofs are not verified, they should be considered as trusted third + parties services. Additionally, client would be advised in the future to use RaaS that support the + largest number of connections between chains in the ecosystem. Unfortunately, none of the existing + public relayers (in [Golang](https://github.com/cosmos/relayer) and + [Rust](https://github.com/informalsystems/ibc-rs)), provide this service to clients. + +:::tip +The only viable alternative for clients (at the time of writing) to tokens with multiple connection hops, is to connect to all chains directly and perform relevant queries to each of them in the sequence. +::: + +## Forwarding + +:::info +Token forwarding and unwinding is supported only on ICS20 v2 transfer channels. +::: + +Forwarding allows tokens to be routed to a final destination through multiple (up to 8) intermediary +chains. With forwarding, it's also possible to unwind IBC vouchers to their native chain, and forward +them afterwards to another destination, all with just a single transfer transaction on the sending chain. + +### Forward tokens + +Native tokens or IBC vouchers on any chain can be forwarded through intermediary chains to reach their +final destination. For example, given the topology below, with 3 chains and a transfer channel between +chains A and B and between chains B and C: + +![Light Mode Forwarding](./images/forwarding-3-chains-light.png#gh-light-mode-only)![Dark Mode Forwarding](./images/forwarding-3-chains-dark.png#gh-dark-mode-only) + +Native tokens on chain `A` can be sent to chain `C` through chain `B`. The routing is specified by the +source port ID and channel ID of choice on every intermediary chain. In this example, there is only one +forwarding hop on chain `B` and the port ID, channel ID pair is `transfer`, `channelBToC`. Forwarding of +a multi-denom collections of tokens is also allowed (i.e. forwarding of tokens of different denominations). + +### Unwind tokens + +Taking again as an example the topology from the previous section, we assume that native tokens on chain `A` +have been transferred to chain `C`. The IBC vouchers on chain `C` have the denomination trace +`transfer/channelCtoB/transfer/channelBtoA`, and with forwarding it is possible to submit a transfer message +on chain `C` and automatically unwind the vouchers through chain `B` to chain `A`, so that the tokens recovered +on the origin chain regain their native denomination. In order to execute automatic unwinding, the transfer +module does not require extra user input: the unwind route is encoded in the denomination trace with the +pairs of destination port ID, channel ID that are added on every chain where the tokens are received. + +Please note that unwinding of vouchers is only allowed when vouchers transferred all share the same denomination +trace (signifying coins that all originate from the same source). It is not possible to unwind vouchers of two different +IBC denominations, since they come from different source chains. + +### Unwind tokens and then forward + +Unwinding and forwarding can be used in combination, so that vouchers are first unwound to their origin chain +and then forwarded to a final destination. The same restriction as in the unwinding case applies: only vouchers +of a single IBC denomination can be used. + +## Locked funds + +In some [exceptional cases](/architecture/adr-026-ibc-client-recovery-mechanisms#exceptional-cases), a client state associated with a given channel cannot be updated. This causes that funds from fungible tokens in that channel will be permanently locked and thus can no longer be transferred. + +To mitigate this, a client update governance proposal can be submitted to update the frozen client +with a new valid header. Once the proposal passes the client state will be unfrozen and the funds +from the associated channels will then be unlocked. This mechanism only applies to clients that +allow updates via governance, such as Tendermint clients. + +In addition to this, it's important to mention that a token must be sent back along the exact route +that it took originally in order to return it to its original form on the source chain (eg: the +Cosmos Hub for the `uatom`). Sending a token back to the same chain across a different channel will +**not** move the token back across its timeline. If a channel in the chain history closes before the +token can be sent back across that channel, then the token will not be returnable to its original +form. + +## Security considerations + +For safety, no other module must be capable of minting tokens with the `ibc/` prefix. The IBC +transfer module needs a subset of the denomination space that only it can create tokens in. + +## Channel Closure + +The IBC transfer module does not support channel closure. diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml new file mode 100644 index 000000000..1d84d30c7 --- /dev/null +++ b/docs/mkdocs.yml @@ -0,0 +1,33 @@ +site_name: Sonr Docs +site_description: Sonr is a decentralized identity network built on the Cosmos-sdk. It has early origins as a peer-to-peer file sharing network, but has since evolved into a platform for decentralized authentication and authorization. The early lessons taught from our file sharing roots are used as our theology for building the Sonr Blockchain. +site_url: https://onsonr.dev +theme: + name: material + features: + - announce.dismiss + - content.action.edit + - content.action.view + - content.code.annotate + - content.code.copy + - content.code.select + # - content.footnote.tooltips + # - content.tabs.link + - content.tooltips + - navigation.footer + - navigation.indexes + - navigation.instant + # - navigation.instant.progress + # - navigation.prune + - navigation.sections + - navigation.tabs + - navigation.tabs.sticky + - navigation.top + - navigation.tracking + - search.highlight + - search.share + - search.suggest + - toc.follow + - toc.integrate + font: + text: Geist + code: Geist Mono diff --git a/gateway/context/credentials.go b/gateway/context/credentials.go deleted file mode 100644 index 1eff7d8fe..000000000 --- a/gateway/context/credentials.go +++ /dev/null @@ -1,19 +0,0 @@ -package context - -import ( - "github.com/go-webauthn/webauthn/protocol" -) - -func (c *GatewayContext) NewChallenge() string { - chal, _ := protocol.CreateChallenge() - chalStr := chal.String() - return chalStr -} - -func (cc *GatewayContext) ListCredentials(handle string) ([]*CredentialDescriptor, error) { - creds, err := cc.GetCredentialsByHandle(bgCtx(), handle) - if err != nil { - return nil, err - } - return CredentialArrayToDescriptors(creds), nil -} diff --git a/gateway/context/middleware.go b/gateway/context/middleware.go deleted file mode 100644 index 40250cd57..000000000 --- a/gateway/context/middleware.go +++ /dev/null @@ -1,64 +0,0 @@ -package context - -import ( - gocontext "context" - "net/http" - - "github.com/labstack/echo/v4" - "github.com/medama-io/go-useragent" - "github.com/onsonr/sonr/internal/crypto/mpc" - "github.com/onsonr/sonr/internal/common" - "github.com/onsonr/sonr/internal/config/hway" - hwayorm "github.com/onsonr/sonr/internal/database/hwayorm" -) - -type GatewayContext struct { - echo.Context - hwayorm.Querier - id string - ipfsClient common.IPFS - agent useragent.UserAgent - tokenStore common.IPFSTokenStore - stagedEnclaves map[string]mpc.Enclave - grpcAddr string - turnstileSiteKey string -} - -func GetGateway(c echo.Context) (*GatewayContext, error) { - cc, ok := c.(*GatewayContext) - if !ok { - return nil, echo.NewHTTPError(http.StatusInternalServerError, "Gateway Context not found") - } - return cc, nil -} - -func UseGateway(env hway.Hway, ipc common.IPFS, db *hwayorm.Queries) echo.MiddlewareFunc { - return func(next echo.HandlerFunc) echo.HandlerFunc { - return func(c echo.Context) error { - ua := useragent.NewParser() - ctx := &GatewayContext{ - Context: c, - Querier: db, - ipfsClient: ipc, - agent: ua.Parse(c.Request().UserAgent()), - grpcAddr: env.GetSonrGrpcUrl(), - tokenStore: common.NewUCANStore(ipc), - turnstileSiteKey: env.GetTurnstileSiteKey(), - } - return next(ctx) - } - } -} - -func BG() gocontext.Context { - ctx := gocontext.Background() - return ctx -} - -func (cc *GatewayContext) ReadCookie(k common.CookieKey) string { - return common.ReadCookieUnsafe(cc.Context, k) -} - -func (cc *GatewayContext) WriteCookie(k common.CookieKey, v string) { - common.WriteCookie(cc.Context, k, v) -} diff --git a/gateway/context/profiles.go b/gateway/context/profiles.go deleted file mode 100644 index 971b9b759..000000000 --- a/gateway/context/profiles.go +++ /dev/null @@ -1,53 +0,0 @@ -package context - -import ( - "net/http" - - "github.com/labstack/echo/v4" - hwayorm "github.com/onsonr/sonr/internal/database/hwayorm" -) - -func UpdateProfile(c echo.Context) (*hwayorm.Profile, error) { - ctx, ok := c.(*GatewayContext) - if !ok { - return nil, echo.NewHTTPError(http.StatusInternalServerError, "Profile Context not found") - } - address := c.FormValue("address") - handle := c.FormValue("handle") - name := c.FormValue("name") - profile, err := ctx.UpdateProfile(bgCtx(), hwayorm.UpdateProfileParams{ - Address: address, - Handle: handle, - Name: name, - }) - if err != nil { - return nil, err - } - return profile, nil -} - -func ReadProfile(c echo.Context) (*hwayorm.Profile, error) { - ctx, ok := c.(*GatewayContext) - if !ok { - return nil, echo.NewHTTPError(http.StatusInternalServerError, "Profile Context not found") - } - handle := c.Param("handle") - profile, err := ctx.GetProfileByHandle(bgCtx(), handle) - if err != nil { - return nil, err - } - return profile, nil -} - -func DeleteProfile(c echo.Context) error { - ctx, ok := c.(*GatewayContext) - if !ok { - return echo.NewHTTPError(http.StatusInternalServerError, "Profile Context not found") - } - address := c.Param("address") - err := ctx.SoftDeleteProfile(bgCtx(), address) - if err != nil { - return err - } - return nil -} diff --git a/gateway/context/renderer.go b/gateway/context/renderer.go deleted file mode 100644 index 1280e8581..000000000 --- a/gateway/context/renderer.go +++ /dev/null @@ -1,42 +0,0 @@ -package context - -import ( - "bytes" - - "github.com/a-h/templ" - "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/gateway/views" -) - -func Render(c echo.Context, cmp templ.Component) error { - // Create a buffer to store the rendered HTML - buf := &bytes.Buffer{} - // Render the component to the buffer - err := cmp.Render(c.Request().Context(), buf) - if err != nil { - return err - } - - // Set the content type - c.Response().Header().Set(echo.HeaderContentType, echo.MIMETextHTML) - - // Write the buffered content to the response - _, err = c.Response().Write(buf.Bytes()) - if err != nil { - return err - } - c.Response().WriteHeader(200) - return nil -} - -func RenderError(c echo.Context, err error) error { - return Render(c, views.ErrorView(err.Error())) -} - -func RenderInitial(c echo.Context) error { - return Render(c, views.InitialView()) -} - -func RenderLoading(c echo.Context) error { - return Render(c, views.LoadingView()) -} diff --git a/gateway/context/resolver.go b/gateway/context/resolver.go deleted file mode 100644 index 348136ab7..000000000 --- a/gateway/context/resolver.go +++ /dev/null @@ -1,105 +0,0 @@ -package context - -import ( - "fmt" - - "github.com/onsonr/sonr/internal/common" -) - -// ParamsBank returns the bank params -func (cc *GatewayContext) ParamsBank() (*common.BankParamsResponse, error) { - cl, err := common.NewBankClient(cc.grpcAddr) - if err != nil { - return nil, err - } - resp, err := cl.Params(bgCtx(), &common.BankParamsRequest{}) - if err != nil { - return nil, err - } - return resp, nil -} - -// ParamsDID returns the DID params -func (cc *GatewayContext) ParamsDID() (*common.DIDParamsResponse, error) { - cl, err := common.NewDIDClient(cc.grpcAddr) - if err != nil { - return nil, err - } - resp, err := cl.Params(bgCtx(), &common.DIDParamsRequest{}) - if err != nil { - return nil, err - } - return resp, nil -} - -// ParamsDWN returns the DWN params -func (cc *GatewayContext) ParamsDWN() (*common.DWNParamsResponse, error) { - cl, err := common.NewDWNClient(cc.grpcAddr) - if err != nil { - return nil, err - } - resp, err := cl.Params(bgCtx(), &common.DWNParamsRequest{}) - if err != nil { - return nil, err - } - return resp, nil -} - -// ParamsSVC returns the SVC params -func (cc *GatewayContext) ParamsSVC() (*common.SVCParamsResponse, error) { - cl, err := common.NewSVCClient(cc.grpcAddr) - if err != nil { - return nil, err - } - resp, err := cl.Params(bgCtx(), &common.SVCParamsRequest{}) - if err != nil { - return nil, err - } - return resp, nil -} - -// StatusBlock returns the current block -func (cc *GatewayContext) StatusBlock() string { - qc, err := common.NewNodeClient(cc.grpcAddr) - if err != nil { - return "-1" - } - resp, err := qc.Status(bgCtx(), &common.StatusRequest{}) - if err != nil { - return "-1" - } - return fmt.Sprintf("%d", resp.GetHeight()) -} - -// StatusNode returns the node status -func (cc *GatewayContext) StatusNode() (*common.StatusResponse, error) { - cl, err := common.NewNodeClient(cc.grpcAddr) - if err != nil { - return nil, err - } - resp, err := cl.Status(bgCtx(), &common.StatusRequest{}) - if err != nil { - return nil, err - } - return resp, nil -} - -// TxBroadcast broadcasts a transaction to the network -func (cc *GatewayContext) TxBroadcast() error { - return nil -} - -// TxEncode encodes a transaction -func (cc *GatewayContext) TxEncode() error { - return nil -} - -// TxDecode decodes a transaction -func (cc *GatewayContext) TxDecode() error { - return nil -} - -// TxSimulate simulates a transaction on the network -func (cc *GatewayContext) TxSimulate() error { - return nil -} diff --git a/gateway/context/sessions.go b/gateway/context/sessions.go deleted file mode 100644 index d1ffe5087..000000000 --- a/gateway/context/sessions.go +++ /dev/null @@ -1,148 +0,0 @@ -package context - -import ( - gocontext "context" - - "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/internal/common" - "github.com/segmentio/ksuid" - "lukechampine.com/blake3" -) - -func NewSession(c echo.Context) error { - cc, ok := c.(*GatewayContext) - if !ok { - return nil - } - baseSessionCreateParams := BaseSessionCreateParams(cc) - cc.id = baseSessionCreateParams.ID - if _, err := cc.CreateSession(bgCtx(), baseSessionCreateParams); err != nil { - return err - } - // Set Cookie - if err := common.WriteCookie(c, common.SessionID, cc.id); err != nil { - return err - } - return nil -} - -// Uses blake3 to hash the sessionID to generate a nonce of length 12 bytes -func GetNonce(sessionID string) ([]byte, error) { - hash := blake3.New(32, nil) - _, err := hash.Write([]byte(sessionID)) - if err != nil { - return nil, err - } - // Read the hash into a byte slice - nonce := make([]byte, 12) - _, err = hash.Write(nonce) - if err != nil { - return nil, err - } - return nonce, nil -} - -// ForbiddenDevice returns true if the device is unavailable -func ForbiddenDevice(c echo.Context) bool { - cc, ok := c.(*GatewayContext) - if !ok { - return true - } - return cc.agent.IsBot() || cc.agent.IsTV() -} - -func GetOrigin(c echo.Context) string { - return c.Request().Host -} - -func GetSessionID(c echo.Context) string { - // Check from context - cc, ok := c.(*GatewayContext) - if !ok { - return "" - } - // check from cookie - if cc.id == "" { - if ok := common.CookieExists(c, common.SessionID); !ok { - return "" - } - cc.id = common.ReadCookieUnsafe(c, common.SessionID) - } - return cc.id -} - -func GetAuthChallenge(c echo.Context) string { - cc, ok := c.(*GatewayContext) - if !ok { - return "" - } - s, err := cc.GetChallengeBySessionID(bgCtx(), cc.id) - if err != nil { - return "" - } - return s -} - -func GetProfileHandle(c echo.Context) string { - // First check for the cookie - handle := common.ReadCookieUnsafe(c, common.UserHandle) - if handle != "" { - return handle - } - - // Then check the session - cc, ok := c.(*GatewayContext) - if !ok { - return "" - } - s, err := cc.GetSessionByID(bgCtx(), cc.id) - if err != nil { - return "" - } - profile, err := cc.GetProfileByID(bgCtx(), s.ProfileID) - if err != nil { - return "" - } - return profile.Handle -} - -// -// func GetHumanVerificationNumbers(c echo.Context) (int64, int64) { -// cc, ok := c.(*GatewayContext) -// if !ok { -// return 0, 0 -// } -// s, err := cc.dbq.GetHumanVerificationNumbers(bgCtx(), cc.id) -// if err != nil { -// return 0, 0 -// } -// return s.IsHumanFirst, s.IsHumanLast -// } - -// utility function to get a context -func bgCtx() gocontext.Context { - ctx := gocontext.Background() - return ctx -} - -func getOrCreateSessionID(c echo.Context) string { - if ok := common.CookieExists(c, common.SessionID); !ok { - sessionID := ksuid.New().String() - common.WriteCookie(c, common.SessionID, sessionID) - return sessionID - } - - sessionID, err := common.ReadCookie(c, common.SessionID) - if err != nil { - sessionID = ksuid.New().String() - common.WriteCookie(c, common.SessionID, sessionID) - } - return sessionID -} - -func boolToInt64(b bool) int64 { - if b { - return 1 - } - return 0 -} diff --git a/gateway/context/types.go b/gateway/context/types.go deleted file mode 100644 index 7072a7b4a..000000000 --- a/gateway/context/types.go +++ /dev/null @@ -1,102 +0,0 @@ -package context - -import ( - "github.com/go-webauthn/webauthn/protocol" - "github.com/labstack/echo/v4" - "github.com/medama-io/go-useragent" - hwayorm "github.com/onsonr/sonr/internal/database/hwayorm" -) - -// Define the credential structure matching our frontend data -type CredentialDescriptor struct { - ID string `json:"id"` - RawID string `json:"rawId"` - Type string `json:"type"` - AuthenticatorAttachment string `json:"authenticatorAttachment"` - Transports string `json:"transports"` - ClientExtensionResults map[string]string `json:"clientExtensionResults"` - Response struct { - AttestationObject string `json:"attestationObject"` - ClientDataJSON string `json:"clientDataJSON"` - } `json:"response"` -} - -func (c *CredentialDescriptor) ToModel(handle, origin string) *hwayorm.Credential { - return &hwayorm.Credential{ - Handle: handle, - Origin: origin, - CredentialID: c.ID, - Type: c.Type, - Transports: c.Transports, - AuthenticatorAttachment: c.AuthenticatorAttachment, - } -} - -func CredentialArrayToDescriptors(credentials []*hwayorm.Credential) []*CredentialDescriptor { - var descriptors []*CredentialDescriptor - for _, cred := range credentials { - cd := &CredentialDescriptor{ - ID: cred.CredentialID, - RawID: cred.CredentialID, - Type: cred.Type, - AuthenticatorAttachment: cred.AuthenticatorAttachment, - Transports: cred.Transports, - } - descriptors = append(descriptors, cd) - } - return descriptors -} - -func BaseSessionCreateParams(e echo.Context) hwayorm.CreateSessionParams { - // f := rand.Intn(5) + 1 - // l := rand.Intn(4) + 1 - challenge, _ := protocol.CreateChallenge() - id := getOrCreateSessionID(e) - ua := useragent.NewParser() - s := ua.Parse(e.Request().UserAgent()) - - return hwayorm.CreateSessionParams{ - ID: id, - BrowserName: s.GetBrowser(), - BrowserVersion: s.GetMajorVersion(), - ClientIpaddr: e.RealIP(), - Platform: s.GetOS(), - IsMobile: s.IsMobile(), - IsTablet: s.IsTablet(), - IsDesktop: s.IsDesktop(), - IsBot: s.IsBot(), - IsTv: s.IsTV(), - // IsHumanFirst: int64(f), - // IsHumanLast: int64(l), - Challenge: challenge.String(), - } -} - -// ╭───────────────────────────────────────────────────────────╮ -// │ Create Passkey (/register/passkey) │ -// ╰───────────────────────────────────────────────────────────╯ - -// CreatePasskeyParams represents the parameters for creating a passkey -type CreatePasskeyParams struct { - Address string - Handle string - Name string - Challenge string - CreationBlock string -} - -// ╭───────────────────────────────────────────────────────────╮ -// │ Create Profile (/register/profile) │ -// ╰───────────────────────────────────────────────────────────╯ - -// CreateProfileParams represents the parameters for creating a profile -type CreateProfileParams struct { - TurnstileSiteKey string - FirstNumber int - LastNumber int -} - -// Sum returns the sum of the first and last number -func (d CreateProfileParams) Sum() int { - return d.FirstNumber + d.LastNumber -} diff --git a/gateway/context/vaults.go b/gateway/context/vaults.go deleted file mode 100644 index 4be0d9381..000000000 --- a/gateway/context/vaults.go +++ /dev/null @@ -1,45 +0,0 @@ -package context - -import ( - "github.com/onsonr/sonr/internal/crypto/mpc" - "github.com/onsonr/sonr/internal/common" - "lukechampine.com/blake3" -) - -func (cc *GatewayContext) Spawn(handle, origin string) (*CreatePasskeyParams, error) { - challenge := GetAuthChallenge(cc) - sid := GetSessionID(cc) - nonce, err := calcNonce(sid) - if err != nil { - return nil, err - } - encl, err := mpc.GenEnclave(nonce) - if err != nil { - return nil, err - } - cc.stagedEnclaves[sid] = encl - common.WriteCookie(cc, common.SonrAddress, encl.Address()) - return &CreatePasskeyParams{ - Address: encl.Address(), - Handle: handle, - Name: origin, - Challenge: challenge, - CreationBlock: cc.StatusBlock(), - }, nil -} - -// Uses blake3 to hash the sessionID to generate a nonce of length 12 bytes -func calcNonce(sessionID string) ([]byte, error) { - hash := blake3.New(32, nil) - _, err := hash.Write([]byte(sessionID)) - if err != nil { - return nil, err - } - // Read the hash into a byte slice - nonce := make([]byte, 12) - _, err = hash.Write(nonce) - if err != nil { - return nil, err - } - return nonce, nil -} diff --git a/gateway/gateway.go b/gateway/gateway.go deleted file mode 100644 index ddd5ddc66..000000000 --- a/gateway/gateway.go +++ /dev/null @@ -1,33 +0,0 @@ -// Package gateway provides the default routes for the Sonr hway. -package gateway - -import ( - "github.com/labstack/echo-contrib/echoprometheus" - "github.com/labstack/echo/v4" - echomiddleware "github.com/labstack/echo/v4/middleware" - "github.com/onsonr/sonr/gateway/context" - "github.com/onsonr/sonr/gateway/handlers" - "github.com/onsonr/sonr/internal/common" - config "github.com/onsonr/sonr/internal/config/hway" - hwayorm "github.com/onsonr/sonr/internal/database/hwayorm" -) - -type Gateway = *echo.Echo - -// New returns a new Gateway instance -func New(env config.Hway, ipc common.IPFS, dbq *hwayorm.Queries) (Gateway, error) { - e := echo.New() - - // Built-in middleware - e.Use(echomiddleware.Logger()) - e.Use(echomiddleware.Recover()) - e.IPExtractor = echo.ExtractIPDirect() - e.Use(echoprometheus.NewMiddleware("hway")) - e.Use(context.UseGateway(env, ipc, dbq)) - - // Register View Handlers - e.HTTPErrorHandler = handlers.ErrorHandler - e.GET("/", handlers.IndexHandler) - handlers.RegisterHandler(e.Group("/register")) - return e, nil -} diff --git a/gateway/handlers/errors.go b/gateway/handlers/errors.go deleted file mode 100644 index a90d81252..000000000 --- a/gateway/handlers/errors.go +++ /dev/null @@ -1,16 +0,0 @@ -package handlers - -import ( - "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/gateway/context" -) - -func ErrorHandler(err error, c echo.Context) { - if he, ok := err.(*echo.HTTPError); ok { - if he.Code == 500 { - // Log the error if needed - c.Logger().Errorf("Error: %v", he.Message) - context.RenderError(c, he) - } - } -} diff --git a/gateway/handlers/index.go b/gateway/handlers/index.go deleted file mode 100644 index 6d1e208ed..000000000 --- a/gateway/handlers/index.go +++ /dev/null @@ -1,14 +0,0 @@ -package handlers - -import ( - "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/gateway/context" -) - -func IndexHandler(c echo.Context) error { - id := context.GetSessionID(c) - if id == "" { - context.NewSession(c) - } - return context.RenderInitial(c) -} diff --git a/gateway/handlers/login.go b/gateway/handlers/login.go deleted file mode 100644 index 5ac8282f4..000000000 --- a/gateway/handlers/login.go +++ /dev/null @@ -1 +0,0 @@ -package handlers diff --git a/gateway/handlers/register.go b/gateway/handlers/register.go deleted file mode 100644 index 637c65c60..000000000 --- a/gateway/handlers/register.go +++ /dev/null @@ -1,111 +0,0 @@ -package handlers - -import ( - "encoding/json" - - "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/gateway/islands" - "github.com/onsonr/sonr/gateway/views" - "github.com/onsonr/sonr/gateway/context" - "github.com/onsonr/sonr/internal/common" - hwayorm "github.com/onsonr/sonr/internal/database/hwayorm" -) - -func RegisterHandler(g *echo.Group) { - g.GET("/start", renderProfileForm) - g.POST("/profile", validateProfileForm) - g.GET("/passkey", renderPasskeyForm) - g.POST("/passkey", validatePasskeyForm) - g.GET("/vault", renderVaultStatus) -} - -// ╭──────────────────────────────────────────────────────╮ -// │ Registration Views │ -// ╰────────────────────────────────────────────────────── - -func renderProfileForm(c echo.Context) error { - params := context.CreateProfileParams{ - FirstNumber: 6, - LastNumber: 3, - } - return context.Render(c, views.RegisterProfileView(params.FirstNumber, params.LastNumber)) -} - -func renderPasskeyForm(c echo.Context) error { - cc, err := context.GetGateway(c) - if err != nil { - return err - } - handle := c.FormValue("handle") - origin := c.FormValue("origin") - name := c.FormValue("name") - cc.InsertProfile(context.BG(), hwayorm.InsertProfileParams{ - Handle: handle, - Origin: origin, - Name: name, - }) - - params, err := cc.Spawn(handle, origin) - if err != nil { - return context.RenderError(c, err) - } - return context.Render(c, views.RegisterPasskeyView(params.Address, params.Handle, params.Name, params.Challenge, params.CreationBlock)) -} - -func renderVaultStatus(c echo.Context) error { - return context.Render(c, views.LoadingView()) -} - -// ╭─────────────────────────────────────────────────────────╮ -// │ Validation Components │ -// ╰─────────────────────────────────────────────────────────╯ - -func validateProfileForm(c echo.Context) error { - cc, err := context.GetGateway(c) - if err != nil { - return context.RenderError(c, err) - } - handle := c.FormValue("handle") - if handle == "" { - return context.Render(c, islands.InputHandleError(handle, "Please enter a 4-16 character handle")) - } - notok, err := cc.CheckHandleExists(context.BG(), handle) - if err != nil { - return err - } - if notok { - return context.Render(c, islands.InputHandleError(handle, "Handle is already taken")) - } - cc.WriteCookie(common.UserHandle, handle) - return context.Render(c, islands.InputHandleSuccess(handle)) -} - -func validatePasskeyForm(c echo.Context) error { - cc, err := context.GetGateway(c) - if err != nil { - return context.RenderError(c, err) - } - handle := context.GetProfileHandle(c) - origin := c.Request().Host - credentialJSON := c.FormValue("credential") - cred := &context.CredentialDescriptor{} - - // Unmarshal the credential JSON - err = json.Unmarshal([]byte(credentialJSON), cred) - if err != nil { - return context.RenderError(c, err) - } - - md := cred.ToModel(handle, origin) - _, err = cc.InsertCredential(context.BG(), hwayorm.InsertCredentialParams{ - Handle: md.Handle, - CredentialID: md.CredentialID, - Origin: md.Origin, - Type: md.Type, - Transports: md.Transports, - }) - if err != nil { - return context.RenderError(c, err) - } - return context.Render(c, views.LoadingView()) -} diff --git a/gateway/islands/card_account.templ b/gateway/islands/card_account.templ deleted file mode 100644 index 76e7b8cb5..000000000 --- a/gateway/islands/card_account.templ +++ /dev/null @@ -1,38 +0,0 @@ -package islands - -templ CardAccount(addr, name, handle, creationBlock string) { -
-
-
-
-

sonr-testnet-1

-

{ handle }

-
-
- -
-
-
- { shortenAddress(addr) } -
-
-
-

Block Created

-

#{ creationBlock }

-
-
-

Issued to

-

{ name }

-
-
-
-
-} - -// Helper function to shorten address -func shortenAddress(address string) string { - if len(address) <= 20 { - return address - } - return address[:16] + "..." + address[len(address)-4:] -} diff --git a/gateway/islands/card_account_templ.go b/gateway/islands/card_account_templ.go deleted file mode 100644 index e4f020a01..000000000 --- a/gateway/islands/card_account_templ.go +++ /dev/null @@ -1,100 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.793 -package islands - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -func CardAccount(addr, name, handle, creationBlock string) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

sonr-testnet-1

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var2 string - templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(handle) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `gateway/islands/card_account.templ`, Line: 9, Col: 43} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var3 string - templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(shortenAddress(addr)) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `gateway/islands/card_account.templ`, Line: 16, Col: 58} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

Block Created

#") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var4 string - templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(creationBlock) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `gateway/islands/card_account.templ`, Line: 21, Col: 55} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

Issued to

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var5 string - templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(name) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `gateway/islands/card_account.templ`, Line: 25, Col: 32} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -// Helper function to shorten address -func shortenAddress(address string) string { - if len(address) <= 20 { - return address - } - return address[:16] + "..." + address[len(address)-4:] -} - -var _ = templruntime.GeneratedTemplate diff --git a/gateway/islands/coin_select.templ b/gateway/islands/coin_select.templ deleted file mode 100644 index e16e7fbf7..000000000 --- a/gateway/islands/coin_select.templ +++ /dev/null @@ -1,70 +0,0 @@ -package islands - -type Coin struct { - Ticker string - Name string - IsDefault bool -} - -var defaultCoins = []Coin{ - {Ticker: "SNR", Name: "Sonr", IsDefault: true}, - {Ticker: "BTC", Name: "Bitcoin", IsDefault: true}, - {Ticker: "ETH", Name: "Ethereum", IsDefault: true}, - {Ticker: "SOL", Name: "Solana", IsDefault: false}, - {Ticker: "LTC", Name: "Litecoin", IsDefault: false}, - {Ticker: "DOGE", Name: "Dogecoin", IsDefault: false}, - {Ticker: "XRP", Name: "Ripple", IsDefault: false}, - {Ticker: "OSMO", Name: "Osmosis", IsDefault: false}, - {Ticker: "ATOM", Name: "Cosmos", IsDefault: false}, - {Ticker: "STARZ", Name: "Stargaze", IsDefault: false}, - {Ticker: "AKT", Name: "Akash", IsDefault: false}, - {Ticker: "EVMOS", Name: "Evmos", IsDefault: false}, - {Ticker: "FIL", Name: "Filecoin", IsDefault: false}, - {Ticker: "AXL", Name: "Axelar", IsDefault: false}, -} - -templ CoinSelect() { - - for _, a := range defaultCoins { - @CoinOption(a) - } - - -} - -templ CoinOption(a Coin) { - if a.IsDefault { - - - { a.Name } - - - } else { - - - { a.Name } - - - } -} diff --git a/gateway/islands/coin_select_templ.go b/gateway/islands/coin_select_templ.go deleted file mode 100644 index 0ff5b84ec..000000000 --- a/gateway/islands/coin_select_templ.go +++ /dev/null @@ -1,187 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.793 -package islands - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -type Coin struct { - Ticker string - Name string - IsDefault bool -} - -var defaultCoins = []Coin{ - {Ticker: "SNR", Name: "Sonr", IsDefault: true}, - {Ticker: "BTC", Name: "Bitcoin", IsDefault: true}, - {Ticker: "ETH", Name: "Ethereum", IsDefault: true}, - {Ticker: "SOL", Name: "Solana", IsDefault: false}, - {Ticker: "LTC", Name: "Litecoin", IsDefault: false}, - {Ticker: "DOGE", Name: "Dogecoin", IsDefault: false}, - {Ticker: "XRP", Name: "Ripple", IsDefault: false}, - {Ticker: "OSMO", Name: "Osmosis", IsDefault: false}, - {Ticker: "ATOM", Name: "Cosmos", IsDefault: false}, - {Ticker: "STARZ", Name: "Stargaze", IsDefault: false}, - {Ticker: "AKT", Name: "Akash", IsDefault: false}, - {Ticker: "EVMOS", Name: "Evmos", IsDefault: false}, - {Ticker: "FIL", Name: "Filecoin", IsDefault: false}, - {Ticker: "AXL", Name: "Axelar", IsDefault: false}, -} - -func CoinSelect() templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - for _, a := range defaultCoins { - templ_7745c5c3_Err = CoinOption(a).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -func CoinOption(a Coin) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var2 := templ.GetChildren(ctx) - if templ_7745c5c3_Var2 == nil { - templ_7745c5c3_Var2 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - if a.IsDefault { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var5 string - templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(a.Name) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `gateway/islands/coin_select.templ`, Line: 60, Col: 11} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } else { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var8 string - templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(a.Name) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `gateway/islands/coin_select.templ`, Line: 66, Col: 11} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - return templ_7745c5c3_Err - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/gateway/islands/human_slider.templ b/gateway/islands/human_slider.templ deleted file mode 100644 index ba5677c49..000000000 --- a/gateway/islands/human_slider.templ +++ /dev/null @@ -1,25 +0,0 @@ -package islands - -import "fmt" - -templ HumanSlider(firstNumber int, lastNumber int) { -
- -
-} - -templ HumanSliderError(firstNumber int, lastNumber int) { - -
- - Invalid Human Sum -
-} - -templ HumanSliderSuccess() { - -} - -func humanLabel(firstNumber int, lastNumber int) string { - return fmt.Sprintf("What is %d + %d?", firstNumber, lastNumber) -} diff --git a/gateway/islands/human_slider_templ.go b/gateway/islands/human_slider_templ.go deleted file mode 100644 index 519cc381b..000000000 --- a/gateway/islands/human_slider_templ.go +++ /dev/null @@ -1,130 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.793 -package islands - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -import "fmt" - -func HumanSlider(firstNumber int, lastNumber int) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -func HumanSliderError(firstNumber int, lastNumber int) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var3 := templ.GetChildren(ctx) - if templ_7745c5c3_Var3 == nil { - templ_7745c5c3_Var3 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
Invalid Human Sum
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -func HumanSliderSuccess() templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var5 := templ.GetChildren(ctx) - if templ_7745c5c3_Var5 == nil { - templ_7745c5c3_Var5 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -func humanLabel(firstNumber int, lastNumber int) string { - return fmt.Sprintf("What is %d + %d?", firstNumber, lastNumber) -} - -var _ = templruntime.GeneratedTemplate diff --git a/gateway/islands/input_handle.templ b/gateway/islands/input_handle.templ deleted file mode 100644 index 12aa6459c..000000000 --- a/gateway/islands/input_handle.templ +++ /dev/null @@ -1,45 +0,0 @@ -package islands - -type HandleState string - -const ( - HandleStateInitial HandleState = "inital" - HandleStateValid HandleState = "valid" - HandleStateInvalid HandleState = "invalid" -) - -func (s HandleState) string() string { - return string(s) -} - -templ InputHandle() { -
- -
- -
-
-
-
-} - -templ InputHandleError(value string, helpText string) { - -
- -
-
- -
-
-
-} - -templ InputHandleSuccess(value string) { - -
- -
-
-
-} diff --git a/gateway/islands/input_handle_templ.go b/gateway/islands/input_handle_templ.go deleted file mode 100644 index 5f2232569..000000000 --- a/gateway/islands/input_handle_templ.go +++ /dev/null @@ -1,149 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.793 -package islands - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -type HandleState string - -const ( - HandleStateInitial HandleState = "inital" - HandleStateValid HandleState = "valid" - HandleStateInvalid HandleState = "invalid" -) - -func (s HandleState) string() string { - return string(s) -} - -func InputHandle() templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -func InputHandleError(value string, helpText string) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var2 := templ.GetChildren(ctx) - if templ_7745c5c3_Var2 == nil { - templ_7745c5c3_Var2 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -func InputHandleSuccess(value string) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var5 := templ.GetChildren(ctx) - if templ_7745c5c3_Var5 == nil { - templ_7745c5c3_Var5 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/gateway/islands/input_passkey.templ b/gateway/islands/input_passkey.templ deleted file mode 100644 index 094a13b0c..000000000 --- a/gateway/islands/input_passkey.templ +++ /dev/null @@ -1,97 +0,0 @@ -package islands - -templ InputPasskey(addr string, userHandle string, challenge string) { - - - Register Passkey - -} - -script navigatorCredentialsCreate(userId string, userHandle string, challenge string) { - const publicKey = { - challenge: Uint8Array.from(challenge, (c) => c.charCodeAt(0)), - rp: { - name: "Sonr.ID", - }, - user: { - // Assuming that userId is ASCII-only - id: Uint8Array.from(userId, (c) => c.charCodeAt(0)), - name: userId, - displayName: userHandle, - }, - pubKeyCredParams: [ - { - type: "public-key", - alg: -7, // "ES256" - }, - { - type: "public-key", - alg: -257, // "RS256" - }, - ], - authenticatorSelection: { - userVerification: "required", - residentKey: "required", - authenticatorAttachment: "platform", - }, - timeout: 60000, // 1 minute - extensions: { - payment: { - isPayment: true, - }, - largeBlob: { - supported: "preferred", - }, - }, - }; - - // Helper function to convert ArrayBuffer to Base64URL string - function arrayBufferToBase64URL(buffer) { - const bytes = new Uint8Array(buffer); - let str = ''; - bytes.forEach(byte => { str += String.fromCharCode(byte) }); - return btoa(str) - .replace(/\+/g, '-') - .replace(/\//g, '_') - .replace(/=/g, ''); - } - -navigator.credentials - .create({ publicKey }) - .then((newCredentialInfo) => { - if (!(newCredentialInfo instanceof PublicKeyCredential)) { - throw new Error('Received credential is not a PublicKeyCredential'); - } - - const response = newCredentialInfo.response; - if (!(response instanceof AuthenticatorAttestationResponse)) { - throw new Error('Response is not an AuthenticatorAttestationResponse'); - } - - // Convert the credential data to a cross-platform compatible format - const credentialJSON = { - id: newCredentialInfo.id, - rawId: arrayBufferToBase64URL(newCredentialInfo.rawId), - type: newCredentialInfo.type, - authenticatorAttachment: newCredentialInfo.authenticatorAttachment || null, - transports: Array.isArray(response.getTransports) ? response.getTransports() : [], - clientExtensionResults: newCredentialInfo.getClientExtensionResults(), - response: { - attestationObject: arrayBufferToBase64URL(response.attestationObject), - clientDataJSON: arrayBufferToBase64URL(response.clientDataJSON) - } - }; - - // Set the form value with the stringified credential data - const credential = document.getElementById('credential-data'); - credential.value = JSON.stringify(credentialJSON); - - // Submit the form - const form = document.getElementById('passkey-form'); - form.submit(); - }) - .catch((err) => { - console.error('Passkey creation failed:', err); - alert(`Failed to create passkey: ${err.message || 'Unknown error'}`); - }); -} diff --git a/gateway/islands/input_passkey_templ.go b/gateway/islands/input_passkey_templ.go deleted file mode 100644 index 24a6734ae..000000000 --- a/gateway/islands/input_passkey_templ.go +++ /dev/null @@ -1,148 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.793 -package islands - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -func InputPasskey(addr string, userHandle string, challenge string) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, navigatorCredentialsCreate(addr, userHandle, challenge)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" Register Passkey") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -func navigatorCredentialsCreate(userId string, userHandle string, challenge string) templ.ComponentScript { - return templ.ComponentScript{ - Name: `__templ_navigatorCredentialsCreate_63c0`, - Function: `function __templ_navigatorCredentialsCreate_63c0(userId, userHandle, challenge){const publicKey = { - challenge: Uint8Array.from(challenge, (c) => c.charCodeAt(0)), - rp: { - name: "Sonr.ID", - }, - user: { - // Assuming that userId is ASCII-only - id: Uint8Array.from(userId, (c) => c.charCodeAt(0)), - name: userId, - displayName: userHandle, - }, - pubKeyCredParams: [ - { - type: "public-key", - alg: -7, // "ES256" - }, - { - type: "public-key", - alg: -257, // "RS256" - }, - ], - authenticatorSelection: { - userVerification: "required", - residentKey: "required", - authenticatorAttachment: "platform", - }, - timeout: 60000, // 1 minute - extensions: { - payment: { - isPayment: true, - }, - largeBlob: { - supported: "preferred", - }, - }, - }; - - // Helper function to convert ArrayBuffer to Base64URL string - function arrayBufferToBase64URL(buffer) { - const bytes = new Uint8Array(buffer); - let str = ''; - bytes.forEach(byte => { str += String.fromCharCode(byte) }); - return btoa(str) - .replace(/\+/g, '-') - .replace(/\//g, '_') - .replace(/=/g, ''); - } - -navigator.credentials - .create({ publicKey }) - .then((newCredentialInfo) => { - if (!(newCredentialInfo instanceof PublicKeyCredential)) { - throw new Error('Received credential is not a PublicKeyCredential'); - } - - const response = newCredentialInfo.response; - if (!(response instanceof AuthenticatorAttestationResponse)) { - throw new Error('Response is not an AuthenticatorAttestationResponse'); - } - - // Convert the credential data to a cross-platform compatible format - const credentialJSON = { - id: newCredentialInfo.id, - rawId: arrayBufferToBase64URL(newCredentialInfo.rawId), - type: newCredentialInfo.type, - authenticatorAttachment: newCredentialInfo.authenticatorAttachment || null, - transports: Array.isArray(response.getTransports) ? response.getTransports() : [], - clientExtensionResults: newCredentialInfo.getClientExtensionResults(), - response: { - attestationObject: arrayBufferToBase64URL(response.attestationObject), - clientDataJSON: arrayBufferToBase64URL(response.clientDataJSON) - } - }; - - // Set the form value with the stringified credential data - const credential = document.getElementById('credential-data'); - credential.value = JSON.stringify(credentialJSON); - - // Submit the form - const form = document.getElementById('passkey-form'); - form.submit(); - }) - .catch((err) => { - console.error('Passkey creation failed:', err); - alert(` + "`" + `Failed to create passkey: ${err.message || 'Unknown error'}` + "`" + `); - }); -}`, - Call: templ.SafeScript(`__templ_navigatorCredentialsCreate_63c0`, userId, userHandle, challenge), - CallInline: templ.SafeScriptInline(`__templ_navigatorCredentialsCreate_63c0`, userId, userHandle, challenge), - } -} - -var _ = templruntime.GeneratedTemplate diff --git a/gateway/views/base_form.templ b/gateway/views/base_form.templ deleted file mode 100644 index df0040b6d..000000000 --- a/gateway/views/base_form.templ +++ /dev/null @@ -1,58 +0,0 @@ -package views - -templ Form(action, id string) { -
- { children... } -
-} - -templ FormHeader() { -
-
- { children... } -
-
-} - -templ FormBody() { - - { children... } - - -} - -templ FormFooter() { -
- { children... } -
-} - -templ FormCancel() { - - - Cancel - -} - -templ FormSubmit(text string) { - - { text } - - -} diff --git a/gateway/views/base_form_templ.go b/gateway/views/base_form_templ.go deleted file mode 100644 index 8613e1a16..000000000 --- a/gateway/views/base_form_templ.go +++ /dev/null @@ -1,265 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.793 -package views - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -func Form(action, id string) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -func FormHeader() templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var5 := templ.GetChildren(ctx) - if templ_7745c5c3_Var5 == nil { - templ_7745c5c3_Var5 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ_7745c5c3_Var5.Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -func FormBody() templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var6 := templ.GetChildren(ctx) - if templ_7745c5c3_Var6 == nil { - templ_7745c5c3_Var6 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ_7745c5c3_Var6.Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -func FormFooter() templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var7 := templ.GetChildren(ctx) - if templ_7745c5c3_Var7 == nil { - templ_7745c5c3_Var7 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ_7745c5c3_Var7.Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -func FormCancel() templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var8 := templ.GetChildren(ctx) - if templ_7745c5c3_Var8 == nil { - templ_7745c5c3_Var8 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" Cancel") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -func FormSubmit(text string) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var9 := templ.GetChildren(ctx) - if templ_7745c5c3_Var9 == nil { - templ_7745c5c3_Var9 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var10 string - templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(text) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `gateway/views/base_form.templ`, Line: 55, Col: 8} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/gateway/views/base_head.templ b/gateway/views/base_head.templ deleted file mode 100644 index ab385ce2b..000000000 --- a/gateway/views/base_head.templ +++ /dev/null @@ -1,135 +0,0 @@ -package views - -import "fmt" - -var ( - nebulaHandle = templ.NewOnceHandle() - tailwindHandle = templ.NewOnceHandle() - alpineHandle = templ.NewOnceHandle() - dexieHandle = templ.NewOnceHandle() - htmxHandle = templ.NewOnceHandle() - turnstileHandle = templ.NewOnceHandle() -) - -templ Head(title string, nebulaVersion string) { - - @Turnstile() - @Tailwind() - @Alpine() - @Htmx() - @Dexie() - @Nebula(nebulaVersion) - - - - { title } - - - - - - { children... } - -} - -// ╭──────────────────────────────────────────────────────────╮ -// │ 3rd Party Libraries │ -// ╰──────────────────────────────────────────────────────────╯ - -// Tailwind css dependencies -templ Tailwind() { - @tailwindHandle.Once() { - - - } -} - -// Turnstile is used for cloudflare challenges -templ Turnstile() { - @turnstileHandle.Once() { - - } -} - -// Alpine is a component that renders the Alpine.js library -templ Alpine() { - @alpineHandle.Once() { - - - } -} - -// Dexie is a component that renders the Dexie.js library -templ Dexie() { - @dexieHandle.Once() { - - - } -} - -// Htmx is a component that renders the Htmx.js library -templ Htmx() { - @htmxHandle.Once() { - - - - - - - } -} - -// Nebula is a component that renders the Nebula.js library -templ Nebula(version string) { - - - @nebulaHandle.Once() { - - } -} - -// ╭───────────────────────────────────────────────────────────╮ -// │ Helper Functions │ -// ╰───────────────────────────────────────────────────────────╯ - -func jsDelivrURL(pkg string, version string, path string) string { - return fmt.Sprintf("https://cdn.jsdelivr.net/npm/%s@%s/%s", pkg, version, path) -} diff --git a/gateway/views/base_head_templ.go b/gateway/views/base_head_templ.go deleted file mode 100644 index 56c4497e8..000000000 --- a/gateway/views/base_head_templ.go +++ /dev/null @@ -1,573 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.793 -package views - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -import "fmt" - -var ( - nebulaHandle = templ.NewOnceHandle() - tailwindHandle = templ.NewOnceHandle() - alpineHandle = templ.NewOnceHandle() - dexieHandle = templ.NewOnceHandle() - htmxHandle = templ.NewOnceHandle() - turnstileHandle = templ.NewOnceHandle() -) - -func Head(title string, nebulaVersion string) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = Turnstile().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = Tailwind().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = Alpine().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = Htmx().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = Dexie().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = Nebula(nebulaVersion).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var2 string - templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(title) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `gateway/views/base_head.templ`, Line: 25, Col: 16} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -// ╭──────────────────────────────────────────────────────────╮ -// │ 3rd Party Libraries │ -// ╰──────────────────────────────────────────────────────────╯ - -// Tailwind css dependencies -func Tailwind() templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var3 := templ.GetChildren(ctx) - if templ_7745c5c3_Var3 == nil { - templ_7745c5c3_Var3 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var4 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = tailwindHandle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var4), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -// Turnstile is used for cloudflare challenges -func Turnstile() templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var5 := templ.GetChildren(ctx) - if templ_7745c5c3_Var5 == nil { - templ_7745c5c3_Var5 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var6 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = turnstileHandle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var6), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -// Alpine is a component that renders the Alpine.js library -func Alpine() templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var7 := templ.GetChildren(ctx) - if templ_7745c5c3_Var7 == nil { - templ_7745c5c3_Var7 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var8 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = alpineHandle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var8), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -// Dexie is a component that renders the Dexie.js library -func Dexie() templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var11 := templ.GetChildren(ctx) - if templ_7745c5c3_Var11 == nil { - templ_7745c5c3_Var11 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var12 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = dexieHandle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var12), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -// Htmx is a component that renders the Htmx.js library -func Htmx() templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var15 := templ.GetChildren(ctx) - if templ_7745c5c3_Var15 == nil { - templ_7745c5c3_Var15 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var16 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = htmxHandle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var16), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -// Nebula is a component that renders the Nebula.js library -func Nebula(version string) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var23 := templ.GetChildren(ctx) - if templ_7745c5c3_Var23 == nil { - templ_7745c5c3_Var23 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Var26 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = nebulaHandle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var26), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -// ╭───────────────────────────────────────────────────────────╮ -// │ Helper Functions │ -// ╰───────────────────────────────────────────────────────────╯ - -func jsDelivrURL(pkg string, version string, path string) string { - return fmt.Sprintf("https://cdn.jsdelivr.net/npm/%s@%s/%s", pkg, version, path) -} - -var _ = templruntime.GeneratedTemplate diff --git a/gateway/views/base_hero.templ b/gateway/views/base_hero.templ deleted file mode 100644 index 596dc9e01..000000000 --- a/gateway/views/base_hero.templ +++ /dev/null @@ -1,36 +0,0 @@ -package views - -templ HeroTitle(title string, subtitle string) { -
-

- { title } -

-

- { subtitle } -

-
-} - -templ HeroStart() { -
- - - Create Vault - - -
-} - -templ HeroSocials() { -
- - - - - - - - - -
-} diff --git a/gateway/views/base_hero_templ.go b/gateway/views/base_hero_templ.go deleted file mode 100644 index bc7ec5fa5..000000000 --- a/gateway/views/base_hero_templ.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.793 -package views - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -func HeroTitle(title string, subtitle string) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var2 string - templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(title) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `gateway/views/base_hero.templ`, Line: 6, Col: 10} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var3 string - templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(subtitle) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `gateway/views/base_hero.templ`, Line: 9, Col: 13} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -func HeroStart() templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var4 := templ.GetChildren(ctx) - if templ_7745c5c3_Var4 == nil { - templ_7745c5c3_Var4 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
Create Vault
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -func HeroSocials() templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var5 := templ.GetChildren(ctx) - if templ_7745c5c3_Var5 == nil { - templ_7745c5c3_Var5 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/gateway/views/base_layout.templ b/gateway/views/base_layout.templ deleted file mode 100644 index 17cadae96..000000000 --- a/gateway/views/base_layout.templ +++ /dev/null @@ -1,59 +0,0 @@ -package views - -templ LayoutContainer() { -
-
-
-
- { children... } -
-
-
-
-} - -// Columns is a component that renders a responsive flex container that stacks on mobile -templ LayoutColumns() { -
- { children... } -
-} - -// Rows is a component that renders a responsive flex container that wraps on mobile -templ LayoutRows() { -
- { children... } -
-} - -templ LayoutSeparator(text string) { -
-
-
- { text } -
-
-} - -// Layout is a component that renders the general layout of the application -templ LayoutView(title string) { - - - @Head(title, "0.0.11") - -
- { children... } -
- - -} - -func Clsx(attrs ...templ.Attributes) templ.Attributes { - merged := templ.Attributes{} - for _, attr := range attrs { - for k, v := range attr { - merged[k] = v - } - } - return merged -} diff --git a/gateway/views/base_layout_templ.go b/gateway/views/base_layout_templ.go deleted file mode 100644 index c9c9a4a2f..000000000 --- a/gateway/views/base_layout_templ.go +++ /dev/null @@ -1,222 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.793 -package views - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -func LayoutContainer() templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -// Columns is a component that renders a responsive flex container that stacks on mobile -func LayoutColumns() templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var2 := templ.GetChildren(ctx) - if templ_7745c5c3_Var2 == nil { - templ_7745c5c3_Var2 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ_7745c5c3_Var2.Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -// Rows is a component that renders a responsive flex container that wraps on mobile -func LayoutRows() templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var3 := templ.GetChildren(ctx) - if templ_7745c5c3_Var3 == nil { - templ_7745c5c3_Var3 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ_7745c5c3_Var3.Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -func LayoutSeparator(text string) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var4 := templ.GetChildren(ctx) - if templ_7745c5c3_Var4 == nil { - templ_7745c5c3_Var4 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var5 string - templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(text) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `gateway/views/base_layout.templ`, Line: 33, Col: 45} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -// Layout is a component that renders the general layout of the application -func LayoutView(title string) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var6 := templ.GetChildren(ctx) - if templ_7745c5c3_Var6 == nil { - templ_7745c5c3_Var6 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = Head(title, "0.0.11").Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ_7745c5c3_Var6.Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -func Clsx(attrs ...templ.Attributes) templ.Attributes { - merged := templ.Attributes{} - for _, attr := range attrs { - for k, v := range attr { - merged[k] = v - } - } - return merged -} - -var _ = templruntime.GeneratedTemplate diff --git a/gateway/views/view_errors.templ b/gateway/views/view_errors.templ deleted file mode 100644 index 269b7ec0f..000000000 --- a/gateway/views/view_errors.templ +++ /dev/null @@ -1,14 +0,0 @@ -package views - -templ ErrorView(err string) { - @LayoutView("Error | Sonr.ID") { - @LayoutContainer() { - @HeroTitle("Uh oh!", "Something went wrong.") -
-

- { err } -

-
- } - } -} diff --git a/gateway/views/view_errors_templ.go b/gateway/views/view_errors_templ.go deleted file mode 100644 index 1e68512b2..000000000 --- a/gateway/views/view_errors_templ.go +++ /dev/null @@ -1,93 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.793 -package views - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -func ErrorView(err string) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var3 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = HeroTitle("Uh oh!", "Something went wrong.").Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var4 string - templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(err) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `gateway/views/view_errors.templ`, Line: 9, Col: 10} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = LayoutContainer().Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = LayoutView("Error | Sonr.ID").Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/gateway/views/view_home.templ b/gateway/views/view_home.templ deleted file mode 100644 index df2ec47b1..000000000 --- a/gateway/views/view_home.templ +++ /dev/null @@ -1,26 +0,0 @@ -package views - -templ InitialView() { - @LayoutView("Sonr.ID") { - @LayoutContainer() { - @HeroTitle("Sonr.ID", "The decentralized identity layer for the web.") - @HeroStart() - @HeroSocials() - } - } -} - -templ ReturningView() { - @LayoutView("Login | Sonr.ID") { - @LayoutContainer() { - @HeroTitle("Welcome Back!", "Continue with your existing Sonr.ID.") -
- - - Log back in - - -
- } - } -} diff --git a/gateway/views/view_home_templ.go b/gateway/views/view_home_templ.go deleted file mode 100644 index 94a5c2e3f..000000000 --- a/gateway/views/view_home_templ.go +++ /dev/null @@ -1,161 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.793 -package views - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -func InitialView() templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var3 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = HeroTitle("Sonr.ID", "The decentralized identity layer for the web.").Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = HeroStart().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = HeroSocials().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = LayoutContainer().Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = LayoutView("Sonr.ID").Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -func ReturningView() templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var4 := templ.GetChildren(ctx) - if templ_7745c5c3_Var4 == nil { - templ_7745c5c3_Var4 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var5 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var6 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = HeroTitle("Welcome Back!", "Continue with your existing Sonr.ID.").Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
Log back in
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = LayoutContainer().Render(templ.WithChildren(ctx, templ_7745c5c3_Var6), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = LayoutView("Login | Sonr.ID").Render(templ.WithChildren(ctx, templ_7745c5c3_Var5), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/gateway/views/view_loading.templ b/gateway/views/view_loading.templ deleted file mode 100644 index 9418b23bb..000000000 --- a/gateway/views/view_loading.templ +++ /dev/null @@ -1,9 +0,0 @@ -package views - -templ LoadingView() { - @LayoutView("Loading... | Sonr.ID") { - @LayoutContainer() { - @HeroTitle("Loading Vault", "This will be used to login to your vault.") - } - } -} diff --git a/gateway/views/view_loading_templ.go b/gateway/views/view_loading_templ.go deleted file mode 100644 index f1d88c510..000000000 --- a/gateway/views/view_loading_templ.go +++ /dev/null @@ -1,76 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.793 -package views - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -func LoadingView() templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var3 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = HeroTitle("Loading Vault", "This will be used to login to your vault.").Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = LayoutContainer().Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = LayoutView("Loading... | Sonr.ID").Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/gateway/views/view_register.templ b/gateway/views/view_register.templ deleted file mode 100644 index b4a5af40c..000000000 --- a/gateway/views/view_register.templ +++ /dev/null @@ -1,47 +0,0 @@ -package views - -import "github.com/onsonr/sonr/gateway/islands" - -templ RegisterProfileView(firstNumber int, lastNumber int) { - @LayoutView("New Profile | Sonr.ID") { - @LayoutContainer() { - @HeroTitle("Basic Info", "Tell us a little about yourself.") - @Form("/register/passkey", "create-profile") { - @FormBody() { - @FormHeader() { -
- -
- } - @islands.InputHandle() - @islands.HumanSlider(firstNumber, lastNumber) - @FormFooter() { - @FormCancel() - @FormSubmit("Next") - } - } - } - } - } -} - -templ RegisterPasskeyView(address string, handle string, name string, challenge string, creationBlock string) { - @LayoutView("Register | Sonr.ID") { - @LayoutContainer() { - @HeroTitle("Link a PassKey", "This will be used to login to your vault.") - @Form("/register/finish", "passkey-form") { - - @FormBody() { - @FormHeader() { - @islands.CardAccount(address, name, handle, creationBlock) - } - @islands.CoinSelect() - @FormFooter() { - @islands.InputPasskey(address, handle, challenge) - @FormCancel() - } - } - } - } - } -} diff --git a/gateway/views/view_register_templ.go b/gateway/views/view_register_templ.go deleted file mode 100644 index dfc546c57..000000000 --- a/gateway/views/view_register_templ.go +++ /dev/null @@ -1,363 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.793 -package views - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -import "github.com/onsonr/sonr/gateway/islands" - -func RegisterProfileView(firstNumber int, lastNumber int) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var3 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = HeroTitle("Basic Info", "Tell us a little about yourself.").Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Var4 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var5 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var6 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = FormHeader().Render(templ.WithChildren(ctx, templ_7745c5c3_Var6), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = islands.InputHandle().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = islands.HumanSlider(firstNumber, lastNumber).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Var7 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = FormCancel().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = FormSubmit("Next").Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = FormFooter().Render(templ.WithChildren(ctx, templ_7745c5c3_Var7), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = FormBody().Render(templ.WithChildren(ctx, templ_7745c5c3_Var5), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = Form("/register/passkey", "create-profile").Render(templ.WithChildren(ctx, templ_7745c5c3_Var4), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = LayoutContainer().Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = LayoutView("New Profile | Sonr.ID").Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -func RegisterPasskeyView(address string, handle string, name string, challenge string, creationBlock string) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var8 := templ.GetChildren(ctx) - if templ_7745c5c3_Var8 == nil { - templ_7745c5c3_Var8 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var9 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var10 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = HeroTitle("Link a PassKey", "This will be used to login to your vault.").Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Var11 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Var12 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var13 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = islands.CardAccount(address, name, handle, creationBlock).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = FormHeader().Render(templ.WithChildren(ctx, templ_7745c5c3_Var13), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = islands.CoinSelect().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Var14 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = islands.InputPasskey(address, handle, challenge).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = FormCancel().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = FormFooter().Render(templ.WithChildren(ctx, templ_7745c5c3_Var14), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = FormBody().Render(templ.WithChildren(ctx, templ_7745c5c3_Var12), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = Form("/register/finish", "passkey-form").Render(templ.WithChildren(ctx, templ_7745c5c3_Var11), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = LayoutContainer().Render(templ.WithChildren(ctx, templ_7745c5c3_Var10), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = LayoutView("Register | Sonr.ID").Render(templ.WithChildren(ctx, templ_7745c5c3_Var9), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/go.mod b/go.mod index 64ec4b8ac..c6984c812 100644 --- a/go.mod +++ b/go.mod @@ -47,8 +47,6 @@ require ( cosmossdk.io/x/upgrade v0.1.1 filippo.io/edwards25519 v1.1.0 git.sr.ht/~sircmpwn/go-bare v0.0.0-20210406120253-ab86bc2846d9 - github.com/a-h/templ v0.2.793 - github.com/apple/pkl-go v0.8.0 github.com/btcsuite/btcd/btcec/v2 v2.3.4 github.com/bwesterb/go-ristretto v1.2.3 github.com/cometbft/cometbft v0.38.12 @@ -63,30 +61,21 @@ require ( github.com/cosmos/ibc-go/v8 v8.2.0 github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 github.com/dustinxie/ecc v0.0.0-20210511000915-959544187564 - github.com/ecies/go/v2 v2.0.9 - github.com/go-webauthn/webauthn v0.11.2 + github.com/ecies/go/v2 v2.0.10 github.com/golang-jwt/jwt v3.2.2+incompatible github.com/golang/protobuf v1.5.4 github.com/gorilla/mux v1.8.1 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/gtank/merlin v0.1.1 - github.com/ipfs/boxo v0.24.3 github.com/ipfs/go-cid v0.4.1 - github.com/ipfs/kubo v0.32.1 - github.com/jackc/pgx/v5 v5.7.2 github.com/joho/godotenv v1.5.1 - github.com/labstack/echo-contrib v0.17.1 - github.com/labstack/echo/v4 v4.12.0 github.com/libp2p/go-libp2p v0.37.2 - github.com/medama-io/go-useragent v1.0.1 github.com/mr-tron/base58 v1.2.0 github.com/multiformats/go-multibase v0.2.0 github.com/multiformats/go-multicodec v0.9.0 github.com/multiformats/go-multihash v0.2.3 github.com/multiformats/go-varint v0.0.7 - github.com/ncruces/go-sqlite3 v0.21.1 github.com/pkg/errors v0.9.1 - github.com/segmentio/ksuid v1.0.4 github.com/spf13/cast v1.7.1 github.com/spf13/cobra v1.8.1 github.com/spf13/pflag v1.0.5 @@ -111,18 +100,12 @@ require ( github.com/99designs/keyring v1.2.1 // indirect github.com/DataDog/datadog-go v3.2.0+incompatible // indirect github.com/DataDog/zstd v1.5.5 // indirect - github.com/alecthomas/units v0.0.0-20240927000941-0f3dac36c52b // indirect github.com/aws/aws-sdk-go v1.55.5 // indirect - github.com/benbjohnson/clock v1.3.5 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect github.com/bits-and-blooms/bitset v1.19.1 // indirect - github.com/blang/semver/v4 v4.0.0 // indirect - github.com/boyter/go-string v1.0.5 // indirect github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 // indirect - github.com/caddyserver/certmagic v0.21.4 // indirect - github.com/caddyserver/zerossl v0.1.3 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect @@ -135,18 +118,16 @@ require ( github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect github.com/cometbft/cometbft-db v0.11.0 // indirect - github.com/consensys/bavard v0.1.24 // indirect + github.com/consensys/bavard v0.1.13 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect github.com/cosmos/iavl v1.1.2 // indirect github.com/cosmos/ics23/go v0.10.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect - github.com/crackcomm/go-gitignore v0.0.0-20241020182519-7843d2ba8fdf // indirect github.com/creachadair/atomicfile v0.3.1 // indirect github.com/creachadair/tomledit v0.0.24 // indirect github.com/danieljoos/wincred v1.1.2 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c // indirect github.com/decred/dcrd/crypto/blake256 v1.1.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect @@ -156,35 +137,25 @@ require ( github.com/dvsekhvalnov/jose2go v1.6.0 // indirect github.com/emicklei/dot v1.6.1 // indirect github.com/ethereum/go-ethereum v1.14.12 // indirect - github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5 // indirect github.com/fatih/color v1.16.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/flynn/noise v1.1.0 // indirect - github.com/francoispqt/gojay v1.2.13 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect - github.com/fxamacker/cbor/v2 v2.7.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.12.0 // indirect github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/go-task/slim-sprig/v3 v3.0.0 // indirect - github.com/go-webauthn/x v0.1.14 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gogo/googleapis v1.4.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang-jwt/jwt/v5 v5.2.1 // indirect github.com/golang/glog v1.2.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/mock v1.6.0 // indirect github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect github.com/google/btree v1.1.3 // indirect github.com/google/go-cmp v0.6.0 // indirect - github.com/google/go-tpm v0.9.1 // indirect - github.com/google/gopacket v1.1.19 // indirect github.com/google/orderedcode v0.0.1 // indirect - github.com/google/pprof v0.0.0-20241203143554-1e3fdc7de467 // indirect github.com/google/s2a-go v0.1.7 // indirect github.com/google/uuid v1.6.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect @@ -193,13 +164,11 @@ require ( github.com/gorilla/websocket v1.5.3 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect - github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-getter v1.7.5 // indirect github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect github.com/hashicorp/go-metrics v0.5.3 // indirect - github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-plugin v1.5.2 // indirect github.com/hashicorp/go-safetemp v1.0.0 // indirect github.com/hashicorp/go-version v1.7.0 // indirect @@ -209,63 +178,22 @@ require ( github.com/hashicorp/yamux v0.1.1 // indirect github.com/hdevalence/ed25519consensus v0.1.0 // indirect github.com/huandu/skiplist v1.2.0 // indirect - github.com/huin/goupnp v1.3.0 // indirect github.com/iancoleman/orderedmap v0.3.0 // indirect github.com/iancoleman/strcase v0.3.0 // indirect github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/ipfs/bbloom v0.0.4 // indirect - github.com/ipfs/go-bitfield v1.1.0 // indirect - github.com/ipfs/go-block-format v0.2.0 // indirect - github.com/ipfs/go-datastore v0.6.0 // indirect - github.com/ipfs/go-ds-measure v0.2.0 // indirect - github.com/ipfs/go-fs-lock v0.0.7 // indirect - github.com/ipfs/go-ipfs-cmds v0.14.0 // indirect - github.com/ipfs/go-ipfs-util v0.0.3 // indirect - github.com/ipfs/go-ipld-cbor v0.2.0 // indirect - github.com/ipfs/go-ipld-format v0.6.0 // indirect - github.com/ipfs/go-ipld-legacy v0.2.1 // indirect - github.com/ipfs/go-log v1.0.5 // indirect - github.com/ipfs/go-log/v2 v2.5.1 // indirect - github.com/ipfs/go-metrics-interface v0.0.1 // indirect - github.com/ipfs/go-unixfsnode v1.9.2 // indirect - github.com/ipld/go-car/v2 v2.14.2 // indirect - github.com/ipld/go-codec-dagpb v1.6.0 // indirect - github.com/ipld/go-ipld-prime v0.21.0 // indirect - github.com/ipshipyard/p2p-forge v0.0.2 // indirect - github.com/jackc/pgpassfile v1.0.0 // indirect - github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect - github.com/jackpal/go-nat-pmp v1.0.2 // indirect - github.com/jbenet/go-temp-err-catcher v0.1.0 // indirect - github.com/jbenet/goprocess v0.1.4 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect github.com/klauspost/compress v1.17.11 // indirect github.com/klauspost/cpuid/v2 v2.2.9 // indirect - github.com/koron/go-ssdp v0.0.4 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect - github.com/labstack/gommon v0.4.2 // indirect github.com/lib/pq v1.10.7 // indirect - github.com/libdns/libdns v0.2.2 // indirect - github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/libp2p/go-cidranger v1.1.0 // indirect - github.com/libp2p/go-flow-metrics v0.2.0 // indirect - github.com/libp2p/go-libp2p-asn-util v0.4.1 // indirect - github.com/libp2p/go-libp2p-kad-dht v0.28.1 // indirect - github.com/libp2p/go-libp2p-kbucket v0.6.4 // indirect - github.com/libp2p/go-libp2p-record v0.2.0 // indirect - github.com/libp2p/go-libp2p-routing-helpers v0.7.4 // indirect - github.com/libp2p/go-msgio v0.3.0 // indirect - github.com/libp2p/go-nat v0.2.0 // indirect - github.com/libp2p/go-netroute v0.2.2 // indirect github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/manifoldco/promptui v0.9.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mholt/acmez/v2 v2.0.3 // indirect - github.com/miekg/dns v1.1.62 // indirect github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643 // indirect github.com/minio/highwayhash v1.0.2 // indirect github.com/minio/sha256-simd v1.0.1 // indirect @@ -277,50 +205,23 @@ require ( github.com/multiformats/go-base32 v0.1.0 // indirect github.com/multiformats/go-base36 v0.2.0 // indirect github.com/multiformats/go-multiaddr v0.14.0 // indirect - github.com/multiformats/go-multiaddr-dns v0.4.1 // indirect - github.com/multiformats/go-multiaddr-fmt v0.1.0 // indirect - github.com/multiformats/go-multistream v0.6.0 // indirect - github.com/ncruces/julianday v1.0.0 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect - github.com/onsi/ginkgo/v2 v2.22.0 // indirect - github.com/opentracing/opentracing-go v1.2.0 // indirect - github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect + github.com/onsi/ginkgo v1.16.5 // indirect + github.com/onsi/gomega v1.34.2 // indirect github.com/pelletier/go-toml/v2 v2.2.2 // indirect - github.com/petar/GoLLRB v0.0.0-20210522233825-ae3b015fd3e9 // indirect github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect - github.com/pion/datachannel v1.5.9 // indirect - github.com/pion/dtls/v2 v2.2.12 // indirect - github.com/pion/ice/v2 v2.3.37 // indirect - github.com/pion/interceptor v0.1.37 // indirect - github.com/pion/logging v0.2.2 // indirect - github.com/pion/mdns v0.0.12 // indirect - github.com/pion/randutil v0.1.0 // indirect - github.com/pion/rtcp v1.2.14 // indirect - github.com/pion/rtp v1.8.9 // indirect - github.com/pion/sctp v1.8.34 // indirect - github.com/pion/sdp/v3 v3.0.9 // indirect - github.com/pion/srtp/v2 v2.0.20 // indirect - github.com/pion/stun v0.6.1 // indirect - github.com/pion/transport/v2 v2.2.10 // indirect - github.com/pion/turn/v2 v2.1.6 // indirect - github.com/pion/webrtc/v3 v3.3.4 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/polydawn/refmt v0.89.0 // indirect github.com/prometheus/client_golang v1.20.5 // indirect github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common v0.61.0 // indirect github.com/prometheus/procfs v0.15.1 // indirect - github.com/quic-go/qpack v0.5.1 // indirect - github.com/quic-go/quic-go v0.48.2 // indirect - github.com/quic-go/webtransport-go v0.8.1-0.20241018022711-4ac2c9250e66 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.13.1 // indirect github.com/rs/cors v1.11.1 // indirect github.com/rs/zerolog v1.32.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect - github.com/samber/lo v1.47.0 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/sourcegraph/conc v0.3.0 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect @@ -328,20 +229,8 @@ require ( github.com/subosito/gotenv v1.6.0 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/tendermint/go-amino v0.16.0 // indirect - github.com/tetratelabs/wazero v1.8.2 // indirect github.com/tidwall/btree v1.7.0 // indirect github.com/ulikunitz/xz v0.5.11 // indirect - github.com/valyala/bytebufferpool v1.0.0 // indirect - github.com/valyala/fasttemplate v1.2.2 // indirect - github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect - github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect - github.com/whyrusleeping/base32 v0.0.0-20170828182744-c30ac30633cc // indirect - github.com/whyrusleeping/cbor v0.0.0-20171005072247-63513f603b11 // indirect - github.com/whyrusleeping/cbor-gen v0.1.2 // indirect - github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1 // indirect - github.com/wlynxg/anet v0.0.5 // indirect - github.com/x448/float16 v0.8.4 // indirect - github.com/zeebo/blake3 v0.2.4 // indirect github.com/zondax/hid v0.9.2 // indirect github.com/zondax/ledger-go v0.14.3 // indirect go.etcd.io/bbolt v1.3.10 // indirect @@ -350,15 +239,10 @@ require ( go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.56.0 // indirect go.opentelemetry.io/otel v1.31.0 // indirect go.opentelemetry.io/otel/metric v1.31.0 // indirect + go.opentelemetry.io/otel/sdk v1.31.0 // indirect go.opentelemetry.io/otel/trace v1.31.0 // indirect - go.uber.org/dig v1.18.0 // indirect - go.uber.org/fx v1.23.0 // indirect - go.uber.org/mock v0.5.0 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.27.0 // indirect - go4.org v0.0.0-20230225012048-214862532bf5 // indirect golang.org/x/exp v0.0.0-20241204233417-43b7b7cde48d // indirect - golang.org/x/mod v0.22.0 // indirect golang.org/x/net v0.32.0 // indirect golang.org/x/oauth2 v0.23.0 // indirect golang.org/x/sync v0.10.0 // indirect @@ -366,9 +250,7 @@ require ( golang.org/x/term v0.27.0 // indirect golang.org/x/text v0.21.0 // indirect golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.28.0 // indirect golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect - gonum.org/v1/gonum v0.15.0 // indirect google.golang.org/api v0.172.0 // indirect google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9 // indirect diff --git a/go.sum b/go.sum index ae73078ac..ed127f7ce 100644 --- a/go.sum +++ b/go.sum @@ -1,19 +1,12 @@ -bazil.org/fuse v0.0.0-20200117225306-7b5117fecadc h1:utDghgcjE8u+EBjHOgYT+dJPcnDF05KqWMBcjuJy510= -bazil.org/fuse v0.0.0-20200117225306-7b5117fecadc/go.mod h1:FbcW6z/2VytnFDhZfumh8Ss8zxHE6qpMP5sHTRe0EaM= -cloud.google.com/go v0.0.0-20170206221025-ce650573d812/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.31.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.37.0/go.mod h1:TS1dMSSfndXH133OKGwekG838Om/cQT0BUHV3HcBgoo= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.43.0/go.mod h1:BOSR3VbTLkk6FDC/TcffxP4NF/FFBGA5ku+jvKOP7pg= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.51.0/go.mod h1:hWtGJ6gnXH+KgDv+V0zFGDvpi07n3z8ZNj3T1RW0Gcw= cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= @@ -160,7 +153,6 @@ cloud.google.com/go/bigquery v1.49.0/go.mod h1:Sv8hMmTFFYBlt/ftw2uN6dFdQPzBlREY9 cloud.google.com/go/bigquery v1.50.0/go.mod h1:YrleYEh2pSEbgTBZYMJ5SuSr0ML3ypjRB1zgf7pvQLU= cloud.google.com/go/bigquery v1.52.0/go.mod h1:3b/iXjRQGU4nKa87cXeg6/gogLjO8C6PmuM8i5Bi/u4= cloud.google.com/go/bigquery v1.53.0/go.mod h1:3b/iXjRQGU4nKa87cXeg6/gogLjO8C6PmuM8i5Bi/u4= -cloud.google.com/go/bigtable v1.2.0/go.mod h1:JcVAOl45lrTmQfLj7T6TxyMzIN/3FGGcFm+2xVAli2o= cloud.google.com/go/billing v1.4.0/go.mod h1:g9IdKBEFlItS8bTtlrZdVLWSSdSyFUZKXNS02zKMOZY= cloud.google.com/go/billing v1.5.0/go.mod h1:mztb1tBc3QekhjSgmpf/CV4LzWXLzCArwpLmP2Gm88s= cloud.google.com/go/billing v1.6.0/go.mod h1:WoXzguj+BeHXPbKfNWkqVtDdzORazmCjraY+vrxcyvI= @@ -770,7 +762,6 @@ cloud.google.com/go/workflows v1.8.0/go.mod h1:ysGhmEajwZxGn1OhGOGKsTXc5PyxOc0vf cloud.google.com/go/workflows v1.9.0/go.mod h1:ZGkj1aFIOd9c8Gerkjjq7OW7I5+l6cSvT3ujaO/WwSA= cloud.google.com/go/workflows v1.10.0/go.mod h1:fZ8LmRmZQWacon9UCX1r/g/DfAXx5VcPALq2CxzdePw= cloud.google.com/go/workflows v1.11.1/go.mod h1:Z+t10G1wF7h8LgdY/EmRcQY8ptBD/nvofaL6FqlET6g= -collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE= cosmossdk.io/api v0.7.6 h1:PC20PcXy1xYKH2KU4RMurVoFjjKkCgYRbVAD4PdqUuY= cosmossdk.io/api v0.7.6/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= cosmossdk.io/client/v2 v2.0.0-beta.1 h1:XkHh1lhrLYIT9zKl7cIOXUXg2hdhtjTPBUfqERNA1/Q= @@ -805,114 +796,53 @@ cosmossdk.io/x/tx v0.13.5 h1:FdnU+MdmFWn1pTsbfU0OCf2u6mJ8cqc1H4OMG418MLw= cosmossdk.io/x/tx v0.13.5/go.mod h1:V6DImnwJMTq5qFjeGWpXNiT/fjgE4HtmclRmTqRVM3w= cosmossdk.io/x/upgrade v0.1.1 h1:aoPe2gNvH+Gwt/Pgq3dOxxQVU3j5P6Xf+DaUJTDZATc= cosmossdk.io/x/upgrade v0.1.1/go.mod h1:MNLptLPcIFK9CWt7Ra//8WUZAxweyRDNcbs5nkOcQy0= -dmitri.shuralyov.com/app/changes v0.0.0-20180602232624-0a106ad413e3/go.mod h1:Yl+fi1br7+Rr3LqpNJf1/uxUdtRUV+Tnj0o93V2B9MU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -dmitri.shuralyov.com/html/belt v0.0.0-20180602232347-f7d459c86be0/go.mod h1:JLBrvjyP0v+ecvNYvCpyZgu5/xkfAUhi6wJj28eUfSU= -dmitri.shuralyov.com/service/change v0.0.0-20181023043359-a85b471d5412/go.mod h1:a1inKt/atXimZ4Mv927x+r7UpyzRUf4emIoiiSC2TN4= -dmitri.shuralyov.com/state v0.0.0-20180228185332-28bcc343414c/go.mod h1:0PRwlb0D6DFvNNtx+9ybjezNCa8XF0xaYcETyp6rHWU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8= -git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= git.sr.ht/~sbinet/gg v0.3.1/go.mod h1:KGYtlADtqsqANL9ueOFkWymvzUvLMQllU5Ixo+8v3pc= git.sr.ht/~sircmpwn/getopt v0.0.0-20191230200459-23622cc906b3/go.mod h1:wMEGFFFNuPos7vHmWXfszqImLppbc0wEhh6JBfJIUgw= git.sr.ht/~sircmpwn/go-bare v0.0.0-20210406120253-ab86bc2846d9 h1:Ahny8Ud1LjVMMAlt8utUFKhhxJtwBAualvsbc/Sk7cE= git.sr.ht/~sircmpwn/go-bare v0.0.0-20210406120253-ab86bc2846d9/go.mod h1:BVJwbDfVjCjoFiKrhkei6NdGcZYpkDkdyCdg1ukytRA= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4= -github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= -github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96 h1:cTp8I5+VIoKjsnZuH8vjyaysT/ses3EvZeaV/1UkF2M= -github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.0/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.0/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0/go.mod h1:+6sju8gk8FRmSajX3Oz4G5Gm7P+mbqE9FVaXXFYTkCM= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0/go.mod h1:OQeznEEkTZ9OrhHJoDD8ZDq51FHgXjqtP9z6bEwBq9U= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM= -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.0.0/go.mod h1:ceIuwmxDWptoW3eCqSXlnPsZFKh4X+R38dWPv7GS9Vs= -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.0.0/go.mod h1:s1tW/At+xHqjNFvWU4G0c0Qv33KOhvbGNj0RCTQDV8s= -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.2.0/go.mod h1:c+Lifp3EDEamAkPVzMooRNOK6CZjNSdEnf1A7jsI9u4= -github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0/go.mod h1:tPaiy8S5bQ+S5sOiDlINkp7+Ef339+Nz5L5XO+cnOHo= -github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.0/go.mod h1:+6KLcKIVgxoBDMqMO/Nvy7bZ9a0nbU3I1DtFQK3YvB4= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= -github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/toml v1.1.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= -github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= -github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/CloudyKit/fastprinter v0.0.0-20170127035650-74b38d55f37a/go.mod h1:EFZQ978U7x8IRnstaskI3IysnWY5Ao3QgZUKOXlsAdw= -github.com/CloudyKit/jet v2.1.3-0.20180809161101-62edd43e4f88+incompatible/go.mod h1:HPYO+50pSWkPoj9Q/eq0aRGByCL6ScRlUmiEX5Zgm+w= github.com/CosmWasm/wasmd v0.50.0 h1:NVaGqCSTRfb9UTDHJwT6nQIWcb6VjlQl88iI+u1+qjE= github.com/CosmWasm/wasmd v0.50.0/go.mod h1:UjmShW4l9YxaMytwJZ7IB7MWzHiynSZP3DdWrG0FRtk= github.com/CosmWasm/wasmvm v1.5.2 h1:+pKB1Mz9GZVt1vadxB+EDdD1FOz3dMNjIKq/58/lrag= github.com/CosmWasm/wasmvm v1.5.2/go.mod h1:Q0bSEtlktzh7W2hhEaifrFp1Erx11ckQZmjq8FLCyys= -github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= -github.com/GoogleCloudPlatform/cloudsql-proxy v0.0.0-20190129172621-c8b1d7a94ddf/go.mod h1:aJ4qN3TfrelA6NZ6AXsXRfmEVaYin3EDbSPJrKS8OXo= -github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c/go.mod h1:X0CRv0ky0k6m906ixxpzmDRLvX58TFUKS2eePweuyxk= -github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= -github.com/Joker/jade v1.0.1-0.20190614124447-d475f43051e7/go.mod h1:6E6s8o2AE4KhCrqr6GRJjdC/gNfTdxkIXvuGZZda2VM= -github.com/Jorropo/jsync v1.0.1 h1:6HgRolFZnsdfzRUj+ImB9og1JYOxQoReSywkHOGSaUU= -github.com/Jorropo/jsync v1.0.1/go.mod h1:jCOZj3vrBCri3bSU3ErUYvevKlnbssrXeCivybS5ABQ= -github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= -github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= -github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8= -github.com/VictoriaMetrics/fastcache v1.6.0/go.mod h1:0qHz5QP0GMX4pfmMA/zt5RgfNuXJrTP0zS7DqpHGGTw= -github.com/VictoriaMetrics/fastcache v1.12.1/go.mod h1:tX04vaqcNoQeGLD+ra5pU5sWkuxnzWhEzLwhP9w653o= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= -github.com/a-h/templ v0.2.793 h1:Io+/ocnfGWYO4VHdR0zBbf39PQlnzVCVVD+wEEs6/qY= -github.com/a-h/templ v0.2.793/go.mod h1:lq48JXoUvuQrU0VThrK31yFwdRjTCnIE5bcPCM9IP1w= -github.com/aclements/go-gg v0.0.0-20170118225347-6dbb4e4fefb0/go.mod h1:55qNq4vcpkIuHowELi5C8e+1yUHtoLoOUR9QU5j7Tes= -github.com/aclements/go-moremath v0.0.0-20210112150236-f10218a38794/go.mod h1:7e+I0LQFUI9AXWxOfsQROs9xPhoJtbsyWcjJqDd4KPY= github.com/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= github.com/adlio/schema v1.3.3/go.mod h1:1EsRssiv9/Ce2CMzq5DoL7RiMshhuigQxrR4DMV9fHg= -github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= github.com/ajstarks/deck v0.0.0-20200831202436-30c9fc6549a9/go.mod h1:JynElWSGnm/4RlzPXRlREEwqTHAN3T56Bv2ITsFT3gY= github.com/ajstarks/deck/generate v0.0.0-20210309230005-c3f852c02e19/go.mod h1:T13YZdzov6OU0A1+RfKZiZN9ca6VeKdBdyDV+BY97Tk= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= -github.com/ajstarks/svgo v0.0.0-20210923152817-c3b6e2f0c527/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b/go.mod h1:1KcenG0jGWcpt8ov532z81sp/kMMUG485J2InIOyADM= github.com/alecthomas/kingpin/v2 v2.4.0/go.mod h1:0gyi0zQnjuFk8xrkNKamJoyUo382HRL7ATRpFZCw6tE= github.com/alecthomas/participle/v2 v2.0.0-alpha7 h1:cK4vjj0VSgb3lN1nuKA5F7dw+1s1pWBe5bx7nNCnN+c= github.com/alecthomas/participle/v2 v2.0.0-alpha7/go.mod h1:NumScqsC42o9x+dGj8/YqsIfhrIQjFEOFovxotbBirA= -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/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= -github.com/alecthomas/units v0.0.0-20240927000941-0f3dac36c52b h1:mimo19zliBX/vSQ6PWWSL9lK8qwHozUj03+zLoEB8O0= -github.com/alecthomas/units v0.0.0-20240927000941-0f3dac36c52b/go.mod h1:fvzegU4vN3H1qMT+8wDmzjAcDONcgo2/SZ/TyfdUOFs= -github.com/alexbrainman/goissue34681 v0.0.0-20191006012335-3fc7a47baff5 h1:iW0a5ljuFxkLGPNem5Ui+KBjFJzKg4Fv2fnxe4dvzpM= -github.com/alexbrainman/goissue34681 v0.0.0-20191006012335-3fc7a47baff5/go.mod h1:Y2QMoi1vgtOIfc+6DhrMOGkLoGzqSV2rKp4Sm+opsyA= -github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= -github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= -github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/apache/arrow/go/arrow v0.0.0-20191024131854-af6fa24be0db/go.mod h1:VTxUBvSJ3s3eHAg65PNgrsn5BtqCRPdmyXh6rAfdxN0= github.com/apache/arrow/go/v10 v10.0.1/go.mod h1:YvhnlEePVnBS4+0z3fhPfUy7W1Ikj0Ih0vcRo/gZ1M0= github.com/apache/arrow/go/v11 v11.0.0/go.mod h1:Eg5OsL5H+e299f7u5ssuXsuHQVEGC4xei5aX110hRiI= github.com/apache/arrow/go/v12 v12.0.0/go.mod h1:d+tV/eHZZ7Dz7RPrFKtPK02tpr+c9/PEd/zm8mDS9Vg= github.com/apache/thrift v0.16.0/go.mod h1:PHK3hniurgQaNMZYaCLEqXKsYK8upmhPbmdP2FXSqgU= -github.com/apple/pkl-go v0.8.0 h1:GRcBvFWeXjT9rc7A5gHK89qrel2wGZ3/a7ge4rPlT5M= -github.com/apple/pkl-go v0.8.0/go.mod h1:5Hwil5tyZGrOekh7JXLZJvIAcGHb4gT19lnv4WEiKeI= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= @@ -921,33 +851,7 @@ github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgI github.com/aws/aws-sdk-go v1.44.122/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= github.com/aws/aws-sdk-go v1.55.5 h1:KKUZBfBoyqy5d3swXyiC7Q76ic40rYcbqH7qjh59kzU= github.com/aws/aws-sdk-go v1.55.5/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU= -github.com/aws/aws-sdk-go-v2 v1.2.0/go.mod h1:zEQs02YRBw1DjK0PoJv3ygDYOFTre1ejlJWl8FwAuQo= -github.com/aws/aws-sdk-go-v2 v1.21.2/go.mod h1:ErQhvNuEMhJjweavOYhxVkn2RUx7kQXVATHrjKtxIpM= -github.com/aws/aws-sdk-go-v2/config v1.1.1/go.mod h1:0XsVy9lBI/BCXm+2Tuvt39YmdHwS5unDQmxZOYe8F5Y= -github.com/aws/aws-sdk-go-v2/config v1.18.45/go.mod h1:ZwDUgFnQgsazQTnWfeLWk5GjeqTQTL8lMkoE1UXzxdE= -github.com/aws/aws-sdk-go-v2/credentials v1.1.1/go.mod h1:mM2iIjwl7LULWtS6JCACyInboHirisUUdkBPoTHMOUo= -github.com/aws/aws-sdk-go-v2/credentials v1.13.43/go.mod h1:zWJBz1Yf1ZtX5NGax9ZdNjhhI4rgjfgsyk6vTY1yfVg= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.2/go.mod h1:3hGg3PpiEjHnrkrlasTfxFqUsZ2GCk/fMUn4CbKgSkM= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.13/go.mod h1:f/Ib/qYjhV2/qdsf79H3QP/eRE4AkVyEf6sk7XfZ1tg= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.43/go.mod h1:auo+PiyLl0n1l8A0e8RIeR8tOzYPfZZH/JNlrJ8igTQ= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.37/go.mod h1:Qe+2KtKml+FEsQF/DHmDV+xjtche/hwoF75EG4UlHW8= -github.com/aws/aws-sdk-go-v2/internal/ini v1.3.45/go.mod h1:lD5M20o09/LCuQ2mE62Mb/iSdSlCNuj6H5ci7tW7OsE= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.2/go.mod h1:45MfaXZ0cNbeuT0KQ1XJylq8A6+OpVV2E5kvY/Kq+u8= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.37/go.mod h1:vBmDnwWXWxNPFRMmG2m/3MKOe+xEcMDo1tanpaWCcck= -github.com/aws/aws-sdk-go-v2/service/route53 v1.1.1/go.mod h1:rLiOUrPLW/Er5kRcQ7NkwbjlijluLsrIbu/iyl35RO4= -github.com/aws/aws-sdk-go-v2/service/route53 v1.30.2/go.mod h1:TQZBt/WaQy+zTHoW++rnl8JBrmZ0VO6EUbVua1+foCA= -github.com/aws/aws-sdk-go-v2/service/sso v1.1.1/go.mod h1:SuZJxklHxLAXgLTc1iFXbEWkXs7QRTQpCLGaKIprQW0= -github.com/aws/aws-sdk-go-v2/service/sso v1.15.2/go.mod h1:gsL4keucRCgW+xA85ALBpRFfdSLH4kHOVSnLMSuBECo= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.17.3/go.mod h1:a7bHA82fyUXOm+ZSWKU6PIoBxrjSprdLoM8xPYvzYVg= -github.com/aws/aws-sdk-go-v2/service/sts v1.1.1/go.mod h1:Wi0EBZwiz/K44YliU0EKxqTCJGUfYTWXrrBwkq736bM= -github.com/aws/aws-sdk-go-v2/service/sts v1.23.2/go.mod h1:Eows6e1uQEsc4ZaHANmsPRzAKcVDrcmjjWiih2+HUUQ= -github.com/aws/smithy-go v1.1.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= -github.com/aws/smithy-go v1.15.0/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= -github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= -github.com/benbjohnson/clock v1.3.5 h1:VvXlSJBzZpA/zum6Sj74hxwYI2DIxRWuNIoXAzHZz5o= -github.com/benbjohnson/clock v1.3.5/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= @@ -955,37 +859,20 @@ github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2gVpmOtVTJZNodLdLQLn/KsJqFvXwnd/s= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bits-and-blooms/bitset v1.5.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= -github.com/bits-and-blooms/bitset v1.7.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= github.com/bits-and-blooms/bitset v1.19.1 h1:mv2yVhy96D2CuskLPXnc58oJNMs5PCWjAZuyYU0p12M= github.com/bits-and-blooms/bitset v1.19.1/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= -github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= -github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= -github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= -github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= -github.com/boyter/go-string v1.0.5 h1:/xcOlWdgelLYLVkUU0xBLfioGjZ9KIMUMI/RXG138YY= -github.com/boyter/go-string v1.0.5/go.mod h1:Mww9cDld2S2cdJ0tQffBhsZFMQRA2OJdcjWYZXvZ4Ss= -github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= -github.com/btcsuite/btcd/btcec/v2 v2.2.0/go.mod h1:U7MHm051Al6XmscBQ0BoNydpOTsFAn707034b5nY8zU= github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ= github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= github.com/btcsuite/btcd/btcutil v1.1.6 h1:zFL2+c3Lb9gEgqKNzowKUPQNb8jV7v5Oaodi/AYFd6c= github.com/btcsuite/btcd/btcutil v1.1.6/go.mod h1:9dFymx8HpuLqBnsPELrImQeTQfKBQqzqGbbV3jK55aE= -github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 h1:59Kx4K6lzOW5w6nFlA0v5+lk/6sjybR934QNHSJZPTQ= github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/bufbuild/protocompile v0.6.0 h1:Uu7WiSQ6Yj9DbkdnOe7U4mNKp58y9WDMKDn28/ZlunY= github.com/bufbuild/protocompile v0.6.0/go.mod h1:YNP35qEYoYGme7QMtz5SBCoN4kL4g12jTtjuzRNdjpE= -github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= github.com/bwesterb/go-ristretto v1.2.3 h1:1w53tCkGhCQ5djbat3+MH0BAQ5Kfgbt56UZQ/JMzngw= github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= -github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= -github.com/caddyserver/certmagic v0.21.4 h1:e7VobB8rffHv8ZZpSiZtEwnLDHUwLVYLWzWSa1FfKI0= -github.com/caddyserver/certmagic v0.21.4/go.mod h1:swUXjQ1T9ZtMv95qj7/InJvWLXURU85r+CfG0T+ZbDE= -github.com/caddyserver/zerossl v0.1.3 h1:onS+pxp3M8HnHpN5MMbOMyNjmTheJyWRaZYwn+YTAyA= -github.com/caddyserver/zerossl v0.1.3/go.mod h1:CxA0acn7oEGO6//4rtrRjYgEoa4MFw/XofZnrYwGqG4= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= @@ -994,9 +881,6 @@ github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyY github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw= -github.com/ceramicnetwork/go-dag-jose v0.1.1 h1:7pObs22egc14vSS3AfCFfS1VmaL4lQUsAK7OGC3PlKk= -github.com/ceramicnetwork/go-dag-jose v0.1.1/go.mod h1:8ptnYwY2Z2y/s5oJnNBn/UCxLg6CpramNJ2ZXF/5aNY= -github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= @@ -1005,22 +889,17 @@ github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UF github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/logex v1.2.0/go.mod h1:9+9sk7u7pGNWYMkh0hdiL++6OeibzJccyQU4p4MedaY= github.com/chzyer/logex v1.2.1 h1:XHDu3E6q+gdHgsdTPH6ImJMIp436vR6MPtH8gP05QzM= github.com/chzyer/logex v1.2.1/go.mod h1:JLbx6lG2kDbNRFnfkgvh4eRJRPX1QCoOIWomwysCBrQ= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/readline v1.5.0/go.mod h1:x22KAscuvRqlLoK9CsoYsmxoXZMMFVyOl86cAH8qUic= github.com/chzyer/readline v1.5.1 h1:upd/6fQk4src78LMRzh5vItIt361/o4uq553V8B5sGI= github.com/chzyer/readline v1.5.1/go.mod h1:Eh+b79XXUwfKfcPLepksvw2tcLE/Ct21YObkaSkeBlk= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/chzyer/test v0.0.0-20210722231415-061457976a23/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/chzyer/test v1.0.0 h1:p3BQDXSxOhOG0P9z6/hGnII4LGiEPOYBhs8asl/fC04= github.com/chzyer/test v1.0.0/go.mod h1:2JlltgoNkt4TW/z9V/IzDdFaMTM2JPIi26O1pF38GC8= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudflare/cloudflare-go v0.14.0/go.mod h1:EnwdgGMaFOruiPZRFSgn+TsQ3hQ7C/YWzIGLeu5c304= -github.com/cloudflare/cloudflare-go v0.79.0/go.mod h1:gkHQf9xEubaQPEuerBuoinR9P8bf8a05Lq0X6WKy1Oc= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= @@ -1040,50 +919,32 @@ github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b80 github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw= github.com/cockroachdb/apd/v3 v3.1.0 h1:MK3Ow7LH0W8zkd5GMKA1PvS9qG3bWFI95WaVNfyZJ/w= github.com/cockroachdb/apd/v3 v3.1.0/go.mod h1:6qgPBMXjATAdD/VefbRP9NoSLKjbB4LCoA7gN4LpHs4= -github.com/cockroachdb/datadriven v1.0.0/go.mod h1:5Ib8Meh+jk1RlHIXej6Pzevx/NLlNvQB9pmSBZErGA4= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= -github.com/cockroachdb/errors v1.6.1/go.mod h1:tm6FTP5G81vwJ5lC0SizQo374JNCOPrHyXGitRJoDqM= -github.com/cockroachdb/errors v1.8.1/go.mod h1:qGwQn6JmZ+oMjuLwjWzUNqblqk0xl4CVV3SQbGwK7Ac= github.com/cockroachdb/errors v1.11.3 h1:5bA+k2Y6r+oz/6Z/RFlNeVCesGARKuC6YymtcDrbC/I= github.com/cockroachdb/errors v1.11.3/go.mod h1:m4UIW4CDjx+R5cybPsNrRbreomiFqt8o1h1wUVazSd8= github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce h1:giXvy4KSc/6g/esnpM7Geqxka4WSqI1SZc7sMJFd3y4= github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce/go.mod h1:9/y3cnZ5GKakj/H4y9r9GTjCvAFta7KLgSHPJJYc52M= -github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593/go.mod h1:6hk1eMY/u5t+Cf18q5lFMUA1Rc+Sm5I6Ra1QuPyxXCo= github.com/cockroachdb/pebble v1.1.2 h1:CUh2IPtR4swHlEj48Rhfzw6l/d0qA31fItcIszQVIsA= github.com/cockroachdb/pebble v1.1.2/go.mod h1:4exszw1r40423ZsmkG/09AFEG83I0uDgfujJdbL6kYU= -github.com/cockroachdb/redact v1.0.8/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= -github.com/cockroachdb/sentry-go v0.6.1-cockroachdb.2/go.mod h1:8BT+cPK6xvFOcRlk0R8eg+OTkcqI6baNH4xAkpiYVvQ= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= -github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= github.com/cometbft/cometbft v0.38.12 h1:OWsLZN2KcSSFe8bet9xCn07VwhBnavPea3VyPnNq1bg= github.com/cometbft/cometbft v0.38.12/go.mod h1:GPHp3/pehPqgX1930HmK1BpBLZPxB75v/dZg8Viwy+o= github.com/cometbft/cometbft-db v0.11.0 h1:M3Lscmpogx5NTbb1EGyGDaFRdsoLWrUWimFEyf7jej8= github.com/cometbft/cometbft-db v0.11.0/go.mod h1:GDPJAC/iFHNjmZZPN8V8C1yr/eyityhi2W1hz2MGKSc= -github.com/consensys/bavard v0.1.8-0.20210406032232-f3452dc9b572/go.mod h1:Bpd0/3mZuaj6Sj+PqrmIquiOKy397AKGThQPaGzNXAQ= +github.com/consensys/bavard v0.1.13 h1:oLhMLOFGTLdlda/kma4VOJazblc7IM5y5QPd2A/YjhQ= github.com/consensys/bavard v0.1.13/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI= -github.com/consensys/bavard v0.1.24 h1:Lfe+bjYbpaoT7K5JTFoMi5wo9V4REGLvQQbHmatoN2I= -github.com/consensys/bavard v0.1.24/go.mod h1:k/zVjHHC4B+PQy1Pg7fgvG3ALicQw540Crag8qx+dZs= -github.com/consensys/gnark-crypto v0.4.1-0.20210426202927-39ac3d4b3f1f/go.mod h1:815PAHg3wvysy0SyIqanF8gZ0Y1wjk/hrDHD/iT88+Q= -github.com/consensys/gnark-crypto v0.10.0/go.mod h1:Iq/P3HHl0ElSjsg2E1gsMwhAyxnxoKK5nVyZKd+/KhU= -github.com/consensys/gnark-crypto v0.12.1/go.mod h1:v2Gy7L/4ZRosZ7Ivs+9SfUDr0f5UlG+EM5t7MPHiLuY= github.com/consensys/gnark-crypto v0.14.0 h1:DDBdl4HaBtdQsq/wfMwJvZNE80sHidrK3Nfrefatm0E= github.com/consensys/gnark-crypto v0.14.0/go.mod h1:CU4UijNPsHawiVGNxe9co07FkzCeWHHrb1li/n1XoU0= -github.com/containerd/cgroups v1.1.0 h1:v8rEWFl6EoqHB+swVNjVoCJE8o3jX7e8nqBGPLaDFBM= -github.com/containerd/cgroups v1.1.0/go.mod h1:6ppBcbh/NOOUU+dMKrykgaBnK9lCIBxHqJDGwsa1mIw= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d h1:t5Wuyh53qYyg9eqn4BbnlIT+vmhyww0TatL+zT3uWgI= -github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= @@ -1115,79 +976,43 @@ github.com/cosmos/keyring v1.2.0/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStK github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= github.com/cosmos/ledger-cosmos-go v0.13.3/go.mod h1:HENcEP+VtahZFw38HZ3+LS3Iv5XV6svsnkk9vdJtLr8= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= -github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/crackcomm/go-gitignore v0.0.0-20241020182519-7843d2ba8fdf h1:dwGgBWn84wUS1pVikGiruW+x5XM4amhjaZO20vCjay4= -github.com/crackcomm/go-gitignore v0.0.0-20241020182519-7843d2ba8fdf/go.mod h1:p1d6YEZWvFzEh4KLyvBcVSnrfNDDvK2zfK/4x2v/4pE= -github.com/crate-crypto/go-ipa v0.0.0-20230601170251-1830d0757c80/go.mod h1:gzbVz57IDJgQ9rLQwfSk696JGWof8ftznEL9GoAv3NI= -github.com/crate-crypto/go-kzg-4844 v0.7.0/go.mod h1:1kMhvPgI0Ky3yIa+9lFySEBUBXkYxeOi8ZF1sYioxhc= github.com/creachadair/atomicfile v0.3.1 h1:yQORkHjSYySh/tv5th1dkKcn02NEW5JleB84sjt+W4Q= github.com/creachadair/atomicfile v0.3.1/go.mod h1:mwfrkRxFKwpNAflYZzytbSwxvbK6fdGRRlp0KEQc0qU= github.com/creachadair/tomledit v0.0.24 h1:5Xjr25R2esu1rKCbQEmjZYlrhFkDspoAbAKb6QKQDhQ= github.com/creachadair/tomledit v0.0.24/go.mod h1:9qHbShRWQzSCcn617cMzg4eab1vbLCOjOshAWSzWr8U= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cskr/pubsub v1.0.2 h1:vlOzMhl6PFn60gRlTQQsIfVwaPB/B/8MziK8FhEPt/0= -github.com/cskr/pubsub v1.0.2/go.mod h1:/8MzYXk/NJAz782G8RPkFzXTZVu63VotefPnR9TIRis= github.com/cucumber/common/gherkin/go/v22 v22.0.0 h1:4K8NqptbvdOrjL9DEea6HFjSpbdT9+Q5kgLpmmsHYl0= github.com/cucumber/common/gherkin/go/v22 v22.0.0/go.mod h1:3mJT10B2GGn3MvVPd3FwR7m2u4tLhSRhWUqJU4KN4Fg= github.com/cucumber/common/messages/go/v17 v17.1.1 h1:RNqopvIFyLWnKv0LfATh34SWBhXeoFTJnSrgm9cT/Ts= github.com/cucumber/common/messages/go/v17 v17.1.1/go.mod h1:bpGxb57tDE385Rb2EohgUadLkAbhoC4IyCFi89u/JQI= -github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= -github.com/dave/jennifer v1.2.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c h1:pFUpOrbxDR6AkioZ1ySsx5yxlDQZ8stG2b88gTPxgJU= -github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c/go.mod h1:6UhI8N9EjYm1c2odKpFpAYeR8dsBeM7PtzQhRgxRr9U= -github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo= -github.com/deckarep/golang-set/v2 v2.1.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= -github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= -github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= github.com/decred/dcrd/crypto/blake256 v1.1.0 h1:zPMNGQCm0g4QTY27fOCorQW7EryeQ/U0x++OzVrdms8= github.com/decred/dcrd/crypto/blake256 v1.1.0/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= -github.com/deepmap/oapi-codegen v1.6.0/go.mod h1:ryDa9AgbELGeB+YEXE1dR53yAjHwFvE9iAUlWl9Al3M= -github.com/deepmap/oapi-codegen v1.8.2/go.mod h1:YLgSKSDv/bZQB7N4ws6luhozi3cEdRktEqrX88CvjIw= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= -github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= -github.com/dgraph-io/badger v1.6.2 h1:mNw0qs90GVgGGWylh0umH5iag1j6n/PeJtNvL6KY/x8= -github.com/dgraph-io/badger v1.6.2/go.mod h1:JW2yswe3V058sS0kZ2h/AXeDSqFjxnZcRrVH//y2UQE= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8= github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= -github.com/dgryski/go-bitstream v0.0.0-20180413035011-3522498ce2c8/go.mod h1:VMaSuZ+SZcx/wljOQKvp5srsbCiKDEb6K2wC4+PiBmQ= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0= github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= -github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= -github.com/dlclark/regexp2 v1.7.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= -github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= -github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= -github.com/docker/docker v1.6.2/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/dop251/goja v0.0.0-20211022113120-dc8c55024d06/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= -github.com/dop251/goja v0.0.0-20220405120441-9037c2b61cbf/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= -github.com/dop251/goja v0.0.0-20230806174421-c933cf95e127/go.mod h1:QMWlm50DNe14hD7t24KEqZuUdC9sOTy8W6XbCU1mlw4= -github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y= -github.com/dop251/goja_nodejs v0.0.0-20211022123610-8dd9abb0616d/go.mod h1:DngW8aVqWbuLRMHItjPUyqdj+HWPvnQe8V8y1nDpIbM= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= @@ -1195,13 +1020,8 @@ github.com/dustinxie/ecc v0.0.0-20210511000915-959544187564 h1:I6KUy4CI6hHjqnyJL github.com/dustinxie/ecc v0.0.0-20210511000915-959544187564/go.mod h1:yekO+3ZShy19S+bsmnERmznGy9Rfg6dWWWpiGJjNAz8= github.com/dvsekhvalnov/jose2go v1.6.0 h1:Y9gnSnP4qEI0+/uQkHvFXeD2PLPJeXEL+ySMEA2EjTY= github.com/dvsekhvalnov/jose2go v1.6.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= -github.com/ecies/go/v2 v2.0.9 h1:a64bUt4/Iqx5xNfQhAdItTjHeHq3oAt6nQ1r6Ddmyug= -github.com/ecies/go/v2 v2.0.9/go.mod h1:HOVvjxPPx/HilLI8q7JRZ2ZTE4WzQU/RVvhUKPG3RjM= -github.com/eclipse/paho.mqtt.golang v1.2.0/go.mod h1:H9keYFcgq3Qr5OUJm/JZI/i6U7joQ8SYLhZwfeOo6Ts= -github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= -github.com/elastic/gosigar v0.14.3 h1:xwkKwPia+hSfg9GqrCUKYdId102m9qTJIIr7egmK/uo= -github.com/elastic/gosigar v0.14.3/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs= +github.com/ecies/go/v2 v2.0.10 h1:AaLxGio0MLLbvWur4rKnLzw+K9zI+wMScIDAtqCqOtU= +github.com/ecies/go/v2 v2.0.10/go.mod h1:N73OyuR6tuKznit2LhXjrZ0XAQ234uKbzYz8pEPYzlI= github.com/emicklei/dot v1.6.1 h1:ujpDlBkkwgWUY+qPId5IwapRW/xEoligRSYjioR6DFI= github.com/emicklei/dot v1.6.1/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -1224,37 +1044,20 @@ github.com/envoyproxy/protoc-gen-validate v0.10.0/go.mod h1:DRjgyB0I43LtJapqN6Ni github.com/envoyproxy/protoc-gen-validate v0.10.1/go.mod h1:DRjgyB0I43LtJapqN6NiRwroiAU2PaFuvk/vjgh61ss= github.com/envoyproxy/protoc-gen-validate v1.0.1/go.mod h1:0vj8bNkYbSTNS2PIyH87KZaeN4x9zpL9Qt8fQC7d+vs= github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE= -github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= -github.com/ethereum/c-kzg-4844 v0.4.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= -github.com/ethereum/go-ethereum v1.10.26/go.mod h1:EYFyF19u3ezGLD4RqOkLq+ZCXzYbLoNDdZlMt7kyKFg= -github.com/ethereum/go-ethereum v1.13.5/go.mod h1:yMTu38GSuyxaYzQMViqNmQ1s3cE84abZexQmTgenWk0= github.com/ethereum/go-ethereum v1.14.12 h1:8hl57x77HSUo+cXExrURjU/w1VhL+ShCTJrTwcCQSe4= github.com/ethereum/go-ethereum v1.14.12/go.mod h1:RAC2gVMWJ6FkxSPESfbshrcKpIokgQKsVKmAuqdekDY= -github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5 h1:BBso6MBKW8ncyZLv37o+KNyy0HrrHgfnOaGQC2qvN+A= -github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5/go.mod h1:JpoxHjuQauoxiFMl1ie8Xc/7TfLuMZ5eOCONd1sUBHg= -github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/color v1.14.1/go.mod h1:2oHN61fhTpgcxD3TSWCgKDiH1+x4OiDVVGH8WlgGZGg= github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= -github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/fjl/gencodec v0.0.0-20220412091415-8bb9e558978c/go.mod h1:AzA8Lj6YtixmJWL+wkKoBGsLWy9gFrAzi4g+5bCKwpY= -github.com/fjl/gencodec v0.0.0-20230517082657-f9840df7b83e/go.mod h1:AzA8Lj6YtixmJWL+wkKoBGsLWy9gFrAzi4g+5bCKwpY= -github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= -github.com/flosch/pongo2 v0.0.0-20190707114632-bbf5a6c351f4/go.mod h1:T9YF2M40nIgbVgp3rreNmTged+9HrbNTIQf1PsaIiTA= -github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= -github.com/flynn/noise v1.1.0 h1:KjPQoQCEFdZDiP03phOvGi11+SVVhBG2wOWAorLsstg= -github.com/flynn/noise v1.1.0/go.mod h1:xbMo+0i6+IGbYdJhF31t2eR1BIU0CYc12+BNAKwUTag= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= -github.com/francoispqt/gojay v1.2.13 h1:d2m3sFjloqoIUQU3TsHBgj6qg/BVGlTBeHDUmyJnXKk= -github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY= github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= @@ -1263,28 +1066,11 @@ github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4 github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= -github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= -github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= -github.com/gabriel-vasile/mimetype v1.4.6 h1:3+PzJTKLkvgjeTbts6msPJt4DixhT4YtFNf1gtGe3zc= -github.com/gabriel-vasile/mimetype v1.4.6/go.mod h1:JX1qVKqZd40hUPpAfiNTe0Sne7hdfKSbOqqmkq8GCXc= -github.com/garslo/gogen v0.0.0-20170306192744-1d203ffc1f61/go.mod h1:Q0X6pkwTILDlzrGEckF6HKjXe48EgsY/l7K7vhY4MW8= -github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= -github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= -github.com/gballet/go-verkle v0.0.0-20230607174250-df487255f46b/go.mod h1:CDncRYVRSDqwakm282WEkjfaAj1hxU/v5RXxk5nXOiI= -github.com/getkin/kin-openapi v0.53.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= -github.com/getkin/kin-openapi v0.61.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= -github.com/ghemawat/stream v0.0.0-20171120220530-696b145b53b9/go.mod h1:106OIgooyS7OzLDOpUGgm9fA3bQENb/cFSyyBmMoJDs= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= -github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= -github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= -github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= -github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= -github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJpoZOs= -github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-fonts/dejavu v0.1.0/go.mod h1:4Wt4I4OU2Nq9asgDCteaAaWZOV24E+0/Pwo0gppep4g= @@ -1295,9 +1081,6 @@ github.com/go-fonts/stix v0.1.0/go.mod h1:w/c1f0ldAUlJmLBvlbkvVXLAD+tAMqobIIQpmn github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-jose/go-jose/v4 v4.0.4 h1:VsjPI33J0SB9vQM6PLmNjoHqMQNGPiZ0rHL7Ni7Q6/E= -github.com/go-jose/go-jose/v4 v4.0.4/go.mod h1:NKb5HO1EZccyMpiZNbdUw/14tiXNyUJh188dfnMCAfc= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.12.0 h1:e4o3o3IsBfAKQh5Qbbiqyfu97Ku7jrO/JbohvztANh4= github.com/go-kit/kit v0.12.0/go.mod h1:lHd+EkCZPIwYItmGDDRdhinkzX2A1sj+M9biaEaizzs= @@ -1306,7 +1089,6 @@ github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-latex/latex v0.0.0-20210118124228-b3d85cf34e07/go.mod h1:CO1AlKB2CSIqUrmQPqA0gdRIlnLEY0gK5JGjh37zN5U= github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81/go.mod h1:SX0U8uGpxhq9o2S/CELCSUxEWWAuoCUcVCQWv7G2OCk= -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-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= @@ -1317,60 +1099,30 @@ github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= -github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= -github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-pdf/fpdf v0.5.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= github.com/go-pdf/fpdf v0.6.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= -github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= -github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= -github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= -github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= -github.com/go-webauthn/webauthn v0.11.2 h1:Fgx0/wlmkClTKlnOsdOQ+K5HcHDsDcYIvtYmfhEOSUc= -github.com/go-webauthn/webauthn v0.11.2/go.mod h1:aOtudaF94pM71g3jRwTYYwQTG1KyTILTcZqN1srkmD0= -github.com/go-webauthn/x v0.1.14 h1:1wrB8jzXAofojJPAaRxnZhRgagvLGnLjhCAwg3kTpT0= -github.com/go-webauthn/x v0.1.14/go.mod h1:UuVvFZ8/NbOnkDz3y1NaxtUN87pmtpC1PQ+/5BBQRdc= -github.com/go-yaml/yaml v2.1.0+incompatible/go.mod h1:w2MrLa16VYP0jy6N7M5kHaCkaLENm+P+Tv+MfurjSw0= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= -github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk= -github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= -github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA= github.com/gofrs/uuid v4.4.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/googleapis v1.4.1-0.20201022092350-68b0159b7869/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0= github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= -github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -github.com/golang-jwt/jwt/v4 v4.3.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/golang-jwt/jwt/v4 v4.4.3/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= -github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= -github.com/golang/geo v0.0.0-20190916061304-5b978397cfec/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ= @@ -1381,7 +1133,6 @@ github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4er github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -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/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= @@ -1413,24 +1164,15 @@ github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= -github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk= github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golangci/lint-1 v0.0.0-20181222135242-d2cdd8c08219/go.mod h1:/X8TswGSh1pIozq4ZwCfxS0WA5JGXguxk94ar/4c87Y= -github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= -github.com/gonum/blas v0.0.0-20181208220705-f22b278b28ac/go.mod h1:P32wAyui1PQ58Oce/KYkOqQv8cVw1zAapXOl+dRFGbc= -github.com/gonum/floats v0.0.0-20181209220543-c233463c7e82/go.mod h1:PxC8OnwL11+aosOB5+iEPoV3picfs8tUpkVd0pDo+Kg= -github.com/gonum/internal v0.0.0-20181124074243-f884aa714029/go.mod h1:Pu4dmpkhSyOzRwuXkOgAvijx4o+4YMUJJo9OvPYMkks= -github.com/gonum/lapack v0.0.0-20181123203213-e4cdc5a0bff9/go.mod h1:XA3DeT6rxh2EAE789SSiSJNqxPaC0aE9J8NTOI0Jo/A= -github.com/gonum/matrix v0.0.0-20181209220409-c518dec07be9/go.mod h1:0EXg4mc1CNP0HCqCz+K4ts155PXIlUywf0wqN+GfPZw= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= -github.com/google/flatbuffers v1.11.0/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/flatbuffers v2.0.8+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -1449,19 +1191,11 @@ github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= github.com/google/go-pkcs11 v0.2.1-0.20230907215043-c6f79328ddf9/go.mod h1:6eQoGcuNJpa7jnd5pMGdkSaQpNDYvPlXWMcjXXThLlY= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= -github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= -github.com/google/go-tpm v0.9.1 h1:0pGc4X//bAlmZzMKf8iz6IsDo1nYTbYJ6FZN/rg4zdM= -github.com/google/go-tpm v0.9.1/go.mod h1:h9jEsEECg7gtLis0upRBQU+GhYVH6jMjrFxI8u6bVUY= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gopacket v1.1.19 h1:ves8RnFZPGiFnTS0uPQStjwru6uO6h+nlr9j6fL7kF8= -github.com/google/gopacket v1.1.19/go.mod h1:iJ8V8n6KS+z2U1A8pUwu8bW5SyEMkXJB8Yo/Vo+TKTo= github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -1486,20 +1220,14 @@ github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20230207041349-798e818bf904/go.mod h1:uglQLonpP8qtYCYyzA+8c/9qtqgA3qsXGYqCPKARAFg= -github.com/google/pprof v0.0.0-20241203143554-1e3fdc7de467 h1:keEZFtbLJugfE0qHn+Ge1JCE71spzkchQobDf3mzS/4= -github.com/google/pprof v0.0.0-20241203143554-1e3fdc7de467/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/s2a-go v0.1.0/go.mod h1:OJpEgntRZo8ugHpF9hkoLJbS5dSI20XZeXJ9JVywLlM= github.com/google/s2a-go v0.1.3/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= github.com/google/s2a-go v0.1.4/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= -github.com/google/safehtml v0.0.2/go.mod h1:L4KWwDsUJdECRAEpZoBn3O64bQaywRscowZjJAzjHnU= github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= @@ -1513,9 +1241,6 @@ github.com/googleapis/enterprise-certificate-proxy v0.2.4/go.mod h1:AwSRAtLfXpU5 github.com/googleapis/enterprise-certificate-proxy v0.3.1/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs= github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= -github.com/googleapis/gax-go v0.0.0-20161107002406-da06d194a00e/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= -github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= -github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE08qbEPm1M08qg= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= @@ -1535,50 +1260,34 @@ github.com/googleapis/gax-go/v2 v2.12.3 h1:5/zPPDvw8Q1SuXjrqrZslrqT7dL/uJT2CQii/ github.com/googleapis/gax-go/v2 v2.12.3/go.mod h1:AKloxT6GtNbaLm8QTNSidHUVsHYcBHwWRvkNFJUQcS4= github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c h1:7lF+Vz0LqiRidnzC1Oq86fpX1q/iEv2KJdrCtttYjT4= -github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/handlers v1.5.2 h1:cLTUSsNkgcwhgRqvCNmdbRWG0A3N4F+M2nWKdScwyEE= github.com/gorilla/handlers v1.5.2/go.mod h1:dX+xVpaxdSw+q0Qek8SSsl3dfMk3jNddUkMzo0GtH0w= -github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= -github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/graph-gophers/graphql-go v1.3.0/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= -github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3/go.mod h1:o//XUCC/F+yRGJoPO/VU0GSB0f8Nhgmxx0VIRUvaC0w= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 h1:asbCHRVmodnJTuQ3qamDwqVOIjwqUPTYmYuemVOx+Ys= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0/go.mod h1:ggCgvZ2r7uOoQjOyu2Y1NhHmEPPzzuhWgcza5M1Ji1I= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= github.com/gtank/merlin v0.1.1 h1:eQ90iG7K9pOhtereWsmyRJ6RAwcP4tHTDBHXNg+u5is= github.com/gtank/merlin v0.1.1/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= -github.com/guptarohit/asciigraph v0.5.5/go.mod h1:dYl5wwK4gNsnFf9Zp+l06rFiDZ5YtXM6x7SRWZ3KGag= github.com/hashicorp/consul/api v1.25.1/go.mod h1:iiLVwR/htV7mas/sy0O+XSuEnrdBUUydemjxcUrAt4g= github.com/hashicorp/consul/sdk v0.14.1/go.mod h1:vFt03juSzocLRFo59NkeQHHmQa6+g7oU0pfzdI1mUhg= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-bexpr v0.1.10/go.mod h1:oxlubA2vC/gFVfX1A6JGp7ls7uCDlfJn732ehYYg+g0= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-getter v1.7.5 h1:dT58k9hQ/vbxNMwoI5+xFYAJuv6152UNvdHokfI5wE4= github.com/hashicorp/go-getter v1.7.5/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= -github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= -github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= @@ -1590,12 +1299,10 @@ github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iP github.com/hashicorp/go-msgpack v0.5.5/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= -github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-plugin v1.5.2 h1:aWv8eimFqWlsEiMrYZdPYl+FdHaBJSN4AWwGWfT1G2Y= github.com/hashicorp/go-plugin v1.5.2/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= -github.com/hashicorp/go-retryablehttp v0.7.4/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= @@ -1606,7 +1313,6 @@ github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/b github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= @@ -1614,7 +1320,6 @@ github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09 github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= @@ -1629,20 +1334,11 @@ github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= github.com/hdevalence/ed25519consensus v0.1.0 h1:jtBwzzcHuTmFrQN6xQZn6CQEO/V9f7HsjsjeEZ6auqU= github.com/hdevalence/ed25519consensus v0.1.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= -github.com/holiman/billy v0.0.0-20230718173358-1c7e68d277a7/go.mod h1:5GuXa7vkL8u9FkFuWdVvfR5ix8hRB7DbOAaYULamFpc= -github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= -github.com/holiman/uint256 v1.2.0/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= -github.com/holiman/uint256 v1.2.3/go.mod h1:SC8Ryt4n+UBbPbIBKaG9zbbDlp4jOru9xFZmPzLUTxw= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/go-assert v1.1.5 h1:fjemmA7sSfYHJD7CUqs9qTwwfdNAx7/j2/ZlHXzNB3c= github.com/huandu/go-assert v1.1.5/go.mod h1:yOLvuqZwmcHIC5rIzrBhT7D3Q9c3GFnd0JrPVhn/06U= github.com/huandu/skiplist v1.2.0 h1:gox56QD77HzSC0w+Ws3MH3iie755GBJU1OER3h5VsYw= github.com/huandu/skiplist v1.2.0/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXMrPiHF9w= -github.com/huin/goupnp v1.0.3/go.mod h1:ZxNlw5WqJj6wSsRK5+YfflQGXYfccj5VgQsMNixHM7Y= -github.com/huin/goupnp v1.3.0 h1:UvLUlWDNpoUdYzb2TCn+MuTWtcjXKSza2n6CBdQ0xXc= -github.com/huin/goupnp v1.3.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8= -github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= -github.com/hydrogen18/memlistener v0.0.0-20141126152155-54553eb933fb/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= github.com/iancoleman/orderedmap v0.3.0 h1:5cbR2grmZR/DiVt+VJopEhtVs9YGInGIxAoMJn+Ichc= github.com/iancoleman/orderedmap v0.3.0/go.mod h1:XuLcCUkdL5owUCQeF2Ue9uuw1EptkJDkXXS7VoV7XGE= github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= @@ -1650,140 +1346,13 @@ github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSAS github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/ianlancetaylor/demangle v0.0.0-20220319035150-800ac71e25c2/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w= -github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= github.com/improbable-eng/grpc-web v0.15.0/go.mod h1:1sy9HKV4Jt9aEs9JSnkWlRJPuPtwNr0l57L4f878wP8= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/influxdata/flux v0.65.1/go.mod h1:J754/zds0vvpfwuq7Gc2wRdVwEodfpCFM7mYlOw2LqY= -github.com/influxdata/influxdb v1.8.3/go.mod h1:JugdFhsvvI8gadxOI6noqNeeBHvWNTbfYGtiAn+2jhI= -github.com/influxdata/influxdb-client-go/v2 v2.4.0/go.mod h1:vLNHdxTJkIf2mSLvGrpj8TCcISApPoXkaxP8g9uRlW8= -github.com/influxdata/influxdb1-client v0.0.0-20220302092344-a9ab5670611c/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/influxdata/influxql v1.1.1-0.20200828144457-65d3ef77d385/go.mod h1:gHp9y86a/pxhjJ+zMjNXiQAA197Xk9wLxaz+fGG+kWk= -github.com/influxdata/line-protocol v0.0.0-20180522152040-32c6aa80de5e/go.mod h1:4kt73NQhadE3daL3WhR5EJ/J2ocX0PZzwxQ0gXJ7oFE= -github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo= -github.com/influxdata/line-protocol v0.0.0-20210311194329-9aa0e372d097/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo= -github.com/influxdata/promql/v2 v2.12.0/go.mod h1:fxOPu+DY0bqCTCECchSRtWfc+0X19ybifQhZoQNF5D8= -github.com/influxdata/roaring v0.4.13-0.20180809181101-fc520f41fab6/go.mod h1:bSgUQ7q5ZLSO+bKBGqJiCBGAl+9DxyW63zLTujjUlOE= -github.com/influxdata/tdigest v0.0.0-20181121200506-bf2b5ad3c0a9/go.mod h1:Js0mqiSBE6Ffsg94weZZ2c+v/ciT8QRHFOap7EKDrR0= -github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368/go.mod h1:Wbbw6tYNvwa5dlB6304Sd+82Z3f7PmVZHVKU637d4po= -github.com/ipfs-shipyard/nopfs v0.0.12 h1:mvwaoefDF5VI9jyvgWCmaoTJIJFAfrbyQV5fJz35hlk= -github.com/ipfs-shipyard/nopfs v0.0.12/go.mod h1:mQyd0BElYI2gB/kq/Oue97obP4B3os4eBmgfPZ+hnrE= -github.com/ipfs-shipyard/nopfs/ipfs v0.13.2-0.20231027223058-cde3b5ba964c h1:7UynTbtdlt+w08ggb1UGLGaGjp1mMaZhoTZSctpn5Ak= -github.com/ipfs-shipyard/nopfs/ipfs v0.13.2-0.20231027223058-cde3b5ba964c/go.mod h1:6EekK/jo+TynwSE/ZOiOJd4eEvRXoavEC3vquKtv4yI= -github.com/ipfs/bbloom v0.0.4 h1:Gi+8EGJ2y5qiD5FbsbpX/TMNcJw8gSqr7eyjHa4Fhvs= -github.com/ipfs/bbloom v0.0.4/go.mod h1:cS9YprKXpoZ9lT0n/Mw/a6/aFV6DTjTLYHeA+gyqMG0= -github.com/ipfs/boxo v0.24.3 h1:gldDPOWdM3Rz0v5LkVLtZu7A7gFNvAlWcmxhCqlHR3c= -github.com/ipfs/boxo v0.24.3/go.mod h1:h0DRzOY1IBFDHp6KNvrJLMFdSXTYID0Zf+q7X05JsNg= -github.com/ipfs/go-bitfield v1.1.0 h1:fh7FIo8bSwaJEh6DdTWbCeZ1eqOaOkKFI74SCnsWbGA= -github.com/ipfs/go-bitfield v1.1.0/go.mod h1:paqf1wjq/D2BBmzfTVFlJQ9IlFOZpg422HL0HqsGWHU= -github.com/ipfs/go-block-format v0.2.0 h1:ZqrkxBA2ICbDRbK8KJs/u0O3dlp6gmAuuXUJNiW1Ycs= -github.com/ipfs/go-block-format v0.2.0/go.mod h1:+jpL11nFx5A/SPpsoBn6Bzkra/zaArfSmsknbPMYgzM= -github.com/ipfs/go-blockservice v0.5.2 h1:in9Bc+QcXwd1apOVM7Un9t8tixPKdaHQFdLSUM1Xgk8= -github.com/ipfs/go-blockservice v0.5.2/go.mod h1:VpMblFEqG67A/H2sHKAemeH9vlURVavlysbdUI632yk= github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s= github.com/ipfs/go-cid v0.4.1/go.mod h1:uQHwDeX4c6CtyrFwdqyhpNcxVewur1M7l7fNU7LKwZk= -github.com/ipfs/go-cidutil v0.1.0 h1:RW5hO7Vcf16dplUU60Hs0AKDkQAVPVplr7lk97CFL+Q= -github.com/ipfs/go-cidutil v0.1.0/go.mod h1:e7OEVBMIv9JaOxt9zaGEmAoSlXW9jdFZ5lP/0PwcfpA= -github.com/ipfs/go-datastore v0.5.0/go.mod h1:9zhEApYMTl17C8YDp7JmU7sQZi2/wqiYh73hakZ90Bk= -github.com/ipfs/go-datastore v0.6.0 h1:JKyz+Gvz1QEZw0LsX1IBn+JFCJQH4SJVFtM4uWU0Myk= -github.com/ipfs/go-datastore v0.6.0/go.mod h1:rt5M3nNbSO/8q1t4LNkLyUwRs8HupMeN/8O4Vn9YAT8= -github.com/ipfs/go-detect-race v0.0.1 h1:qX/xay2W3E4Q1U7d9lNs1sU9nvguX0a7319XbyQ6cOk= -github.com/ipfs/go-detect-race v0.0.1/go.mod h1:8BNT7shDZPo99Q74BpGMK+4D8Mn4j46UU0LZ723meps= -github.com/ipfs/go-ds-badger v0.3.0 h1:xREL3V0EH9S219kFFueOYJJTcjgNSZ2HY1iSvN7U1Ro= -github.com/ipfs/go-ds-badger v0.3.0/go.mod h1:1ke6mXNqeV8K3y5Ak2bAA0osoTfmxUdupVCGm4QUIek= -github.com/ipfs/go-ds-flatfs v0.5.1 h1:ZCIO/kQOS/PSh3vcF1H6a8fkRGS7pOfwfPdx4n/KJH4= -github.com/ipfs/go-ds-flatfs v0.5.1/go.mod h1:RWTV7oZD/yZYBKdbVIFXTX2fdY2Tbvl94NsWqmoyAX4= -github.com/ipfs/go-ds-leveldb v0.5.0 h1:s++MEBbD3ZKc9/8/njrn4flZLnCuY9I79v94gBUNumo= -github.com/ipfs/go-ds-leveldb v0.5.0/go.mod h1:d3XG9RUDzQ6V4SHi8+Xgj9j1XuEk1z82lquxrVbml/Q= -github.com/ipfs/go-ds-measure v0.2.0 h1:sG4goQe0KDTccHMyT45CY1XyUbxe5VwTKpg2LjApYyQ= -github.com/ipfs/go-ds-measure v0.2.0/go.mod h1:SEUD/rE2PwRa4IQEC5FuNAmjJCyYObZr9UvVh8V3JxE= -github.com/ipfs/go-ds-pebble v0.4.0 h1:88lgFAs2ck8jCQ8lMYRBtksEg18r9BlvTxIMnNJkZaQ= -github.com/ipfs/go-ds-pebble v0.4.0/go.mod h1:ZyYU+weIni+4NG/Yjva+cPkU3ghlsU1HA2R/VLHJ9sM= -github.com/ipfs/go-fs-lock v0.0.7 h1:6BR3dajORFrFTkb5EpCUFIAypsoxpGpDSVUdFwzgL9U= -github.com/ipfs/go-fs-lock v0.0.7/go.mod h1:Js8ka+FNYmgQRLrRXzU3CB/+Csr1BwrRilEcvYrHhhc= -github.com/ipfs/go-ipfs-blockstore v1.3.1 h1:cEI9ci7V0sRNivqaOr0elDsamxXFxJMMMy7PTTDQNsQ= -github.com/ipfs/go-ipfs-blockstore v1.3.1/go.mod h1:KgtZyc9fq+P2xJUiCAzbRdhhqJHvsw8u2Dlqy2MyRTE= -github.com/ipfs/go-ipfs-cmds v0.14.0 h1:sxdurhAHSdQr5VrSNJjc+t92uJObSNq+gRVm/wLZGMM= -github.com/ipfs/go-ipfs-cmds v0.14.0/go.mod h1:zj2jN7bHJ4pDucRmqdq863AQYcsqdxXrfVkr9eqPfvo= -github.com/ipfs/go-ipfs-delay v0.0.0-20181109222059-70721b86a9a8/go.mod h1:8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw= -github.com/ipfs/go-ipfs-delay v0.0.1 h1:r/UXYyRcddO6thwOnhiznIAiSvxMECGgtv35Xs1IeRQ= -github.com/ipfs/go-ipfs-delay v0.0.1/go.mod h1:8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw= -github.com/ipfs/go-ipfs-ds-help v1.1.1 h1:B5UJOH52IbcfS56+Ul+sv8jnIV10lbjLF5eOO0C66Nw= -github.com/ipfs/go-ipfs-ds-help v1.1.1/go.mod h1:75vrVCkSdSFidJscs8n4W+77AtTpCIAdDGAwjitJMIo= -github.com/ipfs/go-ipfs-exchange-interface v0.2.1 h1:jMzo2VhLKSHbVe+mHNzYgs95n0+t0Q69GQ5WhRDZV/s= -github.com/ipfs/go-ipfs-exchange-interface v0.2.1/go.mod h1:MUsYn6rKbG6CTtsDp+lKJPmVt3ZrCViNyH3rfPGsZ2E= -github.com/ipfs/go-ipfs-pq v0.0.3 h1:YpoHVJB+jzK15mr/xsWC574tyDLkezVrDNeaalQBsTE= -github.com/ipfs/go-ipfs-pq v0.0.3/go.mod h1:btNw5hsHBpRcSSgZtiNm/SLj5gYIZ18AKtv3kERkRb4= -github.com/ipfs/go-ipfs-redirects-file v0.1.2 h1:QCK7VtL91FH17KROVVy5KrzDx2hu68QvB2FTWk08ZQk= -github.com/ipfs/go-ipfs-redirects-file v0.1.2/go.mod h1:yIiTlLcDEM/8lS6T3FlCEXZktPPqSOyuY6dEzVqw7Fw= -github.com/ipfs/go-ipfs-util v0.0.2/go.mod h1:CbPtkWJzjLdEcezDns2XYaehFVNXG9zrdrtMecczcsQ= -github.com/ipfs/go-ipfs-util v0.0.3 h1:2RFdGez6bu2ZlZdI+rWfIdbQb1KudQp3VGwPtdNCmE0= -github.com/ipfs/go-ipfs-util v0.0.3/go.mod h1:LHzG1a0Ig4G+iZ26UUOMjHd+lfM84LZCrn17xAKWBvs= -github.com/ipfs/go-ipld-cbor v0.2.0 h1:VHIW3HVIjcMd8m4ZLZbrYpwjzqlVUfjLM7oK4T5/YF0= -github.com/ipfs/go-ipld-cbor v0.2.0/go.mod h1:Cp8T7w1NKcu4AQJLqK0tWpd1nkgTxEVB5C6kVpLW6/0= -github.com/ipfs/go-ipld-format v0.6.0 h1:VEJlA2kQ3LqFSIm5Vu6eIlSxD/Ze90xtc4Meten1F5U= -github.com/ipfs/go-ipld-format v0.6.0/go.mod h1:g4QVMTn3marU3qXchwjpKPKgJv+zF+OlaKMyhJ4LHPg= -github.com/ipfs/go-ipld-git v0.1.1 h1:TWGnZjS0htmEmlMFEkA3ogrNCqWjIxwr16x1OsdhG+Y= -github.com/ipfs/go-ipld-git v0.1.1/go.mod h1:+VyMqF5lMcJh4rwEppV0e6g4nCCHXThLYYDpKUkJubI= -github.com/ipfs/go-ipld-legacy v0.2.1 h1:mDFtrBpmU7b//LzLSypVrXsD8QxkEWxu5qVxN99/+tk= -github.com/ipfs/go-ipld-legacy v0.2.1/go.mod h1:782MOUghNzMO2DER0FlBR94mllfdCJCkTtDtPM51otM= -github.com/ipfs/go-log v1.0.5 h1:2dOuUCB1Z7uoczMWgAyDck5JLb72zHzrMnGnCNNbvY8= -github.com/ipfs/go-log v1.0.5/go.mod h1:j0b8ZoR+7+R99LD9jZ6+AJsrzkPbSXbZfGakb5JPtIo= -github.com/ipfs/go-log/v2 v2.1.3/go.mod h1:/8d0SH3Su5Ooc31QlL1WysJhvyOTDCjcCZ9Axpmri6g= -github.com/ipfs/go-log/v2 v2.3.0/go.mod h1:QqGoj30OTpnKaG/LKTGTxoP2mmQtjVMEnK72gynbe/g= -github.com/ipfs/go-log/v2 v2.5.1 h1:1XdUzF7048prq4aBjDQQ4SL5RxftpRGdXhNRwKSAlcY= -github.com/ipfs/go-log/v2 v2.5.1/go.mod h1:prSpmC1Gpllc9UYWxDiZDreBYw7zp4Iqp1kOLU9U5UI= -github.com/ipfs/go-merkledag v0.11.0 h1:DgzwK5hprESOzS4O1t/wi6JDpyVQdvm9Bs59N/jqfBY= -github.com/ipfs/go-merkledag v0.11.0/go.mod h1:Q4f/1ezvBiJV0YCIXvt51W/9/kqJGH4I1LsA7+djsM4= -github.com/ipfs/go-metrics-interface v0.0.1 h1:j+cpbjYvu4R8zbleSs36gvB7jR+wsL2fGD6n0jO4kdg= -github.com/ipfs/go-metrics-interface v0.0.1/go.mod h1:6s6euYU4zowdslK0GKHmqaIZ3j/b/tL7HTWtJ4VPgWY= -github.com/ipfs/go-peertaskqueue v0.8.1 h1:YhxAs1+wxb5jk7RvS0LHdyiILpNmRIRnZVztekOF0pg= -github.com/ipfs/go-peertaskqueue v0.8.1/go.mod h1:Oxxd3eaK279FxeydSPPVGHzbwVeHjatZ2GA8XD+KbPU= -github.com/ipfs/go-test v0.0.4 h1:DKT66T6GBB6PsDFLoO56QZPrOmzJkqU1FZH5C9ySkew= -github.com/ipfs/go-test v0.0.4/go.mod h1:qhIM1EluEfElKKM6fnWxGn822/z9knUGM1+I/OAQNKI= -github.com/ipfs/go-unixfsnode v1.9.2 h1:0A12BYs4XOtDPJTMlwmNPlllDfqcc4yie4e919hcUXk= -github.com/ipfs/go-unixfsnode v1.9.2/go.mod h1:v1nuMFHf4QTIhFUdPMvg1nQu7AqDLvIdwyvJ531Ot1U= -github.com/ipfs/go-verifcid v0.0.3 h1:gmRKccqhWDocCRkC+a59g5QW7uJw5bpX9HWBevXa0zs= -github.com/ipfs/go-verifcid v0.0.3/go.mod h1:gcCtGniVzelKrbk9ooUSX/pM3xlH73fZZJDzQJRvOUw= -github.com/ipfs/kubo v0.32.1 h1:nkx5qrkMeJ2f1ET7v3vx7U1ycurM0dC9R7AnsuSrNjk= -github.com/ipfs/kubo v0.32.1/go.mod h1:7fi1IMPgW5fupyMFUjJ4d4zbvkTEwq6tV3T+EQvtF28= -github.com/ipld/go-car v0.6.2 h1:Hlnl3Awgnq8icK+ze3iRghk805lu8YNq3wlREDTF2qc= -github.com/ipld/go-car v0.6.2/go.mod h1:oEGXdwp6bmxJCZ+rARSkDliTeYnVzv3++eXajZ+Bmr8= -github.com/ipld/go-car/v2 v2.14.2 h1:9ERr7KXpCC7If0rChZLhYDlyr6Bes6yRKPJnCO3hdHY= -github.com/ipld/go-car/v2 v2.14.2/go.mod h1:0iPB/825lTZLU2zPK5bVTk/R3V2612E1VI279OGSXWA= -github.com/ipld/go-codec-dagpb v1.6.0 h1:9nYazfyu9B1p3NAgfVdpRco3Fs2nFC72DqVsMj6rOcc= -github.com/ipld/go-codec-dagpb v1.6.0/go.mod h1:ANzFhfP2uMJxRBr8CE+WQWs5UsNa0pYtmKZ+agnUw9s= -github.com/ipld/go-ipld-prime v0.21.0 h1:n4JmcpOlPDIxBcY037SVfpd1G+Sj1nKZah0m6QH9C2E= -github.com/ipld/go-ipld-prime v0.21.0/go.mod h1:3RLqy//ERg/y5oShXXdx5YIp50cFGOanyMctpPjsvxQ= -github.com/ipld/go-ipld-prime/storage/bsadapter v0.0.0-20230102063945-1a409dc236dd h1:gMlw/MhNr2Wtp5RwGdsW23cs+yCuj9k2ON7i9MiJlRo= -github.com/ipld/go-ipld-prime/storage/bsadapter v0.0.0-20230102063945-1a409dc236dd/go.mod h1:wZ8hH8UxeryOs4kJEJaiui/s00hDSbE37OKsL47g+Sw= -github.com/ipshipyard/p2p-forge v0.0.2 h1:86y9LxGB8sGxYQ/If5sNx+c8C/huSpBUg3UZ1uvtym8= -github.com/ipshipyard/p2p-forge v0.0.2/go.mod h1:taPeh3PDSO8Ual0/N2tIOAUXPV8gZoPF3uPXoUyiq14= -github.com/iris-contrib/blackfriday v2.0.0+incompatible/go.mod h1:UzZ2bDEoaSGPbkg6SAB4att1aAwTmVIx/5gCVqeyUdI= -github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/+fafWORmlnuysV2EMP8MW+qe0= -github.com/iris-contrib/i18n v0.0.0-20171121225848-987a633949d0/go.mod h1:pMCz62A0xJL6I+umB2YTlFRwWXaDFA0jy+5HzGiJjqI= -github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrOcOqfqxa4hXw= -github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= -github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= -github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo= -github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= -github.com/jackc/pgx/v5 v5.7.2 h1:mLoDLV6sonKlvjIEsV56SkWNCnuNv531l94GaIzO+XI= -github.com/jackc/pgx/v5 v5.7.2/go.mod h1:ncY89UGWxg82EykZUwSpUKEfccBGGYq1xjrOpsbsfGQ= -github.com/jackc/puddle/v2 v2.2.2 h1:PR8nw+E/1w0GLuRFSmiioY6UooMp6KJv0/61nB7icHo= -github.com/jackc/puddle/v2 v2.2.2/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= -github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= -github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= -github.com/jbenet/go-cienv v0.1.0/go.mod h1:TqNnHUmJgXau0nCzC7kXWeotg3J9W34CUv5Djy1+FlA= -github.com/jbenet/go-temp-err-catcher v0.1.0 h1:zpb3ZH6wIE8Shj2sKS+khgRvf7T7RABoLk/+KKHggpk= -github.com/jbenet/go-temp-err-catcher v0.1.0/go.mod h1:0kJRvmDZXNMIiJirNPEYfhpPwbGVtZVWC34vc5WLsDk= -github.com/jbenet/goprocess v0.1.4 h1:DRGOFReOMqqDNXwW70QkacFW0YN9QnwLV0Vqk+3oU0o= -github.com/jbenet/goprocess v0.1.4/go.mod h1:5yspPrukOVuOLORacaBi858NqyClJPQxYZlqdZVfqY4= -github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1CVv03EnqU1wYL2dFwXxW2An0az9JTl/ZsqXQeBlkU= -github.com/jedisct1/go-minisign v0.0.0-20230811132847-661be99b8267/go.mod h1:h1nSAbGFqGVzn6Jyl1R/iCcBUHN4g+gW1u9CoBTrb9E= -github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU= github.com/jhump/protoreflect v1.15.3 h1:6SFRuqU45u9hIZPJAoZ8c28T3nK64BNdp9w6jFonzls= github.com/jhump/protoreflect v1.15.3/go.mod h1:4ORHmSBmlCW8fh3xHmJMGyul1zNqZK4Elxc8qKP+p1k= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= @@ -1795,152 +1364,63 @@ github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+ github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/jsternberg/zap-logfmt v1.0.0/go.mod h1:uvPs/4X51zdkcm5jXl5SYoN+4RK21K8mysFmDaM/h+o= -github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/juju/errors v0.0.0-20181118221551-089d3ea4e4d5/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q= -github.com/juju/loggo v0.0.0-20180524022052-584905176618/go.mod h1:vgyd7OREkbtVEN/8IXZe5Ooef3LQePvuBm9UWj6ZL8U= -github.com/juju/testing v0.0.0-20180920084828-472a3e8b2073/go.mod h1:63prj8cnj0tU0S9OHjGJn+b1h0ZghCndfnbQolrYTwA= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= -github.com/jwilder/encoding v0.0.0-20170811194829-b4e1701a28ef/go.mod h1:Ct9fl0F6iIOGgxJ5npU/IUOhOhqlVrGjyIZc8/MagT0= -github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= -github.com/karalabe/usb v0.0.2/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= -github.com/kataras/golog v0.0.9/go.mod h1:12HJgwBIZFNGL0EJnMRhmvGA0PQGx8VFwrZtM4CqbAk= -github.com/kataras/iris/v12 v12.0.1/go.mod h1:udK4vLQKkdDqMGJJVd/msuMtN6hpYJhg/lSzuxjhO+U= -github.com/kataras/neffos v0.0.10/go.mod h1:ZYmJC07hQPW67eKuzlfY7SO3bC0mw83A3j6im82hfqw= -github.com/kataras/pio v0.0.0-20190103105442-ea782b38602d/go.mod h1:NV88laa9UiiDuX9AhMbDPkGYSPugBOV6yTZB1l2K9Z0= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= -github.com/kilic/bls12-381 v0.1.0/go.mod h1:vDTTHJONJ6G+P2R74EhnyotQDTliQDnFEwhdmfzw1ig= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j0HLHbNSE= -github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.9.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= -github.com/klauspost/compress v1.15.15/go.mod h1:ZcK2JAFqKOpnBlxcLsJzYfrS9X1akm9fHZNnD9+Vo/4= github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/compress v1.17.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= -github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= -github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.2.9 h1:66ze0taIn2H33fBvCkXuv9BmCwDfafmiIVpKV9kKGuY= github.com/klauspost/cpuid/v2 v2.2.9/go.mod h1:rqkxqrZ1EhYM9G+hXH7YdowN5R5RGN6NK4QwQ3WMXF8= -github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6/go.mod h1:+ZoRqAPRLkC4NPOvfYeR5KNOrY6TD+/sAC3HXPZgDYg= -github.com/klauspost/pgzip v1.0.2-0.20170402124221-0bf5dcad4ada/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/koron/go-ssdp v0.0.4 h1:1IDwrghSKYM7yLf7XCzbByg2sJ/JcNOZRXS2jczTwz0= -github.com/koron/go-ssdp v0.0.4/go.mod h1:oDXq+E5IL5q0U8uSBcoAXzTzInwy5lEgC91HoKtbmZk= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kylelemons/godebug v0.0.0-20170224010052-a616ab194758/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/labstack/echo-contrib v0.17.1 h1:7I/he7ylVKsDUieaGRZ9XxxTYOjfQwVzHzUYrNykfCU= -github.com/labstack/echo-contrib v0.17.1/go.mod h1:SnsCZtwHBAZm5uBSAtQtXQHI3wqEA73hvTn0bYMKnZA= -github.com/labstack/echo/v4 v4.1.11/go.mod h1:i541M3Fj6f76NZtHSj7TXnyM8n2gaodfvfxNnFqi74g= -github.com/labstack/echo/v4 v4.2.1/go.mod h1:AA49e0DZ8kk5jTOOCKNuPR6oTnBS0dYiM4FW1e6jwpg= -github.com/labstack/echo/v4 v4.12.0 h1:IKpw49IMryVB2p1a4dzwlhP1O2Tf2E0Ir/450lH+kI0= -github.com/labstack/echo/v4 v4.12.0/go.mod h1:UP9Cr2DJXbOK3Kr9ONYzNowSh7HP0aG0ShAyycHSJvM= -github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= -github.com/labstack/gommon v0.4.2 h1:F8qTUNXgG1+6WQmqoUWnz8WiEU60mXVVw0P4ht1WRA0= -github.com/labstack/gommon v0.4.2/go.mod h1:QlUFxVM+SNXhDL/Z7YhocGIBYOiwB0mXm1+1bAPHPyU= -github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= github.com/leanovate/gopter v0.2.11 h1:vRjThO1EKPb/1NsDXuDrzldR28RLkBflWYcU9CvzWu4= github.com/leanovate/gopter v0.2.11/go.mod h1:aK3tzZP/C+p1m3SPRE4SYZFGP7jjkuSI4f7Xvpt0S9c= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= -github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/libdns/libdns v0.2.2 h1:O6ws7bAfRPaBsgAYt8MDe2HcNBGC29hkZ9MX2eUSX3s= -github.com/libdns/libdns v0.2.2/go.mod h1:4Bj9+5CQiNMVGf87wjX4CY3HQJypUHRuLvlsfsZqLWQ= github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= -github.com/libp2p/go-cidranger v1.1.0 h1:ewPN8EZ0dd1LSnrtuwd4709PXVcITVeuwbag38yPW7c= -github.com/libp2p/go-cidranger v1.1.0/go.mod h1:KWZTfSr+r9qEo9OkI9/SIEeAtw+NNoU0dXIXt15Okic= -github.com/libp2p/go-doh-resolver v0.4.0 h1:gUBa1f1XsPwtpE1du0O+nnZCUqtG7oYi7Bb+0S7FQqw= -github.com/libp2p/go-doh-resolver v0.4.0/go.mod h1:v1/jwsFusgsWIGX/c6vCRrnJ60x7bhTiq/fs2qt0cAg= -github.com/libp2p/go-flow-metrics v0.2.0 h1:EIZzjmeOE6c8Dav0sNv35vhZxATIXWZg6j/C08XmmDw= -github.com/libp2p/go-flow-metrics v0.2.0/go.mod h1:st3qqfu8+pMfh+9Mzqb2GTiwrAGjIPszEjZmtksN8Jc= github.com/libp2p/go-libp2p v0.37.2 h1:Irh+n9aDPTLt9wJYwtlHu6AhMUipbC1cGoJtOiBqI9c= github.com/libp2p/go-libp2p v0.37.2/go.mod h1:M8CRRywYkqC6xKHdZ45hmqVckBj5z4mRLIMLWReypz8= -github.com/libp2p/go-libp2p-asn-util v0.4.1 h1:xqL7++IKD9TBFMgnLPZR6/6iYhawHKHl950SO9L6n94= -github.com/libp2p/go-libp2p-asn-util v0.4.1/go.mod h1:d/NI6XZ9qxw67b4e+NgpQexCIiFYJjErASrYW4PFDN8= -github.com/libp2p/go-libp2p-kad-dht v0.28.1 h1:DVTfzG8Ybn88g9RycIq47evWCRss5f0Wm8iWtpwyHso= -github.com/libp2p/go-libp2p-kad-dht v0.28.1/go.mod h1:0wHURlSFdAC42+wF7GEmpLoARw8JuS8do2guCtc/Y/w= -github.com/libp2p/go-libp2p-kbucket v0.6.4 h1:OjfiYxU42TKQSB8t8WYd8MKhYhMJeO2If+NiuKfb6iQ= -github.com/libp2p/go-libp2p-kbucket v0.6.4/go.mod h1:jp6w82sczYaBsAypt5ayACcRJi0lgsba7o4TzJKEfWA= -github.com/libp2p/go-libp2p-pubsub v0.12.0 h1:PENNZjSfk8KYxANRlpipdS7+BfLmOl3L2E/6vSNjbdI= -github.com/libp2p/go-libp2p-pubsub v0.12.0/go.mod h1:Oi0zw9aw8/Y5GC99zt+Ef2gYAl+0nZlwdJonDyOz/sE= -github.com/libp2p/go-libp2p-pubsub-router v0.6.0 h1:D30iKdlqDt5ZmLEYhHELCMRj8b4sFAqrUcshIUvVP/s= -github.com/libp2p/go-libp2p-pubsub-router v0.6.0/go.mod h1:FY/q0/RBTKsLA7l4vqC2cbRbOvyDotg8PJQ7j8FDudE= -github.com/libp2p/go-libp2p-record v0.2.0 h1:oiNUOCWno2BFuxt3my4i1frNrt7PerzB3queqa1NkQ0= -github.com/libp2p/go-libp2p-record v0.2.0/go.mod h1:I+3zMkvvg5m2OcSdoL0KPljyJyvNDFGKX7QdlpYUcwk= -github.com/libp2p/go-libp2p-routing-helpers v0.7.4 h1:6LqS1Bzn5CfDJ4tzvP9uwh42IB7TJLNFJA6dEeGBv84= -github.com/libp2p/go-libp2p-routing-helpers v0.7.4/go.mod h1:we5WDj9tbolBXOuF1hGOkR+r7Uh1408tQbAKaT5n1LE= -github.com/libp2p/go-libp2p-testing v0.12.0 h1:EPvBb4kKMWO29qP4mZGyhVzUyR25dvfUIK5WDu6iPUA= -github.com/libp2p/go-libp2p-testing v0.12.0/go.mod h1:KcGDRXyN7sQCllucn1cOOS+Dmm7ujhfEyXQL5lvkcPg= -github.com/libp2p/go-libp2p-xor v0.1.0 h1:hhQwT4uGrBcuAkUGXADuPltalOdpf9aag9kaYNT2tLA= -github.com/libp2p/go-libp2p-xor v0.1.0/go.mod h1:LSTM5yRnjGZbWNTA/hRwq2gGFrvRIbQJscoIL/u6InY= -github.com/libp2p/go-msgio v0.3.0 h1:mf3Z8B1xcFN314sWX+2vOTShIE0Mmn2TXn3YCUQGNj0= -github.com/libp2p/go-msgio v0.3.0/go.mod h1:nyRM819GmVaF9LX3l03RMh10QdOroF++NBbxAb0mmDM= -github.com/libp2p/go-nat v0.2.0 h1:Tyz+bUFAYqGyJ/ppPPymMGbIgNRH+WqC5QrT5fKrrGk= -github.com/libp2p/go-nat v0.2.0/go.mod h1:3MJr+GRpRkyT65EpVPBstXLvOlAPzUVlG6Pwg9ohLJk= -github.com/libp2p/go-netroute v0.2.2 h1:Dejd8cQ47Qx2kRABg6lPwknU7+nBnFRpko45/fFPuZ8= -github.com/libp2p/go-netroute v0.2.2/go.mod h1:Rntq6jUAH0l9Gg17w5bFGhcC9a+vk4KNXs6s7IljKYE= -github.com/libp2p/go-reuseport v0.4.0 h1:nR5KU7hD0WxXCJbmw7r2rhRYruNRl2koHw8fQscQm2s= -github.com/libp2p/go-reuseport v0.4.0/go.mod h1:ZtI03j/wO5hZVDFo2jKywN6bYKWLOy8Se6DrI2E1cLU= -github.com/libp2p/go-yamux/v4 v4.0.1 h1:FfDR4S1wj6Bw2Pqbc8Uz7pCxeRBPbwsBbEdfwiCypkQ= -github.com/libp2p/go-yamux/v4 v4.0.1/go.mod h1:NWjl8ZTLOGlozrXSOZ/HlfG++39iKNnM5wwmtQP1YB4= -github.com/libp2p/zeroconf/v2 v2.2.0 h1:Cup06Jv6u81HLhIj1KasuNM/RHHrJ8T7wOTS4+Tv53Q= -github.com/libp2p/zeroconf/v2 v2.2.0/go.mod h1:fuJqLnUwZTshS3U/bMRJ3+ow/v9oid1n0DmyYyNO1Xs= github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= -github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= github.com/lyft/protoc-gen-star v0.6.0/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= github.com/lyft/protoc-gen-star v0.6.1/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= github.com/lyft/protoc-gen-star/v2 v2.0.1/go.mod h1:RcCdONR2ScXaYnQC5tUzxzlpA3WVYF7/opLeUgcQs/o= github.com/lyft/protoc-gen-star/v2 v2.0.3/go.mod h1:amey7yeodaJhXSbf/TlLvWiqQfLOSpEk//mLlc+axEk= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= -github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg= -github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd h1:br0buuQ854V8u83wA0rVZ8ttrq5CpaPZdvrK0LP2lOk= -github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd/go.mod h1:QuCEs1Nt24+FYQEqAAncTDPJIuGs+LxK1MCiFL25pMU= -github.com/matryer/moq v0.0.0-20190312154309-6cfb0558e1bd/go.mod h1:9ELz6aaclSIGnZBoaSLZ3NAl1VTufbOrXBPvtcy6WiQ= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= @@ -1948,54 +1428,27 @@ github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovk github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= -github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.13/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= -github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= -github.com/mattn/go-sqlite3 v1.14.5/go.mod h1:WVKg1VTActs4Qso6iwGbiFih2UIHo0ENGwNd0Lj+XmI= github.com/mattn/go-sqlite3 v1.14.14/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/mattn/go-sqlite3 v1.14.15/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= -github.com/mattn/go-tty v0.0.0-20180907095812-13ff1204f104/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE= -github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= -github.com/medama-io/go-useragent v1.0.1 h1:staHGaZKIRpGI7sPVnyjYVT0SMRlQmp0L21rKYusi8Y= -github.com/medama-io/go-useragent v1.0.1/go.mod h1:H9GYWth4IN8vAFZh5LeARza7VwM4jK9uk7Tb9huVzLw= -github.com/mediocregopher/mediocre-go-lib v0.0.0-20181029021733-cb65787f37ed/go.mod h1:dSsfyI2zABAdhcbvkXqgxOxrCsbYeHCPgrZkku60dSg= -github.com/mediocregopher/radix/v3 v3.3.0/go.mod h1:EmfVyvspXz1uZEyPBMyGK+kjWiKQGvsUt6O3Pj+LDCQ= -github.com/mholt/acmez/v2 v2.0.3 h1:CgDBlEwg3QBp6s45tPQmFIBrkRIkBT4rW4orMM6p4sw= -github.com/mholt/acmez/v2 v2.0.3/go.mod h1:pQ1ysaDeGrIMvJ9dfJMk5kJNkn7L2sb3UhyrX6Q91cw= -github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4= -github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= -github.com/miekg/dns v1.1.62 h1:cN8OuEF1/x5Rq6Np+h1epln8OiyPWV+lROx9LxcGgIQ= -github.com/miekg/dns v1.1.62/go.mod h1:mvDlcItzm+br7MToIKqkglaGhlFMHJ9DTNNWONWXbNQ= -github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b h1:z78hV3sbSMAUoyUMM0I83AUIT6Hu17AWfgjzIbtrYFc= -github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b/go.mod h1:lxPUiZwKoFL8DUUmalo2yJJUCxbPKtm8OKfqr2/FTNU= -github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc h1:PTfri+PuQmWDqERdnNMiD9ZejrlswWrCpBEZgWOiTrc= -github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc/go.mod h1:cGKTAVKx4SxOuR/czcZ/E2RSJ3sfHs8FpHhQ5CWMf9s= github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643 h1:hLDRPB66XQT/8+wG9WsDpiCvZf1yKO7sz7scAjSlBa0= github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8/go.mod h1:mC1jAcsrzbxHt8iiaC+zU4b1ylILSosueou12R++wfY= -github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1/go.mod h1:pD8RvIylQ358TN4wwqatJ8rNavkEINozVn9DtGI3dfQ= github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3/go.mod h1:RagcQ7I8IeTMnF8JTXieKnO4Z6JCsikNEzj0DwauVzE= github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= -github.com/minio/sha256-simd v0.1.1-0.20190913151208-6de447530771/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= @@ -2006,10 +1459,8 @@ github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJ github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4= github.com/mmcloughlin/addchain v0.4.0 h1:SobOdjm2xLj1KkXN5/n0xTIWyZA2+s99UCY1iPfkHRY= github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqkyU72HC5wJ4RlU= github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFVejUS1/tS/qU= @@ -2018,80 +1469,48 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= -github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= -github.com/montanaflynn/stats v0.7.0/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= -github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= -github.com/mr-tron/base58 v1.1.2/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= -github.com/mr-tron/base58 v1.1.3/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= -github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg= github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ibNBTZrns= github.com/multiformats/go-base32 v0.1.0 h1:pVx9xoSPqEIQG8o+UbAe7DNi51oej1NtK+aGkbLYxPE= github.com/multiformats/go-base32 v0.1.0/go.mod h1:Kj3tFY6zNr+ABYMqeUNeGvkIC/UYgtWibDcT0rExnbI= github.com/multiformats/go-base36 v0.2.0 h1:lFsAbNOGeKtuKozrtBsAkSVhv1p9D0/qedU9rQyccr0= github.com/multiformats/go-base36 v0.2.0/go.mod h1:qvnKE++v+2MWCfePClUEjE78Z7P2a1UV0xHgWc0hkp4= -github.com/multiformats/go-multiaddr v0.1.1/go.mod h1:aMKBKNEYmzmDmxfX88/vz+J5IU55txyt0p4aiWVohjo= github.com/multiformats/go-multiaddr v0.14.0 h1:bfrHrJhrRuh/NXH5mCnemjpbGjzRw/b+tJFOD41g2tU= github.com/multiformats/go-multiaddr v0.14.0/go.mod h1:6EkVAxtznq2yC3QT5CM1UTAwG0GTP3EWAIcjHuzQ+r4= -github.com/multiformats/go-multiaddr-dns v0.4.1 h1:whi/uCLbDS3mSEUMb1MsoT4uzUeZB0N32yzufqS0i5M= -github.com/multiformats/go-multiaddr-dns v0.4.1/go.mod h1:7hfthtB4E4pQwirrz+J0CcDUfbWzTqEzVyYKKIKpgkc= -github.com/multiformats/go-multiaddr-fmt v0.1.0 h1:WLEFClPycPkp4fnIzoFoV9FVd49/eQsuaL3/CWe167E= -github.com/multiformats/go-multiaddr-fmt v0.1.0/go.mod h1:hGtDIW4PU4BqJ50gW2quDuPVjyWNZxToGUh/HwTZYJo= github.com/multiformats/go-multibase v0.2.0 h1:isdYCVLvksgWlMW9OZRYJEa9pZETFivncJHmHnnd87g= github.com/multiformats/go-multibase v0.2.0/go.mod h1:bFBZX4lKCA/2lyOFSAoKH5SS6oPyjtnzK/XTFDPkNuk= github.com/multiformats/go-multicodec v0.9.0 h1:pb/dlPnzee/Sxv/j4PmkDRxCOi3hXTz3IbPKOXWJkmg= github.com/multiformats/go-multicodec v0.9.0/go.mod h1:L3QTQvMIaVBkXOXXtVmYE+LI16i14xuaojr/H7Ai54k= -github.com/multiformats/go-multihash v0.0.8/go.mod h1:YSLudS+Pi8NHE7o6tb3D8vrpKa63epEDmG8nTduyAew= -github.com/multiformats/go-multihash v0.0.13/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc= github.com/multiformats/go-multihash v0.2.3 h1:7Lyc8XfX/IY2jWb/gI7JP+o7JEq9hOa7BFvVU9RSh+U= github.com/multiformats/go-multihash v0.2.3/go.mod h1:dXgKXCXjBzdscBLk9JkjINiEsCKRVch90MdaGiKsvSM= -github.com/multiformats/go-multistream v0.6.0 h1:ZaHKbsL404720283o4c/IHQXiS6gb8qAN5EIJ4PN5EA= -github.com/multiformats/go-multistream v0.6.0/go.mod h1:MOyoG5otO24cHIg8kf9QW2/NozURlkP/rvi2FQJyCPg= -github.com/multiformats/go-varint v0.0.5/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= github.com/multiformats/go-varint v0.0.7 h1:sWSGR+f/eu5ABZA2ZpYKBILXTTs9JWpdEM/nEGOHFS8= github.com/multiformats/go-varint v0.0.7/go.mod h1:r8PUYw/fD/SjBCiKOoDlGF6QawOELpZAu9eioSos/OU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/grpc-proxy v0.0.0-20181017164139-0f1106ef9c76/go.mod h1:x5OoJHDHqxHS801UIuhqGl6QdSAEJvtausosHSdazIo= -github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0= -github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E= github.com/nats-io/jwt/v2 v2.4.1/go.mod h1:24BeQtRwxRV8ruvC4CojXlx/WQ/VjuwlYiH+vu/+ibI= github.com/nats-io/nats-server/v2 v2.9.20/go.mod h1:aTb/xtLCGKhfTFLxP591CMWfkdgBmcUUSkiSOe5A3gw= -github.com/nats-io/nats.go v1.8.1/go.mod h1:BrFz9vVn0fU3AcH9Vn4Kd7W0NpJ651tD5omQ3M8LwxM= github.com/nats-io/nats.go v1.27.0/go.mod h1:XpbWUlOElGwTYbMR7imivs7jJj9GtK7ypv321Wp6pjc= github.com/nats-io/nats.go v1.30.2/go.mod h1:dcfhUgmQNN4GJEfIb2f9R7Fow+gzBF4emzDHrVBd5qM= -github.com/nats-io/nkeys v0.0.2/go.mod h1:dab7URMsZm6Z/jp9Z5UGa87Uutgc2mVpXLC4B7TDb/4= github.com/nats-io/nkeys v0.4.4/go.mod h1:XUkxdLPTufzlihbamfzQ7mw/VGx6ObUs+0bN5sNvt64= github.com/nats-io/nkeys v0.4.5/go.mod h1:XUkxdLPTufzlihbamfzQ7mw/VGx6ObUs+0bN5sNvt64= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= -github.com/ncruces/go-sqlite3 v0.21.1 h1:cbzIOY3jQrXZWVsBfH9TCFj/iqqMIcJ7PLye4AAEwoQ= -github.com/ncruces/go-sqlite3 v0.21.1/go.mod h1:zxMOaSG5kFYVFK4xQa0pdwIszqxqJ0W0BxBgwdrNjuA= -github.com/ncruces/julianday v1.0.0 h1:fH0OKwa7NWvniGQtxdJRxAgkBMolni2BjDHaWTxqt7M= -github.com/ncruces/julianday v1.0.0/go.mod h1:Dusn2KvZrrovOMJuOt0TNXL6tB7U2E8kvza5fFc9G7g= -github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo= -github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/nxadm/tail v1.4.11 h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY= github.com/nxadm/tail v1.4.11/go.mod h1:OTaG3NK980DZzxbRq6lEuzgU+mug70nY11sMd4JXXHc= github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a h1:dlRvE5fWabOchtH7znfiFCcOvmIYgOeAS5ifBXBlh9Q= github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s= github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.22.0 h1:Yed107/8DjTr0lKCNt7Dn8yQ6ybuDRQoMGrNFKzMfHg= -github.com/onsi/ginkgo/v2 v2.22.0/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.34.2 h1:pNCwDkzrsv7MS9kpaQvVb1aVLahQXyJ/Tv5oAZMI3i8= @@ -2102,87 +1521,25 @@ github.com/opencontainers/image-spec v1.1.0-rc5 h1:Ygwkfw9bpDvs+c9E34SdgGOj41dX/ github.com/opencontainers/image-spec v1.1.0-rc5/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8= github.com/opencontainers/runc v1.1.5 h1:L44KXEpKmfWDcS02aeGm8QNTFXTo2D+8MYGDIJ/GDEs= github.com/opencontainers/runc v1.1.5/go.mod h1:1J5XiS+vdZ3wCyZybsuxXZWGrgSr8fFJHLXuG2PsnNg= -github.com/opencontainers/runtime-spec v1.2.0 h1:z97+pHb3uELt/yiAWD691HNHQIF07bE7dzrbT927iTk= -github.com/opencontainers/runtime-spec v1.2.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/opentracing/opentracing-go v1.0.3-0.20180606204148-bd9c31933947/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= -github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= -github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8= -github.com/openzipkin/zipkin-go v0.4.3 h1:9EGwpqkgnwdEIJ+Od7QVSEIH+ocmm5nPat0G7sjsSdg= -github.com/openzipkin/zipkin-go v0.4.3/go.mod h1:M9wCJZFWCo2RiY+o1eBCEMe0Dp2S5LDHcMZmk3RmK7c= github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/paulbellamy/ratecounter v0.2.0/go.mod h1:Hfx1hDpSGoqxkVVpBi/IlYD7kChlfo5C6hzIHwPqfFE= -github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 h1:onHthvaw9LFnH4t2DcNVpwGmV9E1BkGknEliJkfwQj0= -github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58/go.mod h1:DXv8WO4yhMYhSNPKjeNKa5WY9YCIEBRbNzFFPJbWO6Y= github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= -github.com/petar/GoLLRB v0.0.0-20210522233825-ae3b015fd3e9 h1:1/WtZae0yGtPq+TI6+Tv1WTxkukpXeMlviSxvL7SRgk= -github.com/petar/GoLLRB v0.0.0-20210522233825-ae3b015fd3e9/go.mod h1:x3N5drFsm2uilKKuuYo6LdyD8vZAW55sH/9w+pbo1sw= -github.com/peterh/liner v1.0.1-0.20180619022028-8c1271fcf47f/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc= -github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= -github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= github.com/phpdave11/gofpdf v1.4.2/go.mod h1:zpO6xFn9yxo3YLyMvW8HcKWVdbNqgIfOOp2dXMnm1mY= github.com/phpdave11/gofpdi v1.0.12/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= github.com/phpdave11/gofpdi v1.0.13/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= -github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= -github.com/pion/datachannel v1.5.9 h1:LpIWAOYPyDrXtU+BW7X0Yt/vGtYxtXQ8ql7dFfYUVZA= -github.com/pion/datachannel v1.5.9/go.mod h1:kDUuk4CU4Uxp82NH4LQZbISULkX/HtzKa4P7ldf9izE= -github.com/pion/dtls/v2 v2.2.7/go.mod h1:8WiMkebSHFD0T+dIU+UeBaoV7kDhOW5oDCzZ7WZ/F9s= -github.com/pion/dtls/v2 v2.2.12 h1:KP7H5/c1EiVAAKUmXyCzPiQe5+bCJrpOeKg/L05dunk= -github.com/pion/dtls/v2 v2.2.12/go.mod h1:d9SYc9fch0CqK90mRk1dC7AkzzpwJj6u2GU3u+9pqFE= -github.com/pion/ice/v2 v2.3.37 h1:ObIdaNDu1rCo7hObhs34YSBcO7fjslJMZV0ux+uZWh0= -github.com/pion/ice/v2 v2.3.37/go.mod h1:mBF7lnigdqgtB+YHkaY/Y6s6tsyRyo4u4rPGRuOjUBQ= -github.com/pion/interceptor v0.1.37 h1:aRA8Zpab/wE7/c0O3fh1PqY0AJI3fCSEM5lRWJVorwI= -github.com/pion/interceptor v0.1.37/go.mod h1:JzxbJ4umVTlZAf+/utHzNesY8tmRkM2lVmkS82TTj8Y= -github.com/pion/logging v0.2.2 h1:M9+AIj/+pxNsDfAT64+MAVgJO0rsyLnoJKCqf//DoeY= -github.com/pion/logging v0.2.2/go.mod h1:k0/tDVsRCX2Mb2ZEmTqNa7CWsQPc+YYCB7Q+5pahoms= -github.com/pion/mdns v0.0.12 h1:CiMYlY+O0azojWDmxdNr7ADGrnZ+V6Ilfner+6mSVK8= -github.com/pion/mdns v0.0.12/go.mod h1:VExJjv8to/6Wqm1FXK+Ii/Z9tsVk/F5sD/N70cnYFbk= -github.com/pion/randutil v0.1.0 h1:CFG1UdESneORglEsnimhUjf33Rwjubwj6xfiOXBa3mA= -github.com/pion/randutil v0.1.0/go.mod h1:XcJrSMMbbMRhASFVOlj/5hQial/Y8oH/HVo7TBZq+j8= -github.com/pion/rtcp v1.2.12/go.mod h1:sn6qjxvnwyAkkPzPULIbVqSKI5Dv54Rv7VG0kNxh9L4= -github.com/pion/rtcp v1.2.14 h1:KCkGV3vJ+4DAJmvP0vaQShsb0xkRfWkO540Gy102KyE= -github.com/pion/rtcp v1.2.14/go.mod h1:sn6qjxvnwyAkkPzPULIbVqSKI5Dv54Rv7VG0kNxh9L4= -github.com/pion/rtp v1.8.3/go.mod h1:pBGHaFt/yW7bf1jjWAoUjpSNoDnw98KTMg+jWWvziqU= -github.com/pion/rtp v1.8.9 h1:E2HX740TZKaqdcPmf4pw6ZZuG8u5RlMMt+l3dxeu6Wk= -github.com/pion/rtp v1.8.9/go.mod h1:pBGHaFt/yW7bf1jjWAoUjpSNoDnw98KTMg+jWWvziqU= -github.com/pion/sctp v1.8.34 h1:rCuD3m53i0oGxCSp7FLQKvqVx0Nf5AUAHhMRXTTQjBc= -github.com/pion/sctp v1.8.34/go.mod h1:yWkCClkXlzVW7BXfI2PjrUGBwUI0CjXJBkhLt+sdo4U= -github.com/pion/sdp/v3 v3.0.9 h1:pX++dCHoHUwq43kuwf3PyJfHlwIj4hXA7Vrifiq0IJY= -github.com/pion/sdp/v3 v3.0.9/go.mod h1:B5xmvENq5IXJimIO4zfp6LAe1fD9N+kFv+V/1lOdz8M= -github.com/pion/srtp/v2 v2.0.20 h1:HNNny4s+OUmG280ETrCdgFndp4ufx3/uy85EawYEhTk= -github.com/pion/srtp/v2 v2.0.20/go.mod h1:0KJQjA99A6/a0DOVTu1PhDSw0CXF2jTkqOoMg3ODqdA= -github.com/pion/stun v0.6.1 h1:8lp6YejULeHBF8NmV8e2787BogQhduZugh5PdhDyyN4= -github.com/pion/stun v0.6.1/go.mod h1:/hO7APkX4hZKu/D0f2lHzNyvdkTGtIy3NDmLR7kSz/8= -github.com/pion/transport/v2 v2.2.1/go.mod h1:cXXWavvCnFF6McHTft3DWS9iic2Mftcz1Aq29pGcU5g= -github.com/pion/transport/v2 v2.2.3/go.mod h1:q2U/tf9FEfnSBGSW6w5Qp5PFWRLRj3NjLhCCgpRK4p0= -github.com/pion/transport/v2 v2.2.4/go.mod h1:q2U/tf9FEfnSBGSW6w5Qp5PFWRLRj3NjLhCCgpRK4p0= -github.com/pion/transport/v2 v2.2.10 h1:ucLBLE8nuxiHfvkFKnkDQRYWYfp8ejf4YBOPfaQpw6Q= -github.com/pion/transport/v2 v2.2.10/go.mod h1:sq1kSLWs+cHW9E+2fJP95QudkzbK7wscs8yYgQToO5E= -github.com/pion/transport/v3 v3.0.1/go.mod h1:UY7kiITrlMv7/IKgd5eTUcaahZx5oUN3l9SzK5f5xE0= -github.com/pion/transport/v3 v3.0.7 h1:iRbMH05BzSNwhILHoBoAPxoB9xQgOaJk+591KC9P1o0= -github.com/pion/transport/v3 v3.0.7/go.mod h1:YleKiTZ4vqNxVwh77Z0zytYi7rXHl7j6uPLGhhz9rwo= -github.com/pion/turn/v2 v2.1.3/go.mod h1:huEpByKKHix2/b9kmTAM3YoX6MKP+/D//0ClgUYR2fY= -github.com/pion/turn/v2 v2.1.6 h1:Xr2niVsiPTB0FPtt+yAWKFUkU1eotQbGgpTIld4x1Gc= -github.com/pion/turn/v2 v2.1.6/go.mod h1:huEpByKKHix2/b9kmTAM3YoX6MKP+/D//0ClgUYR2fY= -github.com/pion/webrtc/v3 v3.3.4 h1:v2heQVnXTSqNRXcaFQVOhIOYkLMxOu1iJG8uy1djvkk= -github.com/pion/webrtc/v3 v3.3.4/go.mod h1:liNa+E1iwyzyXqNUwvoMRNQ10x8h8FOeJKL8RkIbamE= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -2190,22 +1547,16 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= -github.com/pkg/term v0.0.0-20180730021639-bffc007b7fd5/go.mod h1:eCbImbZ95eXtAUIbLAuAVnBnwf83mjf6QIVH8SHYwqQ= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/polydawn/refmt v0.89.0 h1:ADJTApkvkeBZsN0tBTx8QjpD9JkmxbKp0cxfr9qszm4= -github.com/polydawn/refmt v0.89.0/go.mod h1:/zvteZs/GwLtCgZ4BL6CBsk9IKIlexP43ObX9AxTqTw= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U= github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= -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/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.1-0.20210607210712-147c58e9608a/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= @@ -2213,24 +1564,11 @@ github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.47.0 h1:p5Cz0FNHo7SnWOmWmoRozVcjEp0bIVU8cV7OShpjL1k= github.com/prometheus/common v0.47.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= -github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= -github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/protolambda/bls12-381-util v0.0.0-20220416220906-d8552aa452c7/go.mod h1:IToEjHuttnUzwZI5KBSM/LOOW3qLbbrHOEfp3SbECGY= -github.com/quic-go/qpack v0.5.1 h1:giqksBPnT/HDtZ6VhtFKgoLOWmlyo9Ei6u9PqzIMbhI= -github.com/quic-go/qpack v0.5.1/go.mod h1:+PC4XFrEskIVkcLzpEkbLqq1uCoxPhQuvK5rH1ZgaEg= -github.com/quic-go/quic-go v0.48.2 h1:wsKXZPeGWpMpCGSWqOcqpW2wZYic/8T3aqiOID0/KWE= -github.com/quic-go/quic-go v0.48.2/go.mod h1:yBgs3rWBOADpga7F+jJsb6Ybg1LSYiQvwWlLX+/6HMs= -github.com/quic-go/webtransport-go v0.8.1-0.20241018022711-4ac2c9250e66 h1:4WFk6u3sOT6pLa1kQ50ZVdm8BQFgJNA117cepZxtLIg= -github.com/quic-go/webtransport-go v0.8.1-0.20241018022711-4ac2c9250e66/go.mod h1:Vp72IJajgeOL6ddqrAhmp7IM9zbTcgkQxD/YdxrVwMw= -github.com/raulk/go-watchdog v1.3.0 h1:oUmdlHxdkXRJlwfG0O9omj8ukerm8MEQavSiDTEtBsk= -github.com/raulk/go-watchdog v1.3.0/go.mod h1:fIvOnLbF0b0ZwkB9YU4mOW9Did//4vPZtDqv66NfsMU= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/regen-network/gocuke v0.6.2 h1:pHviZ0kKAq2U2hN2q3smKNxct6hS0mGByFMHGnWA97M= @@ -2239,14 +1577,10 @@ github.com/regen-network/protobuf v1.3.3-alpha.regen.1 h1:OHEc+q5iIAXpqiqFKeLpu5 github.com/regen-network/protobuf v1.3.3-alpha.regen.1/go.mod h1:2DjTFR1HhMQhiWC5sZ4OhQ3+NtdbZ6oBDKQwq5Ou+FI= github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= -github.com/retailnext/hllpp v1.0.1-0.20180308014038-101a6d2f8b52/go.mod h1:RDpi1RftBQPUCDRw6SmxeaREsAaRKnOclghuzp/WRzc= -github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= -github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= @@ -2258,11 +1592,9 @@ github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.32.0 h1:keLypqrlIjaFsbmJOBdB/qvyF8KEtCWHwobLp5l/mQ0= github.com/rs/zerolog v1.32.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= -github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w= github.com/ruudk/golang-pdf417 v0.0.0-20201230142125-a7e3863a1245/go.mod h1:pQAZKsJ8yyVxGRWYNEm9oFB8ieLgKFnamEyDmSA0BRk= -github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd/go.mod h1:hPqNNc0+uJM6H+SuU8sEs5K5IQeKccPqeSjfgcKGgPk= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sagikazarmark/crypt v0.15.0/go.mod h1:5rwNNax6Mlk9sZ40AcyVtiEw24Z4J04cfSioF2COKmc= @@ -2271,57 +1603,15 @@ github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6ke github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= -github.com/samber/lo v1.47.0 h1:z7RynLwP5nbyRscyvcD043DWYoOcYRv3mV8lBeqOCLc= -github.com/samber/lo v1.47.0/go.mod h1:RmDH9Ct32Qy3gduHQuKJ3gW1fMHAnE/fAzQuf6He5cU= github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= -github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/segmentio/kafka-go v0.1.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= -github.com/segmentio/kafka-go v0.2.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= -github.com/segmentio/ksuid v1.0.4 h1:sBo2BdShXjmcugAMwjugoGUdUV0pcxY5mW4xKRn3v4c= -github.com/segmentio/ksuid v1.0.4/go.mod h1:/XUiZBD3kVx5SmUOl55voK5yeAbBNNIed+2O73XgrPE= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= -github.com/shurcooL/component v0.0.0-20170202220835-f88ec8f54cc4/go.mod h1:XhFIlyj5a1fBNx5aJTbKoIq0mNaPvOagO+HjB3EtxrY= -github.com/shurcooL/events v0.0.0-20181021180414-410e4ca65f48/go.mod h1:5u70Mqkb5O5cxEA8nxTsgrgLehJeAw6Oc4Ab1c/P1HM= -github.com/shurcooL/github_flavored_markdown v0.0.0-20181002035957-2122de532470/go.mod h1:2dOwnU2uBioM+SGy2aZoq1f/Sd1l9OkAeAUvjSyvgU0= -github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= -github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= -github.com/shurcooL/gofontwoff v0.0.0-20180329035133-29b52fc0a18d/go.mod h1:05UtEgK5zq39gLST6uB0cf3NEHjETfB4Fgr3Gx5R9Vw= -github.com/shurcooL/gopherjslib v0.0.0-20160914041154-feb6d3990c2c/go.mod h1:8d3azKNyqcHP1GaQE/c6dDgjkgSx2BZ4IoEi4F1reUI= -github.com/shurcooL/highlight_diff v0.0.0-20170515013008-09bb4053de1b/go.mod h1:ZpfEhSmds4ytuByIcDnOLkTHGUI6KNqRNPDLHDk+mUU= -github.com/shurcooL/highlight_go v0.0.0-20181028180052-98c3abbbae20/go.mod h1:UDKB5a1T23gOMUJrI+uSuH0VRDStOiUVSjBTRDVBVag= -github.com/shurcooL/home v0.0.0-20181020052607-80b7ffcb30f9/go.mod h1:+rgNQw2P9ARFAs37qieuu7ohDNQ3gds9msbT2yn85sg= -github.com/shurcooL/htmlg v0.0.0-20170918183704-d01228ac9e50/go.mod h1:zPn1wHpTIePGnXSHpsVPWEktKXHr6+SS6x/IKRb7cpw= -github.com/shurcooL/httperror v0.0.0-20170206035902-86b7830d14cc/go.mod h1:aYMfkZ6DWSJPJ6c4Wwz3QtW22G7mf/PEgaB9k/ik5+Y= -github.com/shurcooL/httpfs v0.0.0-20171119174359-809beceb2371/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg= -github.com/shurcooL/httpgzip v0.0.0-20180522190206-b1c53ac65af9/go.mod h1:919LwcH0M7/W4fcZ0/jy0qGght1GIhqyS/EgWGH2j5Q= -github.com/shurcooL/issues v0.0.0-20181008053335-6292fdc1e191/go.mod h1:e2qWDig5bLteJ4fwvDAc2NHzqFEthkqn7aOZAOpj+PQ= -github.com/shurcooL/issuesapp v0.0.0-20180602232740-048589ce2241/go.mod h1:NPpHK2TI7iSaM0buivtFUc9offApnI0Alt/K8hcHy0I= -github.com/shurcooL/notifications v0.0.0-20181007000457-627ab5aea122/go.mod h1:b5uSkrEVM1jQUspwbixRBhaIjIzL2xazXp6kntxYle0= -github.com/shurcooL/octicon v0.0.0-20181028054416-fa4f57f9efb2/go.mod h1:eWdoE5JD4R5UVWDucdOPg1g2fqQRq78IQa9zlOV1vpQ= -github.com/shurcooL/reactions v0.0.0-20181006231557-f2e0b4ca5b82/go.mod h1:TCR1lToEk4d2s07G3XGfz2QrgHXg4RJBvjrOozvoWfk= -github.com/shurcooL/sanitized_anchor_name v0.0.0-20170918181015-86672fcb3f95/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/shurcooL/users v0.0.0-20180125191416-49c67e49c537/go.mod h1:QJTqeLYEDaXHZDBsXlPCDqdhQuJkuw4NOtaxYe3xii4= -github.com/shurcooL/webdavfs v0.0.0-20170829043945-18c3829fa133/go.mod h1:hKmq5kWdCj2z2KEozexVbfEZIWiTjhE0+UjmZgPqehw= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/assertions v1.2.0 h1:42S6lae5dvLc7BrLu/0ugRtcFVjoJNMC/N3yZFZkDFs= -github.com/smartystreets/assertions v1.2.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo= -github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/smartystreets/goconvey v1.7.2 h1:9RBaZCeXEQ3UselpuwUQHltGVXvdwm6cv1hgR6gDIPg= -github.com/smartystreets/goconvey v1.7.2/go.mod h1:Vw0tHAZW6lzCRk3xgdin6fKYcG+G3Pg9vgXWeJpQFMM= -github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d/go.mod h1:UdhH50NIW0fCiwBSr0co2m7BnFLdv4fQTgdqdJTHFeE= github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= -github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e/go.mod h1:HuIsMU8RRBOtsCgI77wP899iHVBQpCmg4ErYMZB+2IA= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= @@ -2332,14 +1622,10 @@ github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/ github.com/spf13/afero v1.10.0/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y= github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= -github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= -github.com/spf13/cobra v1.5.0/go.mod h1:dWXEIy2H428czQCjInthrTRUg7yKbok+2Qi/yBIJoUM= github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= @@ -2347,8 +1633,6 @@ github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.17.0 h1:I5txKw7MJasPL/BrfkbA0Jyo/oELqVmux4pR/UxOMfI= github.com/spf13/viper v1.17.0/go.mod h1:BmMMMLQXSbcHK6KAOiFLz0l5JHrU89OdIRHvsk0+yVI= -github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= -github.com/status-im/keycard-go v0.2.0/go.mod h1:wlp8ZLbsmrF6g6WjugPAx+IzoLrkdf9+mHxBEeo3Hbg= github.com/strangelove-ventures/globalfee v0.50.1 h1:UkRoJOFNiswmbAxaTPUI1HndTxQ28XD3yWwYwX6AjI8= github.com/strangelove-ventures/globalfee v0.50.1/go.mod h1:PSXvznw0SrYj0M36vfnUf5+BVuPJgY58do+wU7HpC2Y= github.com/strangelove-ventures/poa v0.50.0 h1:ZLDVv4ZK+FeKyAcJ9ahS6SgAOch8wvGr/txAKWQmcvg= @@ -2361,7 +1645,6 @@ github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSS github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= -github.com/stretchr/testify v1.2.0/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= 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.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -2381,84 +1664,19 @@ github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOf github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= -github.com/supranational/blst v0.3.8-0.20220526154634-513d2456b344/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= -github.com/supranational/blst v0.3.11/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= -github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= -github.com/tetratelabs/wazero v1.8.2 h1:yIgLR/b2bN31bjxwXHD8a3d+BogigR952csSDdLYEv4= -github.com/tetratelabs/wazero v1.8.2/go.mod h1:yAI0XTsMBhREkM/YDAK/zNou3GoiAce1P6+rp/wQhjs= github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI= github.com/tidwall/btree v1.7.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= -github.com/tinylib/msgp v1.0.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= -github.com/tklauser/go-sysconf v0.3.5/go.mod h1:MkWzOF4RMCshBAMXuhXJs64Rte09mITnppBXY/rYEFI= -github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= -github.com/tklauser/numcpus v0.2.2/go.mod h1:x3qojaO3uyYt0i56EW/VUYs7uBvdl2fkfZFu0T9wgjM= -github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= -github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= -github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U= -github.com/ucarion/urlpath v0.0.0-20200424170820-7ccc79b76bbb h1:Ywfo8sUltxogBpFuMOFRrrSifO788kAFxmvVw31PtQQ= -github.com/ucarion/urlpath v0.0.0-20200424170820-7ccc79b76bbb/go.mod h1:ikPs9bRWicNw3S7XpJ8sK/smGwU9WcSVU3dy9qahYBM= github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8= github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= -github.com/urfave/cli v1.22.10/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= -github.com/urfave/cli/v2 v2.10.2/go.mod h1:f8iq5LtQ/bLxafbdBSLPPNsgaW0l/2fYYEHhAyPlwvo= -github.com/urfave/cli/v2 v2.24.1/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= -github.com/urfave/cli/v2 v2.25.7/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ= -github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= -github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.6.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w= -github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo= -github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= -github.com/viant/assertly v0.4.8/go.mod h1:aGifi++jvCrUaklKEKT0BU95igDNaqkvz+49uaYMPRU= -github.com/viant/toolbox v0.24.0/go.mod h1:OxMCG57V0PXuIP2HNQrtJf2CjqdmbrOx5EkMILuUhzM= -github.com/vmihailenco/msgpack/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IUPn0Bjt8= -github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok= -github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= -github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= -github.com/warpfork/go-testmark v0.12.1 h1:rMgCpJfwy1sJ50x0M0NgyphxYYPMOODIJHhsXyEHU0s= -github.com/warpfork/go-testmark v0.12.1/go.mod h1:kHwy7wfvGSPh1rQJYKayD4AbtNaeyZdcGi9tNJTaa5Y= -github.com/warpfork/go-wish v0.0.0-20220906213052-39a1cc7a02d0 h1:GDDkbFiaK8jsSDJfjId/PEGEShv6ugrt4kYsC5UIDaQ= -github.com/warpfork/go-wish v0.0.0-20220906213052-39a1cc7a02d0/go.mod h1:x6AKhvSSexNrVSrViXSHUEbICjmGXhtgABaHIySUSGw= -github.com/whyrusleeping/base32 v0.0.0-20170828182744-c30ac30633cc h1:BCPnHtcboadS0DvysUuJXZ4lWVv5Bh5i7+tbIyi+ck4= -github.com/whyrusleeping/base32 v0.0.0-20170828182744-c30ac30633cc/go.mod h1:r45hJU7yEoA81k6MWNhpMj/kms0n14dkzkxYHoB96UM= -github.com/whyrusleeping/cbor v0.0.0-20171005072247-63513f603b11 h1:5HZfQkwe0mIfyDmc1Em5GqlNRzcdtlv4HTNmdpt7XH0= -github.com/whyrusleeping/cbor v0.0.0-20171005072247-63513f603b11/go.mod h1:Wlo/SzPmxVp6vXpGt/zaXhHH0fn4IxgqZc82aKg6bpQ= -github.com/whyrusleeping/cbor-gen v0.1.2 h1:WQFlrPhpcQl+M2/3dP5cvlTLWPVsL6LGBb9jJt6l/cA= -github.com/whyrusleeping/cbor-gen v0.1.2/go.mod h1:pM99HXyEbSQHcosHc0iW7YFmwnscr+t9Te4ibko05so= -github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f h1:jQa4QT2UP9WYv2nzyawpKMOCl+Z/jW7djv2/J50lj9E= -github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f/go.mod h1:p9UJB6dDgdPgMJZs7UjUOdulKyRr9fqkS+6JKAInPy8= -github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1 h1:EKhdznlJHPMoKr0XTrX+IlJs1LH3lyx2nfr1dOlZ79k= -github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1/go.mod h1:8UvriyWtv5Q5EOgjHaSseUEdkQfvwFv1I/In/O2M9gc= -github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7 h1:E9S12nwJwEOXe2d6gT6qxdvqMnNq+VnSsKPgm2ZZNds= -github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7/go.mod h1:X2c0RVCI1eSUFI8eLcY3c0423ykwiUdxLJtkDvruhjI= -github.com/willf/bitset v1.1.3/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= -github.com/wlynxg/anet v0.0.3/go.mod h1:eay5PRQr7fIVAMbTbchTnO9gG65Hg/uYGdc7mguHxoA= -github.com/wlynxg/anet v0.0.5 h1:J3VJGi1gvo0JwZ/P1/Yc/8p63SoW98B5dHkYDmpgvvU= -github.com/wlynxg/anet v0.0.5/go.mod h1:eay5PRQr7fIVAMbTbchTnO9gG65Hg/uYGdc7mguHxoA= -github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= -github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/xhit/go-str2duration/v2 v2.1.0/go.mod h1:ohY8p+0f07DiV6Em5LKB0s2YpLtXVyJfNt1+BlmyAsU= -github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= -github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= -github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI= -github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= -github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= -github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -2466,12 +1684,7 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ= github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0= -github.com/zeebo/blake3 v0.2.4 h1:KYQPkhpRtcqh0ssGYcKLG1JYvddkEA8QwCM/yBqhaZI= -github.com/zeebo/blake3 v0.2.4/go.mod h1:7eeQ6d2iXWRGF6npfaxl2CU+xy2Fjo2gxeyZGCRUjcE= -github.com/zeebo/pcg v1.0.1 h1:lyqfGeWiv4ahac6ttHs+I5hwtH/+1mrhlCtVNQM2kHo= -github.com/zeebo/pcg v1.0.1/go.mod h1:09F0S9iiKrwn9rlI5yjLkmrug154/YRW6KnnXVDM/l4= github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA= github.com/zondax/hid v0.9.2 h1:WCJFnEDMiqGF64nlZz28E9qLVZ0KSJ7xpc5DLEyma2U= github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= @@ -2483,7 +1696,6 @@ go.etcd.io/etcd/api/v3 v3.5.9/go.mod h1:uyAal843mC8uUVSLWz6eHa/d971iDGnCRpmKd2Z+ go.etcd.io/etcd/client/pkg/v3 v3.5.9/go.mod h1:y+CzeSmkMpWN2Jyu1npecjB9BBnABxGM4pN8cGuJeL4= go.etcd.io/etcd/client/v2 v2.305.9/go.mod h1:0NBdNx9wbxtEQLwAQtrDHwx58m02vXpDcgSYI2seohQ= go.etcd.io/etcd/client/v3 v3.5.9/go.mod h1:i/Eo5LrZ5IKqpbtpPDuaUnDOUv471oDg8cjQaUr2MbA= -go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -2499,16 +1711,6 @@ go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.56.0 h1:UP6IpuH go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.56.0/go.mod h1:qxuZLtbq5QDtdeSHsS7bcf6EH6uO6jUAgk764zd3rhM= go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.31.0 h1:K0XaT3DwHAcV4nKLzcQvwAgSyisUghWoY20I7huthMk= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.31.0/go.mod h1:B5Ki776z/MBnVha1Nzwp5arlzBbE3+1jk+pGmaP5HME= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.31.0 h1:FFeLy03iVTXP6ffeN2iXrxfGsZGCjVx0/4KlizjyBwU= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.31.0/go.mod h1:TMu73/k1CP8nBUpDLc71Wj/Kf7ZS9FK5b53VapRsP9o= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.31.0 h1:lUsI2TYsQw2r1IASwoROaCnjdj2cvC2+Jbxvk6nHnWU= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.31.0/go.mod h1:2HpZxxQurfGxJlJDblybejHB6RX6pmExPNe517hREw4= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.31.0 h1:UGZ1QwZWY67Z6BmckTU+9Rxn04m2bD3gD6Mk0OIOCPk= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.31.0/go.mod h1:fcwWuDuaObkkChiDlhEpSq9+X1C0omv+s5mBtToAQ64= -go.opentelemetry.io/otel/exporters/zipkin v1.31.0 h1:CgucL0tj3717DJnni7HVVB2wExzi8c2zJNEA2BhLMvI= -go.opentelemetry.io/otel/exporters/zipkin v1.31.0/go.mod h1:rfzOVNiSwIcWtEC2J8epwG26fiaXlYvLySJ7bwsrtAE= go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= @@ -2518,86 +1720,47 @@ go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06F go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.opentelemetry.io/proto/otlp v0.15.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= -go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0= -go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8= -go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= -go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/automaxprocs v1.5.1/go.mod h1:BF4eumQw0P9GtnuxxovUd06vwm1o18oMzFtK66vU6XU= -go.uber.org/automaxprocs v1.5.2/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= -go.uber.org/dig v1.18.0 h1:imUL1UiY0Mg4bqbFfsRQO5G4CGRBec/ZujWTvSVp3pw= -go.uber.org/dig v1.18.0/go.mod h1:Us0rSJiThwCv2GteUN0Q7OKvU7n5J4dxZ9JKUXozFdE= -go.uber.org/fx v1.23.0 h1:lIr/gYWQGfTwGcSXWXu4vP5Ws6iqnNEIY+F/aFzCKTg= -go.uber.org/fx v1.23.0/go.mod h1:o/D9n+2mLP6v1EG+qsdT1O8wKopYAsqZasju97SDFCU= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= -go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= -go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= -go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/mock v0.5.0 h1:KAMbZvZPyBPWgD14IrIQ38QCyjwpvVVV6K/bHl1IwQU= go.uber.org/mock v0.5.0/go.mod h1:ge71pBPLYDk7QIi1LupWxdAykm7KIEFchiOqd6z7qMM= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= -go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= -go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= -go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= -go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= -go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE= -go4.org v0.0.0-20200411211856-f5505b9728dd/go.mod h1:CIiUVy99QCPfoE13bO4EZaz5GZMZXMSBGhxRdsvzbkg= -go4.org v0.0.0-20230225012048-214862532bf5 h1:nifaUDeh+rPaBCMPMQHZmvJf+QdpLFnuQPwx+LxVmtc= -go4.org v0.0.0-20230225012048-214862532bf5/go.mod h1:F57wTi5Lrj6WLyswp5EYV1ncrEbFGHD4hhz6S1ZYeaU= -golang.org/x/build v0.0.0-20190111050920-041ab4dc3f9d/go.mod h1:OWs+y06UdEOHN4y+MfF/py+xQ/tYqIWW03b70/CG9Rw= -golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/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-20190313024323-a1f597ede03a/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190909091759-094676da4a83/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200602180216-279210d13fed/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE= golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I= golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= -golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= @@ -2616,10 +1779,8 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20220426173459-3bcf042a4bf5/go.mod h1:lgLbSvA5ygNOMpwM/9anMpWVlVJ7Z+cHWq/eFuinpGE= golang.org/x/exp v0.0.0-20220827204233-334a2380cb91/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE= golang.org/x/exp v0.0.0-20230321023759-10a507213a29/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= -golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= golang.org/x/exp v0.0.0-20241204233417-43b7b7cde48d h1:0olWaB5pg3+oychR51GUVCEsGkeCU/2JxjBgIo4f3M0= golang.org/x/exp v0.0.0-20241204233417-43b7b7cde48d/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= @@ -2636,7 +1797,6 @@ golang.org/x/image v0.0.0-20210607152325-775e3b0c77b9/go.mod h1:023OzeP/+EPmXeap golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= golang.org/x/image v0.0.0-20211028202545-6944b10bf410/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= golang.org/x/image v0.0.0-20220302094943-723b81ca9867/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= -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-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -2662,7 +1822,6 @@ golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= -golang.org/x/mod v0.6.0-dev.0.20211013180041-c96bc1413d57/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= @@ -2671,19 +1830,12 @@ golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4= -golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= 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-20181029044818-c44066c5c816/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-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/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-20190313220215-9f648a60d977/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190327091125-710a502c58a2/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -2691,7 +1843,6 @@ golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -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/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -2710,20 +1861,17 @@ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210220033124-5f55cee0dc0d/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= @@ -2758,10 +1906,7 @@ golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= golang.org/x/net v0.32.0 h1:ZqPmj8Kzc+Y6e0+skZsuACbx+wzMgo5MQsJh9Qd6aYI= golang.org/x/net v0.32.0/go.mod h1:CwU0IoeOlnQQWJ6ioyFrfRuomB8GKF6KbYXZVyeXNfs= -golang.org/x/oauth2 v0.0.0-20170207211851-4464e7848382/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -2797,8 +1942,6 @@ golang.org/x/oauth2 v0.12.0/go.mod h1:A74bZ3aGXgCY0qaIC9Ahg6Lglin4AMAco8cIv9baba golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs= golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= -golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw= -golang.org/x/perf v0.0.0-20230113213139-801c7ef9e5c5/go.mod h1:UBKtEnL8aqnd+0JHqZ+2qoMDwtuy6cYhhKNoHLBiTQc= 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= @@ -2822,14 +1965,11 @@ golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/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-20181029174526-d69651ed3497/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-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190130150945-aca44879d564/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-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190316082340-a2f829d7f35f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -2838,20 +1978,16 @@ golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/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/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200107162124-548cf772de50/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -2867,16 +2003,14 @@ golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201101102859-da207088b7d1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -2885,12 +2019,9 @@ golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210304124612-50617c2ba197/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210420205809-ac73e9fd8988/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -2898,7 +2029,6 @@ golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -2910,7 +2040,6 @@ golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211020174200-9d6173849985/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -2928,13 +2057,11 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -2953,7 +2080,6 @@ golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -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/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -2969,7 +2095,6 @@ golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o= golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= -golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= @@ -2996,30 +2121,22 @@ golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= -golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20220922220347-f3bd1da661af/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.1.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -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-20181030000716-a0a13e073c7b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181221001348-537d06c36207/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-20190206041539-40960b6deb8e/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-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190327201419-c70d86f8b7cf/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= @@ -3031,18 +2148,14 @@ golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190927191325-030b2cf1153e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191126055441-b0650ceb63d9/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200108203644-89082a384178/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -3067,6 +2180,7 @@ golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20201124115921-2c860bdd6e78/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= @@ -3076,7 +2190,6 @@ golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.8-0.20211029000441-d6a9af8af023/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= @@ -3087,8 +2200,6 @@ golang.org/x/tools v0.8.0/go.mod h1:JxBZ99ISMI5ViVkT1tr6tdNmXeTrcpVSD3vZ1RsRdN4= golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= golang.org/x/tools v0.10.0/go.mod h1:UJwyiVBsOA2uwvK/e5OY3GTpDUJriEd+/YlqAwLPmyM= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= -golang.org/x/tools v0.28.0 h1:WuB6qZ4RPCQo5aP3WdKZS7i595EdWqWR8vqJTlwTVK8= -golang.org/x/tools v0.28.0/go.mod h1:dcIOrVd3mfQKTgrDVQHqCPMWy6lnhfhtX3hLXYVLfRw= 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= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -3100,23 +2211,13 @@ golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNq golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da h1:noIWHXmPHxILtqtCOPIhSt0ABwskkZKjD3bXGnZGpNY= golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= -gonum.org/v1/gonum v0.0.0-20181121035319-3f7ecaa7e8ca/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= -gonum.org/v1/gonum v0.6.0/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= gonum.org/v1/gonum v0.9.3/go.mod h1:TZumC3NeyVQskjXqmyWt4S3bINhy7B4eYwW69EbyX+0= gonum.org/v1/gonum v0.11.0/go.mod h1:fSG4YDCxxUZQJ7rKsQrj0gMOg00Il0Z96/qMA4bVQhA= -gonum.org/v1/gonum v0.15.0 h1:2lYxjRbTYyxkJxlhC+LvJIx3SsANPdRybu1tGj9/OrQ= -gonum.org/v1/gonum v0.15.0/go.mod h1:xzZVBJBtS+Mz4q0Yl2LJTk+OxOg4jiXZ7qBoM0uISGo= -gonum.org/v1/netlib v0.0.0-20181029234149-ec6d1f5cefe6/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= gonum.org/v1/plot v0.9.0/go.mod h1:3Pcqqmp6RHvJI72kgb8fThyUnav364FOsdDo2aGW5lY= -gonum.org/v1/plot v0.10.0/go.mod h1:JWIHJ7U20drSQb/aDpTetJzfC1KlAPldJLpkSy88dvQ= gonum.org/v1/plot v0.10.1/go.mod h1:VZW5OlhkL1mysU9vaqNHnsy86inf6Ot+jB3r+BczCEo= -google.golang.org/api v0.0.0-20170206182103-3d017632ea10/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= -google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= -google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= -google.golang.org/api v0.1.0/go.mod h1:UGEZY7KEX120AnNLIHFMKIo4obdJhkp2tPbaPlQx13Y= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -3184,25 +2285,18 @@ google.golang.org/api v0.143.0/go.mod h1:FoX9DO9hT7DLNn97OuoZAGSDuNAXdJRuGK98rSU google.golang.org/api v0.172.0 h1:/1OcMZGPmW1rX2LCu2CmGUD1KXK1+pfzxotxyRUCCdk= google.golang.org/api v0.172.0/go.mod h1:+fJZq6QXWfa9pXhnIzsjx4yI22d4aI9ZpLb58gvXjis= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -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/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20181029155118-b69ba1387ce2/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20181202183823-bd91e49a0898/go.mod h1:7Ep/1NZk928CDR8SjdVbjWNpdIf6nzjE3BTgJDr2Atg= -google.golang.org/genproto v0.0.0-20190306203927-b5d61aea6440/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190716160619-c506a9f90610/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= @@ -3210,7 +2304,6 @@ google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvx google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200108215221-bd8f9a0ef82f/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= @@ -3376,11 +2469,6 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go. google.golang.org/genproto/googleapis/rpc v0.0.0-20230920204549-e6e6cdab5c13/go.mod h1:KSqppvjFjtoCI+KGd4PELB0qLNxdJHRGqRI09mB6pQA= google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9 h1:QCqS/PdaHTSWGvupk2F/ehwHtGc0/GYkT+3GAcR1CCc= google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= -google.golang.org/grpc v0.0.0-20170208002647-2a6bf6142e96/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= -google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= -google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= -google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= -google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -3453,26 +2541,19 @@ google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqw google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= google.golang.org/protobuf v1.36.0 h1:mjIs9gYtt56AzC4ZaffQuh88TZurBGhIJMBZGSxNerQ= google.golang.org/protobuf v1.36.0/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= -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/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= -gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= -gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= 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/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -3482,13 +2563,10 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= -grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o= -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-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -3564,5 +2642,3 @@ rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= -sourcegraph.com/sourcegraph/go-diff v0.5.0/go.mod h1:kuch7UrkMzY0X+p9CRK03kfuPQ2zzQcaEFbx8wA8rck= -sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0= diff --git a/x/did/types/internal/accounts/api_builder.go b/internal/accounts/api_builder.go similarity index 98% rename from x/did/types/internal/accounts/api_builder.go rename to internal/accounts/api_builder.go index b648f7d45..b799d24b1 100644 --- a/x/did/types/internal/accounts/api_builder.go +++ b/internal/accounts/api_builder.go @@ -5,7 +5,7 @@ import ( "errors" "fmt" - "github.com/onsonr/sonr/internal/chain/transaction" + "github.com/onsonr/sonr/internal/transaction" ) var ( diff --git a/x/did/types/internal/accounts/context.go b/internal/accounts/context.go similarity index 97% rename from x/did/types/internal/accounts/context.go rename to internal/accounts/context.go index 3a815791d..2586b6e04 100644 --- a/x/did/types/internal/accounts/context.go +++ b/internal/accounts/context.go @@ -8,8 +8,8 @@ import ( "cosmossdk.io/core/store" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/onsonr/sonr/internal/chain/transaction" - "github.com/onsonr/sonr/x/did/types/internal/prefixstore" + "github.com/onsonr/sonr/internal/prefixstore" + "github.com/onsonr/sonr/internal/transaction" ) var AccountStatePrefix = collections.NewPrefix(255) diff --git a/x/did/types/internal/accounts/encoding.go b/internal/accounts/encoding.go similarity index 96% rename from x/did/types/internal/accounts/encoding.go rename to internal/accounts/encoding.go index 58cedd0f2..78af65fee 100644 --- a/x/did/types/internal/accounts/encoding.go +++ b/internal/accounts/encoding.go @@ -8,7 +8,7 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/gogoproto/proto" - "github.com/onsonr/sonr/internal/chain/transaction" + "github.com/onsonr/sonr/internal/transaction" ) // ProtoMsgG is a generic interface for protobuf messages. diff --git a/x/did/types/internal/accounts/implementation.go b/internal/accounts/implementation.go similarity index 98% rename from x/did/types/internal/accounts/implementation.go rename to internal/accounts/implementation.go index eb4bf7260..41f1de6b6 100644 --- a/x/did/types/internal/accounts/implementation.go +++ b/internal/accounts/implementation.go @@ -9,8 +9,8 @@ import ( "github.com/cosmos/cosmos-sdk/codec" gogoproto "github.com/cosmos/gogoproto/proto" - "github.com/onsonr/sonr/internal/chain/appmodule" - "github.com/onsonr/sonr/internal/chain/transaction" + "github.com/onsonr/sonr/internal/appmodule" + "github.com/onsonr/sonr/internal/transaction" ) // Dependencies are passed to the constructor of a smart account. diff --git a/x/did/types/internal/accounts/interface.go b/internal/accounts/interface.go similarity index 100% rename from x/did/types/internal/accounts/interface.go rename to internal/accounts/interface.go diff --git a/x/did/types/internal/accounts/protoaccount.go b/internal/accounts/protoaccount.go similarity index 97% rename from x/did/types/internal/accounts/protoaccount.go rename to internal/accounts/protoaccount.go index 5361d2c3b..ee947d4ee 100644 --- a/x/did/types/internal/accounts/protoaccount.go +++ b/internal/accounts/protoaccount.go @@ -6,7 +6,7 @@ import ( "google.golang.org/protobuf/proto" - "github.com/onsonr/sonr/internal/chain/transaction" + "github.com/onsonr/sonr/internal/transaction" ) // RegisterInitHandler registers an initialisation handler for a smart account that uses protobuf. diff --git a/x/did/types/address/bip32.go b/internal/address/bip32.go similarity index 100% rename from x/did/types/address/bip32.go rename to internal/address/bip32.go diff --git a/x/did/types/address/codec.go b/internal/address/codec.go similarity index 100% rename from x/did/types/address/codec.go rename to internal/address/codec.go diff --git a/internal/chain/appmodule/environment.go b/internal/appmodule/environment.go similarity index 77% rename from internal/chain/appmodule/environment.go rename to internal/appmodule/environment.go index 99785f4b9..6e1ac5819 100644 --- a/internal/chain/appmodule/environment.go +++ b/internal/appmodule/environment.go @@ -6,10 +6,10 @@ import ( "cosmossdk.io/core/header" "cosmossdk.io/core/store" - "github.com/onsonr/sonr/internal/chain/branch" - "github.com/onsonr/sonr/internal/chain/log" - "github.com/onsonr/sonr/internal/chain/router" - "github.com/onsonr/sonr/internal/chain/transaction" + "github.com/onsonr/sonr/internal/branch" + "github.com/onsonr/sonr/internal/log" + "github.com/onsonr/sonr/internal/router" + "github.com/onsonr/sonr/internal/transaction" ) // Environment is used to get all services to their respective module. diff --git a/internal/chain/branch/branch.go b/internal/branch/branch.go similarity index 100% rename from internal/chain/branch/branch.go rename to internal/branch/branch.go diff --git a/internal/chain/README.md b/internal/chain/README.md deleted file mode 100644 index 3b616f93d..000000000 --- a/internal/chain/README.md +++ /dev/null @@ -1 +0,0 @@ -# Core diff --git a/internal/common/chain_query.go b/internal/common/chain_query.go deleted file mode 100644 index ae4409c0e..000000000 --- a/internal/common/chain_query.go +++ /dev/null @@ -1,80 +0,0 @@ -package common - -import ( - bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" - nodev1beta1 "github.com/cosmos/cosmos-sdk/client/grpc/node" - didv1 "github.com/onsonr/sonr/api/did/v1" - dwnv1 "github.com/onsonr/sonr/api/dwn/v1" - svcv1 "github.com/onsonr/sonr/api/svc/v1" - "google.golang.org/grpc" -) - -type ( - StatusResponse = nodev1beta1.StatusResponse // StatusResponse is the response type for the Service.Status RPC method. - StatusRequest = nodev1beta1.StatusRequest // StatusRequest is the request type for the Service.Status RPC method. - BalanceRequest = bankv1beta1.QueryBalanceRequest // BalanceRequest is the request type for the Bank.Balance RPC method. - BalanceResponse = bankv1beta1.QueryBalanceResponse // BalanceResponse is the response type for the Bank.Balance RPC method. - AllBalancesRequest = bankv1beta1.QueryAllBalancesRequest // AllBalancesRequest is the request type for the Bank.AllBalances RPC method. - AllBalancesResponse = bankv1beta1.QueryAllBalancesResponse // AllBalancesResponse is the response type for the Bank.AllBalances RPC method. - TotalSupplyRequest = bankv1beta1.QueryTotalSupplyRequest // TotalSupplyRequest is the request type for the Bank.TotalSupply RPC method. - TotalSupplyResponse = bankv1beta1.QueryTotalSupplyResponse // TotalSupplyResponse is the response type for the Bank.TotalSupply RPC method. - DenomMetadataRequest = bankv1beta1.QueryDenomMetadataRequest // DenomMetadataRequest is the request type for the Bank.DenomMetadata RPC method. - DenomMetadataResponse = bankv1beta1.QueryDenomMetadataResponse // DenomMetadataResponse is the response type for the Bank.DenomMetadata RPC method. - BankParamsRequest = bankv1beta1.QueryParamsRequest // BankParamsRequest is the request type for the Bank.Params RPC method. - BankParamsResponse = bankv1beta1.QueryParamsResponse // BankParamsResponse is the response type for the Bank.Params RPC method. - DIDParamsRequest = didv1.QueryRequest // DIDParamsRequest is the request type for the DID.Params RPC method. - DIDParamsResponse = didv1.QueryParamsResponse // DIDParamsResponse is the response type for the DID.Params RPC method. - DIDResolveResponse = didv1.QueryResolveResponse // DIDResolveResponse is the response type for the DID.Resolve RPC method. - DWNParamsRequest = dwnv1.QueryParamsRequest // DWNParamsRequest is the request type for the DWN.Params RPC method. - DWNParamsResponse = dwnv1.QueryParamsResponse // DWNParamsResponse is the response type for the DWN.Params RPC method. - SVCParamsRequest = svcv1.QueryParamsRequest // SVCParamsRequest is the request type for the SVC.Params RPC method. - SVCParamsResponse = svcv1.QueryParamsResponse // SVCParamsResponse is the response type for the SVC.Params RPC method. -) - -func conn(addr string) (*grpc.ClientConn, error) { - grpcConn, err := grpc.NewClient(addr, grpc.WithInsecure()) - if err != nil { - return nil, err - } - return grpcConn, nil -} - -func NewBankClient(addr string) (bankv1beta1.QueryClient, error) { - conn, err := conn(addr) - if err != nil { - return nil, err - } - return bankv1beta1.NewQueryClient(conn), nil -} - -func NewDIDClient(addr string) (didv1.QueryClient, error) { - conn, err := conn(addr) - if err != nil { - return nil, err - } - return didv1.NewQueryClient(conn), nil -} - -func NewDWNClient(addr string) (dwnv1.QueryClient, error) { - conn, err := conn(addr) - if err != nil { - return nil, err - } - return dwnv1.NewQueryClient(conn), nil -} - -func NewNodeClient(addr string) (nodev1beta1.ServiceClient, error) { - conn, err := conn(addr) - if err != nil { - return nil, err - } - return nodev1beta1.NewServiceClient(conn), nil -} - -func NewSVCClient(addr string) (svcv1.QueryClient, error) { - conn, err := conn(addr) - if err != nil { - return nil, err - } - return svcv1.NewQueryClient(conn), nil -} diff --git a/internal/common/http_cookies.go b/internal/common/http_cookies.go deleted file mode 100644 index ad7e419eb..000000000 --- a/internal/common/http_cookies.go +++ /dev/null @@ -1,124 +0,0 @@ -package common - -import ( - "encoding/base64" - "net/http" - "time" - - "github.com/labstack/echo/v4" -) - -// CookieKey is a type alias for string. -type CookieKey string - -const ( - // SessionID is the key for the session ID cookie. - SessionID CookieKey = "session.id" - - // SessionChallenge is the key for the session challenge cookie. - SessionChallenge CookieKey = "session.challenge" - - // SessionRole is the key for the session role cookie. - SessionRole CookieKey = "session.role" - - // SonrAddress is the key for the Sonr address cookie. - SonrAddress CookieKey = "sonr.address" - - // SonrDID is the key for the Sonr DID cookie. - SonrDID CookieKey = "sonr.did" - - // UserAvatar is the key for the User Avatar cookie. - UserAvatar CookieKey = "user.avatar" - - // UserHandle is the key for the User Handle cookie. - UserHandle CookieKey = "user.handle" - - // UserName is the key for the User Name cookie. - UserName CookieKey = "user.full_name" - - // VaultAddress is the key for the Vault address cookie. - VaultAddress CookieKey = "vault.address" - - // VaultCID is the key for the Vault CID cookie. - VaultCID CookieKey = "vault.cid" - - // VaultSchema is the key for the Vault schema cookie. - VaultSchema CookieKey = "vault.schema" -) - -// String returns the string representation of the CookieKey. -func (c CookieKey) String() string { - return string(c) -} - -// ╭───────────────────────────────────────────────────────────╮ -// │ Utility Methods │ -// ╰───────────────────────────────────────────────────────────╯ - -func CookieExists(c echo.Context, key CookieKey) bool { - ck, err := c.Cookie(key.String()) - if err != nil { - return false - } - return ck != nil -} - -func ReadCookie(c echo.Context, key CookieKey) (string, error) { - cookie, err := c.Cookie(key.String()) - if err != nil { - // Cookie not found or other error - return "", err - } - if cookie == nil || cookie.Value == "" { - // Cookie is empty - return "", http.ErrNoCookie - } - return cookie.Value, nil -} - -func ReadCookieBytes(c echo.Context, key CookieKey) ([]byte, error) { - cookie, err := c.Cookie(key.String()) - if err != nil { - // Cookie not found or other error - return nil, err - } - if cookie == nil || cookie.Value == "" { - // Cookie is empty - return nil, http.ErrNoCookie - } - return base64.RawURLEncoding.DecodeString(cookie.Value) -} - -func ReadCookieUnsafe(c echo.Context, key CookieKey) string { - ck, err := c.Cookie(key.String()) - if err != nil { - return "" - } - return ck.Value -} - -func WriteCookie(c echo.Context, key CookieKey, value string) error { - cookie := &http.Cookie{ - Name: key.String(), - Value: value, - Expires: time.Now().Add(24 * time.Hour), - HttpOnly: true, - Path: "/", - // Add Secure and SameSite attributes as needed - } - c.SetCookie(cookie) - return nil -} - -func WriteCookieBytes(c echo.Context, key CookieKey, value []byte) error { - cookie := &http.Cookie{ - Name: key.String(), - Value: base64.RawURLEncoding.EncodeToString(value), - Expires: time.Now().Add(24 * time.Hour), - HttpOnly: true, - Path: "/", - // Add Secure and SameSite attributes as needed - } - c.SetCookie(cookie) - return nil -} diff --git a/internal/common/http_headers.go b/internal/common/http_headers.go deleted file mode 100644 index 68de391be..000000000 --- a/internal/common/http_headers.go +++ /dev/null @@ -1,52 +0,0 @@ -package common - -import "github.com/labstack/echo/v4" - -type HeaderKey string - -const ( - Authorization HeaderKey = "Authorization" - - // User Agent - Architecture HeaderKey = "Sec-CH-UA-Arch" - Bitness HeaderKey = "Sec-CH-UA-Bitness" - FullVersionList HeaderKey = "Sec-CH-UA-Full-Version-List" - Mobile HeaderKey = "Sec-CH-UA-Mobile" - Model HeaderKey = "Sec-CH-UA-Model" - Platform HeaderKey = "Sec-CH-UA-Platform" - PlatformVersion HeaderKey = "Sec-CH-UA-Platform-Version" - UserAgent HeaderKey = "Sec-CH-UA" - - // Sonr Injected - SonrAPIURL HeaderKey = "X-Sonr-API" - SonrgRPCURL HeaderKey = "X-Sonr-GRPC" - SonrRPCURL HeaderKey = "X-Sonr-RPC" - SonrWSURL HeaderKey = "X-Sonr-WS" -) - -func (h HeaderKey) String() string { - return string(h) -} - -// ╭───────────────────────────────────────────────────────────╮ -// │ Utility Methods │ -// ╰───────────────────────────────────────────────────────────╯ - -func HeaderEquals(c echo.Context, key HeaderKey, value string) bool { - return c.Response().Header().Get(key.String()) == value -} - -// HeaderExists returns true if the request has the header Key. -func HeaderExists(c echo.Context, key HeaderKey) bool { - return c.Response().Header().Get(key.String()) != "" -} - -// HeaderRead returns the header value for the Key. -func HeaderRead(c echo.Context, key HeaderKey) string { - return c.Response().Header().Get(key.String()) -} - -// HeaderWrite sets the header value for the Key. -func HeaderWrite(c echo.Context, key HeaderKey, value string) { - c.Response().Header().Set(key.String(), value) -} diff --git a/internal/common/ipfs_api.go b/internal/common/ipfs_api.go deleted file mode 100644 index befc63ccd..000000000 --- a/internal/common/ipfs_api.go +++ /dev/null @@ -1,136 +0,0 @@ -package common - -import ( - "bytes" - "context" - "fmt" - "io" - - "github.com/ipfs/boxo/files" - "github.com/ipfs/boxo/path" - "github.com/ipfs/kubo/client/rpc" - "github.com/ipfs/kubo/core/coreiface/options" -) - -// IPFS represents a wrapper interface abstracting the localhost api -type IPFS interface { - Add(data []byte) (string, error) - AddFile(file File) (string, error) - AddFolder(folder Folder) (string, error) - Exists(cid string) (bool, error) - Get(cid string) ([]byte, error) - IsPinned(ipns string) (bool, error) - Ls(cid string) ([]string, error) - Pin(cid string, name string) error - Unpin(cid string) error -} - -type File interface { - files.File - Name() string -} - -func NewFileMap(vs []File) map[string]files.Node { - m := make(map[string]files.Node) - for _, f := range vs { - m[f.Name()] = f - } - return m -} - -type client struct { - api *rpc.HttpApi -} - -func NewIPFS() (IPFS, error) { - api, err := rpc.NewLocalApi() - if err != nil { - return nil, err - } - return &client{api: api}, nil -} - -func (c *client) Add(data []byte) (string, error) { - file := files.NewBytesFile(data) - cidFile, err := c.api.Unixfs().Add(context.Background(), file) - if err != nil { - return "", err - } - return cidFile.String(), nil -} - -func (c *client) Get(cid string) ([]byte, error) { - p, err := path.NewPath(cid) - if err != nil { - return nil, err - } - node, err := c.api.Unixfs().Get(context.Background(), p) - if err != nil { - return nil, err - } - - file, ok := node.(files.File) - if !ok { - return nil, fmt.Errorf("unexpected node type: %T", node) - } - - buf := new(bytes.Buffer) - if _, err := io.Copy(buf, file); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -func (c *client) IsPinned(ipns string) (bool, error) { - _, err := c.api.Name().Resolve(context.Background(), ipns) - if err != nil { - return false, nil - } - return true, nil -} - -func (c *client) Exists(cid string) (bool, error) { - p, err := path.NewPath(cid) - if err != nil { - return false, err - } - _, err = c.api.Block().Stat(context.Background(), p) - if err != nil { - return false, nil - } - return true, nil -} - -func (c *client) Pin(cid string, name string) error { - p, err := path.NewPath(cid) - if err != nil { - return err - } - return c.api.Pin().Add(context.Background(), p, options.Pin.Name(name)) -} - -func (c *client) Unpin(cid string) error { - p, err := path.NewPath(cid) - if err != nil { - return err - } - return c.api.Pin().Rm(context.Background(), p) -} - -func (c *client) Ls(cid string) ([]string, error) { - p, err := path.NewPath(cid) - if err != nil { - return nil, err - } - node, err := c.api.Unixfs().Ls(context.Background(), p) - if err != nil { - return nil, err - } - - var files []string - for entry := range node { - files = append(files, entry.Name) - } - return files, nil -} diff --git a/internal/common/ipfs_file.go b/internal/common/ipfs_file.go deleted file mode 100644 index e92455b5f..000000000 --- a/internal/common/ipfs_file.go +++ /dev/null @@ -1,28 +0,0 @@ -package common - -import ( - "context" - - "github.com/ipfs/boxo/files" -) - -type file struct { - files.File - name string -} - -func (f *file) Name() string { - return f.name -} - -func NewFile(name string, data []byte) File { - return &file{File: files.NewBytesFile(data), name: name} -} - -func (c *client) AddFile(file File) (string, error) { - cidFile, err := c.api.Unixfs().Add(context.Background(), file) - if err != nil { - return "", err - } - return cidFile.String(), nil -} diff --git a/internal/common/ipfs_folder.go b/internal/common/ipfs_folder.go deleted file mode 100644 index 53754258d..000000000 --- a/internal/common/ipfs_folder.go +++ /dev/null @@ -1,21 +0,0 @@ -package common - -import ( - "context" - - "github.com/ipfs/boxo/files" -) - -type Folder = files.Directory - -func NewFolder(fs ...File) Folder { - return files.NewMapDirectory(NewFileMap(fs)) -} - -func (c *client) AddFolder(folder Folder) (string, error) { - cidFile, err := c.api.Unixfs().Add(context.Background(), folder) - if err != nil { - return "", err - } - return cidFile.String(), nil -} diff --git a/internal/common/ucan_store.go b/internal/common/ucan_store.go deleted file mode 100644 index 549379226..000000000 --- a/internal/common/ucan_store.go +++ /dev/null @@ -1,142 +0,0 @@ -package common - -import ( - "context" - "fmt" - "sort" - "sync" - - "github.com/golang-jwt/jwt" - "github.com/ipfs/go-cid" - "github.com/onsonr/sonr/internal/crypto/keys" - "github.com/onsonr/sonr/internal/crypto/ucan" -) - -type IPFSTokenStore interface { - ucan.TokenStore - ResolveCIDBytes(ctx context.Context, id cid.Cid) ([]byte, error) - ResolveDIDKey(ctx context.Context, did string) (keys.DID, error) -} - -// ipfsUCANStore is a token store that uses IPFS to store tokens. It uses the memory store as a cache -// for CID strings to be used as keys for retrieving tokens. -type ipfsUCANStore struct { - sync.Mutex - ipfs IPFS - cache map[string]string -} - -// NewUCANStore creates a new IPFS-backed token store -func NewUCANStore(ipfsClient IPFS) IPFSTokenStore { - return &ipfsUCANStore{ - ipfs: ipfsClient, - cache: make(map[string]string), - } -} - -func (st *ipfsUCANStore) PutToken(ctx context.Context, key string, raw string) error { - // Validate token format - p := &jwt.Parser{ - UseJSONNumber: true, - SkipClaimsValidation: false, - } - if _, _, err := p.ParseUnverified(raw, jwt.MapClaims{}); err != nil { - return fmt.Errorf("%w: %s", ucan.ErrInvalidToken, err) - } - - // Store token in IPFS - cid, err := st.ipfs.Add([]byte(raw)) - if err != nil { - return fmt.Errorf("failed to store token in IPFS: %w", err) - } - - // Update cache - st.Lock() - defer st.Unlock() - st.cache[key] = cid - return nil -} - -func (st *ipfsUCANStore) RawToken(ctx context.Context, key string) (string, error) { - st.Lock() - cid, exists := st.cache[key] - st.Unlock() - - if !exists { - return "", ucan.ErrTokenNotFound - } - - // Retrieve token from IPFS - data, err := st.ipfs.Get(cid) - if err != nil { - return "", fmt.Errorf("failed to retrieve token from IPFS: %w", err) - } - - return string(data), nil -} - -func (st *ipfsUCANStore) DeleteToken(ctx context.Context, key string) error { - st.Lock() - defer st.Unlock() - - cid, exists := st.cache[key] - if !exists { - return ucan.ErrTokenNotFound - } - - // Unpin from IPFS - if err := st.ipfs.Unpin(cid); err != nil { - return fmt.Errorf("failed to unpin token from IPFS: %w", err) - } - - delete(st.cache, key) - return nil -} - -func (st *ipfsUCANStore) ListTokens(ctx context.Context, offset, limit int) ([]ucan.RawToken, error) { - st.Lock() - defer st.Unlock() - - tokens := make(ucan.RawTokens, 0, len(st.cache)) - for key, cid := range st.cache { - data, err := st.ipfs.Get(cid) - if err != nil { - continue // Skip invalid tokens - } - tokens = append(tokens, ucan.RawToken{ - Key: key, - Raw: string(data), - }) - } - - // Sort tokens - sort.Sort(tokens) - - // Apply pagination - if offset >= len(tokens) { - return []ucan.RawToken{}, nil - } - - end := offset + limit - if end > len(tokens) || limit <= 0 { - end = len(tokens) - } - - return tokens[offset:end], nil -} - -func (st *ipfsUCANStore) ResolveCIDBytes(ctx context.Context, id cid.Cid) ([]byte, error) { - data, err := st.ipfs.Get(id.String()) - if err != nil { - return nil, fmt.Errorf("failed to resolve CID bytes: %w", err) - } - return data, nil -} - -func (st *ipfsUCANStore) ResolveDIDKey(ctx context.Context, did string) (keys.DID, error) { - id, err := keys.Parse(did) - if err != nil { - return keys.DID{}, fmt.Errorf("failed to parse DID: %w", err) - } - return id, nil -} diff --git a/internal/config/env.go b/internal/config/env.go deleted file mode 100644 index 7f45e1360..000000000 --- a/internal/config/env.go +++ /dev/null @@ -1,46 +0,0 @@ -package config - -import ( - "context" - - "github.com/apple/pkl-go/pkl" - hwayconfig "github.com/onsonr/sonr/internal/config/hway" -) - -// LoadFromBytes loads the environment from the given bytes -func LoadHwayFromBytes(data []byte) (hwayconfig.Hway, error) { - text := string(data) - return LoadHwayFromString(text) -} - -// LoadFromString loads the environment from the given string -func LoadHwayFromString(text string) (hwayconfig.Hway, error) { - evaluator, err := pkl.NewEvaluator(context.Background(), pkl.PreconfiguredOptions) - if err != nil { - return nil, err - } - defer func() { - cerr := evaluator.Close() - if err == nil { - err = cerr - } - }() - ret, err := hwayconfig.Load(context.Background(), evaluator, pkl.TextSource(text)) - return ret, err -} - -// LoadFromURL loads the environment from the given URL -func LoadFromURL(url string) (hwayconfig.Hway, error) { - evaluator, err := pkl.NewEvaluator(context.Background(), pkl.PreconfiguredOptions) - if err != nil { - return nil, err - } - defer func() { - cerr := evaluator.Close() - if err == nil { - err = cerr - } - }() - ret, err := hwayconfig.Load(context.Background(), evaluator, pkl.UriSource(url)) - return ret, err -} diff --git a/internal/config/hway/Hway.pkl.go b/internal/config/hway/Hway.pkl.go deleted file mode 100644 index c3e46fa37..000000000 --- a/internal/config/hway/Hway.pkl.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated from Pkl module `sonr.net.Hway`. DO NOT EDIT. -package hway - -import ( - "context" - - "github.com/apple/pkl-go/pkl" -) - -type Hway interface { - GetServePort() int - - GetSqliteFile() string - - GetChainId() string - - GetIpfsGatewayUrl() string - - GetSonrApiUrl() string - - GetSonrGrpcUrl() string - - GetSonrRpcUrl() string - - GetPsqlDSN() string - - GetTurnstileSiteKey() string -} - -var _ Hway = (*HwayImpl)(nil) - -type HwayImpl struct { - ServePort int `pkl:"servePort"` - - SqliteFile string `pkl:"sqliteFile"` - - ChainId string `pkl:"chainId"` - - IpfsGatewayUrl string `pkl:"ipfsGatewayUrl"` - - SonrApiUrl string `pkl:"sonrApiUrl"` - - SonrGrpcUrl string `pkl:"sonrGrpcUrl"` - - SonrRpcUrl string `pkl:"sonrRpcUrl"` - - PsqlDSN string `pkl:"psqlDSN"` - - TurnstileSiteKey string `pkl:"turnstileSiteKey"` -} - -func (rcv *HwayImpl) GetServePort() int { - return rcv.ServePort -} - -func (rcv *HwayImpl) GetSqliteFile() string { - return rcv.SqliteFile -} - -func (rcv *HwayImpl) GetChainId() string { - return rcv.ChainId -} - -func (rcv *HwayImpl) GetIpfsGatewayUrl() string { - return rcv.IpfsGatewayUrl -} - -func (rcv *HwayImpl) GetSonrApiUrl() string { - return rcv.SonrApiUrl -} - -func (rcv *HwayImpl) GetSonrGrpcUrl() string { - return rcv.SonrGrpcUrl -} - -func (rcv *HwayImpl) GetSonrRpcUrl() string { - return rcv.SonrRpcUrl -} - -func (rcv *HwayImpl) GetPsqlDSN() string { - return rcv.PsqlDSN -} - -func (rcv *HwayImpl) GetTurnstileSiteKey() string { - return rcv.TurnstileSiteKey -} - -// LoadFromPath loads the pkl module at the given path and evaluates it into a Hway -func LoadFromPath(ctx context.Context, path string) (ret Hway, err error) { - evaluator, err := pkl.NewEvaluator(ctx, pkl.PreconfiguredOptions) - if err != nil { - return nil, err - } - defer func() { - cerr := evaluator.Close() - if err == nil { - err = cerr - } - }() - ret, err = Load(ctx, evaluator, pkl.FileSource(path)) - return ret, err -} - -// Load loads the pkl module at the given source and evaluates it with the given evaluator into a Hway -func Load(ctx context.Context, evaluator pkl.Evaluator, source *pkl.ModuleSource) (Hway, error) { - var ret HwayImpl - if err := evaluator.EvaluateModule(ctx, source, &ret); err != nil { - return nil, err - } - return &ret, nil -} diff --git a/internal/config/hway/init.pkl.go b/internal/config/hway/init.pkl.go deleted file mode 100644 index f8e5b2d88..000000000 --- a/internal/config/hway/init.pkl.go +++ /dev/null @@ -1,8 +0,0 @@ -// Code generated from Pkl module `sonr.net.Hway`. DO NOT EDIT. -package hway - -import "github.com/apple/pkl-go/pkl" - -func init() { - pkl.RegisterMapping("sonr.net.Hway", HwayImpl{}) -} diff --git a/internal/config/motr/Config.pkl.go b/internal/config/motr/Config.pkl.go deleted file mode 100644 index f6a6e3735..000000000 --- a/internal/config/motr/Config.pkl.go +++ /dev/null @@ -1,16 +0,0 @@ -// Code generated from Pkl module `sonr.net.Motr`. DO NOT EDIT. -package motr - -type Config struct { - IpfsGatewayUrl string `pkl:"ipfsGatewayUrl" json:"ipfsGatewayUrl,omitempty"` - - MotrToken string `pkl:"motrToken" json:"motrToken,omitempty"` - - MotrAddress string `pkl:"motrAddress" json:"motrAddress,omitempty"` - - SonrApiUrl string `pkl:"sonrApiUrl" json:"sonrApiUrl,omitempty"` - - SonrRpcUrl string `pkl:"sonrRpcUrl" json:"sonrRpcUrl,omitempty"` - - SonrChainId string `pkl:"sonrChainId" json:"sonrChainId,omitempty"` -} diff --git a/internal/config/motr/Environment.pkl.go b/internal/config/motr/Environment.pkl.go deleted file mode 100644 index 8235f7724..000000000 --- a/internal/config/motr/Environment.pkl.go +++ /dev/null @@ -1,14 +0,0 @@ -// Code generated from Pkl module `sonr.net.Motr`. DO NOT EDIT. -package motr - -type Environment struct { - IsDevelopment bool `pkl:"isDevelopment" json:"isDevelopment,omitempty"` - - CacheVersion string `pkl:"cacheVersion" json:"cacheVersion,omitempty"` - - HttpserverPath string `pkl:"httpserverPath" json:"httpserverPath,omitempty"` - - WasmExecPath string `pkl:"wasmExecPath" json:"wasmExecPath,omitempty"` - - WasmPath string `pkl:"wasmPath" json:"wasmPath,omitempty"` -} diff --git a/internal/config/motr/Motr.pkl.go b/internal/config/motr/Motr.pkl.go deleted file mode 100644 index 5aeb64bf0..000000000 --- a/internal/config/motr/Motr.pkl.go +++ /dev/null @@ -1,36 +0,0 @@ -// Code generated from Pkl module `sonr.net.Motr`. DO NOT EDIT. -package motr - -import ( - "context" - - "github.com/apple/pkl-go/pkl" -) - -type Motr struct { -} - -// LoadFromPath loads the pkl module at the given path and evaluates it into a Motr -func LoadFromPath(ctx context.Context, path string) (ret *Motr, err error) { - evaluator, err := pkl.NewEvaluator(ctx, pkl.PreconfiguredOptions) - if err != nil { - return nil, err - } - defer func() { - cerr := evaluator.Close() - if err == nil { - err = cerr - } - }() - ret, err = Load(ctx, evaluator, pkl.FileSource(path)) - return ret, err -} - -// Load loads the pkl module at the given source and evaluates it with the given evaluator into a Motr -func Load(ctx context.Context, evaluator pkl.Evaluator, source *pkl.ModuleSource) (*Motr, error) { - var ret Motr - if err := evaluator.EvaluateModule(ctx, source, &ret); err != nil { - return nil, err - } - return &ret, nil -} diff --git a/internal/config/motr/init.pkl.go b/internal/config/motr/init.pkl.go deleted file mode 100644 index 9c55d885e..000000000 --- a/internal/config/motr/init.pkl.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated from Pkl module `sonr.net.Motr`. DO NOT EDIT. -package motr - -import "github.com/apple/pkl-go/pkl" - -func init() { - pkl.RegisterMapping("sonr.net.Motr", Motr{}) - pkl.RegisterMapping("sonr.net.Motr#Config", Config{}) -} diff --git a/internal/crypto/ucan/attns/UCAN.pkl.go b/internal/crypto/ucan/attns/UCAN.pkl.go deleted file mode 100644 index e11a05ce6..000000000 --- a/internal/crypto/ucan/attns/UCAN.pkl.go +++ /dev/null @@ -1,36 +0,0 @@ -// Code generated from Pkl module `sonr.orm.UCAN`. DO NOT EDIT. -package attns - -import ( - "context" - - "github.com/apple/pkl-go/pkl" -) - -type UCAN struct { -} - -// LoadFromPath loads the pkl module at the given path and evaluates it into a UCAN -func LoadFromPath(ctx context.Context, path string) (ret *UCAN, err error) { - evaluator, err := pkl.NewEvaluator(ctx, pkl.PreconfiguredOptions) - if err != nil { - return nil, err - } - defer func() { - cerr := evaluator.Close() - if err == nil { - err = cerr - } - }() - ret, err = Load(ctx, evaluator, pkl.FileSource(path)) - return ret, err -} - -// Load loads the pkl module at the given source and evaluates it with the given evaluator into a UCAN -func Load(ctx context.Context, evaluator pkl.Evaluator, source *pkl.ModuleSource) (*UCAN, error) { - var ret UCAN - if err := evaluator.EvaluateModule(ctx, source, &ret); err != nil { - return nil, err - } - return &ret, nil -} diff --git a/internal/crypto/ucan/attns/capaccount/CapAccount.pkl.go b/internal/crypto/ucan/attns/capaccount/CapAccount.pkl.go deleted file mode 100644 index fdaff7e0f..000000000 --- a/internal/crypto/ucan/attns/capaccount/CapAccount.pkl.go +++ /dev/null @@ -1,49 +0,0 @@ -// Code generated from Pkl module `sonr.orm.UCAN`. DO NOT EDIT. -package capaccount - -import ( - "encoding" - "fmt" -) - -type CapAccount string - -const ( - ExecBroadcast CapAccount = "exec/broadcast" - ExecQuery CapAccount = "exec/query" - ExecSimulate CapAccount = "exec/simulate" - ExecVote CapAccount = "exec/vote" - ExecDelegate CapAccount = "exec/delegate" - ExecInvoke CapAccount = "exec/invoke" - ExecSend CapAccount = "exec/send" -) - -// String returns the string representation of CapAccount -func (rcv CapAccount) String() string { - return string(rcv) -} - -var _ encoding.BinaryUnmarshaler = new(CapAccount) - -// UnmarshalBinary implements encoding.BinaryUnmarshaler for CapAccount. -func (rcv *CapAccount) UnmarshalBinary(data []byte) error { - switch str := string(data); str { - case "exec/broadcast": - *rcv = ExecBroadcast - case "exec/query": - *rcv = ExecQuery - case "exec/simulate": - *rcv = ExecSimulate - case "exec/vote": - *rcv = ExecVote - case "exec/delegate": - *rcv = ExecDelegate - case "exec/invoke": - *rcv = ExecInvoke - case "exec/send": - *rcv = ExecSend - default: - return fmt.Errorf(`illegal: "%s" is not a valid CapAccount`, str) - } - return nil -} diff --git a/internal/crypto/ucan/attns/capaccount/caps.go b/internal/crypto/ucan/attns/capaccount/caps.go deleted file mode 100644 index 18fd50cb4..000000000 --- a/internal/crypto/ucan/attns/capaccount/caps.go +++ /dev/null @@ -1,11 +0,0 @@ -package capaccount - -import "github.com/onsonr/sonr/internal/crypto/ucan" - -func NewCap(ty CapAccount) ucan.Capability { - return ucan.Capability(ty) -} - -func (c CapAccount) Contains(b ucan.Capability) bool { - return c.String() == b.String() -} diff --git a/internal/crypto/ucan/attns/capinterchain/CapInterchain.pkl.go b/internal/crypto/ucan/attns/capinterchain/CapInterchain.pkl.go deleted file mode 100644 index 4048860cc..000000000 --- a/internal/crypto/ucan/attns/capinterchain/CapInterchain.pkl.go +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated from Pkl module `sonr.orm.UCAN`. DO NOT EDIT. -package capinterchain - -import ( - "encoding" - "fmt" -) - -type CapInterchain string - -const ( - TransferSwap CapInterchain = "transfer/swap" - TransferSend CapInterchain = "transfer/send" - TransferAtomic CapInterchain = "transfer/atomic" - TransferBatch CapInterchain = "transfer/batch" - TransferP2p CapInterchain = "transfer/p2p" -) - -// String returns the string representation of CapInterchain -func (rcv CapInterchain) String() string { - return string(rcv) -} - -var _ encoding.BinaryUnmarshaler = new(CapInterchain) - -// UnmarshalBinary implements encoding.BinaryUnmarshaler for CapInterchain. -func (rcv *CapInterchain) UnmarshalBinary(data []byte) error { - switch str := string(data); str { - case "transfer/swap": - *rcv = TransferSwap - case "transfer/send": - *rcv = TransferSend - case "transfer/atomic": - *rcv = TransferAtomic - case "transfer/batch": - *rcv = TransferBatch - case "transfer/p2p": - *rcv = TransferP2p - default: - return fmt.Errorf(`illegal: "%s" is not a valid CapInterchain`, str) - } - return nil -} diff --git a/internal/crypto/ucan/attns/capinterchain/caps.go b/internal/crypto/ucan/attns/capinterchain/caps.go deleted file mode 100644 index adc4f63a4..000000000 --- a/internal/crypto/ucan/attns/capinterchain/caps.go +++ /dev/null @@ -1,11 +0,0 @@ -package capinterchain - -import "github.com/onsonr/sonr/internal/crypto/ucan" - -func NewCap(ty CapInterchain) ucan.Capability { - return ucan.Capability(ty) -} - -func (c CapInterchain) Contains(b ucan.Capability) bool { - return c.String() == b.String() -} diff --git a/internal/crypto/ucan/attns/capvault/CapVault.pkl.go b/internal/crypto/ucan/attns/capvault/CapVault.pkl.go deleted file mode 100644 index 6c2c53e8e..000000000 --- a/internal/crypto/ucan/attns/capvault/CapVault.pkl.go +++ /dev/null @@ -1,49 +0,0 @@ -// Code generated from Pkl module `sonr.orm.UCAN`. DO NOT EDIT. -package capvault - -import ( - "encoding" - "fmt" -) - -type CapVault string - -const ( - CrudAsset CapVault = "crud/asset" - CrudAuthzgrant CapVault = "crud/authzgrant" - CrudProfile CapVault = "crud/profile" - CrudRecord CapVault = "crud/record" - UseRecovery CapVault = "use/recovery" - UseSync CapVault = "use/sync" - UseSigner CapVault = "use/signer" -) - -// String returns the string representation of CapVault -func (rcv CapVault) String() string { - return string(rcv) -} - -var _ encoding.BinaryUnmarshaler = new(CapVault) - -// UnmarshalBinary implements encoding.BinaryUnmarshaler for CapVault. -func (rcv *CapVault) UnmarshalBinary(data []byte) error { - switch str := string(data); str { - case "crud/asset": - *rcv = CrudAsset - case "crud/authzgrant": - *rcv = CrudAuthzgrant - case "crud/profile": - *rcv = CrudProfile - case "crud/record": - *rcv = CrudRecord - case "use/recovery": - *rcv = UseRecovery - case "use/sync": - *rcv = UseSync - case "use/signer": - *rcv = UseSigner - default: - return fmt.Errorf(`illegal: "%s" is not a valid CapVault`, str) - } - return nil -} diff --git a/internal/crypto/ucan/attns/capvault/caps.go b/internal/crypto/ucan/attns/capvault/caps.go deleted file mode 100644 index efd873be7..000000000 --- a/internal/crypto/ucan/attns/capvault/caps.go +++ /dev/null @@ -1,11 +0,0 @@ -package capvault - -import "github.com/onsonr/sonr/internal/crypto/ucan" - -func NewCap(ty CapVault) ucan.Capability { - return ucan.Capability(ty) -} - -func (c CapVault) Contains(b ucan.Capability) bool { - return c.String() == b.String() -} diff --git a/internal/crypto/ucan/attns/exports.go b/internal/crypto/ucan/attns/exports.go deleted file mode 100644 index 5beb2ca17..000000000 --- a/internal/crypto/ucan/attns/exports.go +++ /dev/null @@ -1,114 +0,0 @@ -// Package attns implements the UCAN resource and capability types -package attns - -import ( - "github.com/onsonr/sonr/internal/crypto/ucan" - "github.com/onsonr/sonr/internal/crypto/ucan/attns/capaccount" - "github.com/onsonr/sonr/internal/crypto/ucan/attns/capinterchain" - "github.com/onsonr/sonr/internal/crypto/ucan/attns/capvault" - "github.com/onsonr/sonr/internal/crypto/ucan/attns/resaccount" - "github.com/onsonr/sonr/internal/crypto/ucan/attns/resinterchain" - "github.com/onsonr/sonr/internal/crypto/ucan/attns/resvault" -) - -// Capability hierarchy for sonr network -// ------------------------------------- -// VAULT (DWN) -// -// └─ CRUD/ASSET -// └─ CRUD/AUTHZGRANT -// └─ CRUD/PROFILE -// └─ CRUD/RECORD -// └─ USE/RECOVERY -// └─ USE/SYNC -// └─ USE/SIGNER -// -// ACCOUNT (DID) -// -// └─ EXEC/BROADCAST -// └─ EXEC/QUERY -// └─ EXEC/SIMULATE -// └─ EXEC/VOTE -// └─ EXEC/DELEGATE -// └─ EXEC/INVOKE -// └─ EXEC/SEND -// -// INTERCHAIN -// -// └─ TRANSFER/SWAP -// └─ TRANSFER/SEND -// └─ TRANSFER/ATOMIC -// └─ TRANSFER/BATCH -// └─ TRANSFER/P2P -// └─ TRANSFER/SEND - -type Capability string - -const ( - CapExecBroadcast = capaccount.ExecBroadcast - CapExecQuery = capaccount.ExecQuery - CapExecSimulate = capaccount.ExecSimulate - CapExecVote = capaccount.ExecVote - CapExecDelegate = capaccount.ExecDelegate - CapExecInvoke = capaccount.ExecInvoke - CapExecSend = capaccount.ExecSend - - CapTransferSwap = capinterchain.TransferSwap - CapTransferSend = capinterchain.TransferSend - CapTransferAtomic = capinterchain.TransferAtomic - CapTransferBatch = capinterchain.TransferBatch - CapTransferP2P = capinterchain.TransferP2p - - CapCrudAsset = capvault.CrudAsset - CapCrudAuthzgrant = capvault.CrudAuthzgrant - CapCrudProfile = capvault.CrudProfile - CapCrudRecord = capvault.CrudRecord - CapUseRecovery = capvault.UseRecovery - CapUseSync = capvault.UseSync - CapUseSigner = capvault.UseSigner -) - -type NewCapFunc func(string) ucan.Capability - -type BuildResourceFunc func(string, string) ucan.Resource - -func CreateArray(attns ...ucan.Attenuation) ucan.Attenuations { - return ucan.Attenuations(attns) -} - -func New(cap ucan.Capability, rsc ucan.Resource) ucan.Attenuation { - return ucan.Attenuation{ - Cap: cap, - Rsc: rsc, - } -} - -// NewAccountCap creates a new account capability -func NewAccountCap(ty capaccount.CapAccount) ucan.Capability { - return capaccount.NewCap(ty) -} - -// NewInterchainCap creates a new interchain capability -func NewInterchainCap(ty capinterchain.CapInterchain) ucan.Capability { - return capinterchain.NewCap(ty) -} - -// NewVaultCap creates a new vault capability -func NewVaultCap(ty capvault.CapVault) ucan.Capability { - return capvault.NewCap(ty) -} - -// BuildAccountResource creates a new account resource -func BuildAccountResource(ty resaccount.ResAccount, value string) ucan.Resource { - return resaccount.Build(ty, value) -} - -// BuildInterchainResource creates a new interchain resource -func BuildInterchainResource(ty resinterchain.ResInterchain, value string) ucan.Resource { - return resinterchain.Build(ty, value) -} - -// BuildVaultResource creates a new vault resource -func BuildVaultResource(ty resvault.ResVault, value string) ucan.Resource { - return resvault.Build(ty, value) -} diff --git a/internal/crypto/ucan/attns/init.pkl.go b/internal/crypto/ucan/attns/init.pkl.go deleted file mode 100644 index 931f6989d..000000000 --- a/internal/crypto/ucan/attns/init.pkl.go +++ /dev/null @@ -1,8 +0,0 @@ -// Code generated from Pkl module `sonr.orm.UCAN`. DO NOT EDIT. -package attns - -import "github.com/apple/pkl-go/pkl" - -func init() { - pkl.RegisterMapping("sonr.orm.UCAN", UCAN{}) -} diff --git a/internal/crypto/ucan/attns/resaccount/ResAccount.pkl.go b/internal/crypto/ucan/attns/resaccount/ResAccount.pkl.go deleted file mode 100644 index 29d8aa24c..000000000 --- a/internal/crypto/ucan/attns/resaccount/ResAccount.pkl.go +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated from Pkl module `sonr.orm.UCAN`. DO NOT EDIT. -package resaccount - -import ( - "encoding" - "fmt" -) - -type ResAccount string - -const ( - AccSequence ResAccount = "acc/sequence" - AccNumber ResAccount = "acc/number" - ChainId ResAccount = "chain/id" - AssetCode ResAccount = "asset/code" - AuthzGrant ResAccount = "authz/grant" -) - -// String returns the string representation of ResAccount -func (rcv ResAccount) String() string { - return string(rcv) -} - -var _ encoding.BinaryUnmarshaler = new(ResAccount) - -// UnmarshalBinary implements encoding.BinaryUnmarshaler for ResAccount. -func (rcv *ResAccount) UnmarshalBinary(data []byte) error { - switch str := string(data); str { - case "acc/sequence": - *rcv = AccSequence - case "acc/number": - *rcv = AccNumber - case "chain/id": - *rcv = ChainId - case "asset/code": - *rcv = AssetCode - case "authz/grant": - *rcv = AuthzGrant - default: - return fmt.Errorf(`illegal: "%s" is not a valid ResAccount`, str) - } - return nil -} diff --git a/internal/crypto/ucan/attns/resaccount/resource.go b/internal/crypto/ucan/attns/resaccount/resource.go deleted file mode 100644 index b05c99b28..000000000 --- a/internal/crypto/ucan/attns/resaccount/resource.go +++ /dev/null @@ -1,33 +0,0 @@ -package resaccount - -import "github.com/onsonr/sonr/internal/crypto/ucan" - -func Build(ty ResAccount, value string) ucan.Resource { - return newStringLengthResource(ty.String(), value) -} - -type stringLengthRsc struct { - t string - v string -} - -// NewStringLengthResource is a silly implementation of resource to use while -// I figure out what an OR filter on strings is. Don't use this. -func newStringLengthResource(typ, val string) ucan.Resource { - return stringLengthRsc{ - t: typ, - v: val, - } -} - -func (r stringLengthRsc) Type() string { - return r.t -} - -func (r stringLengthRsc) Value() string { - return r.v -} - -func (r stringLengthRsc) Contains(b ucan.Resource) bool { - return r.Type() == b.Type() && len(r.Value()) <= len(b.Value()) -} diff --git a/internal/crypto/ucan/attns/resinterchain/ResInterchain.pkl.go b/internal/crypto/ucan/attns/resinterchain/ResInterchain.pkl.go deleted file mode 100644 index 4d16806e6..000000000 --- a/internal/crypto/ucan/attns/resinterchain/ResInterchain.pkl.go +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated from Pkl module `sonr.orm.UCAN`. DO NOT EDIT. -package resinterchain - -import ( - "encoding" - "fmt" -) - -type ResInterchain string - -const ( - ChannnelPort ResInterchain = "channnel/port" - ChainId ResInterchain = "chain/id" - ChainName ResInterchain = "chain/name" - AccHost ResInterchain = "acc/host" - AccController ResInterchain = "acc/controller" -) - -// String returns the string representation of ResInterchain -func (rcv ResInterchain) String() string { - return string(rcv) -} - -var _ encoding.BinaryUnmarshaler = new(ResInterchain) - -// UnmarshalBinary implements encoding.BinaryUnmarshaler for ResInterchain. -func (rcv *ResInterchain) UnmarshalBinary(data []byte) error { - switch str := string(data); str { - case "channnel/port": - *rcv = ChannnelPort - case "chain/id": - *rcv = ChainId - case "chain/name": - *rcv = ChainName - case "acc/host": - *rcv = AccHost - case "acc/controller": - *rcv = AccController - default: - return fmt.Errorf(`illegal: "%s" is not a valid ResInterchain`, str) - } - return nil -} diff --git a/internal/crypto/ucan/attns/resinterchain/resource.go b/internal/crypto/ucan/attns/resinterchain/resource.go deleted file mode 100644 index 3d35223d8..000000000 --- a/internal/crypto/ucan/attns/resinterchain/resource.go +++ /dev/null @@ -1,33 +0,0 @@ -package resinterchain - -import "github.com/onsonr/sonr/internal/crypto/ucan" - -func Build(ty ResInterchain, value string) ucan.Resource { - return newStringLengthResource(ty.String(), value) -} - -type stringLengthRsc struct { - t string - v string -} - -// NewStringLengthResource is a silly implementation of resource to use while -// I figure out what an OR filter on strings is. Don't use this. -func newStringLengthResource(typ, val string) ucan.Resource { - return stringLengthRsc{ - t: typ, - v: val, - } -} - -func (r stringLengthRsc) Type() string { - return r.t -} - -func (r stringLengthRsc) Value() string { - return r.v -} - -func (r stringLengthRsc) Contains(b ucan.Resource) bool { - return r.Type() == b.Type() && len(r.Value()) <= len(b.Value()) -} diff --git a/internal/crypto/ucan/attns/resvault/ResVault.pkl.go b/internal/crypto/ucan/attns/resvault/ResVault.pkl.go deleted file mode 100644 index f70518245..000000000 --- a/internal/crypto/ucan/attns/resvault/ResVault.pkl.go +++ /dev/null @@ -1,46 +0,0 @@ -// Code generated from Pkl module `sonr.orm.UCAN`. DO NOT EDIT. -package resvault - -import ( - "encoding" - "fmt" -) - -type ResVault string - -const ( - KsEnclave ResVault = "ks/enclave" - LocCid ResVault = "loc/cid" - LocEntity ResVault = "loc/entity" - LocIpns ResVault = "loc/ipns" - AddrSonr ResVault = "addr/sonr" - ChainCode ResVault = "chain/code" -) - -// String returns the string representation of ResVault -func (rcv ResVault) String() string { - return string(rcv) -} - -var _ encoding.BinaryUnmarshaler = new(ResVault) - -// UnmarshalBinary implements encoding.BinaryUnmarshaler for ResVault. -func (rcv *ResVault) UnmarshalBinary(data []byte) error { - switch str := string(data); str { - case "ks/enclave": - *rcv = KsEnclave - case "loc/cid": - *rcv = LocCid - case "loc/entity": - *rcv = LocEntity - case "loc/ipns": - *rcv = LocIpns - case "addr/sonr": - *rcv = AddrSonr - case "chain/code": - *rcv = ChainCode - default: - return fmt.Errorf(`illegal: "%s" is not a valid ResVault`, str) - } - return nil -} diff --git a/internal/crypto/ucan/attns/resvault/resource.go b/internal/crypto/ucan/attns/resvault/resource.go deleted file mode 100644 index 134f7d314..000000000 --- a/internal/crypto/ucan/attns/resvault/resource.go +++ /dev/null @@ -1,33 +0,0 @@ -package resvault - -import "github.com/onsonr/sonr/internal/crypto/ucan" - -func Build(ty ResVault, value string) ucan.Resource { - return newStringLengthResource(ty.String(), value) -} - -type stringLengthRsc struct { - t string - v string -} - -// NewStringLengthResource is a silly implementation of resource to use while -// I figure out what an OR filter on strings is. Don't use this. -func newStringLengthResource(typ, val string) ucan.Resource { - return stringLengthRsc{ - t: typ, - v: val, - } -} - -func (r stringLengthRsc) Type() string { - return r.t -} - -func (r stringLengthRsc) Value() string { - return r.v -} - -func (r stringLengthRsc) Contains(b ucan.Resource) bool { - return r.Type() == b.Type() && len(r.Value()) <= len(b.Value()) -} diff --git a/internal/database/hwayorm/db.go b/internal/database/hwayorm/db.go deleted file mode 100644 index 976fb26f7..000000000 --- a/internal/database/hwayorm/db.go +++ /dev/null @@ -1,32 +0,0 @@ -// Code generated by sqlc. DO NOT EDIT. -// versions: -// sqlc v1.27.0 - -package hwayorm - -import ( - "context" - - "github.com/jackc/pgx/v5" - "github.com/jackc/pgx/v5/pgconn" -) - -type DBTX interface { - Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error) - Query(context.Context, string, ...interface{}) (pgx.Rows, error) - QueryRow(context.Context, string, ...interface{}) pgx.Row -} - -func New(db DBTX) *Queries { - return &Queries{db: db} -} - -type Queries struct { - db DBTX -} - -func (q *Queries) WithTx(tx pgx.Tx) *Queries { - return &Queries{ - db: tx, - } -} diff --git a/internal/database/hwayorm/models.go b/internal/database/hwayorm/models.go deleted file mode 100644 index 4c32b6d2a..000000000 --- a/internal/database/hwayorm/models.go +++ /dev/null @@ -1,68 +0,0 @@ -// Code generated by sqlc. DO NOT EDIT. -// versions: -// sqlc v1.27.0 - -package hwayorm - -import ( - "github.com/jackc/pgx/v5/pgtype" -) - -type Credential struct { - ID string `json:"id"` - CreatedAt pgtype.Timestamptz `json:"created_at"` - UpdatedAt pgtype.Timestamptz `json:"updated_at"` - DeletedAt pgtype.Timestamptz `json:"deleted_at"` - Handle string `json:"handle"` - CredentialID string `json:"credential_id"` - AuthenticatorAttachment string `json:"authenticator_attachment"` - Origin string `json:"origin"` - Type string `json:"type"` - Transports string `json:"transports"` -} - -type Profile struct { - ID string `json:"id"` - CreatedAt pgtype.Timestamptz `json:"created_at"` - UpdatedAt pgtype.Timestamptz `json:"updated_at"` - DeletedAt pgtype.Timestamptz `json:"deleted_at"` - Address string `json:"address"` - Handle string `json:"handle"` - Origin string `json:"origin"` - Name string `json:"name"` - Status string `json:"status"` -} - -type Session struct { - ID string `json:"id"` - CreatedAt pgtype.Timestamptz `json:"created_at"` - UpdatedAt pgtype.Timestamptz `json:"updated_at"` - DeletedAt pgtype.Timestamptz `json:"deleted_at"` - BrowserName string `json:"browser_name"` - BrowserVersion string `json:"browser_version"` - ClientIpaddr string `json:"client_ipaddr"` - Platform string `json:"platform"` - IsDesktop bool `json:"is_desktop"` - IsMobile bool `json:"is_mobile"` - IsTablet bool `json:"is_tablet"` - IsTv bool `json:"is_tv"` - IsBot bool `json:"is_bot"` - Challenge string `json:"challenge"` - IsHumanFirst bool `json:"is_human_first"` - IsHumanLast bool `json:"is_human_last"` - ProfileID string `json:"profile_id"` -} - -type Vault struct { - ID int64 `json:"id"` - CreatedAt pgtype.Timestamptz `json:"created_at"` - UpdatedAt pgtype.Timestamptz `json:"updated_at"` - DeletedAt pgtype.Timestamptz `json:"deleted_at"` - Handle string `json:"handle"` - Origin string `json:"origin"` - Address string `json:"address"` - Cid string `json:"cid"` - Config []byte `json:"config"` - SessionID int64 `json:"session_id"` - RedirectUri string `json:"redirect_uri"` -} diff --git a/internal/database/hwayorm/querier.go b/internal/database/hwayorm/querier.go deleted file mode 100644 index b277726e9..000000000 --- a/internal/database/hwayorm/querier.go +++ /dev/null @@ -1,34 +0,0 @@ -// Code generated by sqlc. DO NOT EDIT. -// versions: -// sqlc v1.27.0 - -package hwayorm - -import ( - "context" -) - -type Querier interface { - CheckHandleExists(ctx context.Context, handle string) (bool, error) - CreateSession(ctx context.Context, arg CreateSessionParams) (*Session, error) - GetChallengeBySessionID(ctx context.Context, id string) (string, error) - GetCredentialByID(ctx context.Context, credentialID string) (*Credential, error) - GetCredentialsByHandle(ctx context.Context, handle string) ([]*Credential, error) - GetHumanVerificationNumbers(ctx context.Context, id string) (*GetHumanVerificationNumbersRow, error) - GetProfileByAddress(ctx context.Context, address string) (*Profile, error) - GetProfileByHandle(ctx context.Context, handle string) (*Profile, error) - GetProfileByID(ctx context.Context, id string) (*Profile, error) - GetSessionByClientIP(ctx context.Context, clientIpaddr string) (*Session, error) - GetSessionByID(ctx context.Context, id string) (*Session, error) - GetVaultConfigByCID(ctx context.Context, cid string) (*Vault, error) - GetVaultRedirectURIBySessionID(ctx context.Context, sessionID int64) (string, error) - InsertCredential(ctx context.Context, arg InsertCredentialParams) (*Credential, error) - InsertProfile(ctx context.Context, arg InsertProfileParams) (*Profile, error) - SoftDeleteCredential(ctx context.Context, credentialID string) error - SoftDeleteProfile(ctx context.Context, address string) error - UpdateProfile(ctx context.Context, arg UpdateProfileParams) (*Profile, error) - UpdateSessionHumanVerification(ctx context.Context, arg UpdateSessionHumanVerificationParams) (*Session, error) - UpdateSessionWithProfileID(ctx context.Context, arg UpdateSessionWithProfileIDParams) (*Session, error) -} - -var _ Querier = (*Queries)(nil) diff --git a/internal/database/hwayorm/query.sql.go b/internal/database/hwayorm/query.sql.go deleted file mode 100644 index 93c770963..000000000 --- a/internal/database/hwayorm/query.sql.go +++ /dev/null @@ -1,583 +0,0 @@ -// Code generated by sqlc. DO NOT EDIT. -// versions: -// sqlc v1.27.0 -// source: query.sql - -package hwayorm - -import ( - "context" -) - -const checkHandleExists = `-- name: CheckHandleExists :one -SELECT COUNT(*) > 0 as handle_exists FROM profiles -WHERE handle = $1 -AND deleted_at IS NULL -` - -func (q *Queries) CheckHandleExists(ctx context.Context, handle string) (bool, error) { - row := q.db.QueryRow(ctx, checkHandleExists, handle) - var handle_exists bool - err := row.Scan(&handle_exists) - return handle_exists, err -} - -const createSession = `-- name: CreateSession :one -INSERT INTO sessions ( - id, - browser_name, - browser_version, - client_ipaddr, - platform, - is_desktop, - is_mobile, - is_tablet, - is_tv, - is_bot, - challenge, - is_human_first, - is_human_last, - profile_id -) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14) -RETURNING id, created_at, updated_at, deleted_at, browser_name, browser_version, client_ipaddr, platform, is_desktop, is_mobile, is_tablet, is_tv, is_bot, challenge, is_human_first, is_human_last, profile_id -` - -type CreateSessionParams struct { - ID string `json:"id"` - BrowserName string `json:"browser_name"` - BrowserVersion string `json:"browser_version"` - ClientIpaddr string `json:"client_ipaddr"` - Platform string `json:"platform"` - IsDesktop bool `json:"is_desktop"` - IsMobile bool `json:"is_mobile"` - IsTablet bool `json:"is_tablet"` - IsTv bool `json:"is_tv"` - IsBot bool `json:"is_bot"` - Challenge string `json:"challenge"` - IsHumanFirst bool `json:"is_human_first"` - IsHumanLast bool `json:"is_human_last"` - ProfileID string `json:"profile_id"` -} - -func (q *Queries) CreateSession(ctx context.Context, arg CreateSessionParams) (*Session, error) { - row := q.db.QueryRow(ctx, createSession, - arg.ID, - arg.BrowserName, - arg.BrowserVersion, - arg.ClientIpaddr, - arg.Platform, - arg.IsDesktop, - arg.IsMobile, - arg.IsTablet, - arg.IsTv, - arg.IsBot, - arg.Challenge, - arg.IsHumanFirst, - arg.IsHumanLast, - arg.ProfileID, - ) - var i Session - err := row.Scan( - &i.ID, - &i.CreatedAt, - &i.UpdatedAt, - &i.DeletedAt, - &i.BrowserName, - &i.BrowserVersion, - &i.ClientIpaddr, - &i.Platform, - &i.IsDesktop, - &i.IsMobile, - &i.IsTablet, - &i.IsTv, - &i.IsBot, - &i.Challenge, - &i.IsHumanFirst, - &i.IsHumanLast, - &i.ProfileID, - ) - return &i, err -} - -const getChallengeBySessionID = `-- name: GetChallengeBySessionID :one -SELECT challenge FROM sessions -WHERE id = $1 AND deleted_at IS NULL -LIMIT 1 -` - -func (q *Queries) GetChallengeBySessionID(ctx context.Context, id string) (string, error) { - row := q.db.QueryRow(ctx, getChallengeBySessionID, id) - var challenge string - err := row.Scan(&challenge) - return challenge, err -} - -const getCredentialByID = `-- name: GetCredentialByID :one -SELECT id, created_at, updated_at, deleted_at, handle, credential_id, authenticator_attachment, origin, type, transports FROM credentials -WHERE credential_id = $1 -AND deleted_at IS NULL -LIMIT 1 -` - -func (q *Queries) GetCredentialByID(ctx context.Context, credentialID string) (*Credential, error) { - row := q.db.QueryRow(ctx, getCredentialByID, credentialID) - var i Credential - err := row.Scan( - &i.ID, - &i.CreatedAt, - &i.UpdatedAt, - &i.DeletedAt, - &i.Handle, - &i.CredentialID, - &i.AuthenticatorAttachment, - &i.Origin, - &i.Type, - &i.Transports, - ) - return &i, err -} - -const getCredentialsByHandle = `-- name: GetCredentialsByHandle :many -SELECT id, created_at, updated_at, deleted_at, handle, credential_id, authenticator_attachment, origin, type, transports FROM credentials -WHERE handle = $1 -AND deleted_at IS NULL -` - -func (q *Queries) GetCredentialsByHandle(ctx context.Context, handle string) ([]*Credential, error) { - rows, err := q.db.Query(ctx, getCredentialsByHandle, handle) - if err != nil { - return nil, err - } - defer rows.Close() - var items []*Credential - for rows.Next() { - var i Credential - if err := rows.Scan( - &i.ID, - &i.CreatedAt, - &i.UpdatedAt, - &i.DeletedAt, - &i.Handle, - &i.CredentialID, - &i.AuthenticatorAttachment, - &i.Origin, - &i.Type, - &i.Transports, - ); err != nil { - return nil, err - } - items = append(items, &i) - } - if err := rows.Err(); err != nil { - return nil, err - } - return items, nil -} - -const getHumanVerificationNumbers = `-- name: GetHumanVerificationNumbers :one -SELECT is_human_first, is_human_last FROM sessions -WHERE id = $1 AND deleted_at IS NULL -LIMIT 1 -` - -type GetHumanVerificationNumbersRow struct { - IsHumanFirst bool `json:"is_human_first"` - IsHumanLast bool `json:"is_human_last"` -} - -func (q *Queries) GetHumanVerificationNumbers(ctx context.Context, id string) (*GetHumanVerificationNumbersRow, error) { - row := q.db.QueryRow(ctx, getHumanVerificationNumbers, id) - var i GetHumanVerificationNumbersRow - err := row.Scan(&i.IsHumanFirst, &i.IsHumanLast) - return &i, err -} - -const getProfileByAddress = `-- name: GetProfileByAddress :one -SELECT id, created_at, updated_at, deleted_at, address, handle, origin, name, status FROM profiles -WHERE address = $1 AND deleted_at IS NULL -LIMIT 1 -` - -func (q *Queries) GetProfileByAddress(ctx context.Context, address string) (*Profile, error) { - row := q.db.QueryRow(ctx, getProfileByAddress, address) - var i Profile - err := row.Scan( - &i.ID, - &i.CreatedAt, - &i.UpdatedAt, - &i.DeletedAt, - &i.Address, - &i.Handle, - &i.Origin, - &i.Name, - &i.Status, - ) - return &i, err -} - -const getProfileByHandle = `-- name: GetProfileByHandle :one -SELECT id, created_at, updated_at, deleted_at, address, handle, origin, name, status FROM profiles -WHERE handle = $1 -AND deleted_at IS NULL -LIMIT 1 -` - -func (q *Queries) GetProfileByHandle(ctx context.Context, handle string) (*Profile, error) { - row := q.db.QueryRow(ctx, getProfileByHandle, handle) - var i Profile - err := row.Scan( - &i.ID, - &i.CreatedAt, - &i.UpdatedAt, - &i.DeletedAt, - &i.Address, - &i.Handle, - &i.Origin, - &i.Name, - &i.Status, - ) - return &i, err -} - -const getProfileByID = `-- name: GetProfileByID :one -SELECT id, created_at, updated_at, deleted_at, address, handle, origin, name, status FROM profiles -WHERE id = $1 AND deleted_at IS NULL -LIMIT 1 -` - -func (q *Queries) GetProfileByID(ctx context.Context, id string) (*Profile, error) { - row := q.db.QueryRow(ctx, getProfileByID, id) - var i Profile - err := row.Scan( - &i.ID, - &i.CreatedAt, - &i.UpdatedAt, - &i.DeletedAt, - &i.Address, - &i.Handle, - &i.Origin, - &i.Name, - &i.Status, - ) - return &i, err -} - -const getSessionByClientIP = `-- name: GetSessionByClientIP :one -SELECT id, created_at, updated_at, deleted_at, browser_name, browser_version, client_ipaddr, platform, is_desktop, is_mobile, is_tablet, is_tv, is_bot, challenge, is_human_first, is_human_last, profile_id FROM sessions -WHERE client_ipaddr = $1 AND deleted_at IS NULL -LIMIT 1 -` - -func (q *Queries) GetSessionByClientIP(ctx context.Context, clientIpaddr string) (*Session, error) { - row := q.db.QueryRow(ctx, getSessionByClientIP, clientIpaddr) - var i Session - err := row.Scan( - &i.ID, - &i.CreatedAt, - &i.UpdatedAt, - &i.DeletedAt, - &i.BrowserName, - &i.BrowserVersion, - &i.ClientIpaddr, - &i.Platform, - &i.IsDesktop, - &i.IsMobile, - &i.IsTablet, - &i.IsTv, - &i.IsBot, - &i.Challenge, - &i.IsHumanFirst, - &i.IsHumanLast, - &i.ProfileID, - ) - return &i, err -} - -const getSessionByID = `-- name: GetSessionByID :one -SELECT id, created_at, updated_at, deleted_at, browser_name, browser_version, client_ipaddr, platform, is_desktop, is_mobile, is_tablet, is_tv, is_bot, challenge, is_human_first, is_human_last, profile_id FROM sessions -WHERE id = $1 AND deleted_at IS NULL -LIMIT 1 -` - -func (q *Queries) GetSessionByID(ctx context.Context, id string) (*Session, error) { - row := q.db.QueryRow(ctx, getSessionByID, id) - var i Session - err := row.Scan( - &i.ID, - &i.CreatedAt, - &i.UpdatedAt, - &i.DeletedAt, - &i.BrowserName, - &i.BrowserVersion, - &i.ClientIpaddr, - &i.Platform, - &i.IsDesktop, - &i.IsMobile, - &i.IsTablet, - &i.IsTv, - &i.IsBot, - &i.Challenge, - &i.IsHumanFirst, - &i.IsHumanLast, - &i.ProfileID, - ) - return &i, err -} - -const getVaultConfigByCID = `-- name: GetVaultConfigByCID :one -SELECT id, created_at, updated_at, deleted_at, handle, origin, address, cid, config, session_id, redirect_uri FROM vaults -WHERE cid = $1 -AND deleted_at IS NULL -LIMIT 1 -` - -func (q *Queries) GetVaultConfigByCID(ctx context.Context, cid string) (*Vault, error) { - row := q.db.QueryRow(ctx, getVaultConfigByCID, cid) - var i Vault - err := row.Scan( - &i.ID, - &i.CreatedAt, - &i.UpdatedAt, - &i.DeletedAt, - &i.Handle, - &i.Origin, - &i.Address, - &i.Cid, - &i.Config, - &i.SessionID, - &i.RedirectUri, - ) - return &i, err -} - -const getVaultRedirectURIBySessionID = `-- name: GetVaultRedirectURIBySessionID :one -SELECT redirect_uri FROM vaults -WHERE session_id = $1 -AND deleted_at IS NULL -LIMIT 1 -` - -func (q *Queries) GetVaultRedirectURIBySessionID(ctx context.Context, sessionID int64) (string, error) { - row := q.db.QueryRow(ctx, getVaultRedirectURIBySessionID, sessionID) - var redirect_uri string - err := row.Scan(&redirect_uri) - return redirect_uri, err -} - -const insertCredential = `-- name: InsertCredential :one -INSERT INTO credentials ( - handle, - credential_id, - origin, - type, - transports -) VALUES ($1, $2, $3, $4, $5) -RETURNING id, created_at, updated_at, deleted_at, handle, credential_id, authenticator_attachment, origin, type, transports -` - -type InsertCredentialParams struct { - Handle string `json:"handle"` - CredentialID string `json:"credential_id"` - Origin string `json:"origin"` - Type string `json:"type"` - Transports string `json:"transports"` -} - -func (q *Queries) InsertCredential(ctx context.Context, arg InsertCredentialParams) (*Credential, error) { - row := q.db.QueryRow(ctx, insertCredential, - arg.Handle, - arg.CredentialID, - arg.Origin, - arg.Type, - arg.Transports, - ) - var i Credential - err := row.Scan( - &i.ID, - &i.CreatedAt, - &i.UpdatedAt, - &i.DeletedAt, - &i.Handle, - &i.CredentialID, - &i.AuthenticatorAttachment, - &i.Origin, - &i.Type, - &i.Transports, - ) - return &i, err -} - -const insertProfile = `-- name: InsertProfile :one -INSERT INTO profiles ( - address, - handle, - origin, - name -) VALUES ($1, $2, $3, $4) -RETURNING id, created_at, updated_at, deleted_at, address, handle, origin, name, status -` - -type InsertProfileParams struct { - Address string `json:"address"` - Handle string `json:"handle"` - Origin string `json:"origin"` - Name string `json:"name"` -} - -func (q *Queries) InsertProfile(ctx context.Context, arg InsertProfileParams) (*Profile, error) { - row := q.db.QueryRow(ctx, insertProfile, - arg.Address, - arg.Handle, - arg.Origin, - arg.Name, - ) - var i Profile - err := row.Scan( - &i.ID, - &i.CreatedAt, - &i.UpdatedAt, - &i.DeletedAt, - &i.Address, - &i.Handle, - &i.Origin, - &i.Name, - &i.Status, - ) - return &i, err -} - -const softDeleteCredential = `-- name: SoftDeleteCredential :exec -UPDATE credentials -SET deleted_at = CURRENT_TIMESTAMP -WHERE credential_id = $1 -` - -func (q *Queries) SoftDeleteCredential(ctx context.Context, credentialID string) error { - _, err := q.db.Exec(ctx, softDeleteCredential, credentialID) - return err -} - -const softDeleteProfile = `-- name: SoftDeleteProfile :exec -UPDATE profiles -SET deleted_at = CURRENT_TIMESTAMP -WHERE address = $1 -` - -func (q *Queries) SoftDeleteProfile(ctx context.Context, address string) error { - _, err := q.db.Exec(ctx, softDeleteProfile, address) - return err -} - -const updateProfile = `-- name: UpdateProfile :one -UPDATE profiles -SET - name = $1, - handle = $2, - updated_at = CURRENT_TIMESTAMP -WHERE address = $3 -AND deleted_at IS NULL -RETURNING id, created_at, updated_at, deleted_at, address, handle, origin, name, status -` - -type UpdateProfileParams struct { - Name string `json:"name"` - Handle string `json:"handle"` - Address string `json:"address"` -} - -func (q *Queries) UpdateProfile(ctx context.Context, arg UpdateProfileParams) (*Profile, error) { - row := q.db.QueryRow(ctx, updateProfile, arg.Name, arg.Handle, arg.Address) - var i Profile - err := row.Scan( - &i.ID, - &i.CreatedAt, - &i.UpdatedAt, - &i.DeletedAt, - &i.Address, - &i.Handle, - &i.Origin, - &i.Name, - &i.Status, - ) - return &i, err -} - -const updateSessionHumanVerification = `-- name: UpdateSessionHumanVerification :one -UPDATE sessions -SET - is_human_first = $1, - is_human_last = $2, - updated_at = CURRENT_TIMESTAMP -WHERE id = $3 -RETURNING id, created_at, updated_at, deleted_at, browser_name, browser_version, client_ipaddr, platform, is_desktop, is_mobile, is_tablet, is_tv, is_bot, challenge, is_human_first, is_human_last, profile_id -` - -type UpdateSessionHumanVerificationParams struct { - IsHumanFirst bool `json:"is_human_first"` - IsHumanLast bool `json:"is_human_last"` - ID string `json:"id"` -} - -func (q *Queries) UpdateSessionHumanVerification(ctx context.Context, arg UpdateSessionHumanVerificationParams) (*Session, error) { - row := q.db.QueryRow(ctx, updateSessionHumanVerification, arg.IsHumanFirst, arg.IsHumanLast, arg.ID) - var i Session - err := row.Scan( - &i.ID, - &i.CreatedAt, - &i.UpdatedAt, - &i.DeletedAt, - &i.BrowserName, - &i.BrowserVersion, - &i.ClientIpaddr, - &i.Platform, - &i.IsDesktop, - &i.IsMobile, - &i.IsTablet, - &i.IsTv, - &i.IsBot, - &i.Challenge, - &i.IsHumanFirst, - &i.IsHumanLast, - &i.ProfileID, - ) - return &i, err -} - -const updateSessionWithProfileID = `-- name: UpdateSessionWithProfileID :one -UPDATE sessions -SET - profile_id = $1, - updated_at = CURRENT_TIMESTAMP -WHERE id = $2 -RETURNING id, created_at, updated_at, deleted_at, browser_name, browser_version, client_ipaddr, platform, is_desktop, is_mobile, is_tablet, is_tv, is_bot, challenge, is_human_first, is_human_last, profile_id -` - -type UpdateSessionWithProfileIDParams struct { - ProfileID string `json:"profile_id"` - ID string `json:"id"` -} - -func (q *Queries) UpdateSessionWithProfileID(ctx context.Context, arg UpdateSessionWithProfileIDParams) (*Session, error) { - row := q.db.QueryRow(ctx, updateSessionWithProfileID, arg.ProfileID, arg.ID) - var i Session - err := row.Scan( - &i.ID, - &i.CreatedAt, - &i.UpdatedAt, - &i.DeletedAt, - &i.BrowserName, - &i.BrowserVersion, - &i.ClientIpaddr, - &i.Platform, - &i.IsDesktop, - &i.IsMobile, - &i.IsTablet, - &i.IsTv, - &i.IsBot, - &i.Challenge, - &i.IsHumanFirst, - &i.IsHumanLast, - &i.ProfileID, - ) - return &i, err -} diff --git a/internal/database/motrorm/db.go b/internal/database/motrorm/db.go deleted file mode 100644 index 93a2528e3..000000000 --- a/internal/database/motrorm/db.go +++ /dev/null @@ -1,31 +0,0 @@ -// Code generated by sqlc. DO NOT EDIT. -// versions: -// sqlc v1.27.0 - -package motrorm - -import ( - "context" - "database/sql" -) - -type DBTX interface { - ExecContext(context.Context, string, ...interface{}) (sql.Result, error) - PrepareContext(context.Context, string) (*sql.Stmt, error) - QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error) - QueryRowContext(context.Context, string, ...interface{}) *sql.Row -} - -func New(db DBTX) *Queries { - return &Queries{db: db} -} - -type Queries struct { - db DBTX -} - -func (q *Queries) WithTx(tx *sql.Tx) *Queries { - return &Queries{ - db: tx, - } -} diff --git a/internal/database/motrorm/models.go b/internal/database/motrorm/models.go deleted file mode 100644 index 2d474aa27..000000000 --- a/internal/database/motrorm/models.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by sqlc. DO NOT EDIT. -// versions: -// sqlc v1.27.0 - -package motrorm - -import ( - "database/sql" - "time" -) - -type Account struct { - ID string `json:"id"` - CreatedAt time.Time `json:"created_at"` - UpdatedAt time.Time `json:"updated_at"` - DeletedAt sql.NullTime `json:"deleted_at"` - Number int64 `json:"number"` - Sequence int64 `json:"sequence"` - Address string `json:"address"` - PublicKey string `json:"public_key"` - ChainID string `json:"chain_id"` - Controller string `json:"controller"` - IsSubsidiary bool `json:"is_subsidiary"` - IsValidator bool `json:"is_validator"` - IsDelegator bool `json:"is_delegator"` - IsAccountable bool `json:"is_accountable"` -} - -type Asset struct { - ID string `json:"id"` - CreatedAt time.Time `json:"created_at"` - UpdatedAt time.Time `json:"updated_at"` - DeletedAt sql.NullTime `json:"deleted_at"` - Name string `json:"name"` - Symbol string `json:"symbol"` - Decimals int64 `json:"decimals"` - ChainID string `json:"chain_id"` - Channel string `json:"channel"` - AssetType string `json:"asset_type"` - CoingeckoID sql.NullString `json:"coingecko_id"` -} - -type Credential struct { - ID string `json:"id"` - CreatedAt time.Time `json:"created_at"` - UpdatedAt time.Time `json:"updated_at"` - DeletedAt sql.NullTime `json:"deleted_at"` - Handle string `json:"handle"` - CredentialID string `json:"credential_id"` - AuthenticatorAttachment string `json:"authenticator_attachment"` - Origin string `json:"origin"` - Type string `json:"type"` - Transports string `json:"transports"` -} - -type Profile struct { - ID string `json:"id"` - CreatedAt time.Time `json:"created_at"` - UpdatedAt time.Time `json:"updated_at"` - DeletedAt sql.NullTime `json:"deleted_at"` - Address string `json:"address"` - Handle string `json:"handle"` - Origin string `json:"origin"` - Name string `json:"name"` -} - -type Session struct { - ID string `json:"id"` - CreatedAt time.Time `json:"created_at"` - UpdatedAt time.Time `json:"updated_at"` - DeletedAt sql.NullTime `json:"deleted_at"` - BrowserName string `json:"browser_name"` - BrowserVersion string `json:"browser_version"` - ClientIpaddr string `json:"client_ipaddr"` - Platform string `json:"platform"` - IsDesktop bool `json:"is_desktop"` - IsMobile bool `json:"is_mobile"` - IsTablet bool `json:"is_tablet"` - IsTv bool `json:"is_tv"` - IsBot bool `json:"is_bot"` - Challenge string `json:"challenge"` - IsHumanFirst bool `json:"is_human_first"` - IsHumanLast bool `json:"is_human_last"` - ProfileID int64 `json:"profile_id"` -} - -type Vault struct { - ID string `json:"id"` - CreatedAt time.Time `json:"created_at"` - UpdatedAt time.Time `json:"updated_at"` - DeletedAt sql.NullTime `json:"deleted_at"` - Handle string `json:"handle"` - Origin string `json:"origin"` - Address string `json:"address"` - Cid string `json:"cid"` - Config string `json:"config"` - SessionID string `json:"session_id"` - RedirectUri string `json:"redirect_uri"` -} diff --git a/internal/database/motrorm/querier.go b/internal/database/motrorm/querier.go deleted file mode 100644 index f3ecc0787..000000000 --- a/internal/database/motrorm/querier.go +++ /dev/null @@ -1,34 +0,0 @@ -// Code generated by sqlc. DO NOT EDIT. -// versions: -// sqlc v1.27.0 - -package motrorm - -import ( - "context" -) - -type Querier interface { - CheckHandleExists(ctx context.Context, handle string) (bool, error) - CreateSession(ctx context.Context, arg CreateSessionParams) (Session, error) - GetChallengeBySessionID(ctx context.Context, id string) (string, error) - GetCredentialByID(ctx context.Context, credentialID string) (Credential, error) - GetCredentialsByHandle(ctx context.Context, handle string) ([]Credential, error) - GetHumanVerificationNumbers(ctx context.Context, id string) (GetHumanVerificationNumbersRow, error) - GetProfileByAddress(ctx context.Context, address string) (Profile, error) - GetProfileByHandle(ctx context.Context, handle string) (Profile, error) - GetProfileByID(ctx context.Context, id string) (Profile, error) - GetSessionByClientIP(ctx context.Context, clientIpaddr string) (Session, error) - GetSessionByID(ctx context.Context, id string) (Session, error) - GetVaultConfigByCID(ctx context.Context, cid string) (Vault, error) - GetVaultRedirectURIBySessionID(ctx context.Context, sessionID string) (string, error) - InsertCredential(ctx context.Context, arg InsertCredentialParams) (Credential, error) - InsertProfile(ctx context.Context, arg InsertProfileParams) (Profile, error) - SoftDeleteCredential(ctx context.Context, credentialID string) error - SoftDeleteProfile(ctx context.Context, address string) error - UpdateProfile(ctx context.Context, arg UpdateProfileParams) (Profile, error) - UpdateSessionHumanVerification(ctx context.Context, arg UpdateSessionHumanVerificationParams) (Session, error) - UpdateSessionWithProfileID(ctx context.Context, arg UpdateSessionWithProfileIDParams) (Session, error) -} - -var _ Querier = (*Queries)(nil) diff --git a/internal/database/motrorm/query.sql.go b/internal/database/motrorm/query.sql.go deleted file mode 100644 index 7f61cd1b4..000000000 --- a/internal/database/motrorm/query.sql.go +++ /dev/null @@ -1,581 +0,0 @@ -// Code generated by sqlc. DO NOT EDIT. -// versions: -// sqlc v1.27.0 -// source: query.sql - -package motrorm - -import ( - "context" -) - -const checkHandleExists = `-- name: CheckHandleExists :one -SELECT COUNT(*) > 0 as handle_exists FROM profiles -WHERE handle = ? -AND deleted_at IS NULL -` - -func (q *Queries) CheckHandleExists(ctx context.Context, handle string) (bool, error) { - row := q.db.QueryRowContext(ctx, checkHandleExists, handle) - var handle_exists bool - err := row.Scan(&handle_exists) - return handle_exists, err -} - -const createSession = `-- name: CreateSession :one -INSERT INTO sessions ( - id, - browser_name, - browser_version, - client_ipaddr, - platform, - is_desktop, - is_mobile, - is_tablet, - is_tv, - is_bot, - challenge, - is_human_first, - is_human_last, - profile_id -) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ) -RETURNING id, created_at, updated_at, deleted_at, browser_name, browser_version, client_ipaddr, platform, is_desktop, is_mobile, is_tablet, is_tv, is_bot, challenge, is_human_first, is_human_last, profile_id -` - -type CreateSessionParams struct { - ID string `json:"id"` - BrowserName string `json:"browser_name"` - BrowserVersion string `json:"browser_version"` - ClientIpaddr string `json:"client_ipaddr"` - Platform string `json:"platform"` - IsDesktop bool `json:"is_desktop"` - IsMobile bool `json:"is_mobile"` - IsTablet bool `json:"is_tablet"` - IsTv bool `json:"is_tv"` - IsBot bool `json:"is_bot"` - Challenge string `json:"challenge"` - IsHumanFirst bool `json:"is_human_first"` - IsHumanLast bool `json:"is_human_last"` - ProfileID int64 `json:"profile_id"` -} - -func (q *Queries) CreateSession(ctx context.Context, arg CreateSessionParams) (Session, error) { - row := q.db.QueryRowContext(ctx, createSession, - arg.ID, - arg.BrowserName, - arg.BrowserVersion, - arg.ClientIpaddr, - arg.Platform, - arg.IsDesktop, - arg.IsMobile, - arg.IsTablet, - arg.IsTv, - arg.IsBot, - arg.Challenge, - arg.IsHumanFirst, - arg.IsHumanLast, - arg.ProfileID, - ) - var i Session - err := row.Scan( - &i.ID, - &i.CreatedAt, - &i.UpdatedAt, - &i.DeletedAt, - &i.BrowserName, - &i.BrowserVersion, - &i.ClientIpaddr, - &i.Platform, - &i.IsDesktop, - &i.IsMobile, - &i.IsTablet, - &i.IsTv, - &i.IsBot, - &i.Challenge, - &i.IsHumanFirst, - &i.IsHumanLast, - &i.ProfileID, - ) - return i, err -} - -const getChallengeBySessionID = `-- name: GetChallengeBySessionID :one -SELECT challenge FROM sessions -WHERE id = ? AND deleted_at IS NULL -LIMIT 1 -` - -func (q *Queries) GetChallengeBySessionID(ctx context.Context, id string) (string, error) { - row := q.db.QueryRowContext(ctx, getChallengeBySessionID, id) - var challenge string - err := row.Scan(&challenge) - return challenge, err -} - -const getCredentialByID = `-- name: GetCredentialByID :one -SELECT id, created_at, updated_at, deleted_at, handle, credential_id, authenticator_attachment, origin, type, transports FROM credentials -WHERE credential_id = ? -AND deleted_at IS NULL -LIMIT 1 -` - -func (q *Queries) GetCredentialByID(ctx context.Context, credentialID string) (Credential, error) { - row := q.db.QueryRowContext(ctx, getCredentialByID, credentialID) - var i Credential - err := row.Scan( - &i.ID, - &i.CreatedAt, - &i.UpdatedAt, - &i.DeletedAt, - &i.Handle, - &i.CredentialID, - &i.AuthenticatorAttachment, - &i.Origin, - &i.Type, - &i.Transports, - ) - return i, err -} - -const getCredentialsByHandle = `-- name: GetCredentialsByHandle :many -SELECT id, created_at, updated_at, deleted_at, handle, credential_id, authenticator_attachment, origin, type, transports FROM credentials -WHERE handle = ? -AND deleted_at IS NULL -` - -func (q *Queries) GetCredentialsByHandle(ctx context.Context, handle string) ([]Credential, error) { - rows, err := q.db.QueryContext(ctx, getCredentialsByHandle, handle) - if err != nil { - return nil, err - } - defer rows.Close() - var items []Credential - for rows.Next() { - var i Credential - if err := rows.Scan( - &i.ID, - &i.CreatedAt, - &i.UpdatedAt, - &i.DeletedAt, - &i.Handle, - &i.CredentialID, - &i.AuthenticatorAttachment, - &i.Origin, - &i.Type, - &i.Transports, - ); err != nil { - return nil, err - } - items = append(items, i) - } - if err := rows.Close(); err != nil { - return nil, err - } - if err := rows.Err(); err != nil { - return nil, err - } - return items, nil -} - -const getHumanVerificationNumbers = `-- name: GetHumanVerificationNumbers :one -SELECT is_human_first, is_human_last FROM sessions -WHERE id = ? AND deleted_at IS NULL -LIMIT 1 -` - -type GetHumanVerificationNumbersRow struct { - IsHumanFirst bool `json:"is_human_first"` - IsHumanLast bool `json:"is_human_last"` -} - -func (q *Queries) GetHumanVerificationNumbers(ctx context.Context, id string) (GetHumanVerificationNumbersRow, error) { - row := q.db.QueryRowContext(ctx, getHumanVerificationNumbers, id) - var i GetHumanVerificationNumbersRow - err := row.Scan(&i.IsHumanFirst, &i.IsHumanLast) - return i, err -} - -const getProfileByAddress = `-- name: GetProfileByAddress :one -SELECT id, created_at, updated_at, deleted_at, address, handle, origin, name FROM profiles -WHERE address = ? AND deleted_at IS NULL -LIMIT 1 -` - -func (q *Queries) GetProfileByAddress(ctx context.Context, address string) (Profile, error) { - row := q.db.QueryRowContext(ctx, getProfileByAddress, address) - var i Profile - err := row.Scan( - &i.ID, - &i.CreatedAt, - &i.UpdatedAt, - &i.DeletedAt, - &i.Address, - &i.Handle, - &i.Origin, - &i.Name, - ) - return i, err -} - -const getProfileByHandle = `-- name: GetProfileByHandle :one -SELECT id, created_at, updated_at, deleted_at, address, handle, origin, name FROM profiles -WHERE handle = ? -AND deleted_at IS NULL -LIMIT 1 -` - -func (q *Queries) GetProfileByHandle(ctx context.Context, handle string) (Profile, error) { - row := q.db.QueryRowContext(ctx, getProfileByHandle, handle) - var i Profile - err := row.Scan( - &i.ID, - &i.CreatedAt, - &i.UpdatedAt, - &i.DeletedAt, - &i.Address, - &i.Handle, - &i.Origin, - &i.Name, - ) - return i, err -} - -const getProfileByID = `-- name: GetProfileByID :one -SELECT id, created_at, updated_at, deleted_at, address, handle, origin, name FROM profiles -WHERE id = ? AND deleted_at IS NULL -LIMIT 1 -` - -func (q *Queries) GetProfileByID(ctx context.Context, id string) (Profile, error) { - row := q.db.QueryRowContext(ctx, getProfileByID, id) - var i Profile - err := row.Scan( - &i.ID, - &i.CreatedAt, - &i.UpdatedAt, - &i.DeletedAt, - &i.Address, - &i.Handle, - &i.Origin, - &i.Name, - ) - return i, err -} - -const getSessionByClientIP = `-- name: GetSessionByClientIP :one -SELECT id, created_at, updated_at, deleted_at, browser_name, browser_version, client_ipaddr, platform, is_desktop, is_mobile, is_tablet, is_tv, is_bot, challenge, is_human_first, is_human_last, profile_id FROM sessions -WHERE client_ipaddr = ? AND deleted_at IS NULL -LIMIT 1 -` - -func (q *Queries) GetSessionByClientIP(ctx context.Context, clientIpaddr string) (Session, error) { - row := q.db.QueryRowContext(ctx, getSessionByClientIP, clientIpaddr) - var i Session - err := row.Scan( - &i.ID, - &i.CreatedAt, - &i.UpdatedAt, - &i.DeletedAt, - &i.BrowserName, - &i.BrowserVersion, - &i.ClientIpaddr, - &i.Platform, - &i.IsDesktop, - &i.IsMobile, - &i.IsTablet, - &i.IsTv, - &i.IsBot, - &i.Challenge, - &i.IsHumanFirst, - &i.IsHumanLast, - &i.ProfileID, - ) - return i, err -} - -const getSessionByID = `-- name: GetSessionByID :one -SELECT id, created_at, updated_at, deleted_at, browser_name, browser_version, client_ipaddr, platform, is_desktop, is_mobile, is_tablet, is_tv, is_bot, challenge, is_human_first, is_human_last, profile_id FROM sessions -WHERE id = ? AND deleted_at IS NULL -LIMIT 1 -` - -func (q *Queries) GetSessionByID(ctx context.Context, id string) (Session, error) { - row := q.db.QueryRowContext(ctx, getSessionByID, id) - var i Session - err := row.Scan( - &i.ID, - &i.CreatedAt, - &i.UpdatedAt, - &i.DeletedAt, - &i.BrowserName, - &i.BrowserVersion, - &i.ClientIpaddr, - &i.Platform, - &i.IsDesktop, - &i.IsMobile, - &i.IsTablet, - &i.IsTv, - &i.IsBot, - &i.Challenge, - &i.IsHumanFirst, - &i.IsHumanLast, - &i.ProfileID, - ) - return i, err -} - -const getVaultConfigByCID = `-- name: GetVaultConfigByCID :one -SELECT id, created_at, updated_at, deleted_at, handle, origin, address, cid, config, session_id, redirect_uri FROM vaults -WHERE cid = ? -AND deleted_at IS NULL -LIMIT 1 -` - -func (q *Queries) GetVaultConfigByCID(ctx context.Context, cid string) (Vault, error) { - row := q.db.QueryRowContext(ctx, getVaultConfigByCID, cid) - var i Vault - err := row.Scan( - &i.ID, - &i.CreatedAt, - &i.UpdatedAt, - &i.DeletedAt, - &i.Handle, - &i.Origin, - &i.Address, - &i.Cid, - &i.Config, - &i.SessionID, - &i.RedirectUri, - ) - return i, err -} - -const getVaultRedirectURIBySessionID = `-- name: GetVaultRedirectURIBySessionID :one -SELECT redirect_uri FROM vaults -WHERE session_id = ? -AND deleted_at IS NULL -LIMIT 1 -` - -func (q *Queries) GetVaultRedirectURIBySessionID(ctx context.Context, sessionID string) (string, error) { - row := q.db.QueryRowContext(ctx, getVaultRedirectURIBySessionID, sessionID) - var redirect_uri string - err := row.Scan(&redirect_uri) - return redirect_uri, err -} - -const insertCredential = `-- name: InsertCredential :one -INSERT INTO credentials ( - handle, - credential_id, - origin, - type, - transports -) VALUES (?, ?, ?, ?, ?) -RETURNING id, created_at, updated_at, deleted_at, handle, credential_id, authenticator_attachment, origin, type, transports -` - -type InsertCredentialParams struct { - Handle string `json:"handle"` - CredentialID string `json:"credential_id"` - Origin string `json:"origin"` - Type string `json:"type"` - Transports string `json:"transports"` -} - -func (q *Queries) InsertCredential(ctx context.Context, arg InsertCredentialParams) (Credential, error) { - row := q.db.QueryRowContext(ctx, insertCredential, - arg.Handle, - arg.CredentialID, - arg.Origin, - arg.Type, - arg.Transports, - ) - var i Credential - err := row.Scan( - &i.ID, - &i.CreatedAt, - &i.UpdatedAt, - &i.DeletedAt, - &i.Handle, - &i.CredentialID, - &i.AuthenticatorAttachment, - &i.Origin, - &i.Type, - &i.Transports, - ) - return i, err -} - -const insertProfile = `-- name: InsertProfile :one -INSERT INTO profiles ( - address, - handle, - origin, - name -) VALUES (?, ?, ?, ?) -RETURNING id, created_at, updated_at, deleted_at, address, handle, origin, name -` - -type InsertProfileParams struct { - Address string `json:"address"` - Handle string `json:"handle"` - Origin string `json:"origin"` - Name string `json:"name"` -} - -func (q *Queries) InsertProfile(ctx context.Context, arg InsertProfileParams) (Profile, error) { - row := q.db.QueryRowContext(ctx, insertProfile, - arg.Address, - arg.Handle, - arg.Origin, - arg.Name, - ) - var i Profile - err := row.Scan( - &i.ID, - &i.CreatedAt, - &i.UpdatedAt, - &i.DeletedAt, - &i.Address, - &i.Handle, - &i.Origin, - &i.Name, - ) - return i, err -} - -const softDeleteCredential = `-- name: SoftDeleteCredential :exec -UPDATE credentials -SET deleted_at = CURRENT_TIMESTAMP -WHERE credential_id = ? -` - -func (q *Queries) SoftDeleteCredential(ctx context.Context, credentialID string) error { - _, err := q.db.ExecContext(ctx, softDeleteCredential, credentialID) - return err -} - -const softDeleteProfile = `-- name: SoftDeleteProfile :exec -UPDATE profiles -SET deleted_at = CURRENT_TIMESTAMP -WHERE address = ? -` - -func (q *Queries) SoftDeleteProfile(ctx context.Context, address string) error { - _, err := q.db.ExecContext(ctx, softDeleteProfile, address) - return err -} - -const updateProfile = `-- name: UpdateProfile :one -UPDATE profiles -SET - name = ?, - handle = ?, - updated_at = CURRENT_TIMESTAMP -WHERE address = ? -AND deleted_at IS NULL -RETURNING id, created_at, updated_at, deleted_at, address, handle, origin, name -` - -type UpdateProfileParams struct { - Name string `json:"name"` - Handle string `json:"handle"` - Address string `json:"address"` -} - -func (q *Queries) UpdateProfile(ctx context.Context, arg UpdateProfileParams) (Profile, error) { - row := q.db.QueryRowContext(ctx, updateProfile, arg.Name, arg.Handle, arg.Address) - var i Profile - err := row.Scan( - &i.ID, - &i.CreatedAt, - &i.UpdatedAt, - &i.DeletedAt, - &i.Address, - &i.Handle, - &i.Origin, - &i.Name, - ) - return i, err -} - -const updateSessionHumanVerification = `-- name: UpdateSessionHumanVerification :one -UPDATE sessions -SET - is_human_first = ?, - is_human_last = ?, - updated_at = CURRENT_TIMESTAMP -WHERE id = ? -RETURNING id, created_at, updated_at, deleted_at, browser_name, browser_version, client_ipaddr, platform, is_desktop, is_mobile, is_tablet, is_tv, is_bot, challenge, is_human_first, is_human_last, profile_id -` - -type UpdateSessionHumanVerificationParams struct { - IsHumanFirst bool `json:"is_human_first"` - IsHumanLast bool `json:"is_human_last"` - ID string `json:"id"` -} - -func (q *Queries) UpdateSessionHumanVerification(ctx context.Context, arg UpdateSessionHumanVerificationParams) (Session, error) { - row := q.db.QueryRowContext(ctx, updateSessionHumanVerification, arg.IsHumanFirst, arg.IsHumanLast, arg.ID) - var i Session - err := row.Scan( - &i.ID, - &i.CreatedAt, - &i.UpdatedAt, - &i.DeletedAt, - &i.BrowserName, - &i.BrowserVersion, - &i.ClientIpaddr, - &i.Platform, - &i.IsDesktop, - &i.IsMobile, - &i.IsTablet, - &i.IsTv, - &i.IsBot, - &i.Challenge, - &i.IsHumanFirst, - &i.IsHumanLast, - &i.ProfileID, - ) - return i, err -} - -const updateSessionWithProfileID = `-- name: UpdateSessionWithProfileID :one -UPDATE sessions -SET - profile_id = ?, - updated_at = CURRENT_TIMESTAMP -WHERE id = ? -RETURNING id, created_at, updated_at, deleted_at, browser_name, browser_version, client_ipaddr, platform, is_desktop, is_mobile, is_tablet, is_tv, is_bot, challenge, is_human_first, is_human_last, profile_id -` - -type UpdateSessionWithProfileIDParams struct { - ProfileID int64 `json:"profile_id"` - ID string `json:"id"` -} - -func (q *Queries) UpdateSessionWithProfileID(ctx context.Context, arg UpdateSessionWithProfileIDParams) (Session, error) { - row := q.db.QueryRowContext(ctx, updateSessionWithProfileID, arg.ProfileID, arg.ID) - var i Session - err := row.Scan( - &i.ID, - &i.CreatedAt, - &i.UpdatedAt, - &i.DeletedAt, - &i.BrowserName, - &i.BrowserVersion, - &i.ClientIpaddr, - &i.Platform, - &i.IsDesktop, - &i.IsMobile, - &i.IsTablet, - &i.IsTv, - &i.IsBot, - &i.Challenge, - &i.IsHumanFirst, - &i.IsHumanLast, - &i.ProfileID, - ) - return i, err -} diff --git a/internal/database/sink/highway/query.sql b/internal/database/sink/highway/query.sql deleted file mode 100644 index 8130158d7..000000000 --- a/internal/database/sink/highway/query.sql +++ /dev/null @@ -1,151 +0,0 @@ --- name: InsertCredential :one -INSERT INTO credentials ( - id, - created_at, - updated_at, - deleted_at, - handle, - credential_id, - authenticator_attachment, - origin, - type, - transports -) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) -RETURNING *; - --- name: InsertProfile :one -INSERT INTO profiles ( - id, - created_at, - updated_at, - deleted_at, - address, - handle, - origin, - name, - status -) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) -RETURNING *; - --- name: GetProfileByID :one -SELECT * FROM profiles -WHERE id = ? AND deleted_at IS NULL -LIMIT 1; - --- name: GetProfileByAddress :one -SELECT * FROM profiles -WHERE address = ? AND deleted_at IS NULL -LIMIT 1; - --- name: GetChallengeBySessionID :one -SELECT challenge FROM sessions -WHERE id = ? AND deleted_at IS NULL -LIMIT 1; - --- name: GetHumanVerificationNumbers :one -SELECT is_human_first, is_human_last FROM sessions -WHERE id = ? AND deleted_at IS NULL -LIMIT 1; - --- name: GetSessionByID :one -SELECT * FROM sessions -WHERE id = ? AND deleted_at IS NULL -LIMIT 1; - --- name: GetSessionByClientIP :one -SELECT * FROM sessions -WHERE client_ipaddr = ? AND deleted_at IS NULL -LIMIT 1; - --- name: UpdateSessionHumanVerification :one -UPDATE sessions -SET - is_human_first = ?, - is_human_last = ?, - updated_at = CURRENT_TIMESTAMP -WHERE id = ? -RETURNING *; - --- name: UpdateSessionWithProfileID :one -UPDATE sessions -SET - profile_id = ?, - updated_at = CURRENT_TIMESTAMP -WHERE id = ? -RETURNING *; - --- name: CheckHandleExists :one -SELECT COUNT(*) > 0 as handle_exists FROM profiles -WHERE handle = ? -AND deleted_at IS NULL; - --- name: GetCredentialsByHandle :many -SELECT * FROM credentials -WHERE handle = ? -AND deleted_at IS NULL; - --- name: GetCredentialByID :one -SELECT * FROM credentials -WHERE credential_id = ? -AND deleted_at IS NULL -LIMIT 1; - --- name: SoftDeleteCredential :exec -UPDATE credentials -SET deleted_at = CURRENT_TIMESTAMP -WHERE credential_id = ?; - --- name: SoftDeleteProfile :exec -UPDATE profiles -SET deleted_at = CURRENT_TIMESTAMP -WHERE id = ?; - --- name: UpdateProfile :one -UPDATE profiles -SET - name = ?, - handle = ?, - updated_at = CURRENT_TIMESTAMP -WHERE id = ? -AND deleted_at IS NULL -RETURNING *; - --- name: GetProfileByHandle :one -SELECT * FROM profiles -WHERE handle = ? -AND deleted_at IS NULL -LIMIT 1; - --- name: GetVaultConfigByCID :one -SELECT * FROM vaults -WHERE cid = ? -AND deleted_at IS NULL -LIMIT 1; - --- name: GetVaultRedirectURIBySessionID :one -SELECT redirect_uri FROM vaults -WHERE session_id = ? -AND deleted_at IS NULL -LIMIT 1; - --- name: CreateSession :one -INSERT INTO sessions ( - id, - created_at, - updated_at, - deleted_at, - browser_name, - browser_version, - client_ipaddr, - platform, - is_desktop, - is_mobile, - is_tablet, - is_tv, - is_bot, - challenge, - is_human_first, - is_human_last, - profile_id -) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) -RETURNING *; diff --git a/internal/database/sink/highway/schema.sql b/internal/database/sink/highway/schema.sql deleted file mode 100644 index ecfc2b3a1..000000000 --- a/internal/database/sink/highway/schema.sql +++ /dev/null @@ -1,122 +0,0 @@ --- Profiles represent user identities -CREATE TABLE profiles ( - id TEXT PRIMARY KEY, - created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - deleted_at DATETIME, - address TEXT NOT NULL, - handle TEXT NOT NULL UNIQUE, - origin TEXT NOT NULL, - name TEXT NOT NULL, - status TEXT NOT NULL, - UNIQUE(address, origin) -); - --- Accounts represent blockchain accounts -CREATE TABLE accounts ( - id TEXT PRIMARY KEY, - created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - deleted_at DATETIME, - number INTEGER NOT NULL, - sequence INTEGER NOT NULL DEFAULT 0, - address TEXT NOT NULL UNIQUE, - public_key TEXT NOT NULL, - chain_id TEXT NOT NULL, - controller TEXT NOT NULL, - is_subsidiary INTEGER NOT NULL DEFAULT 0, - is_validator INTEGER NOT NULL DEFAULT 0, - is_delegator INTEGER NOT NULL DEFAULT 0, - is_accountable INTEGER NOT NULL DEFAULT 1 -); - --- Assets represent tokens and coins -CREATE TABLE assets ( - id TEXT PRIMARY KEY, - created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - deleted_at DATETIME, - name TEXT NOT NULL, - symbol TEXT NOT NULL, - decimals INTEGER NOT NULL CHECK(decimals >= 0), - chain_id TEXT NOT NULL, - channel TEXT NOT NULL, - asset_type TEXT NOT NULL, - coingecko_id TEXT, - UNIQUE(chain_id, symbol) -); - --- Credentials store WebAuthn credentials -CREATE TABLE credentials ( - id TEXT PRIMARY KEY, - created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - deleted_at DATETIME, - handle TEXT NOT NULL, - credential_id TEXT NOT NULL UNIQUE, - authenticator_attachment TEXT NOT NULL, - origin TEXT NOT NULL, - type TEXT NOT NULL, - transports TEXT NOT NULL -); - --- Sessions track user authentication state -CREATE TABLE sessions ( - id TEXT PRIMARY KEY, - created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - deleted_at DATETIME, - browser_name TEXT NOT NULL, - browser_version TEXT NOT NULL, - client_ipaddr TEXT NOT NULL, - platform TEXT NOT NULL, - is_desktop INTEGER NOT NULL DEFAULT 0, - is_mobile INTEGER NOT NULL DEFAULT 0, - is_tablet INTEGER NOT NULL DEFAULT 0, - is_tv INTEGER NOT NULL DEFAULT 0, - is_bot INTEGER NOT NULL DEFAULT 0, - challenge TEXT NOT NULL, - is_human_first INTEGER NOT NULL DEFAULT 0, - is_human_last INTEGER NOT NULL DEFAULT 0, - profile_id TEXT NOT NULL, - FOREIGN KEY (profile_id) REFERENCES profiles(id) -); - --- Vaults store encrypted data -CREATE TABLE vaults ( - id TEXT PRIMARY KEY, - created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - deleted_at DATETIME, - handle TEXT NOT NULL, - origin TEXT NOT NULL, - address TEXT NOT NULL, - cid TEXT NOT NULL UNIQUE, - config TEXT NOT NULL, - session_id TEXT NOT NULL, - redirect_uri TEXT NOT NULL, - FOREIGN KEY (session_id) REFERENCES sessions(id) -); - --- Indexes for common queries -CREATE INDEX idx_profiles_handle ON profiles(handle); -CREATE INDEX idx_profiles_address ON profiles(address); -CREATE INDEX idx_profiles_origin ON profiles(origin); -CREATE INDEX idx_profiles_status ON profiles(status); -CREATE INDEX idx_profiles_deleted_at ON profiles(deleted_at); - -CREATE INDEX idx_accounts_address ON accounts(address); -CREATE INDEX idx_accounts_chain_id ON accounts(chain_id); -CREATE INDEX idx_accounts_deleted_at ON accounts(deleted_at); - -CREATE INDEX idx_assets_symbol ON assets(symbol); -CREATE INDEX idx_assets_chain_id ON assets(chain_id); -CREATE INDEX idx_assets_deleted_at ON assets(deleted_at); - -CREATE INDEX idx_credentials_handle ON credentials(handle); -CREATE INDEX idx_credentials_origin ON credentials(origin); -CREATE INDEX idx_credentials_deleted_at ON credentials(deleted_at); - -CREATE INDEX idx_sessions_profile_id ON sessions(profile_id); -CREATE INDEX idx_sessions_client_ipaddr ON sessions(client_ipaddr); -CREATE INDEX idx_sessions_deleted_at ON sessions(deleted_at); diff --git a/internal/database/sink/sink.go b/internal/database/sink/sink.go deleted file mode 100644 index 09c662283..000000000 --- a/internal/database/sink/sink.go +++ /dev/null @@ -1,8 +0,0 @@ -package sink - -import ( - _ "embed" -) - -//go:embed vault/schema.sql -var SchemaVaultSQL string diff --git a/internal/database/sink/vault/query.sql b/internal/database/sink/vault/query.sql deleted file mode 100644 index f4692ac71..000000000 --- a/internal/database/sink/vault/query.sql +++ /dev/null @@ -1,138 +0,0 @@ --- name: InsertCredential :one -INSERT INTO credentials ( - handle, - credential_id, - origin, - type, - transports -) VALUES (?, ?, ?, ?, ?) -RETURNING *; - --- name: InsertProfile :one -INSERT INTO profiles ( - address, - handle, - origin, - name -) VALUES (?, ?, ?, ?) -RETURNING *; - --- name: GetProfileByID :one -SELECT * FROM profiles -WHERE id = ? AND deleted_at IS NULL -LIMIT 1; - --- name: GetProfileByAddress :one -SELECT * FROM profiles -WHERE address = ? AND deleted_at IS NULL -LIMIT 1; - --- name: GetChallengeBySessionID :one -SELECT challenge FROM sessions -WHERE id = ? AND deleted_at IS NULL -LIMIT 1; - --- name: GetHumanVerificationNumbers :one -SELECT is_human_first, is_human_last FROM sessions -WHERE id = ? AND deleted_at IS NULL -LIMIT 1; - --- name: GetSessionByID :one -SELECT * FROM sessions -WHERE id = ? AND deleted_at IS NULL -LIMIT 1; - --- name: GetSessionByClientIP :one -SELECT * FROM sessions -WHERE client_ipaddr = ? AND deleted_at IS NULL -LIMIT 1; - --- name: UpdateSessionHumanVerification :one -UPDATE sessions -SET - is_human_first = ?, - is_human_last = ?, - updated_at = CURRENT_TIMESTAMP -WHERE id = ? -RETURNING *; - --- name: UpdateSessionWithProfileID :one -UPDATE sessions -SET - profile_id = ?, - updated_at = CURRENT_TIMESTAMP -WHERE id = ? -RETURNING *; - --- name: CheckHandleExists :one -SELECT COUNT(*) > 0 as handle_exists FROM profiles -WHERE handle = ? -AND deleted_at IS NULL; - --- name: GetCredentialsByHandle :many -SELECT * FROM credentials -WHERE handle = ? -AND deleted_at IS NULL; - --- name: GetCredentialByID :one -SELECT * FROM credentials -WHERE credential_id = ? -AND deleted_at IS NULL -LIMIT 1; - --- name: SoftDeleteCredential :exec -UPDATE credentials -SET deleted_at = CURRENT_TIMESTAMP -WHERE credential_id = ?; - --- name: SoftDeleteProfile :exec -UPDATE profiles -SET deleted_at = CURRENT_TIMESTAMP -WHERE address = ?; - --- name: UpdateProfile :one -UPDATE profiles -SET - name = ?, - handle = ?, - updated_at = CURRENT_TIMESTAMP -WHERE address = ? -AND deleted_at IS NULL -RETURNING *; - --- name: GetProfileByHandle :one -SELECT * FROM profiles -WHERE handle = ? -AND deleted_at IS NULL -LIMIT 1; - --- name: GetVaultConfigByCID :one -SELECT * FROM vaults -WHERE cid = ? -AND deleted_at IS NULL -LIMIT 1; - --- name: GetVaultRedirectURIBySessionID :one -SELECT redirect_uri FROM vaults -WHERE session_id = ? -AND deleted_at IS NULL -LIMIT 1; - --- name: CreateSession :one -INSERT INTO sessions ( - id, - browser_name, - browser_version, - client_ipaddr, - platform, - is_desktop, - is_mobile, - is_tablet, - is_tv, - is_bot, - challenge, - is_human_first, - is_human_last, - profile_id -) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ) -RETURNING *; diff --git a/internal/database/sink/vault/schema.sql b/internal/database/sink/vault/schema.sql deleted file mode 100644 index 912d465c3..000000000 --- a/internal/database/sink/vault/schema.sql +++ /dev/null @@ -1,121 +0,0 @@ --- Profiles represent user identities -CREATE TABLE profiles ( - id TEXT PRIMARY KEY, - created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - deleted_at TIMESTAMP, - address TEXT NOT NULL, - handle TEXT NOT NULL UNIQUE, - origin TEXT NOT NULL, - name TEXT NOT NULL, - UNIQUE(address, origin) -); - --- Accounts represent blockchain accounts -CREATE TABLE accounts ( - id TEXT PRIMARY KEY, - created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - deleted_at TIMESTAMP, - number INTEGER NOT NULL, - sequence INTEGER NOT NULL DEFAULT 0, - address TEXT NOT NULL UNIQUE, - public_key TEXT NOT NULL CHECK(json_valid(public_key)), - chain_id TEXT NOT NULL, - controller TEXT NOT NULL, - is_subsidiary BOOLEAN NOT NULL DEFAULT FALSE CHECK(is_subsidiary IN (0,1)), - is_validator BOOLEAN NOT NULL DEFAULT FALSE CHECK(is_validator IN (0,1)), - is_delegator BOOLEAN NOT NULL DEFAULT FALSE CHECK(is_delegator IN (0,1)), - is_accountable BOOLEAN NOT NULL DEFAULT TRUE CHECK(is_accountable IN (0,1)) -); - --- Assets represent tokens and coins -CREATE TABLE assets ( - id TEXT PRIMARY KEY, - created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - deleted_at TIMESTAMP, - name TEXT NOT NULL, - symbol TEXT NOT NULL, - decimals INTEGER NOT NULL CHECK(decimals >= 0), - chain_id TEXT NOT NULL, - channel TEXT NOT NULL, - asset_type TEXT NOT NULL, - coingecko_id TEXT, - UNIQUE(chain_id, symbol) -); - --- Credentials store WebAuthn credentials -CREATE TABLE credentials ( - id TEXT PRIMARY KEY, - created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - deleted_at TIMESTAMP, - handle TEXT NOT NULL, - credential_id TEXT NOT NULL UNIQUE, - authenticator_attachment TEXT NOT NULL, - origin TEXT NOT NULL, - type TEXT NOT NULL, - transports TEXT NOT NULL -); - --- Sessions track user authentication state -CREATE TABLE sessions ( - id TEXT PRIMARY KEY, - created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - deleted_at TIMESTAMP, - browser_name TEXT NOT NULL, - browser_version TEXT NOT NULL, - client_ipaddr TEXT NOT NULL, - platform TEXT NOT NULL, - is_desktop BOOLEAN NOT NULL DEFAULT FALSE CHECK(is_desktop IN (0,1)), - is_mobile BOOLEAN NOT NULL DEFAULT FALSE CHECK(is_mobile IN (0,1)), - is_tablet BOOLEAN NOT NULL DEFAULT FALSE CHECK(is_tablet IN (0,1)), - is_tv BOOLEAN NOT NULL DEFAULT FALSE CHECK(is_tv IN (0,1)), - is_bot BOOLEAN NOT NULL DEFAULT FALSE CHECK(is_bot IN (0,1)), - challenge TEXT NOT NULL, - is_human_first BOOLEAN NOT NULL DEFAULT FALSE CHECK(is_human_first IN (0,1)), - is_human_last BOOLEAN NOT NULL DEFAULT FALSE CHECK(is_human_last IN (0,1)), - profile_id INTEGER NOT NULL -); - --- Vaults store encrypted data -CREATE TABLE vaults ( - id TEXT PRIMARY KEY, - created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - deleted_at TIMESTAMP, - handle TEXT NOT NULL, - origin TEXT NOT NULL, - address TEXT NOT NULL, - cid TEXT NOT NULL UNIQUE, - config TEXT NOT NULL CHECK(json_valid(config)), - session_id TEXT NOT NULL, - redirect_uri TEXT NOT NULL -); - --- Indexes for common queries -CREATE INDEX idx_profiles_handle ON profiles(handle); -CREATE INDEX idx_profiles_address ON profiles(address); -CREATE INDEX idx_profiles_deleted_at ON profiles(deleted_at); - -CREATE INDEX idx_accounts_address ON accounts(address); -CREATE INDEX idx_accounts_chain_id ON accounts(chain_id); -CREATE INDEX idx_accounts_deleted_at ON accounts(deleted_at); - -CREATE INDEX idx_assets_symbol ON assets(symbol); -CREATE INDEX idx_assets_chain_id ON assets(chain_id); -CREATE INDEX idx_assets_deleted_at ON assets(deleted_at); - -CREATE INDEX idx_credentials_handle ON credentials(handle); -CREATE INDEX idx_credentials_origin ON credentials(origin); -CREATE INDEX idx_credentials_deleted_at ON credentials(deleted_at); - -CREATE INDEX idx_sessions_profile_id ON sessions(profile_id); -CREATE INDEX idx_sessions_client_ipaddr ON sessions(client_ipaddr); -CREATE INDEX idx_sessions_deleted_at ON sessions(deleted_at); - -CREATE INDEX idx_vaults_handle ON vaults(handle); -CREATE INDEX idx_vaults_session_id ON vaults(session_id); -CREATE INDEX idx_vaults_deleted_at ON vaults(deleted_at); diff --git a/internal/database/sqlc.yaml b/internal/database/sqlc.yaml deleted file mode 100644 index e43516c01..000000000 --- a/internal/database/sqlc.yaml +++ /dev/null @@ -1,26 +0,0 @@ -version: "2" -sql: - - engine: "sqlite" - queries: "./sink/vault/query.sql" - schema: "./sink/vault/schema.sql" - gen: - go: - emit_interface: true - emit_json_tags: true - package: "motrorm" - out: "motrorm" - - - engine: "postgresql" - queries: "./sink/highway/query.sql" - schema: "./sink/highway/schema.sql" - gen: - go: - emit_all_enum_values: true - emit_enum_valid_method: true - emit_json_tags: true - emit_interface: true - emit_result_struct_pointers: true - omit_unused_structs: true - package: "hwayorm" - out: "hwayorm" - sql_package: "pgx/v5" diff --git a/x/did/types/crypto/crypto.go b/internal/didcrypto/crypto.go similarity index 100% rename from x/did/types/crypto/crypto.go rename to internal/didcrypto/crypto.go diff --git a/x/did/types/crypto/crypto_test.go b/internal/didcrypto/crypto_test.go similarity index 98% rename from x/did/types/crypto/crypto_test.go rename to internal/didcrypto/crypto_test.go index a5391166e..f6a87e0c0 100644 --- a/x/did/types/crypto/crypto_test.go +++ b/internal/didcrypto/crypto_test.go @@ -12,7 +12,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onsonr/sonr/x/did/types/crypto" + "github.com/onsonr/sonr/internal/didcrypto" ) const ( diff --git a/x/did/types/crypto/did.go b/internal/didcrypto/did.go similarity index 100% rename from x/did/types/crypto/did.go rename to internal/didcrypto/did.go diff --git a/x/did/types/crypto/did_test.go b/internal/didcrypto/did_test.go similarity index 100% rename from x/did/types/crypto/did_test.go rename to internal/didcrypto/did_test.go diff --git a/internal/ipfsnode/config.go b/internal/ipfsnode/config.go new file mode 100644 index 000000000..7cedd2b32 --- /dev/null +++ b/internal/ipfsnode/config.go @@ -0,0 +1 @@ +package ipfsnode diff --git a/internal/ipfsnode/ipfsnode.go b/internal/ipfsnode/ipfsnode.go new file mode 100644 index 000000000..7cedd2b32 --- /dev/null +++ b/internal/ipfsnode/ipfsnode.go @@ -0,0 +1 @@ +package ipfsnode diff --git a/internal/chain/log/logger.go b/internal/log/logger.go similarity index 100% rename from internal/chain/log/logger.go rename to internal/log/logger.go diff --git a/x/did/types/internal/prefixstore/prefixstore.go b/internal/prefixstore/prefixstore.go similarity index 100% rename from x/did/types/internal/prefixstore/prefixstore.go rename to internal/prefixstore/prefixstore.go diff --git a/internal/chain/router/service.go b/internal/router/service.go similarity index 90% rename from internal/chain/router/service.go rename to internal/router/service.go index acaef82f5..a145e9622 100644 --- a/internal/chain/router/service.go +++ b/internal/router/service.go @@ -3,7 +3,7 @@ package router import ( "context" - "github.com/onsonr/sonr/internal/chain/transaction" + "github.com/onsonr/sonr/internal/transaction" ) // Service is the interface that wraps the basic methods for a router. diff --git a/internal/chain/transaction/service.go b/internal/transaction/service.go similarity index 100% rename from internal/chain/transaction/service.go rename to internal/transaction/service.go diff --git a/internal/chain/transaction/transaction.go b/internal/transaction/transaction.go similarity index 100% rename from internal/chain/transaction/transaction.go rename to internal/transaction/transaction.go diff --git a/networks/README.md b/networks/README.md new file mode 100644 index 000000000..e8d976f2c --- /dev/null +++ b/networks/README.md @@ -0,0 +1,5 @@ +# Deployment + +### Prerequisites + +### Running a Network diff --git a/networks/devnet/bootstrap.sh b/networks/devnet/bootstrap.sh new file mode 100755 index 000000000..df82332cd --- /dev/null +++ b/networks/devnet/bootstrap.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +set -e diff --git a/networks/devnet/devbox.json b/networks/devnet/devbox.json new file mode 100644 index 000000000..4e34c27bc --- /dev/null +++ b/networks/devnet/devbox.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.13.7/.schema/devbox.schema.json", + "packages": ["go@latest", "cargo@latest", "uv@latest", "bun@latest"], + "env": { + "PATH": "$HOME/.cargo/bin:$HOME/go/bin:$HOME/.local/bin:$HOME/.bun/bin:$PATH", + "GITHUB_TOKEN": "$GITHUB_TOKEN", + "GOPATH": "$HOME/go", + "GOBIN": "$GOPATH/bin", + "GHQ_ROOT": "$CLONEDIR" + }, + "shell": { + "init_hook": [], + "scripts": { + "test": ["echo \"Error: no test specified\" && exit 1"] + } + } +} diff --git a/process-compose.yaml b/networks/devnet/process-compose.yaml similarity index 100% rename from process-compose.yaml rename to networks/devnet/process-compose.yaml diff --git a/networks/testnet/bootstrap.sh b/networks/testnet/bootstrap.sh new file mode 100755 index 000000000..df82332cd --- /dev/null +++ b/networks/testnet/bootstrap.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +set -e diff --git a/networks/testnet/devbox.json b/networks/testnet/devbox.json new file mode 100644 index 000000000..4e34c27bc --- /dev/null +++ b/networks/testnet/devbox.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.13.7/.schema/devbox.schema.json", + "packages": ["go@latest", "cargo@latest", "uv@latest", "bun@latest"], + "env": { + "PATH": "$HOME/.cargo/bin:$HOME/go/bin:$HOME/.local/bin:$HOME/.bun/bin:$PATH", + "GITHUB_TOKEN": "$GITHUB_TOKEN", + "GOPATH": "$HOME/go", + "GOBIN": "$GOPATH/bin", + "GHQ_ROOT": "$CLONEDIR" + }, + "shell": { + "init_hook": [], + "scripts": { + "test": ["echo \"Error: no test specified\" && exit 1"] + } + } +} diff --git a/networks/testnet/process-compose.yaml b/networks/testnet/process-compose.yaml new file mode 100644 index 000000000..4f72402cc --- /dev/null +++ b/networks/testnet/process-compose.yaml @@ -0,0 +1,23 @@ +version: "0.5" + +processes: + IPFS: + namespace: testnet + command: "ipfs daemon --mount" + ready_log_line: "Daemon is ready" + + Sonr: + namespace: testnet + command: "task sonrd:start" + depends_on: + IPFS: + condition: process_log_ready + + Hway: + namespace: testnet + command: "hway" + depends_on: + IPFS: + condition: process_log_ready + Sonr: + condition: process_started diff --git a/scripts/install.sh b/scripts/install.sh index 1b2767b00..a61d9f1c3 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -4,88 +4,88 @@ set -e # Function to detect OS and architecture detect_platform() { - OS=$(uname -s) - ARCH=$(uname -m) - - # Normalize architecture names - case "$ARCH" in - x86_64) ARCH="amd64" ;; - aarch64|arm64) ARCH="arm64" ;; - esac + OS=$(uname -s) + ARCH=$(uname -m) + + # Normalize architecture names + case "${ARCH}" in + x86_64) ARCH="amd64" ;; + aarch64 | arm64) ARCH="arm64" ;; + esac } # Function to get latest release version get_latest_version() { - LATEST_VERSION=$(curl -s https://api.github.com/repos/onsonr/sonr/releases/latest | grep "tag_name" | cut -d '"' -f 4) - LATEST_VERSION=${LATEST_VERSION#v} # Remove 'v' prefix + LATEST_VERSION=$(curl -s https://api.github.com/repos/onsonr/sonr/releases/latest | grep "tag_name" | cut -d '"' -f 4) + LATEST_VERSION=${LATEST_VERSION#v} # Remove 'v' prefix } # Function to install binaries to current directory install_tar() { - local OS_NAME=$1 - echo "Installing Sonr for $OS_NAME ($ARCH)..." - DOWNLOAD_URL="https://github.com/onsonr/sonr/releases/download/v${LATEST_VERSION}/sonr_${LATEST_VERSION}_${OS_NAME}_${ARCH}.tar.gz" - - # Download and extract - echo "Downloading Sonr..." - curl -L "$DOWNLOAD_URL" -o sonr.tar.gz - tar -xzf sonr.tar.gz - rm sonr.tar.gz - - chmod +x sonrd hway - - echo "Binaries 'sonrd' and 'hway' have been extracted to the current directory" - echo - echo "To make them available system-wide, you can move them to /usr/local/bin with:" - echo "sudo mv sonrd hway /usr/local/bin/" - echo - echo "Or move them to your personal bin directory with:" - echo "mkdir -p ~/.local/bin" - echo "mv sonrd hway ~/.local/bin/" - echo "Then add ~/.local/bin to your PATH if it's not already there" + local OS_NAME=$1 + echo "Installing Sonr for ${OS_NAME} (${ARCH})..." + DOWNLOAD_URL="https://github.com/onsonr/sonr/releases/download/v${LATEST_VERSION}/sonr_${LATEST_VERSION}_${OS_NAME}_${ARCH}.tar.gz" + + # Download and extract + echo "Downloading Sonr..." + curl -L "${DOWNLOAD_URL}" -o sonr.tar.gz + tar -xzf sonr.tar.gz + rm sonr.tar.gz + + chmod +x sonrd hway + + echo "Binaries 'sonrd' and 'hway' have been extracted to the current directory" + echo + echo "To make them available system-wide, you can move them to /usr/local/bin with:" + echo "sudo mv sonrd hway /usr/local/bin/" + echo + echo "Or move them to your personal bin directory with:" + echo "mkdir -p ~/.local/bin" + echo "mv sonrd hway ~/.local/bin/" + echo "Then add ~/.local/bin to your PATH if it's not already there" } # Function to install on Debian/Ubuntu install_debian() { - echo "Installing Sonr for Debian/Ubuntu ($ARCH)..." - SONRD_URL="https://github.com/onsonr/sonr/releases/download/v${LATEST_VERSION}/sonrd_${LATEST_VERSION}_${ARCH}.deb" - HWAY_URL="https://github.com/onsonr/sonr/releases/download/v${LATEST_VERSION}/hway_${LATEST_VERSION}_${ARCH}.deb" - - # Download packages - TMP_DIR=$(mktemp -d) - curl -L "$SONRD_URL" -o "$TMP_DIR/sonrd.deb" - curl -L "$HWAY_URL" -o "$TMP_DIR/hway.deb" - - # Install packages - sudo dpkg -i "$TMP_DIR/sonrd.deb" - sudo dpkg -i "$TMP_DIR/hway.deb" - - # Cleanup - rm -rf "$TMP_DIR" - - echo "Sonr has been installed system-wide" + echo "Installing Sonr for Debian/Ubuntu (${ARCH})..." + SONRD_URL="https://github.com/onsonr/sonr/releases/download/v${LATEST_VERSION}/sonrd_${LATEST_VERSION}_${ARCH}.deb" + HWAY_URL="https://github.com/onsonr/sonr/releases/download/v${LATEST_VERSION}/hway_${LATEST_VERSION}_${ARCH}.deb" + + # Download packages + TMP_DIR=$(mktemp -d) + curl -L "${SONRD_URL}" -o "${TMP_DIR}/sonrd.deb" + curl -L "${HWAY_URL}" -o "${TMP_DIR}/hway.deb" + + # Install packages + sudo dpkg -i "${TMP_DIR}/sonrd.deb" + sudo dpkg -i "${TMP_DIR}/hway.deb" + + # Cleanup + rm -rf "${TMP_DIR}" + + echo "Sonr has been installed system-wide" } main() { - detect_platform - get_latest_version - - case "$OS" in - Darwin) - install_tar "Darwin" - ;; - Linux) - if [ -f /etc/debian_version ]; then - install_debian - else - install_tar "Linux" - fi - ;; - *) - echo "Unsupported operating system: $OS" - exit 1 - ;; - esac + detect_platform + get_latest_version + + case "${OS}" in + Darwin) + install_tar "Darwin" + ;; + Linux) + if [[ -f /etc/debian_version ]]; then + install_debian + else + install_tar "Linux" + fi + ;; + *) + echo "Unsupported operating system: ${OS}" + exit 1 + ;; + esac } main diff --git a/scripts/setup_env.sh b/scripts/setup_env.sh new file mode 100755 index 000000000..e72bbf7f5 --- /dev/null +++ b/scripts/setup_env.sh @@ -0,0 +1,68 @@ +#!/bin/bash + +set -e + +ROOT_DIR=$(git rev-parse --show-toplevel) + +# Function to install a Go binary if it doesn't exist +function go_install() { + if ! command -v "$1" &>/dev/null; then + echo "Installing $1..." + go install "github.com/$1" + fi +} + +# Function to install a Cargo binary if it doesn't exist +function cargo_install() { + if ! command -v "$1" &>/dev/null; then + echo "Installing $1..." + cargo install "$1" + fi +} + +# Function to install a uv tool if it doesn't exist +function uv_install() { + if ! command -v "$1" &>/dev/null; then + echo "Installing $1..." + uv tool install "$1" --force + fi +} + +# Function to initialize git credentials +function set_git() { + git config --global user.name "Darp Alakun" + git config --global user.email "i@prad.nu" + + # Check if the GITHUB_TOKEN is set then authenticate with it if not ignore + if [[ -z ${GITHUB_TOKEN} ]]; then + echo "GITHUB_TOKEN is not set. Please set it before running this script." + exit 1 + else + gh auth login --with-token <<<"${GITHUB_TOKEN}" + fi +} + +function get_deps() { + go_install go-task/task/v3/cmd/task@latest + go_install x-motemen/ghq@latest + go_install a-h/templ/cmd/templ@latest + + cargo_install ripgrep + cargo_install fd-find + cargo_install eza + + uv_install aider-chat +} + +function clone_repos() { + ghq get github.com/onsonr/sonr + ghq get github.com/onsonr/nebula + ghq get github.com/onsonr/hway +} + +function main() { + get_deps + set_git +} + +main diff --git a/vault/context/wasm.go b/vault/context/wasm.go deleted file mode 100644 index d46922097..000000000 --- a/vault/context/wasm.go +++ /dev/null @@ -1,34 +0,0 @@ -//go:build js && wasm -// +build js,wasm - -package context - -import ( - "encoding/base64" - "encoding/json" - - "github.com/labstack/echo/v4" -) - -func WASMMiddleware(next echo.HandlerFunc) echo.HandlerFunc { - return func(c echo.Context) error { - // Extract WASM context from headers - if wasmCtx := c.Request().Header.Get("X-Wasm-Context"); wasmCtx != "" { - if ctx, err := decodeWasmContext(wasmCtx); err == nil { - c.Set("wasm_context", ctx) - } - } - return next(c) - } -} - -// decodeWasmContext decodes the WASM context from a base64 encoded string -func decodeWasmContext(ctx string) (map[string]any, error) { - decoded, err := base64.StdEncoding.DecodeString(ctx) - if err != nil { - return nil, err - } - var ctxData map[string]any - err = json.Unmarshal(decoded, &ctxData) - return ctxData, err -} diff --git a/vault/handlers/authorize.go b/vault/handlers/authorize.go deleted file mode 100644 index 0f7c8417e..000000000 --- a/vault/handlers/authorize.go +++ /dev/null @@ -1,23 +0,0 @@ -package handlers - -import ( - "github.com/labstack/echo/v4" -) - -func GrantAuthorization(e echo.Context) error { - // Implement authorization endpoint using passkey authentication - // Store session data in cache - return nil -} - -func GetJWKS(e echo.Context) error { - // Implement token endpoint - // Use cached session data for validation - return nil -} - -func GetToken(e echo.Context) error { - // Implement token endpoint - // Use cached session data for validation - return nil -} diff --git a/vault/handlers/errors.go b/vault/handlers/errors.go deleted file mode 100644 index 5ac8282f4..000000000 --- a/vault/handlers/errors.go +++ /dev/null @@ -1 +0,0 @@ -package handlers diff --git a/vault/handlers/index.go b/vault/handlers/index.go deleted file mode 100644 index 609bbb780..000000000 --- a/vault/handlers/index.go +++ /dev/null @@ -1,11 +0,0 @@ -package handlers - -import ( - "net/http" - - "github.com/labstack/echo/v4" -) - -func RenderIndex(c echo.Context) error { - return c.Render(http.StatusOK, "index.templ", nil) -} diff --git a/vault/handlers/login.go b/vault/handlers/login.go deleted file mode 100644 index 5ac8282f4..000000000 --- a/vault/handlers/login.go +++ /dev/null @@ -1 +0,0 @@ -package handlers diff --git a/vault/handlers/profile.go b/vault/handlers/profile.go deleted file mode 100644 index 5ac8282f4..000000000 --- a/vault/handlers/profile.go +++ /dev/null @@ -1 +0,0 @@ -package handlers diff --git a/vault/handlers/search.go b/vault/handlers/search.go deleted file mode 100644 index 5ac8282f4..000000000 --- a/vault/handlers/search.go +++ /dev/null @@ -1 +0,0 @@ -package handlers diff --git a/vault/handlers/wallet.go b/vault/handlers/wallet.go deleted file mode 100644 index 1b6420c1c..000000000 --- a/vault/handlers/wallet.go +++ /dev/null @@ -1,7 +0,0 @@ -package handlers - -import "github.com/labstack/echo/v4" - -func HandleConnect(c echo.Context) error { - return nil -} diff --git a/vault/vault.go b/vault/vault.go deleted file mode 100644 index 77e65e41b..000000000 --- a/vault/vault.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build js && wasm - -package vault - -import ( - "github.com/labstack/echo/v4" - echomiddleware "github.com/labstack/echo/v4/middleware" - "github.com/onsonr/sonr/internal/config/motr" - "github.com/onsonr/sonr/internal/database/motrorm" - "github.com/onsonr/sonr/vault/context" -) - -type Vault = *echo.Echo - -// New returns a new Vault instance -func New(config *motr.Config, dbq *motrorm.Queries) (Vault, error) { - e := echo.New() - // Override default behaviors - e.IPExtractor = echo.ExtractIPDirect() - e.HTTPErrorHandler = handleError() - - // Built-in middleware - e.Use(echomiddleware.Logger()) - e.Use(echomiddleware.Recover()) - e.Use(context.WASMMiddleware) - registerRoutes(e) - return e, nil -} - -func handleError() echo.HTTPErrorHandler { - return func(err error, c echo.Context) { - if he, ok := err.(*echo.HTTPError); ok { - // Log the error if needed - c.Logger().Errorf("Error: %v", he.Message) - } - } -} - -// RegisterRoutes registers the Decentralized Web Node API routes. -func registerRoutes(e *echo.Echo) { -} diff --git a/vault/views/base_form.templ b/vault/views/base_form.templ deleted file mode 100644 index 70bf47bfe..000000000 --- a/vault/views/base_form.templ +++ /dev/null @@ -1,58 +0,0 @@ -package views - -templ Form(action, id string) { -
- { children... } -
-} - -templ FormHeader() { -
-
- { children... } -
-
-} - -templ FormBody() { - - { children... } - - -} - -templ FormFooter() { -
- { children... } -
-} - -templ FormCancel() { - - - Cancel - -} - -templ FormSubmit(text string) { - - { text } - - -} diff --git a/vault/views/base_form_templ.go b/vault/views/base_form_templ.go deleted file mode 100644 index 771d92c0f..000000000 --- a/vault/views/base_form_templ.go +++ /dev/null @@ -1,243 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.793 -package views - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -func Form(action, id string) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -func FormHeader() templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var3 := templ.GetChildren(ctx) - if templ_7745c5c3_Var3 == nil { - templ_7745c5c3_Var3 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ_7745c5c3_Var3.Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -func FormBody() templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var4 := templ.GetChildren(ctx) - if templ_7745c5c3_Var4 == nil { - templ_7745c5c3_Var4 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ_7745c5c3_Var4.Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -func FormFooter() templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var5 := templ.GetChildren(ctx) - if templ_7745c5c3_Var5 == nil { - templ_7745c5c3_Var5 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ_7745c5c3_Var5.Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -func FormCancel() templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var6 := templ.GetChildren(ctx) - if templ_7745c5c3_Var6 == nil { - templ_7745c5c3_Var6 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" Cancel") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -func FormSubmit(text string) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var7 := templ.GetChildren(ctx) - if templ_7745c5c3_Var7 == nil { - templ_7745c5c3_Var7 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var8 string - templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(text) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `vault/views/base_form.templ`, Line: 55, Col: 8} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/vault/views/base_head.templ b/vault/views/base_head.templ deleted file mode 100644 index ab385ce2b..000000000 --- a/vault/views/base_head.templ +++ /dev/null @@ -1,135 +0,0 @@ -package views - -import "fmt" - -var ( - nebulaHandle = templ.NewOnceHandle() - tailwindHandle = templ.NewOnceHandle() - alpineHandle = templ.NewOnceHandle() - dexieHandle = templ.NewOnceHandle() - htmxHandle = templ.NewOnceHandle() - turnstileHandle = templ.NewOnceHandle() -) - -templ Head(title string, nebulaVersion string) { - - @Turnstile() - @Tailwind() - @Alpine() - @Htmx() - @Dexie() - @Nebula(nebulaVersion) - - - - { title } - - - - - - { children... } - -} - -// ╭──────────────────────────────────────────────────────────╮ -// │ 3rd Party Libraries │ -// ╰──────────────────────────────────────────────────────────╯ - -// Tailwind css dependencies -templ Tailwind() { - @tailwindHandle.Once() { - - - } -} - -// Turnstile is used for cloudflare challenges -templ Turnstile() { - @turnstileHandle.Once() { - - } -} - -// Alpine is a component that renders the Alpine.js library -templ Alpine() { - @alpineHandle.Once() { - - - } -} - -// Dexie is a component that renders the Dexie.js library -templ Dexie() { - @dexieHandle.Once() { - - - } -} - -// Htmx is a component that renders the Htmx.js library -templ Htmx() { - @htmxHandle.Once() { - - - - - - - } -} - -// Nebula is a component that renders the Nebula.js library -templ Nebula(version string) { - - - @nebulaHandle.Once() { - - } -} - -// ╭───────────────────────────────────────────────────────────╮ -// │ Helper Functions │ -// ╰───────────────────────────────────────────────────────────╯ - -func jsDelivrURL(pkg string, version string, path string) string { - return fmt.Sprintf("https://cdn.jsdelivr.net/npm/%s@%s/%s", pkg, version, path) -} diff --git a/vault/views/base_head_templ.go b/vault/views/base_head_templ.go deleted file mode 100644 index da0909d9d..000000000 --- a/vault/views/base_head_templ.go +++ /dev/null @@ -1,573 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.793 -package views - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -import "fmt" - -var ( - nebulaHandle = templ.NewOnceHandle() - tailwindHandle = templ.NewOnceHandle() - alpineHandle = templ.NewOnceHandle() - dexieHandle = templ.NewOnceHandle() - htmxHandle = templ.NewOnceHandle() - turnstileHandle = templ.NewOnceHandle() -) - -func Head(title string, nebulaVersion string) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = Turnstile().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = Tailwind().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = Alpine().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = Htmx().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = Dexie().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = Nebula(nebulaVersion).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var2 string - templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(title) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `vault/views/base_head.templ`, Line: 25, Col: 16} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -// ╭──────────────────────────────────────────────────────────╮ -// │ 3rd Party Libraries │ -// ╰──────────────────────────────────────────────────────────╯ - -// Tailwind css dependencies -func Tailwind() templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var3 := templ.GetChildren(ctx) - if templ_7745c5c3_Var3 == nil { - templ_7745c5c3_Var3 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var4 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = tailwindHandle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var4), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -// Turnstile is used for cloudflare challenges -func Turnstile() templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var5 := templ.GetChildren(ctx) - if templ_7745c5c3_Var5 == nil { - templ_7745c5c3_Var5 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var6 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = turnstileHandle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var6), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -// Alpine is a component that renders the Alpine.js library -func Alpine() templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var7 := templ.GetChildren(ctx) - if templ_7745c5c3_Var7 == nil { - templ_7745c5c3_Var7 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var8 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = alpineHandle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var8), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -// Dexie is a component that renders the Dexie.js library -func Dexie() templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var11 := templ.GetChildren(ctx) - if templ_7745c5c3_Var11 == nil { - templ_7745c5c3_Var11 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var12 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = dexieHandle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var12), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -// Htmx is a component that renders the Htmx.js library -func Htmx() templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var15 := templ.GetChildren(ctx) - if templ_7745c5c3_Var15 == nil { - templ_7745c5c3_Var15 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var16 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = htmxHandle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var16), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -// Nebula is a component that renders the Nebula.js library -func Nebula(version string) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var23 := templ.GetChildren(ctx) - if templ_7745c5c3_Var23 == nil { - templ_7745c5c3_Var23 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Var26 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = nebulaHandle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var26), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -// ╭───────────────────────────────────────────────────────────╮ -// │ Helper Functions │ -// ╰───────────────────────────────────────────────────────────╯ - -func jsDelivrURL(pkg string, version string, path string) string { - return fmt.Sprintf("https://cdn.jsdelivr.net/npm/%s@%s/%s", pkg, version, path) -} - -var _ = templruntime.GeneratedTemplate diff --git a/vault/views/base_hero.templ b/vault/views/base_hero.templ deleted file mode 100644 index cf124e0cc..000000000 --- a/vault/views/base_hero.templ +++ /dev/null @@ -1,36 +0,0 @@ -package views - -templ HeroTitle(title string, subtitle string) { -
-

- { title } -

-

- { subtitle } -

-
-} - -templ HeroStart() { -
- - - Create Vault - - -
-} - -templ HeroSocials() { -
- - - - - - - - - -
-} diff --git a/vault/views/base_hero_templ.go b/vault/views/base_hero_templ.go deleted file mode 100644 index 0c2348da0..000000000 --- a/vault/views/base_hero_templ.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.793 -package views - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -func HeroTitle(title string, subtitle string) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var2 string - templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(title) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `vault/views/base_hero.templ`, Line: 6, Col: 10} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var3 string - templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(subtitle) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `vault/views/base_hero.templ`, Line: 9, Col: 13} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -func HeroStart() templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var4 := templ.GetChildren(ctx) - if templ_7745c5c3_Var4 == nil { - templ_7745c5c3_Var4 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
Create Vault
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -func HeroSocials() templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var5 := templ.GetChildren(ctx) - if templ_7745c5c3_Var5 == nil { - templ_7745c5c3_Var5 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/vault/views/base_layout.templ b/vault/views/base_layout.templ deleted file mode 100644 index 17cadae96..000000000 --- a/vault/views/base_layout.templ +++ /dev/null @@ -1,59 +0,0 @@ -package views - -templ LayoutContainer() { -
-
-
-
- { children... } -
-
-
-
-} - -// Columns is a component that renders a responsive flex container that stacks on mobile -templ LayoutColumns() { -
- { children... } -
-} - -// Rows is a component that renders a responsive flex container that wraps on mobile -templ LayoutRows() { -
- { children... } -
-} - -templ LayoutSeparator(text string) { -
-
-
- { text } -
-
-} - -// Layout is a component that renders the general layout of the application -templ LayoutView(title string) { - - - @Head(title, "0.0.11") - -
- { children... } -
- - -} - -func Clsx(attrs ...templ.Attributes) templ.Attributes { - merged := templ.Attributes{} - for _, attr := range attrs { - for k, v := range attr { - merged[k] = v - } - } - return merged -} diff --git a/vault/views/base_layout_templ.go b/vault/views/base_layout_templ.go deleted file mode 100644 index 020251d9a..000000000 --- a/vault/views/base_layout_templ.go +++ /dev/null @@ -1,222 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.793 -package views - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -func LayoutContainer() templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -// Columns is a component that renders a responsive flex container that stacks on mobile -func LayoutColumns() templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var2 := templ.GetChildren(ctx) - if templ_7745c5c3_Var2 == nil { - templ_7745c5c3_Var2 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ_7745c5c3_Var2.Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -// Rows is a component that renders a responsive flex container that wraps on mobile -func LayoutRows() templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var3 := templ.GetChildren(ctx) - if templ_7745c5c3_Var3 == nil { - templ_7745c5c3_Var3 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ_7745c5c3_Var3.Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -func LayoutSeparator(text string) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var4 := templ.GetChildren(ctx) - if templ_7745c5c3_Var4 == nil { - templ_7745c5c3_Var4 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var5 string - templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(text) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `vault/views/base_layout.templ`, Line: 33, Col: 45} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -// Layout is a component that renders the general layout of the application -func LayoutView(title string) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var6 := templ.GetChildren(ctx) - if templ_7745c5c3_Var6 == nil { - templ_7745c5c3_Var6 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = Head(title, "0.0.11").Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ_7745c5c3_Var6.Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -func Clsx(attrs ...templ.Attributes) templ.Attributes { - merged := templ.Attributes{} - for _, attr := range attrs { - for k, v := range attr { - merged[k] = v - } - } - return merged -} - -var _ = templruntime.GeneratedTemplate diff --git a/vault/views/initial.templ b/vault/views/initial.templ deleted file mode 100644 index 2f457692b..000000000 --- a/vault/views/initial.templ +++ /dev/null @@ -1,14 +0,0 @@ -package views - -import ( -) - -templ InitialView() { - @LayoutView("Sonr.ID") { - @LayoutContainer() { - @HeroTitle("Sonr.ID", "The decentralized identity layer for the web.") - @HeroStart() - @HeroSocials() - } - } -} diff --git a/vault/views/initial_templ.go b/vault/views/initial_templ.go deleted file mode 100644 index e29570ccc..000000000 --- a/vault/views/initial_templ.go +++ /dev/null @@ -1,94 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.793 -package views - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -import () - -func InitialView() templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var3 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = HeroTitle("Sonr.ID", "The decentralized identity layer for the web.").Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = HeroStart().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = HeroSocials().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = LayoutContainer().Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = LayoutView("Sonr.ID").Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/x/did/README.md b/x/did/README.md index f3bf1a7f3..2779d6d97 100644 --- a/x/did/README.md +++ b/x/did/README.md @@ -9,6 +9,7 @@ The DID module maintains several key state structures: ### Controller State The Controller state represents a Sonr DWN Vault. It includes: + - Unique identifier (number) - DID - Sonr address @@ -22,6 +23,7 @@ The Controller state represents a Sonr DWN Vault. It includes: ### Assertion State The Assertion state includes: + - DID - Controller - Subject @@ -33,6 +35,7 @@ The Assertion state includes: ### Authentication State The Authentication state includes: + - DID - Controller - Subject @@ -44,6 +47,7 @@ The Authentication state includes: ### Verification State The Verification state includes: + - DID - Controller - DID method @@ -57,6 +61,7 @@ The Verification state includes: ## State Transitions State transitions are triggered by the following messages: + - LinkAssertion - LinkAuthentication - UnlinkAssertion @@ -89,6 +94,7 @@ The DID module provides the following query endpoints: ## Params The module parameters include: + - Allowed public keys (map of KeyInfo) - Conveyance preference - Attestation formats @@ -123,6 +129,7 @@ This module utilizes UCAN (User Controlled Authorization Networks) to provide a ## Future Improvements Potential future improvements could include: + 1. Enhanced privacy features for DID operations, potentially leveraging UCAN capabilities for privacy-preserving authorization. 2. Integration with more blockchain networks 3. Support for additional key types and cryptographic algorithms @@ -131,6 +138,7 @@ Potential future improvements could include: ## Tests Acceptance tests should cover all major functionality, including: + - Creating and managing DIDs - Linking and unlinking assertions and authentications - Executing transactions with DIDs @@ -154,6 +162,7 @@ A Verifiable Credential (VC) is a digital statement that can be cryptographicall ### Key Types The module supports various key types, including: + - Role - Algorithm (e.g., ES256, EdDSA, ES256K) - Encoding (e.g., hex, base64, multibase) diff --git a/x/did/types/accounts.go b/x/did/types/accounts.go index b4ab46bb3..0a9a66023 100644 --- a/x/did/types/accounts.go +++ b/x/did/types/accounts.go @@ -9,8 +9,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/address" - "github.com/onsonr/sonr/internal/chain/transaction" - "github.com/onsonr/sonr/x/did/types/internal/accounts" + "github.com/onsonr/sonr/internal/accounts" + "github.com/onsonr/sonr/internal/transaction" ) var ( diff --git a/x/dwn/types/embed/codec.go b/x/dwn/types/embed/codec.go deleted file mode 100644 index 839bd0f88..000000000 --- a/x/dwn/types/embed/codec.go +++ /dev/null @@ -1,48 +0,0 @@ -package embed - -import ( - "encoding/json" - - "github.com/ipfs/boxo/files" - "github.com/onsonr/sonr/internal/config/motr" -) - -const SchemaVersion = 1 -const ( - AppManifestFileName = "app.webmanifest" - DWNConfigFileName = "dwn.json" - IndexHTMLFileName = "index.html" - MainJSFileName = "main.js" - ServiceWorkerFileName = "sw.js" -) - -// spawnVaultDirectory creates a new directory with the default files -func NewVaultFS(cfg *motr.Config) (files.Directory, error) { - manifestBz, err := NewWebManifest() - if err != nil { - return nil, err - } - cnfBz, err := json.Marshal(cfg) - if err != nil { - return nil, err - } - return files.NewMapDirectory(map[string]files.Node{ - AppManifestFileName: files.NewBytesFile(manifestBz), - DWNConfigFileName: files.NewBytesFile(cnfBz), - IndexHTMLFileName: files.NewBytesFile(IndexHTML), - MainJSFileName: files.NewBytesFile(MainJS), - ServiceWorkerFileName: files.NewBytesFile(WorkerJS), - }), nil -} - -// NewVaultConfig returns the default vault config -func NewVaultConfig(addr string, ucanCID string) *motr.Config { - return &motr.Config{ - MotrToken: ucanCID, - MotrAddress: addr, - IpfsGatewayUrl: "http://localhost:80", - SonrApiUrl: "http://localhost:1317", - SonrRpcUrl: "http://localhost:26657", - SonrChainId: "sonr-testnet-1", - } -} diff --git a/x/dwn/types/embed/index.html b/x/dwn/types/embed/index.html deleted file mode 100644 index b830f7a1b..000000000 --- a/x/dwn/types/embed/index.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - Sonr DWN - - - - - - - - - - - - - - - - - - - - - -
- You are currently offline. Some features may be limited. -
- - - - -
-
- Loading... -
-
- - - - - - - diff --git a/x/dwn/types/embed/main.js b/x/dwn/types/embed/main.js deleted file mode 100644 index 480d26357..000000000 --- a/x/dwn/types/embed/main.js +++ /dev/null @@ -1,152 +0,0 @@ -// MessageChannel for WASM communication -let wasmChannel; -let wasmPort; - -async function initWasmChannel() { - wasmChannel = new MessageChannel(); - wasmPort = wasmChannel.port1; - - // Setup message handling from WASM - wasmPort.onmessage = (event) => { - const { type, data } = event.data; - switch (type) { - case 'WASM_READY': - console.log('WASM is ready'); - document.dispatchEvent(new CustomEvent('wasm-ready')); - break; - case 'RESPONSE': - handleWasmResponse(data); - break; - case 'SYNC_COMPLETE': - handleSyncComplete(data); - break; - } - }; -} - -// Initialize WebAssembly and Service Worker -async function init() { - try { - // Register service worker - if ('serviceWorker' in navigator) { - const registration = await navigator.serviceWorker.register('./sw.js'); - console.log('ServiceWorker registered'); - - // Wait for the service worker to be ready - await navigator.serviceWorker.ready; - - // Initialize MessageChannel - await initWasmChannel(); - - // Send the MessageChannel port to the service worker - navigator.serviceWorker.controller.postMessage({ - type: 'PORT_INITIALIZATION', - port: wasmChannel.port2 - }, [wasmChannel.port2]); - - // Register for periodic sync if available - if ('periodicSync' in registration) { - try { - await registration.periodicSync.register('wasm-sync', { - minInterval: 24 * 60 * 60 * 1000 // 24 hours - }); - } catch (error) { - console.log('Periodic sync could not be registered:', error); - } - } - } - - // Initialize HTMX with custom config - htmx.config.withCredentials = true; - htmx.config.wsReconnectDelay = 'full-jitter'; - - // Override HTMX's internal request handling - htmx.config.beforeRequest = function (config) { - // Add request ID for tracking - const requestId = 'req_' + Date.now(); - config.headers['X-Wasm-Request-ID'] = requestId; - - // If offline, handle through service worker - if (!navigator.onLine) { - return false; // Let service worker handle it - } - return true; - }; - - // Handle HTMX after request - htmx.config.afterRequest = function (config) { - // Additional processing after request if needed - }; - - // Handle HTMX errors - htmx.config.errorHandler = function (error) { - console.error('HTMX Error:', error); - }; - - } catch (error) { - console.error('Initialization failed:', error); - } -} - -function handleWasmResponse(data) { - const { requestId, response } = data; - // Process the WASM response - // This might update the UI or trigger HTMX swaps - const targetElement = document.querySelector(`[data-request-id="${requestId}"]`); - if (targetElement) { - htmx.process(targetElement); - } -} - -function handleSyncComplete(data) { - const { url } = data; - // Handle successful sync - // Maybe refresh the relevant part of the UI - htmx.trigger('body', 'sync:complete', { url }); -} - -// Handle offline status changes -window.addEventListener('online', () => { - document.body.classList.remove('offline'); - // Trigger sync when back online - if (wasmPort) { - wasmPort.postMessage({ type: 'SYNC_REQUEST' }); - } -}); - -window.addEventListener('offline', () => { - document.body.classList.add('offline'); -}); - -// Custom event handlers for HTMX -document.addEventListener('htmx:beforeRequest', (event) => { - const { elt, xhr } = event.detail; - // Add request tracking - const requestId = xhr.headers['X-Wasm-Request-ID']; - elt.setAttribute('data-request-id', requestId); -}); - -document.addEventListener('htmx:afterRequest', (event) => { - const { elt, successful } = event.detail; - if (successful) { - elt.removeAttribute('data-request-id'); - } -}); - -// Initialize everything when the page loads -document.addEventListener('DOMContentLoaded', init); - -// Export functions that might be needed by WASM -window.wasmBridge = { - triggerUIUpdate: function (selector, content) { - const target = document.querySelector(selector); - if (target) { - htmx.process(htmx.parse(content).forEach(node => target.appendChild(node))); - } - }, - - showNotification: function (message, type = 'info') { - // Implement notification system - console.log(`${type}: ${message}`); - } -}; diff --git a/x/dwn/types/embed/sw.js b/x/dwn/types/embed/sw.js deleted file mode 100644 index e1490650f..000000000 --- a/x/dwn/types/embed/sw.js +++ /dev/null @@ -1,258 +0,0 @@ -// Cache names for different types of resources -const CACHE_NAMES = { - wasm: 'wasm-cache-v1', - static: 'static-cache-v1', - dynamic: 'dynamic-cache-v1' -}; - -// Import required scripts -importScripts( - "https://cdn.jsdelivr.net/gh/golang/go@go1.22.5/misc/wasm/wasm_exec.js", - "https://cdn.jsdelivr.net/gh/nlepage/go-wasm-http-server@v1.1.0/sw.js", -); - -// Initialize WASM HTTP listener -const wasmInstance = registerWasmHTTPListener("https://cdn.sonr.id/wasm/app.wasm"); - -// MessageChannel port for WASM communication -let wasmPort; - -// Request queue for offline operations -let requestQueue = new Map(); - -// Setup message channel handler -self.addEventListener('message', async (event) => { - if (event.data.type === 'PORT_INITIALIZATION') { - wasmPort = event.data.port; - setupWasmCommunication(); - } -}); - -function setupWasmCommunication() { - wasmPort.onmessage = async (event) => { - const { type, data } = event.data; - - switch (type) { - case 'WASM_REQUEST': - handleWasmRequest(data); - break; - case 'SYNC_REQUEST': - processSyncQueue(); - break; - } - }; - - // Notify that WASM is ready - wasmPort.postMessage({ type: 'WASM_READY' }); -} - -// Enhanced install event -self.addEventListener("install", (event) => { - event.waitUntil( - Promise.all([ - skipWaiting(), - // Cache WASM binary and essential resources - caches.open(CACHE_NAMES.wasm).then(cache => - cache.addAll([ - 'https://cdn.sonr.id/wasm/app.wasm', - 'https://cdn.jsdelivr.net/gh/golang/go@go1.22.5/misc/wasm/wasm_exec.js' - ]) - ) - ]) - ); -}); - -// Enhanced activate event -self.addEventListener("activate", (event) => { - event.waitUntil( - Promise.all([ - clients.claim(), - // Clean up old caches - caches.keys().then(keys => - Promise.all( - keys.map(key => { - if (!Object.values(CACHE_NAMES).includes(key)) { - return caches.delete(key); - } - }) - ) - ) - ]) - ); -}); - -// Intercept fetch events -self.addEventListener('fetch', (event) => { - const request = event.request; - - // Handle API requests differently from static resources - if (request.url.includes('/api/')) { - event.respondWith(handleApiRequest(request)); - } else { - event.respondWith(handleStaticRequest(request)); - } -}); - -async function handleApiRequest(request) { - try { - // Try to make the request - const response = await fetch(request.clone()); - - // If successful, pass through WASM handler - if (response.ok) { - return await processWasmResponse(request, response); - } - - // If offline or failed, queue the request - await queueRequest(request); - - // Return cached response if available - const cachedResponse = await caches.match(request); - if (cachedResponse) { - return cachedResponse; - } - - // Return offline response - return new Response( - JSON.stringify({ error: 'Currently offline' }), - { - status: 503, - headers: { 'Content-Type': 'application/json' } - } - ); - } catch (error) { - await queueRequest(request); - return new Response( - JSON.stringify({ error: 'Request failed' }), - { - status: 500, - headers: { 'Content-Type': 'application/json' } - } - ); - } -} - -async function handleStaticRequest(request) { - // Check cache first - const cachedResponse = await caches.match(request); - if (cachedResponse) { - return cachedResponse; - } - - try { - const response = await fetch(request); - - // Cache successful responses - if (response.ok) { - const cache = await caches.open(CACHE_NAMES.static); - cache.put(request, response.clone()); - } - - return response; - } catch (error) { - // Return offline page for navigation requests - if (request.mode === 'navigate') { - return caches.match('/offline.html'); - } - throw error; - } -} - -async function processWasmResponse(request, response) { - // Clone the response before processing - const responseClone = response.clone(); - - try { - // Process through WASM - const processedResponse = await wasmInstance.processResponse(responseClone); - - // Notify client through message channel - if (wasmPort) { - wasmPort.postMessage({ - type: 'RESPONSE', - requestId: request.headers.get('X-Wasm-Request-ID'), - response: processedResponse - }); - } - - return processedResponse; - } catch (error) { - console.error('WASM processing error:', error); - return response; - } -} - -async function queueRequest(request) { - const serializedRequest = await serializeRequest(request); - requestQueue.set(request.url, serializedRequest); - - // Register for background sync - try { - await self.registration.sync.register('wasm-sync'); - } catch (error) { - console.error('Sync registration failed:', error); - } -} - -async function serializeRequest(request) { - const headers = {}; - for (const [key, value] of request.headers.entries()) { - headers[key] = value; - } - - return { - url: request.url, - method: request.method, - headers, - body: await request.text(), - timestamp: Date.now() - }; -} - -// Handle background sync -self.addEventListener('sync', (event) => { - if (event.tag === 'wasm-sync') { - event.waitUntil(processSyncQueue()); - } -}); - -async function processSyncQueue() { - const requests = Array.from(requestQueue.values()); - - for (const serializedRequest of requests) { - try { - const response = await fetch(new Request(serializedRequest.url, { - method: serializedRequest.method, - headers: serializedRequest.headers, - body: serializedRequest.body - })); - - if (response.ok) { - requestQueue.delete(serializedRequest.url); - - // Notify client of successful sync - if (wasmPort) { - wasmPort.postMessage({ - type: 'SYNC_COMPLETE', - url: serializedRequest.url - }); - } - } - } catch (error) { - console.error('Sync failed for request:', error); - } - } -} - -// Handle payment requests -self.addEventListener("canmakepayment", function (e) { - e.respondWith(Promise.resolve(true)); -}); - -// Handle periodic sync if available -self.addEventListener('periodicsync', (event) => { - if (event.tag === 'wasm-sync') { - event.waitUntil(processSyncQueue()); - } -}); - diff --git a/x/dwn/types/embed/utils.go b/x/dwn/types/embed/utils.go deleted file mode 100644 index fac01a126..000000000 --- a/x/dwn/types/embed/utils.go +++ /dev/null @@ -1,47 +0,0 @@ -package embed - -import ( - _ "embed" - "reflect" - "strings" -) - -//go:embed index.html -var IndexHTML []byte - -//go:embed main.js -var MainJS []byte - -//go:embed sw.js -var WorkerJS []byte - -func getSchema(structType interface{}) string { - t := reflect.TypeOf(structType) - if t.Kind() == reflect.Ptr { - t = t.Elem() - } - - if t.Kind() != reflect.Struct { - return "" - } - - var fields []string - for i := 0; i < t.NumField(); i++ { - field := t.Field(i) - fieldName := toCamelCase(field.Name) - fields = append(fields, fieldName) - } - - // Add "++" at the beginning, separated by a comma - return "++, " + strings.Join(fields, ", ") -} - -func toCamelCase(s string) string { - if s == "" { - return s - } - if len(s) == 1 { - return strings.ToLower(s) - } - return strings.ToLower(s[:1]) + s[1:] -} diff --git a/x/dwn/types/embed/webworker.go b/x/dwn/types/embed/webworker.go deleted file mode 100644 index fd0e83d15..000000000 --- a/x/dwn/types/embed/webworker.go +++ /dev/null @@ -1,124 +0,0 @@ -package embed - -import "encoding/json" - -func NewWebManifest() ([]byte, error) { - return json.Marshal(baseWebManifest) -} - -var baseWebManifest = WebManifest{ - Name: "Sonr Vault", - ShortName: "Sonr.ID", - StartURL: "/index.html", - Display: "standalone", - DisplayOverride: []string{ - "fullscreen", - "minimal-ui", - }, - Icons: []IconDefinition{ - { - Src: "/icons/icon-192x192.png", - Sizes: "192x192", - Type: "image/png", - }, - }, - ServiceWorker: ServiceWorker{ - Scope: "/", - Src: "/sw.js", - UseCache: true, - }, - ProtocolHandlers: []ProtocolHandler{ - { - Scheme: "did.sonr", - URL: "/resolve/sonr/%s", - }, - { - Scheme: "did.eth", - URL: "/resolve/eth/%s", - }, - { - Scheme: "did.btc", - URL: "/resolve/btc/%s", - }, - { - Scheme: "did.usdc", - URL: "/resolve/usdc/%s", - }, - { - Scheme: "did.ipfs", - URL: "/resolve/ipfs/%s", - }, - }, -} - -type WebManifest struct { - // Required fields - Name string `json:"name"` // Full name of the application - ShortName string `json:"short_name"` // Short version of the name - - // Display and appearance - Description string `json:"description,omitempty"` // Purpose and features of the application - Display string `json:"display,omitempty"` // Preferred display mode: fullscreen, standalone, minimal-ui, browser - DisplayOverride []string `json:"display_override,omitempty"` - ThemeColor string `json:"theme_color,omitempty"` // Default theme color for the application - BackgroundColor string `json:"background_color,omitempty"` // Background color during launch - Orientation string `json:"orientation,omitempty"` // Default orientation: any, natural, landscape, portrait - - // URLs and scope - StartURL string `json:"start_url"` // Starting URL when launching - Scope string `json:"scope,omitempty"` // Navigation scope of the web application - ServiceWorker ServiceWorker `json:"service_worker,omitempty"` - - // Icons - Icons []IconDefinition `json:"icons,omitempty"` - - // Optional features - RelatedApplications []RelatedApplication `json:"related_applications,omitempty"` - PreferRelatedApplications bool `json:"prefer_related_applications,omitempty"` - Shortcuts []Shortcut `json:"shortcuts,omitempty"` - - // Experimental features (uncomment if needed) - FileHandlers []FileHandler `json:"file_handlers,omitempty"` - ProtocolHandlers []ProtocolHandler `json:"protocol_handlers,omitempty"` -} - -type FileHandler struct { - Action string `json:"action"` - Accept map[string][]string `json:"accept"` -} - -type LaunchHandler struct { - Action string `json:"action"` -} - -type IconDefinition struct { - Src string `json:"src"` - Sizes string `json:"sizes"` - Type string `json:"type,omitempty"` - Purpose string `json:"purpose,omitempty"` -} - -type ProtocolHandler struct { - Scheme string `json:"scheme"` - URL string `json:"url"` -} - -type RelatedApplication struct { - Platform string `json:"platform"` - URL string `json:"url,omitempty"` - ID string `json:"id,omitempty"` -} - -type Shortcut struct { - Name string `json:"name"` - ShortName string `json:"short_name,omitempty"` - Description string `json:"description,omitempty"` - URL string `json:"url"` - Icons []IconDefinition `json:"icons,omitempty"` -} - -type ServiceWorker struct { - Scope string `json:"scope"` - Src string `json:"src"` - UseCache bool `json:"use_cache"` -} diff --git a/x/svc/keeper/query_server.go b/x/svc/keeper/query_server.go index e079116ba..fc158b671 100644 --- a/x/svc/keeper/query_server.go +++ b/x/svc/keeper/query_server.go @@ -32,13 +32,11 @@ func (k Querier) Params(c context.Context, req *types.QueryParamsRequest) (*type // OriginExists implements types.QueryServer. func (k Querier) OriginExists(goCtx context.Context, req *types.QueryOriginExistsRequest) (*types.QueryOriginExistsResponse, error) { // ctx := sdk.UnwrapSDKContext(goCtx) - panic("OriginExists is unimplemented") return &types.QueryOriginExistsResponse{}, nil } // ResolveOrigin implements types.QueryServer. func (k Querier) ResolveOrigin(goCtx context.Context, req *types.QueryResolveOriginRequest) (*types.QueryResolveOriginResponse, error) { // ctx := sdk.UnwrapSDKContext(goCtx) - panic("ResolveOrigin is unimplemented") return &types.QueryResolveOriginResponse{}, nil }