Skip to content

Collection of Kotlin functions for signing data on Ethereum.

License

Notifications You must be signed in to change notification settings

blocto/ethereum-sign-util.kotlin

Repository files navigation

Ethereum-Sign-Util

Maven Central CircleCI GitHub

A collection of kotlin functions for signing data on Ethereum.

Ethereum-Sign-Util that is currently under development, alpha builds are available in the Sonatype staging repository.

How to

repositories {
    mavenCentral()
    
    // If you need to get Ethereum-Sign-Util versions that are not uploaded to Maven Central.
    maven { url "https://s01.oss.sonatype.org/content/repositories/staging/" }
}

dependencies {
    implementation 'com.portto.ethereum:sign:0.1.0'
}

Functions

Create an Ethereum-specific signature for a message.

fun personalSign(privateKey: ByteArray, data: Any): String

Sign typed data according to EIP-712. The signing differs based upon the version.

fun signTypedData(
    privateKey: ByteArray,
    data: String,
    version: SignTypedDataVersion = SignTypedDataVersion.V4,
): String

Hash a typed message according to EIP-712.

fun eip712Hash(typedData: String): ByteArray

Generate the "V1" hash for the provided typed message.

fun typedSignatureHash(typedData: TypedDataV1): String

Developed By

Kihon, kihon@portto.com

License

Ethereum-Sign-Util is maintained by portto. Licensed under the MIT license.

About

Collection of Kotlin functions for signing data on Ethereum.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages