Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add JSON-LD support for BJJSignature2021 #380

Merged
merged 34 commits into from
Nov 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
36d7cd2
intial v0.29.2 integration
arnabghose997 Jan 20, 2023
f240043
fixed common tx flags by adding --output json flag
arnabghose997 Jan 24, 2023
c7ef717
lint fix: removed unused setGenesis() function
arnabghose997 Jan 31, 2023
fad6330
Merge pull request #360 from hypersign-protocol/develop
arnabghose997 Jun 29, 2023
66236e5
Merge pull request #361 from hypersign-protocol/develop
arnabghose997 Jun 30, 2023
958ad18
Merge pull request #364 from hypersign-protocol/develop
arnabghose997 Jul 20, 2023
a8fca3b
feat: added identityfee module to make ssi related transactions incur…
arnabghose997 Jul 25, 2023
a734c4c
added tests for fixed fee ssi txs
arnabghose997 Jul 26, 2023
a7a44b7
refactor: removed x/identityfee module and moved the fixed fee functi…
arnabghose997 Aug 5, 2023
e4d8ad1
added check to meter ssi sub-messages present in authz MsgExec message
arnabghose997 Aug 12, 2023
3c50170
Merge branch 'develop' into ssi-fixed-fee
arnabghose997 Aug 12, 2023
89e82e7
feat: added support for JSON-LD signing for VC status
arnabghose997 Nov 13, 2023
0c4abb1
feat: added JSON-LD signing support for credential schema
arnabghose997 Nov 13, 2023
d10e2ae
modified clientSpec check to do JSON-singing only for BabyJubJubSigna…
arnabghose997 Nov 13, 2023
f3abe4f
updated Swagger for Credential Schema
arnabghose997 Nov 14, 2023
9ffbb3a
merge conflict fix: imported changes from PR #378
arnabghose997 Nov 20, 2023
1d22b51
fixed merge conflicts
arnabghose997 Nov 20, 2023
4f1021e
fixed ssi genesis param chainNamespace in docker script; removed loca…
arnabghose997 Nov 21, 2023
e75cd1a
chore: updated Go version to go1.20
arnabghose997 Nov 21, 2023
f9a92a8
chore: moved localnetsetup.sh inside scripts dir; updated README.md
arnabghose997 Nov 21, 2023
a9ebd34
chore: set the consensusVersion of ssi module to 1
arnabghose997 Nov 21, 2023
f1a65ca
chore: replace jagrat blockchainAccountId with prajna (next testnet)
arnabghose997 Nov 21, 2023
2b7383e
chore: updated cosmos-sdk to v0.45.16 and cometbft to v0.34.27
arnabghose997 Nov 21, 2023
d0352a1
chore: updated ibc to v4; updated CosmWasm to v0.31
arnabghose997 Nov 21, 2023
7c642a4
removed unused string.go
arnabghose997 Nov 21, 2023
d3e7aaa
chore: formatted go codebase using go fmt
arnabghose997 Nov 22, 2023
d5700a1
updated go version in git actions to go1.20
arnabghose997 Nov 22, 2023
82ebd3b
feat: add support for json-ld signing of BJJSignature2021 proof type
arnabghose997 Nov 23, 2023
1597bce
lint fix: removed unused function getPersonalSignSpecDocBytes
arnabghose997 Nov 23, 2023
2d970fe
fix: updated golang image version to go1.20
arnabghose997 Nov 23, 2023
26238be
Merge branch 'testnetv2-housekeeping' of https://github.com/hypersign…
arnabghose997 Nov 23, 2023
67fcc8a
comment fix for BJJSignature2021Normalize
arnabghose997 Nov 23, 2023
b31cf65
VerificationMethod being added in their respective VM relationships w…
arnabghose997 Nov 24, 2023
81d8533
fix: fixed the mapping between vmId and verificationMethodWithoutCont…
arnabghose997 Nov 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v3
with:
go-version: 1.19.7
go-version: 1.20.11
id: go

- name: Check out code into the Go module directory
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: 1.20

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
Expand All @@ -49,7 +49,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: 1.20

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*.dll
*.so
*.dylib
*.wasm

# Test binary, built with `go test -c`
*.test
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.19
FROM golang:1.20

