https://github.com/arcblock/did-wallet-sdk-android
DID Wallet Andorid version sdk
https://github.com/arcblock/did-wallet-sdk-android
Last synced: 4 months ago
JSON representation
DID Wallet Andorid version sdk
- Host: GitHub
- URL: https://github.com/arcblock/did-wallet-sdk-android
- Owner: ArcBlock
- License: apache-2.0
- Created: 2022-03-16T03:30:57.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-01-21T06:31:59.000Z (over 1 year ago)
- Last Synced: 2025-04-14T15:08:57.302Z (about 1 year ago)
- Language: Kotlin
- Size: 333 KB
- Stars: 2
- Watchers: 17
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# did-wallet-sdk-android
DID Wallet Andorid version sdk
### Install
```groovy
implementation("io.arcblock.did:sdk-protocol:${version}")
implementation("io.arcblock.did:wallet-sdk:${version}")
implementation("org.web3j:core:4.6.0-android")
implementation("org.bitcoinj:bitcoinj-core:0.16.1"){
exclude group: 'com.google.protobuf'
}
implementation("com.google.guava:guava:30.1-android")
implementation 'com.google.protobuf:protobuf-kotlin-lite:3.19.4'
implementation('com.google.crypto.tink:tink-android:1.6.1') {
exclude module: 'protobuf-lite'
}
```
### Usage
#### DID Generate
``` kotlin
// generate mnemonic words
val codes = Bip44Utils.genMnemonicCodes()
// generate Root seed
val seed = Bip44Utils.genSeedByInsertMnemonics(codes).seed
// generate keypair derived by AppID
val keypair = IdGenerator.genAppKeyPair("zEdhj45f", 0, seed, ED25519)
// generate DID
val did = IdGenerator.sk2did(keypair.privateKey)
```
#### Sign/Verify a message
```
val sig = Signer.sign(KeyType.ETHEREUM, messageUtf8.toByteArray(), sk)
val verified = Signer.verify(KeyType.ETHEREUM, messageUtf8.toByteArray(), pk, sig)
```
### License
```
Copyright [2022] [ArcBlock.io]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```