get10101 / 10101-poc Goto Github PK
View Code? Open in Web Editor NEWThe world needs more Lightning!
License: MIT License
The world needs more Lightning!
License: MIT License
Before funding a cfd contract using a lightning transaction, the taker and the maker need to open a payment channel
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>
Add jobs that lint and build the whole app for different platforms.
Otherwise we risk inadvertently breaking the builds.
Upon first start of the app a wallet needs to be generated utilizing the Bip39 standard. This may be implemented using a combination of the bitcoindevkit and the lightningdevkit
Acceptance Criterias
Send Rust logs to Flutter via stream so that they can be included in the file output (and have unified logging).
see:
https://cjycode.com/flutter_rust_bridge/feature/logging.html
Use tracing
and direct all messages to the StreamSink
(implemented in #83 ).
Upon the first start of the application, a new bitcoin wallet should be created from with a seed compatible with BIP39.
This should allow us to export the seed words.
Goal: Develop a mobile lightning wallet which offers non-custodial financial products based on bitcoin. The first financial product will be CFD trading.
Write up and publish the PPP (Plan, Progress, Problems) as weekly report to https://makers.bolt.fun/project/10101
The settle confirmation screen is missing. It is modelled in the wireframes, but was not implemented.
We have a confirmation screen for opening a positions, we should also have one for closing a position.
This gives the user the chance to review the action to be performed.
Confirmation screens are good practice in financial applications.
A lowfi set of user interfaces depicting the user journey through the app including the following flows.
This is the maker part of the cfd trading. see also #82 for the taker part.
https://lightningdevkit.org/tutorials/build_a_node_in_rust/
This should be implemented as a server.
Initial exploration of flutter showed that we have a few unknowns.
Some questions:
conquer_once
/lazy_static
) in Rust, or keep them in Flutter and pass as parameters? (the latter is more library convention). By state I mean: things like the wallet, the db, the seed file etc.Currently we have not way of configuring the app. Here are a couple of settings I think would make sense on a settings screen.
Acceptance Criteria
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):
A widget which can be seen throughout multiple screens and gets updated if the balance changes.
Currently the seed is mocked, it should be wired with the seed phrase used to generate the BIP84 wallet.
Acceptance Criteria
At some point we should think about storing the seed file to the mobile device, but this is not focus of this issue.
We want to build a wallet which speaks lightning and is able to do DLCs.
Probably the most complex solution is to have 2 virtual channels. One speaking lightning, the other one speaking DLCs.
E.g. something like this:
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:
Disadvantage:
We could implement the needed bolts into https://github.com/comit-network/maia/
Advantage:
Disadvantage:
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:
Disadvantage:
Fetch Bitcoin and Lightning payment history from the wallet backend and plug it in instead of the mocked data.
This concerns the Dashboard
where we have a combined history of Bitcoin and Lightning, and the specific Lightning and Bitcoin wallet screens.
Furthermore this payment history could serve as the basis for the CFD trading overview (which is basically a subset of the Lightning history + some additional CFD specific data).
our current job, based on rust-flutter-bridge workflow is using macos-latest
, which has strict quotas, which could lead to the jobs piling up in a queue.
There's no advantage to use it over standard linux container, so use ubuntu-latest
instead (which would not cause such queuing )
With #78 we removed the generated code from the git repository and added a quick fix to generate the flutter rust bridge code in every step where needed.
It would be nice (and faster) if we could cache that bit.
This is necessary to depict our Bitcoin hot-wallet. In the long run we might be able to get rid of this and focus on a pure Lightning wallet, but for the current onboarding / offboarding process it is very hard to abstract this way.
Note: It might be good to have either way, this makes the distinction between Lightning and BTC clearer, one could even allow trading using the BTC wallet, but that is not modelled / planned for now.
https://lightningdevkit.org/tutorials/build_a_node_in_rust/
Our app is more complex than just a screen and sub-screens. The trading / bet screens are on the same hierarchy level as the wallet screen (siblings rather than child-parent).
With the introduction of go_router
in #99 we are able to depict such kind of routing relationships, but without a proper navigation menu we can't navigate between the main screens (i.e. at the moment we are unable to navigate back to the wallet once on the CFD trading screen).
Introduce a proper navigation menu as depicted in the wireframes.
Originally posted by bonomat October 12, 2022
Hi there,
I've done a bit of research and wrote this wall of text together to foster our vision around TenTenOne.
Let me know what you think below:
There are a handful of Lightning Wallets available yet. From my limited research I came across:
And then there are custodial wallets which I leave out for now. Here is a list of other wallets - not sure how up2date this is though.
Form my personal opinion
To the best of my knowledge there is no full lightning node for the phone yet which provides great UX and flexibility to open channels to whoever you want.
Additionally, there is no lightning wallet which allows you to trade in a non-custodial way.
What we can learn from Breez and Phoenix in particular is: they offer a service to open channels and have a great UX. Both of them seem to be well adopted in the wild.
As of today, there is no awesome lightning wallet which
Build an one-stop app for Bitcoiners. A mobile lightning wallet in the first place which offers non-custodial financial products (e.g. CFD trading).
// edit 13.10.2022: @bonomat fixed formatting
it would be great if FLog logs were formatted in a more similar fashion to tracing logs (they're pretty ugly right now), and are the main reason I disabled the same logs on the Flutter side from stdout (it's really hard to read them when they're interleaved).
๐จ Innovation: Is it something we've seen before or does it bring something new and exciting to bitcoin and beyond?
โก๏ธ Bitcoin Integration & Scalability: Have they used bitcoin/lightning? If so, how many features? How well will this product scale for either local or global adoption?
Setup the initial mobile wallet app.
Fund the CFD contract using the lightning channel
// edited by @bonomat: removed proposal how to solve it as the proposed approach is not yet final.
On iPhone SE (3rd gen) we have several screen overflows.
We should arrange the design to be flexible enough to expand on different screens. This usually just requires a decision on what element can expand on the screen.
We can also agree to stick to a specific screen for the tournament to reduce
Screenshots:
Furthermore, our "confirmation" buttons are placed in different locations on different screens which is not a good design practice.
I looked into using FABs everywhere, but it appears that they are not meant to be disabled, see: flutter/flutter#76120
Instead of using FABs we can make use of the SafeArea
widget, so that the bottom of the screen area (where we usually place our button) is correctly located according to screensize.
This issue summarizes the goals / features for the legends of lightning tournament.
Release app on desktop and android.
The taker gets a full fledged on and off-chain wallet
The maker runs a full lightning node server side.
(would be cool if this could also work eventually on the phone ๐ )
Taker can trade a non-perpetual CFD position.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.