# Set up dependencies
ENV PACKAGES curl make git libc-dev bash gcc python3 jq
Expand Down
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=hid-node \
-X github.com/cosmos/cosmos-sdk/version.AppName=hid-node \
-X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \
-X github.com/tendermint/tendermint/version.TMCoreSemVer=$(TM_VERSION)
-X github.com/tendermint/tendermint/version.TMCoreSemVer=$(TM_VERSION) \
-X github.com/hypersign-protocol/hid-node/app.ProposalsEnabled=true # enable x/wasm based proposals

BUILD_FLAGS := -ldflags '$(ldflags)'

Expand All @@ -32,8 +33,8 @@ export GO111MODULE=on
all: proto-gen-go proto-gen-swagger build

go-version-check:
ifneq ($(GO_MINOR_VERSION),19)
@echo "ERROR: Go version 1.19 is required to build hid-noded binary"
ifneq ($(GO_MINOR_VERSION),20)
@echo "ERROR: Go version 1.20 is required to build hid-noded binary"
exit 1
endif

Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ The Hypersign Identity Network is a permissionless blockchain network to manage

Following are the prerequisites that needs to be installed:

- Golang (Installation Guide: https://go.dev/doc/install) (version: 1.19+)
- Golang (Installation Guide: https://go.dev/doc/install) (version: 1.20)
- make
- jq

## Get started

Expand All @@ -39,7 +40,7 @@ Following are the prerequisites that needs to be installed:

2. Run the following script to setup a single-node blockchain. Please note that the following script requires `jq` to be installed.
```sh
bash localnet.sh
bash ./scripts/localnet-single-node/setup.sh
```

3. Start `hid-noded`:
Expand Down
72 changes: 72 additions & 0 deletions app/ante.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
package app

import (
"github.com/cosmos/cosmos-sdk/x/auth/ante"
"github.com/cosmos/ibc-go/v4/modules/core/keeper"

wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmTypes "github.com/CosmWasm/wasmd/x/wasm/types"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
ibcante "github.com/cosmos/ibc-go/v4/modules/core/ante"
ssiante "github.com/hypersign-protocol/hid-node/x/ssi/ante"
)

// HandlerOptions extend the SDK's AnteHandler options by requiring the IBC
// channel keeper.
type HandlerOptions struct {
ante.HandlerOptions

IBCKeeper *keeper.Keeper
WasmConfig *wasmTypes.WasmConfig
TXCounterStoreKey sdk.StoreKey
SsiKeeper ssiante.SsiKeeper
}

func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
if options.AccountKeeper == nil {
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "account keeper is required for AnteHandler")
}
if options.BankKeeper == nil {
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "bank keeper is required for AnteHandler")
}
if options.SignModeHandler == nil {
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "sign mode handler is required for ante builder")
}
if options.WasmConfig == nil {
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "wasm config is required for ante builder")
}
if options.TXCounterStoreKey == nil {
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "tx counter key is required for ante builder")
}
if options.SsiKeeper == nil {
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "ssi keeper is required for ante builder")
}

sigGasConsumer := options.SigGasConsumer
if sigGasConsumer == nil {
sigGasConsumer = ante.DefaultSigVerificationGasConsumer
}

anteDecorators := []sdk.AnteDecorator{
ante.NewSetUpContextDecorator(),
wasmkeeper.NewLimitSimulationGasDecorator(options.WasmConfig.SimulationGasLimit), // after setup context to enforce limits early
wasmkeeper.NewCountTXDecorator(options.TXCounterStoreKey),
ante.NewRejectExtensionOptionsDecorator(),
ssiante.NewSSITxDecorator(), // SSITxDecorator MUST always be called before MempoolFeeDecorator
ssiante.NewMempoolFeeDecorator(), // MempoolFeeDecorator MUST always be called before DeductFeeDecorator
ante.NewValidateBasicDecorator(),
ante.NewTxTimeoutHeightDecorator(),
ante.NewValidateMemoDecorator(options.AccountKeeper),
ante.NewConsumeGasForTxSizeDecorator(options.AccountKeeper),
ssiante.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper, options.SsiKeeper),
ante.NewSetPubKeyDecorator(options.AccountKeeper),
ante.NewValidateSigCountDecorator(options.AccountKeeper),
ante.NewSigGasConsumeDecorator(options.AccountKeeper, sigGasConsumer),
ante.NewSigVerificationDecorator(options.AccountKeeper, options.SignModeHandler),
ante.NewIncrementSequenceDecorator(options.AccountKeeper),
ibcante.NewAnteDecorator(options.IBCKeeper),
}

return sdk.ChainAnteDecorators(anteDecorators...), nil
}
Loading
Loading