Skip to content

Latest commit

 

History

History
54 lines (42 loc) · 1.77 KB

README.md

File metadata and controls

54 lines (42 loc) · 1.77 KB

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, [email protected]

License

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