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

v0.2.0 - Prajna Testnet Release #384

Merged
merged 92 commits into from
Dec 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
3fdeade
added vesting module
arnabghose997 Oct 14, 2022
d14323b
add gosec worflow
arnabghose997 Oct 21, 2022
36e06b6
added pull request event for gosec worflow
arnabghose997 Oct 21, 2022
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
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
230cee1
feat: added babyjubjub signature verification
arnabghose997 Sep 4, 2023
e3d6404
added 'BabyJubJubSignature2023' in verificationMethodSignatureMap to …
arnabghose997 Sep 6, 2023
98d082c
added BabyJubJub keypair generation and document signing in CLI
arnabghose997 Sep 6, 2023
82e08f1
added tests for BabyJubJub keypair
arnabghose997 Sep 6, 2023
2fde2fe
refactor: ed25519 signature verification has been aligned in accordan…
arnabghose997 Sep 19, 2023
07d115b
feat: added x25519-2020 ld context
arnabghose997 Sep 20, 2023
f0d4995
fix: normalized rdf string came empty even after passing correct Json…
arnabghose997 Sep 22, 2023
c4f2a40
feat: added secp256k1-2020 context
arnabghose997 Sep 25, 2023
00f27e4
feat: added bbs-signature-2020 ld-context
arnabghose997 Sep 25, 2023
e7f86b5
feat: added secp256k1-2019 ld context
arnabghose997 Sep 25, 2023
5c8f53b
refactor: corrected signature verification function name of BbsBlsSig…
arnabghose997 Sep 25, 2023
608bc44
Merge pull request #372 from hypersign-protocol/babyjubjub-signature-…
arnabghose997 Oct 10, 2023
4ce52b2
- Pre TestnetV2 Refactor
arnabghose997 Oct 19, 2023
5e3fb53
fix: fixed the canonization process of JSON-LD documents by canonizin…
arnabghose997 Oct 30, 2023
4bcbe4e
added clients proto package to define supported constants by protocol…
arnabghose997 Oct 30, 2023
1ebd392
added check to ensure credentialMerkleRootHash is not changed while u…
arnabghose997 Oct 31, 2023
a019cfb
added check in updateCredentialStatus rpc to ensure that update only …
arnabghose997 Oct 31, 2023
256968c
added HypersignCredentialStatus2023 json-ld doc
arnabghose997 Oct 31, 2023
f9b5e0e
removed @version from internal @context doc to correct LD syntax
arnabghose997 Oct 31, 2023
91ae4a1
store related ssiKeeper methods are not exposed to prevent any usage …
arnabghose997 Nov 1, 2023
3e63994
updateDidDocumentInStore and registerDidDocumentInStore methods are r…
arnabghose997 Nov 1, 2023
e818923
moved HypersignCredentialStatus2023.jsonld to a seperate github repo;…
arnabghose997 Nov 6, 2023
36416aa
renamed X25519KeyAgreementKeyEIP5630 to X25519KeyAgreementKeyEIP5630C…
arnabghose997 Nov 6, 2023
915af78
fixed ssi genesis parameter name
arnabghose997 Nov 6, 2023
ce0091b
refactor: grouped the logic for document json-ld canonization under a…
arnabghose997 Nov 8, 2023
05d2d40
Merge pull request #373 from hypersign-protocol/w3c-signature-suite-r…
arnabghose997 Nov 9, 2023
c0928a1
Merge pull request #374 from hypersign-protocol/pre-testnet-factor
arnabghose997 Nov 9, 2023
ad004f4
Merge pull request #376 from hypersign-protocol/ld-json-fix
arnabghose997 Nov 9, 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
380f171
feat: added validation for name and properties in credential schema
arnabghose997 Nov 24, 2023
d6e1273
deps: updated vulnerable go dependencies
arnabghose997 Nov 24, 2023
8bf73b6
added validation to look for 'type' and 'format' sub-attributes in sc…
arnabghose997 Nov 24, 2023
a87f940
lint fix: simplified range expression in isValidJSONDocument function
arnabghose997 Nov 25, 2023
feca14a
Merge pull request #377 from hypersign-protocol/vc-status-context
arnabghose997 Nov 25, 2023
dfd19c8
Merge pull request #378 from hypersign-protocol/credential-schema-vc-…
arnabghose997 Nov 25, 2023
e821c4d
Merge pull request #365 from hypersign-protocol/ssi-fixed-fee
arnabghose997 Nov 25, 2023
74f15b7
Merge pull request #330 from hypersign-protocol/wasm-integration
arnabghose997 Nov 25, 2023
5e44dc2
Merge pull request #379 from hypersign-protocol/testnetv2-housekeeping
arnabghose997 Nov 25, 2023
a6d2c8c
Merge pull request #380 from hypersign-protocol/bjj-jsonld-context-su…
arnabghose997 Nov 25, 2023
700703b
Merge pull request #381 from hypersign-protocol/credential-schema-val…
arnabghose997 Nov 25, 2023
ba6e487
Merge pull request #382 from hypersign-protocol/fix-dependency-vulner…
arnabghose997 Nov 25, 2023
c863a58
Merge branch 'develop' of https://github.com/hypersign-protocol/hid-n…
arnabghose997 Nov 25, 2023
7197f3c
gosec fix: made changes based on gosec analyzer results
arnabghose997 Nov 25, 2023
f5d6baa
fixed duplicate ibcports import
arnabghose997 Nov 25, 2023
dcc22f5
gosec: added rule to exclude rule G705
arnabghose997 Nov 25, 2023
c205b6e
gosec: fixed gosec non-issue errors
arnabghose997 Nov 25, 2023
bbe698d
Merge pull request #298 from hypersign-protocol/add-gosec-git-workflow
arnabghose997 Nov 25, 2023
291a7ce
solved merge conflict for PR #300
arnabghose997 Nov 25, 2023
03eeb13
Merge pull request #300 from hypersign-protocol/294-add-vesting-module
arnabghose997 Nov 25, 2023
4deb695
feat: upgraded cosmos-sdk to v0.47 and IBC to v7; switched from proto…
arnabghose997 Dec 10, 2023
73e0279
bump go version to 1.21
arnabghose997 Dec 10, 2023
c0508c2
update README.md
arnabghose997 Dec 10, 2023
20c9d60
chore: go fmt code
arnabghose997 Dec 10, 2023
b53647a
chore: replaced deprecated cosmos-sdk error package with cosmossdk.io…
arnabghose997 Dec 10, 2023
51c0faa
fix: handled error for handle func
arnabghose997 Dec 10, 2023
14f3481
chore: remove placeholders to fix gosec issue
arnabghose997 Dec 10, 2023
a7f592f
fix: handled error to fix lint issues
arnabghose997 Dec 10, 2023
8b01cb0
Merge pull request #383 from hypersign-protocol/prajna-cosmos-sdk-upg…
arnabghose997 Dec 10, 2023
aa89f17
Merge branch 'main' into develop
arnabghose997 Dec 10, 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
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.19.7
go-version: 1.21
id: go

