The world needs more Lightning!

Overview

10101 (a.k.a TenTenOne)

Dependencies

This project requires Flutter and Rust. Rust toolchain can be installed via Rustup. In order to setup Flutter (as well as mobile simulators etc), please see the excellent Flutter guide here

A lot of complexity for building the app has been encapsulated in a Makefile. To see the available commands, simply run make help or make.

To install necessary project dependencies for all targets, run the following:

make deps

Documentation

This project uses flutter-rust-bridge. It is strongly encouraged to read its documentation before jumping into the project in order to understand the project's structure, conventions and ways of integrating between Rust and Flutter.

Building

The instructions below allow building the Rust backend for 10101 application.

Bindings to Flutter

Bindings for Flutter can be generated with the following command:

make gen

Native (desktop)

make native

iOS

make ios

Android

Native

For building for target devices, run:

make android

Simulator

make android-sim

Formatting

We strive to keep the code consistent, therefore before submitting PRs one should run: make format to ensure code is properly formatted.

Linting

Static analysers (clippy and flutter analyze) can be run by calling make lint.

Running

After compiling the relevant Rust backend in the previous section, invoke Flutter:

flutter run

note: Flutter might ask you which target you'd like to run.

Running 10101 for web target is currently unsupported.

Comments
  • Combine DLCs and Lightning Channels

    Combine DLCs and Lightning Channels

    Goal

    We want to build a wallet which speaks lightning and is able to do DLCs.

    Possible approaches

    Virtual channels

    Probably the most complex solution is to have 2 virtual channels. One speaking lightning, the other one speaking DLCs. E.g. something like this:

    Diagram
    flowchart LR
        A1((Alice))
        B1((Bob))
       
    
        txf[tx_fund]
        
        txc_outer[tx_commit]
        
        txs[tx_settle]
        
        txcis[tx_commit_itchysats]
        txcln[tx_commit_ln]
        or{or}
        and{and}
    
    
        A1 -- fund --> txf
        B1 -- fund --> txf
        txf --> or
        or --> txs
        or --> txc_outer
        txc_outer --> and
        and --> txcis
        and --> txcln
        
        subgraph ItchySats
          txcet_is[tx_cetN]
          txr_is[tx_refund]
          txp_is[tx_punish]
          or_is{or}
          
          txcis --> or_is
          or_is --> txp_is
          or_is --> txcet_is
          or_is --> txr_is
        end
        
        
        subgraph LN
          htlc1((htlc1))
          htlc2((htlc2))
          htlcN((htlcN))
          txp_ln[tx_punish]
    
          txcln --> txp_ln
          txcln --> htlc1
          txcln --> htlc2
          txcln --> htlcN
    
        end
    

    Advantages:

    • we might be able to use ldk, this needs to be evaluated.
    • we might be able to use maia.
    • we should be able to receive standard LN payments from anyone in LN.

    Disadvantage:

    • clearly complex
    • channels can only be opened to nodes running the same code because of the custom transaction structure. i.e. you can't open a channel to other LN nodes (LND or CLightning) with this.

    Maia speak LN

    We could implement the needed bolts into https://github.com/comit-network/maia/

    Advantage:

    • full control over the code base. We can decide to only implement what we really need
    • we should be able to receive standard LN payments from anyone in LN.

    Disadvantage:

    • complexity
    • only compatible with our own nodes, i.e. you can't open channels to other LN nodes (LND, Clightning) with this.

    LN speak DLC

    We could add the DLC feature to a lightning implementation (e.g. use LDK and extend it). The it's ok to be odd would allow us to add features to our client without breaking compatibility with other LN implementations.

    Advantage:

    • we can open a channel with other LN nodes
    • we speak native lightning out of the box

    Disadvantage:

    • Complexity
    • If we build on LDK we probably will need to fork the library to add what we need which could become a nightmare in pulling in upstream changes.
    Legends of Lightning 
    opened by holzeis 14
  • feat: parse flutter arguments

    feat: parse flutter arguments

    This will allow for providing configurations using the command line when running flutter.

    e.g.

    flutter run -d macos --dart-define="NETWORK=testnet" --dart-define="[email protected]:9045"
    

    The following parameter are supported

    • MAKER_IP
    • MAKER_PK
    • MAKER_PORT_LIGHTNING
    • MAKER_PORT_HTTP
    • MAKER_P2P_ENDPOINT (will overwrite MAKER_IP, MAKER_PK and MAKER_PORT_LIGHTNING if set)
    opened by holzeis 12
  • Create user journey for the TenTenOne wallet

    Create user journey for the TenTenOne wallet

    A lowfi set of user interfaces depicting the user journey through the app including the following flows.

    • Initialize wallet
    • Create payment channel with maker.
    • Navigation to the CFD trading app (itchysats)
    • Open a CFD trade (funding through the lightning wallet)
    • Close a CFD trade
    Legends of Lightning 
    opened by holzeis 10
  • BIP39 derived seed for a BIP84 wallet

    BIP39 derived seed for a BIP84 wallet

    This PR derives a BIP84 wallet from a BIP39 seed phrase and exposes a corresponding rust api through the flutter rust bridge. Additionally this PR already improves the structuring (to the best of my limited flutter skills).

    resolves #68 #11

    This PR is still draft as the seed screen needs a little bit more care.

    opened by holzeis 9
  • Add service selector to dashboard

    Add service selector to dashboard

    Includes navigation to CFD Trading screen, but we need more complex routing and should plug in a routing library as recommended here: https://docs.flutter.dev/development/ui/navigation#using-the-navigator

    Screenshot 2022-11-01 at 3 07 23 pm

    I will work on introducing go_router routing library so we can depict the routing between the wallet and the service screens.

    Note on naming: I don't particularly like the name service for trading/bets (...) - I thought about different names (e.g. feature or in-app-...?) but did not come up with anything satisfying so I just went with service for now.

    opened by da-kami 8
  • android: Failed to load dynamic library 'libten_ten_one.so'

    android: Failed to load dynamic library 'libten_ten_one.so'

    Regardless if on the emulated android device or through wireless debugging on the physical android device. The following error gets printed repeatedly in the logs. The app gets started though.

    E/flutter (29452): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Invalid argument(s): Failed to load dynamic library 'libten_ten_one.so': dlopen failed: library "libten_ten_one.so" not found
    E/flutter (29452): #0      _open (dart:ffi-patch/ffi_dynamic_library_patch.dart:12:43)
    E/flutter (29452): #1      new DynamicLibrary.open (dart:ffi-patch/ffi_dynamic_library_patch.dart:23:12)
    E/flutter (29452): #2      dylib (package:ten_ten_one/ffi.io.dart:12:26)
    E/flutter (29452): #3      dylib (package:ten_ten_one/ffi.io.dart)
    E/flutter (29452): #4      api (package:ten_ten_one/ffi.io.dart:13:32)
    E/flutter (29452): #5      api (package:ten_ten_one/ffi.io.dart)
    E/flutter (29452): #6      _MyAppState._callExampleFfiOne (package:ten_ten_one/main.dart:41:33)
    E/flutter (29452): #7      runPeriodically.<anonymous closure> (package:ten_ten_one/off_topic_code.dart:137:74)
    E/flutter (29452): #8      _Timer._runTimers (dart:isolate-patch/timer_impl.dart:398:19)
    E/flutter (29452): #9      _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:429:5)
    E/flutter (29452): #10     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:192:12)
    E/flutter (29452): 
    
    bug android 
    opened by holzeis 8
  • Mobile wallet

    Mobile wallet

    Mobile wallet

    Goal: Develop a mobile lightning wallet which offers non-custodial financial products based on bitcoin. The first financial product will be CFD trading.

    • [x] #9
    • [x] #11
    • [x] #10
    • [x] #7
    • [x] #8
    • [x] Setup build pipeline

    Open Decisions

    • What framework should be used for the mobile project? see discussion at https://github.com/itchysats/10101/discussions/5
    • Do we want to build the wallet in typescript (what library to use) or build a native module using neon (https://neon-bindings.com/)? Second option may be hard to cross-compile for all architectures.
    • The wallet needs to run a background task which is listening for events from the taker daemon, respectively which is monitoring it's own cfds and triggers an action e.g. if it needs to be rolled over. How should we build that part? headless-js? (https://blog.logrocket.com/run-react-native-background-tasks-headless-js/)
    Legends of Lightning epic 
    opened by holzeis 8
  • Release apk

    Release apk

    Adds the principle release workflow from ItchySats.

    • Draft release to create a new PR with an updated version in the pubspec (version needs to be provided manually) and change log.
    • Generate launcher icons for macos, windows, ios and android using flutter_launcher_icons
    • Build, sign and upload android apk to the job outputs before the actual release will be triggered.
    • Create a release from the merged release PR using https://github.com/ncipollo/release-action

    For the git actions I generated a personal GITHUB TOKEN, which we should exchange with a bot user.

    see example release here - https://github.com/holzeis/10101/releases/tag/0.1.1

    resolves #128

    opened by holzeis 7
  • feat: Support paying lightning invoices

    feat: Support paying lightning invoices

    In order to test, I have added some basic API to generate an invoice on the maker side.

    TODO(follow-up): Improve the invoice generation API and hook it up into 10101.

    opened by klochowicz 6
  • Add maker binary

    Add maker binary

    First cut of the binary. So far it just initialises the tracing and wallet (and then exits). Posting now to make sure we're on the same page with the structure.

    opened by klochowicz 6
  • Hot restart breaks rust logging

    Hot restart breaks rust logging

    Performing hot restart...                                               
    Restarted application in 366ms.
    flutter: {_TenTenOneState} {initState} {Successfully initialised wallet} {LogLevel.INFO} {09 November 2022 08:11:56 AM}
    [VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: FfiException(PANIC_ERROR, Logger to initialise: Failed to init tracing
    
    Caused by:
        a global default trace dispatcher has already been set, null)
    #0      FlutterRustBridgeBase._transformRust2DartMessage (package:flutter_rust_bridge/src/basic.dart:101:9)
    #1      FlutterRustBridgeBase.executeStream (package:flutter_rust_bridge/src/basic.dart:84:15)
    <asynchronous suspension>
    #2      _TenTenOneState.setupRustLogging.<anonymous closure> (package:ten_ten_one/main.dart:153:30)
    <asynchronous suspension>
    
    bug 
    opened by holzeis 6
  • Persist lightning payment history

    Persist lightning payment history

    I've noticed that my lightning payment history disappeared after restarting. We should persist it.

    Note: it probably is not needed for the purpose of the tournament, as we can demo all the functionality in a single run.

    opened by klochowicz 0
  • Use authentication for  maker's API calls

    Use authentication for maker's API calls

    everything except /api/offers should not be accessible to the public.

    Note: It doesn't matter that much as long we're only using it on regtest/testnet, but will be a blocker when going to mainnet.

    opened by klochowicz 0
  • Unify naming of wallet actions (e.g. sending / receiving / paying an invoice / deposit / withdraw)

    Unify naming of wallet actions (e.g. sending / receiving / paying an invoice / deposit / withdraw)

    I think this discussion can wait until after the tournament; for completion here are some of my thoughts. We don't have to action this now from my point if view :)

    I think pay makes sense in the context of an invoice, but is this not in conflict with our discussion about send / receive vs deposit / withdraw? One conclusion there was that we could agree on send/receive and send-on-chain/receive-on-chain. Would you keep the actions buttons for the Lightning wallet as Send and Receive but use pay in the context of an invoice?

    Originally posted by @da-kami in https://github.com/itchysats/10101/pull/251#discussion_r1027368806

    opened by klochowicz 1
  • LOL Pitch Presentation / Story

    LOL Pitch Presentation / Story

    From Ledgends of Lightning email:

    Make it easy for the judges to learn about your project by writing up one final story in the form of a "pitch". This should include details on your project such as what it is, why and how you built it, who's on your team, your project's roadmap and next steps, as well as any relevant links (e.g to #BuildInPublic articles), etc.

    Legends of Lightning 
    opened by da-kami 0
  • LOL Video

    LOL Video

    Create a 5~ minutes video that showcases 10101 for the Ledgends of Lightning submission.

    We recommend you also record a short 5 minute video of this summary/pitch which you can embed or link prior to the submission deadline.

    Legends of Lightning 
    opened by da-kami 1
Releases(0.1.0)
Owner
ItchySats
Trade derivatives peer-to-peer on Bitcoin
ItchySats
World Time App - World time application made using flutter

World Time App Flutter Application to view time in different parts of world. This was my first app built while learning flutter App Screenshots Loadin

Akash Rajpurohit 0 Jan 17, 2020
Flutter-world-time-practice - World Time Tutorial App For Flutter

world_time Result of Flutter Tutorial for Beginners Navigation: pushNamed, pop r

Seonghyeon Cho 1 Feb 7, 2022
A platform for car sharing where users can book any car that suits their needs and wants for their intended journey, from the closest hosts in the community.

Getting Started This project is a starting point for a Flutter application. For help getting started with Flutter, view our online documentation, whic

Faisal Ramdan 28 Apr 29, 2022
AMURoboclub is the official app of AMURoboclub, a student body of ZHCET that nurtures the needs of curious and innovative minds

AMURoboclub is the official app of AMURoboclub, a student body of ZHCET that nurtures the needs of curious and innovative minds. It is the nerve center of robotics enthusiasts who are curious and innovative and wish to come together to learn and share. With the motto 'Where Innovation Meets Implementation', it endeavors to ignite young minds with the fuel of robotics. Enabling that, the app ensures to acquaint its users with the various activities and achievements of AMURoboclub.

AMU Roboclub 8 Oct 31, 2022
With TOT you can find a teacher that is suitable for your needs with less effort, less time, and less money.

TOT App In TOT we are here to help you find a teacher at any aspect of science you want from kindergarten to secondary schools. Instead of searching m

Ahmed Hussein 2 Sep 29, 2022
DoItEverywhere fitnessApp - DIE - A project created in flutter for the needs of classes

DIE - DoItEverywhere DIE is a project created in flutter for the needs of classe

Grzegorz Kucharski 0 Jan 31, 2022
Magpie-fly is a component library produced by 58 Group, which encapsulates a variety of common components to meet the needs of developers

[toc] magpie_fly Magpie-fly 是58集体出品组件库,封装了多种常用组件,以满足开发者需求。(Magpie-fly is a component library produced by 58 Group, which encapsulates a variety of com

Wuba 40 Mar 18, 2022
The application contains the Noble Qur’an, Qur’an radio stations, morning and evening remembrances, and some supplications that a Muslim needs in his life, as well as prayer times, the direction of the qiblah, and the Forty-Nawawi book

The application contains the Noble Qur’an, Qur’an radio stations, morning and evening remembrances, and some supplications that a Muslim needs in his life, as well as prayer times, the direction of the qiblah, and the Forty-Nawawi book

Mohamed Ayad 14 Oct 2, 2022
Application that calculates the calorie needs of a person.

calories_app It is an application that calculates a person's calorie requirement. Getting Started This project is a starting point for a Flutter appli

Edghi 3 Oct 12, 2022
Weather app using Bloc architecture pattern & generic HTTP client with interface implementation and much more for more detail read Readme

weather Weather application for current weather, hourly forecast for 48 hours, Daily forecast for 7 days and national weather alerts. How to Run Insta

Jibran Ahmed SiddiQui 9 Oct 29, 2022
More than 130+ pages in this beautiful app and more than 45 developers has contributed to it.

flutter-ui-nice ❤️ Star ❤️ the repo to support the project or ?? Follow Me.Thanks! Facebook Page Twitter Medium QQ Group Flutter Open NieBin Flutter O

Flutter开源社区 3.3k Nov 20, 2022
An extended version of Flutter Colors with more swatches and more flexibility to generate your own custom swatch.

Colours An extended version of Flutter Colors with more swatches and more flexibility to generate your own custom swatch. Getting Started In your flut

Salman S 4 Nov 23, 2021
More than 130+ pages in this beautiful app and more than 45 developers has contributed to it.

flutter-ui-nice ❤️ Star ❤️ the repo to support the project or ?? Follow Me.Thanks! Facebook Page Twitter Medium QQ Group Flutter Open NieBin Flutter O

Flutter开源社区 3.3k Nov 23, 2022
An easy-to-use flutter http network requests handler with more functionality than http but more simpler than dio.

network_requests An easy-to-use flutter http network requests handler with more functionality than http but more simpler than dio. Platform Supported

Coder_Manuel 2 Oct 25, 2022
A set of real world timelines to showcase the use of timeline_tile package, built with Flutter.

beatiful_timelines Beautiful timelines built with Flutter and timeline_tile. Current examples: Timeline Showcase Football Timeline Activity Timeline S

null 229 Nov 26, 2022
Breathe is a mental health blogging app where users can join communities of doctors and other users from around the world and both share their problems as well as lend a ear to and help others

?????????????? ?????????????? In a condensed, suffocating society you can feel closed off, when you can't process your emotions and are going through

Soham Sen 3 May 16, 2022
An application to track bitcoin prices around the world.

![App Brewery Banner](https://github.com/londonappbrewery/Images/blob/master/AppBreweryBanner.png) # Bitcoin Ticker ?? ## Our Goal The object

Aryaman Prakash 1 Jan 7, 2022
Sample flutter project to show exchange Rates of leading cryptos to different currencies in the world.

bitcointicker A bitcoin ticker project Getting Started This project is a starting point for a Flutter application. A few resources to get you started

null 0 Feb 15, 2022
Simple project that consumes the World Time APi and displays the time for the chosen location.

World Time App Simple project that consumes the World Time APi and displays the time for the chosen location. Web Api WorldTime Technologies Flutter A

Mario Vieria 1 Jan 20, 2022