Skip to content

Instantly share code, notes, and snippets.

View NCrashed's full-sized avatar
🐢

Anton Gushcha NCrashed

🐢
  • Russia, Moscow
View GitHub Profile

Не так давно @lamed опубликовал здесь введение в bitcoin. Опираясь на него, попробую рассказать про Bitcoin Lightning Network. Едва ли у меня получится так же хорошо, но я буду ориентироваться на ту же пропорцию технической корректности, доходчивости и занудства, которую вижу там; также я буду опираться на изложенные там вещи как на общеизвестные.

Участники сети bitcoin могут участвовать в генерации новых блоков ("майнинге"), а могут следить за наращиванием цепочки блоков, всего лишь проверяя соблюдение правил майнерами. И те, и другие называются "полными узлами сети" (full node). Не-майнящий полный узел помогает прежде всего своему владельцу, удостоверяя, что полученные данные о транзакциях "настоящие" (если сама запущенная реализация полного узла настоящая). Также владелец узла может запрашивать баланс своих адресов, не боясь, что чужой сервер зафиксирует его интерес конкретно к этим адресам (даже если я скрываю от чужого серве

Submarine 0 trust rebalance

  1. Alice opens 4M channel to Bob.
  2. Bob selects a random password P and calculates ripemd160 hash of it H(P).
  3. Bob locks 2M sats to the output with the script:
OP_SIZE 32 OP_EQUAL
OP_IF
OP_HASH160  OP_EQUALVERIFY
building '/nix/store/0yd4fd00z881j3m0xd7sprgpsacp5ag2-tg_owt-unstable-2022-02-25.drv'...
exporting https://github.com/telegramdesktop/tdesktop.git (rev v3.7.1) into /nix/store/dd5yk57lpsawwxvkgp80hc9ib7wr14ic-source
Initialized empty Git repository in /nix/store/dd5yk57lpsawwxvkgp80hc9ib7wr14ic-source/.git/
unpacking sources
unpacking source archive /nix/store/m1v82gncqrs8iccm5bv65kh3iwlc4c2v-source
source root is source
patching sources
configuring
fixing cmake files...
cmake flags: -GNinja -DCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY=OFF -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_SKIP_BUILD_RPATH=ON -DBUILD_TESTING=OFF -DCMAKE_INSTALL_LOCALEDIR=/nix/store/wbbvdlskwvx8v9fs2jqjfplf0ykh40y6-tg_owt-unstable-2022-02-25/share/locale -DCMAKE_INSTALL_LIBEXECDIR=/nix/store/wbbvdlskwvx8v9fs2jqjfplf0ykh40y6-tg_owt-unstable-2022-02-25/libexec -DCMAKE_INSTALL_LIBDIR=/nix/store/wbbvdlskwvx8v9fs2jqjfplf0ykh40y6-tg_owt-unstable-2022-02-25/lib -DCMAKE_INSTALL_D
@NCrashed
NCrashed / gist:16074ed461e47a2e04f7fbedc05c004a
Created October 7, 2021 18:48
Creative tab crash log 7.10.2021
Oct 07 17:52:39 main systemd[1]: Started Minecraft server.
Oct 07 17:52:39 main minecraft-server[15573]: Unrecognized option: --version
Oct 07 17:52:39 main minecraft-server[15573]: Error: Could not create the Java Virtual Machine.
Oct 07 17:52:39 main minecraft-server[15573]: Error: A fatal exception has occurred. Program will exit.
Oct 07 17:52:39 main minecraft-server[15572]: [authlib-injector] [INFO] Version: 1.1.34
Oct 07 17:52:39 main minecraft-server[15572]: [authlib-injector] [INFO] Authentication server: https://auth.kubach.tk
Oct 07 17:52:39 main minecraft-server[15572]: [authlib-injector] [DEBUG] Metadata: {"meta":{"serverName":"Koprokubach","implementationName":"yggdrasil-rust","implementationVersion":"0.1","links":{"homepage":"https://kubach.tk","register":"https://kubach.tk/register","launcher":{"linux":"https://kubach.tk/static/launcher-linux.zip","windows":"https://kubach.tk/static/launcher-windows.zip","mac":"https://kubach.tk/static/lanucher-mac.zip"},"client":{"linux":"https://kubach.tk/sta
@NCrashed
NCrashed / gist:857e37992814ca2e784224342160fd60
Created October 6, 2021 00:44
Minecraft WarpDrive cables bug log
[03:31:30] [main/INFO] [GradleStart]: Extra: []
[03:31:30] [main/INFO] [GradleStart]: Found and added coremod: cr0s.warpdrive.core.FMLLoadingPlugin
[03:31:30] [main/INFO] [GradleStart]: Running with arguments: [--userProperties, {}, --assetsDir, /home/user/.gradle/caches/minecraft/assets, --assetIndex, 1.12, --accessToken{REDACTED}, --version, 1.12.2, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker]
[03:31:30] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[03:31:30] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[03:31:30] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker
[03:31:30] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker
[03:31:30] [main/INFO] [FML]: Forge Mod Loader version 14.23.5.2847 for Minecra
import Data.ByteString
type family mode :- a :: *
infixl 0 :-
data OnlyPacketB
type instance OnlyPacketB :- PacketB OnlyPacketB = PacketB OnlyPacketB
type instance OnlyPacketB :- PacketA OnlyPacketB = ByteString
@NCrashed
NCrashed / configuration.nix
Created January 29, 2020 19:52
configuration.nix AGB
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix

Keybase proof

I hereby claim:

  • I am ncrashed on github.
  • I am ncrashed (https://keybase.io/ncrashed) on keybase.
  • I have a public key ASDogyFYeGbUcxE8QyxvGiN-qn39zJF5Bm1IDQxfdDbXpwo

To claim this, I am signing this object:

@NCrashed
NCrashed / configuration.nix
Last active February 27, 2019 21:25
configuration_kde_laptop.nix
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, lib, pkgs, ... }:
with lib;
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
@NCrashed
NCrashed / shell.nix
Created December 2, 2018 12:37
nix rust shell
# Latest Nightly
with import <nixpkgs> {};
let src = fetchFromGitHub {
owner = "mozilla";
repo = "nixpkgs-mozilla";
rev = "b9c99d043b1cb55ee8c08265223b7c35d687acb9";
sha256 = "0akyhdv5p0qiiyp6940k9bvismjqm9f8xhs0gpznjl6509dwgfxl";
};
in
with import "${src.out}/rust-overlay.nix" pkgs pkgs;