This repository has been archived by the owner on Mar 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement and test the holder functionalities
- Loading branch information
1 parent
6fbd078
commit 3276707
Showing
82 changed files
with
672 additions
and
2,523 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,13 @@ | ||
# go-iden3-client | ||
**go iden3 client** is a library implementation for an iden3 identity client in go that also offers gomobile-friendly wrappers. | ||
# iden3-mobile | ||
**iden3 mobile** is a set of libraries that implement iden3 protocol in mobile platforms. This repository contain a set of components o do so: | ||
* go: go code that implements all the logic, and have gomobile friendly wrappers | ||
* [To do] android: android library that wrapper the binded go code | ||
* [To do] iOS: iOS library that wrapper the binded go code | ||
* [To do] flutter: flutter plugin that calls the native iOS and android libraries | ||
|
||
|
||
## Test | ||
- this library connects with the [IdenityServer](https://github.com/iden3/go-iden3-servers), so it will need a running IdentityServer. | ||
|
||
``` | ||
go test ./... | ||
``` | ||
|
||
## Usage | ||
|
||
```go | ||
// define a provider | ||
providerParams := make(map[string]string) | ||
providerParams["url"] = "http://127.0.0.1:25000/api/unstable" | ||
provider := Provider{ | ||
Type: "remote", | ||
Params: providerParams, | ||
} | ||
|
||
// new BabyJubJub public key | ||
kOpStr := "0x117f0a278b32db7380b078cdb451b509a2ed591664d1bac464e8c35a90646796" | ||
var kOpComp babyjub.PublicKeyComp | ||
err := kOpComp.UnmarshalText([]byte(kOpStr)) | ||
assert.Nil(t, err) | ||
kOpPub, err := kOpComp.Decompress() | ||
|
||
// create new keystore | ||
ks := NewKeyStore() | ||
|
||
// import key to keystore | ||
err = ks.ImportKeyBabyJub(kOpPub) | ||
|
||
// create new identity | ||
id, proofKOp, err = provider.CreateIdentity(keyStore, kOp, nil) | ||
|
||
// load identity | ||
identity, err = provider.LoadIdentity(id, kOp, proofKOp, keyStore) | ||
|
||
// add claims | ||
err := identity.AddClaims([]*merkletree.Entry{c0, c1}) | ||
|
||
// get emitted claims | ||
claims, err := identity.EmittedClaims() | ||
|
||
// get received claims | ||
claims, err := identity.ReceivedClaims() | ||
|
||
// [WIP] | ||
``` | ||
|
||
## Gomobile | ||
|
||
Using go1.12.7 linux/amd64 | ||
|
||
### First time | ||
|
||
``` | ||
go mod vendor | ||
gomobile init | ||
GO111MODULE=off go get github.com/ethereum/go-ethereum | ||
ln -s $PWD ~/go/src/ | ||
cp -r \ | ||
"${GOPATH}/src/github.com/ethereum/go-ethereum/crypto/secp256k1/libsecp256k1" \ | ||
"vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/" | ||
GO111MODULE=off gomobile bind -target=android go-iden3-light-wallet/identityprovider | ||
``` | ||
### Go | ||
1. Rename go/mobile/config-example.yml to go/mobile/config.yml, and change the value of `web3Url` for a valid web3 provider. | ||
2. `cd` into `go/mockupServer/main` and run `go run . -ip 127.0.0.1 -verifytime 1 -aprovetime 1` | ||
3. In a new terminal, `cd` into `go/mobile` and run `go test ./...` |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
33 changes: 0 additions & 33 deletions
33
flutter/android/app/src/main/java/com/example/iden3core/CallbackHandler.java
This file was deleted.
Oops, something went wrong.
35 changes: 0 additions & 35 deletions
35
flutter/android/app/src/main/java/com/example/iden3core/EventHandler.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.