A kotlin multiplatform BLS12-381 implementation for chia key management

Related tags

Kotlin kbls
Overview

KBLS

KBLS is a kotlin multiplatform BLS12-381 implementation built for creating cross platform chia applications.

Tips are much appreciated and will definitely help motivation! :)

xch1u7kw3qyl5xypz5m34dangmwnstsrnze0k486j97yepn66gsycxss7pyuww

The currently supported platforms are:

  • jvm (android/desktop)
  • javascript
  • linuxX64
  • MinGWX64
  • MacosX64
  • MacosArm64
  • iosX64
  • iosArm64

This library is still early and in development, not all features are tested let alone audited.

Below is a list of features which are tested & have unit tests/examples to look at (see src/commonTest/kotlin/chiachat/kbls)

  • AugSchemeMPL, BasicSchemeMPL, PopSchemeMPL
    • Generate private keys
    • Generate public keys
    • Derive child private/public keys
    • Sign messages w/ private keys
    • verify signed messages
    • create aggregate signatures
    • verify aggregate signatures

Getting Started

To get started using this library, just add the following dependency to your commonMain sourceset dependencies

sourceSets {
        val commonMain by getting {
            dependencies() {
                implementation("org.chiachat:kbls:1.0.3")
            }
        }
    }

Here are some examples of using a the library (more in depth examples can be found in the unit tests)

    // Private key seed, using all 0's as an example. Normally you'd take a 24 word phrase and encode it.
    val seed = UByteArray(32).also { it.fill(0.toUByte()) }
    val msg = "hello world".encodeToByteArray()
    val secretKey = BasicSchemeMPL.keyGen(seed1)
    val publicKey = sk.getG1()
    val sig = BasicSchemeMPL.sign(sk1, msg1)
    val valid = if(BasicSchemeMPL.verify(publicKey, msg, sig)) "Signature is valid!!" else "Invalid signature"
    println(valid)

Building

To build this project simply run ./gradlew build or ./gradlew publishToMavenLocal

To run the unit tests for all available platforms run ./gradlew test

Credits

Huge thanks to Rigidity for providing a javascript implementation to reference and cross-check against the chia python implementation https://github.com/Rigidity/bls-signatures

You might also like...
📒 NotyKT is a complete 💎Kotlin-stack (Backend + Android) 📱 application built to demonstrate the use of Modern development tools with best practices implementation🦸.
📒 NotyKT is a complete 💎Kotlin-stack (Backend + Android) 📱 application built to demonstrate the use of Modern development tools with best practices implementation🦸.

NotyKT 🖊️ NotyKT is the complete Kotlin-stack note taking 🖊️ application 📱 built to demonstrate a use of Kotlin programming language in server-side

A kotlin implementation of commutative encryption based on ECC ElGamal encryption over Curve25519

komuta A commutative encryption implementation. This is a naive implementation of commutative encryption using the ElGamal scheme applied over Curve25

Netflix inspired OTT Home Screen, Contains implementation in Reactjs, Kotlin React Wrapper, Jetpack Compose Web

Netflix-Clone-React Practising React by building Netflix Clone Requirements TMDB api key : Add TMDB API key to AppApi.kt Learning Resourcce Build Netf

🏗️ Kotlin implementation of Point-Free's composable architecture

🧩 Komposable Architecture Kotlin implementation of Point-Free's The Composable Architecture 🚧 Project Status We've been using Komposable Architectur

Slime World Format implementation written in Kotlin with Zstd for bukkit.

Slime Korld Easily create many slime worlds with the Slime Korld. What is Slime Korld? Slime Korld is a bukkit library written in Kotlin to make minec

AndroidArchitecture - An Implementation of Google Recommended New Android Architecture with Kotlin
AndroidArchitecture - An Implementation of Google Recommended New Android Architecture with Kotlin

Android Architecture An Implementation of Google Recommended New Android Archite

Lambda-snake.kt - Snake Game Implementation for Web using Kotlin programming language compiled for Javascript
Lambda-snake.kt - Snake Game Implementation for Web using Kotlin programming language compiled for Javascript

Projeto da disciplina de Linguagem de Programação Funcional 2021.1 (jan/2022) 📄

A simple, classic Kotlin MVI implementation based on coroutines with Android support, clean DSL and easy to understand logic

A simple, classic Kotlin MVI implementation based on coroutines with Android support, clean DSL and easy to understand logic

A Bluetooth kotlin multiplatform "Cross-Platform" library for iOS and Android

Blue-Falcon A Bluetooth "Cross Platform" Kotlin Multiplatform library for iOS, Android, MacOS, Raspberry Pi and Javascript. Bluetooth in general has t

Releases(1.0.3)
Owner
ChiaChat
ChiaChat
:blowfish: An Android & JVM key-value storage powered by Protobuf and Coroutines

PufferDB PufferDB is a ⚡ key-value storage powered by Protocol Buffers (aka Protobuf) and Coroutines. The purpose of this library is to provide an eff

Adriel Café 94 Dec 7, 2022
Opinionated Redux-like implementation backed by Kotlin Coroutines and Kotlin Multiplatform Mobile

CoRed CoRed is Redux-like implementation that maintains the benefits of Redux's core idea without the boilerplate. No more action types, action creato

Kittinun Vantasin 28 Dec 10, 2022
Ethereum Web3 implementation for mobile (android & ios) Kotlin Multiplatform development

Mobile Kotlin web3 This is a Kotlin MultiPlatform library that ... Table of Contents Features Requirements Installation Usage Samples Set Up Locally C

IceRock Development 32 Aug 26, 2022
A pure Kotlin/Multiplatform implementation of group operations on Curve25519.

curve25519-kotlin A pure Kotlin/Multiplatform implementation of group operations on Curve25519. Gradle Kotlin DSL: dependencies { implementation("

Andrey Pfau 9 Dec 22, 2022
Gestor is an innovative open-source application for universal Minecraft mod management.

Gestor Gestor is an innovative open-source application for universal Minecraft mod management. About It combines three types of tools into a single ap

GestorMC 11 Dec 9, 2021
Solid - A CLI that tries to cover a dry-run phase for liquibase database change management

solid a CLI that tries to cover a dry-run phase for liquibase database change ma

Giovanni Panice (mos_) 1 Jan 28, 2022
How to structure a growing Gradle project with smart dependency management?

How to set up a larger Gradle project This repo shows one possibility to structure a Gradle project when you want: Centralized and maintainable build

Jendrik Johannes 59 Jan 6, 2023
Real life Kotlin Multiplatform project with an iOS application developed in Swift with SwiftUI, an Android application developed in Kotlin with Jetpack Compose and a backed in Kotlin hosted on AppEngine.

Conferences4Hall Real life Kotlin Multiplatform project with an iOS application developed in Swift with SwiftUI, an Android application developed in K

Gérard Paligot 98 Dec 15, 2022
LifecycleMvp 1.2 0.0 Kotlin is MVP architecture implementation with Android Architecture Components and Kotlin language features

MinSDK 14+ Download Gradle Add to project level build.gradle allprojects { repositories { ... maven { url 'https://jitpack.io' }

Robert 20 Nov 9, 2021
An app architecture for Kotlin/Native on Android/iOS. Use Kotlin Multiplatform Mobile.

An app architecture for Kotlin/Native on Android/iOS. Use Kotlin Multiplatform Mobile. 项目架构主要分为原生系统层、Android/iOS业务SDK层、KMM SDK层、KMM业务逻辑SDK层、iOS sdkfra

libill 4 Nov 20, 2022