- name: Check out code into the Go module directory
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/gosec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Gosec
on:
pull_request:

jobs:
tests:
runs-on: ubuntu-latest
env:
GO111MODULE: on
steps:
- name: Checkout Source
uses: actions/checkout@v2

- name: Run Gosec Security Scanner
uses: cosmos/gosec@master
with:
args: -exclude=G705 ./...
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ jobs:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: 1.19
go-version: 1.21

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
Expand All @@ -47,9 +47,9 @@ jobs:
run: echo "LATEST_RELEASE_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV

- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: 1.19
go-version: 1.21

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
Expand Down
4 changes: 4 additions & 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 Expand Up @@ -31,3 +32,6 @@ dist/
.cache/
__pycache__
artifacts
node_modules
package-lock.json
generated-ts
2 changes: 1 addition & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ env:

before:
hooks:
- go mod tidy -compat=1.19
- go mod tidy -compat=1.21

builds:
- id: ubuntu-amd64
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.21

# Set up dependencies
ENV PACKAGES curl make git libc-dev bash gcc python3 jq
Expand Down
27 changes: 13 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ GOOS = $(shell go env GOOS)
GOARCH = $(shell go env GOARCH)

SDK_VERSION := $(shell go list -m github.com/cosmos/cosmos-sdk | sed 's:.* ::')
TM_VERSION := $(shell go list -m github.com/tendermint/tendermint | sed 's:.* ::')
BFT_VERSION := $(shell go list -m github.com/cometbft/cometbft | sed 's:.* ::')

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/cometbft/cometbft/version.TMCoreSemVer=$(BFT_VERSION)

