Giter Club home page Giter Club logo

iota-c-light-wallet's Introduction

Notice

Not under development, kind of deprecated. I decided to split this wallet into three parts due to seperation of concerns.

IOTA C library: The library contains the basic operation to build an iota transaction bundle. POSIX, C99, thread-safe, no malloc. To make sure that it runs on any device in any operation system.

Wallet header files: Defines the universal header files which needs to get implemented. Higher level fund managment included.

Wallet implementation: An operation system, database etc. dependend implementation of an iota wallet.

The goal is that every application which includes the wallet header can run on any operation system and any implementation.

IOTA C library:

https://github.com/embedded-iota/iota-c-library

RIOS OS (IOTA C library):

https://github.com/Citrullin/RIOT/tree/master/pkg/iota-library

https://github.com/Citrullin/RIOT/tree/master/examples/iota_transaction_pthread

IOTA C Light Wallet

A big thanks to the people of the IOTA implementation of the Ledger Nano S. They create an amazing low footprint C light wallet implementation for the Nano S. We use this as base for the generic embedded C light wallet implementation.

A notice to trytes:

Due to confusion of several people, a short explanation about the conversions. The API for the conversion is available in conversion.c and conversion.h.

In this context the following words have the following meaning:

Chars: Means the char representation of an Tryte. (ASCII character) A - Z and 9. (base-27 encoded ternary number) Bytes: Means a byte representation of trytes, optimized for low storage and memory usage.
Trits: Means a int8_t array representation of trits.
Trytes: Means a int8_t array representation of trytes.

Conversion space ratio

One transaction = 2673 trytes = ((2673/81) * 48) Bytes = 2673*3 Trits = 2673 chars

Usage:

Generation of addresses

 unsigned char address[81];
 char seedChars[] = "INSERT_SEED_HERE";
 unsigned char seedBytes[48];
 chars_to_bytes(seedChars, seedBytes, 81);
 get_public_addr(seedBytes, 0, 2, address);

 char charAddress[81];
 bytes_to_chars(address, charAddress, 48);

Generation of transactions and bundles

char *seed = "YOURSEEDSTRING"; // 81 ternary characters
char address_one[82] = {0};
char address_two[82] = {0};
char *tag = "ANTAG"; //27 ternary characters

//Define the output array, where the coins must go to.
TX_OUTPUT output_txs[] = 
    {{.address = "ANADDRESS", .value = 10000, .message = "", .tag = ""}}; //ANADDRESS => 81 ternary characters


//Define the input array. Where the coins come from
TX_INPUT input_txs[] = {{.key_index = 4, .balance = 10000}};

//Define the transaction chars array. The char trytes will saved in this array. (base-27 encoded)
char transaction_chars[10][2673];
//Get all raw transaction trytes. Will saved in transaction_chars
prepare_transfers(seed, 2, output_txs, 1, input_txs, 1, transaction_chars);

iota-c-light-wallet's People

Contributors

wollac avatar tylerhann avatar peterwilli avatar citrullin avatar muxxer avatar pascalbros avatar edmundmiller avatar cylix avatar

Stargazers

Luiz Carlos Leão avatar Andrea Rebuzzi avatar yOn3l avatar Tristan Feldbusch avatar  avatar  avatar Islam Mostafa avatar  avatar Bogdan Djukic avatar  avatar  avatar  avatar Maxime avatar silvio avatar DaMarkov avatar 李耳 avatar  avatar Sebastian Fuchs avatar 0x1 avatar

Watchers

James Cloos avatar Gary Leung avatar Hu Chia Wei avatar Sascha1337 avatar  avatar lukas avatar DaMarkov avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.