BUILD_FLAGS := -ldflags '$(ldflags)'

Expand All @@ -29,19 +29,19 @@ export GO111MODULE=on
###############################################################################
.PHONY: build install

all: proto-gen swagger-docs-gen build
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),21)
@echo "ERROR: Go version 1.21 is required to build hid-noded binary"
exit 1
endif

go.sum: go.mod
@echo "--> Ensure dependencies have not been modified"
@go mod verify

install: go-version-check go.sum
install: go.sum go-version-check
go install -mod=readonly $(BUILD_FLAGS) $(HIDNODE_CMD_DIR)

build: go-version-check
Expand All @@ -51,18 +51,17 @@ build: go-version-check
### Proto ###
###############################################################################

proto-gen:
proto-gen-go:
@echo "Generating golang code from protobuf"
./scripts/protocgen.sh
./scripts/protocgen-go.sh

###############################################################################
### Docs ###
###############################################################################

swagger-docs-gen:
proto-gen-swagger:
@echo "Generating swagger docs"
./scripts/protoc-swagger-gen.sh
./scripts/protocgen-swagger.sh

proto-gen-ts:
@echo "Generating typescript code from protobuf"
./scripts/protocgen-ts.sh

###############################################################################
### Docker ###
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@ The Hypersign Identity Network is a permissionless blockchain network to manage
- Store/Update status of a Verifiable Credential
- Stake `$HID` tokens
- Submit Governance Proposals
- Transfer `$HID` tokens within and across different Tendermint-based blockchains
- Transfer `$HID` tokens within and across different Tendermint-based blockchains using IBC
- Deploy CosmWasm Smart Contracts (Governance Based)

## Prerequisite

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.21)
- make
- jq

## Get started

Expand All @@ -39,7 +41,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
77 changes: 77 additions & 0 deletions app/ante.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
package app

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

"cosmossdk.io/errors"

wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmTypes "github.com/CosmWasm/wasmd/x/wasm/types"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
ibcante "github.com/cosmos/ibc-go/v7/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
WasmKeeper *wasmkeeper.Keeper
WasmConfig *wasmTypes.WasmConfig
TXCounterStoreKey storetypes.StoreKey
SsiKeeper ssiante.SsiKeeper
}

func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
if options.AccountKeeper == nil {
return nil, errors.Wrap(sdkerrors.ErrLogic, "account keeper is required for AnteHandler")
}
if options.BankKeeper == nil {
return nil, errors.Wrap(sdkerrors.ErrLogic, "bank keeper is required for AnteHandler")
}
if options.SignModeHandler == nil {
return nil, errors.Wrap(sdkerrors.ErrLogic, "sign mode handler is required for ante builder")
}
if options.WasmConfig == nil {
return nil, errors.Wrap(sdkerrors.ErrLogic, "wasm config is required for ante builder")
}
if options.TXCounterStoreKey == nil {
return nil, errors.Wrap(sdkerrors.ErrLogic, "tx counter key is required for ante builder")
}
if options.SsiKeeper == nil {
return nil, errors.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),
wasmkeeper.NewGasRegisterDecorator(options.WasmKeeper.GetGasRegister()),
ante.NewExtensionOptionsDecorator(options.ExtensionOptionChecker),
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.NewRedundantRelayDecorator(options.IBCKeeper),
}

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