Skip to content

Instantly share code, notes, and snippets.

View johnta0's full-sized avatar
🦍

j0hnta johnta0

🦍
View GitHub Profile
@johnta0
johnta0 / key.md
Created December 23, 2020 17:45
Twitter (un)official Consumer Key

Twitter Official Consumer Key

Twitter for Android

type:            PIN
Consumer key:    3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPhone

type:            PIN

Consumer key: IQKbtAYlXLripLGPWd0HUA

@johnta0
johnta0 / fine_play.md
Last active January 16, 2020 03:57
馬の骨「Fine Play」歌詞

Google Play Music

雨が上がる 光まとった街は 新しい匂いの夕暮れ前 君は一層お喋りになって

公園じゃ子どもたちが ゴムボールで大リーグのつもり でカメラの中(ファールフライは) 声がいた

@johnta0
johnta0 / fine_play.txt
Created January 16, 2020 03:56
馬の骨「Fine Play」歌詞
雨が上がる 光まとった街は
新しい匂いの夕暮れ前
君は一層お喋りになって
公園じゃ子どもたちが
ゴムボールで大リーグのつもり
でカメラの中(ファールフライは)
声がいた
Baby you're mine
var writer = function (d, k, f) {
d = void 0 === d ? "Title" : d; k = void 0 === k ? [] : k; if (f) $.ajax({ url: "http://127.0.0.1:" + window.PORT + "/create/pdf", method: "post", data: { texts: k, proxy: window.PROXY || "" }, dataType: "json" }).done(function (c) { console.log(c) }).fail(function (c) { console.log("request failed"); writer(d, k, void 0) }); else {
f = ""; for (var c = 0; c < k.length; c++)f += "\n" + k[c]; c = window.open(); c.document.open(); c.document.write("<title>" + d + "</title>"); c.document.write("<pre>"); c.document.write(escapeHtml(f)); c.document.write("</pre>");
c.document.close()
}
}, escapeHtml = function (d) { d = d.replace(/&/g, "&amp;"); d = d.replace(/</g, "&lt;"); d = d.replace(/>/g, "&gt;"); d = d.replace(/"/g, "&quot;"); return d = d.replace(/'/g, "&#39;") };
(function () {
console.clear(); for (var d = "", k = "", f = 0, c = 0, r = [], g = [""], h = "", A = function (e) { e = void 0 === e ? 0 : e; for (var a = h + " ", b = 1; b < e; b++)a += " "; retur
@johnta0
johnta0 / somewhere_someday_somebody.lyrics
Last active May 29, 2019 13:45
Someday, somewhere, somebody by Umanohone for my own use
雨上がりのせいじゃない
新しい気分
You know what I mean
放された子犬の気分さ
派手にコケたっていいのさ
ぬかるみを蹴って
旅に出よう
ともに道に轍をつけて
# https://github.com/bitcoinjs/bitcoinjs-lib/blob/582727f6de251441c75027a6292699b6f1e1b8f2/test/integration/crypto.js#L61-L103
# の recoverParent function を言葉で要約したもの
serQp = "the point on secp256k1 representing pubkey derived from master key"
d1 = "child private key"
data = "length: 37, 左詰めで serQP"
for i in range(0, 2^31):
# 右端に index を uint32 で write
// ニュートン法で平方根を求める関数を実装する
// z -= (z*z - x) / (2*z)
package main
import (
"fmt"
)
func Sqrt(x float64) float64 {
@johnta0
johnta0 / bolt-03.md
Created August 11, 2018 09:50
Lightning Network におけるオフチェーントランザクションの構造

Lightning Network では、はじめにチャネルを開く際 Funding transaction によってマルチシグアドレスにデポジットし、そこから分配するトランザクションを更新・無効化していくことによってマイクロペイメントを行う。

この記事では、Funding transaction の output と、Commitment transaction(状態を更新するためのトランザクション)の構造について書く。

transaction input と output のオーダー

BIP69 で定義されたような Lexicographic な順番になっている。

Segwit

Lightning Network のトランザクションには基本的に SegWit(P2WSH)が用いられる。

Lightning Network 用語集

  • Announcement:
    • peer の間で交わされるメッセージで、チャネルやノードを発見するために利用される。
  • chain_hash:
    • blockchain を識別するためのユニークなハッシュ値。ほとんどの場合、genesis hash が用いられる。この値によって ln node は複数のブロックチェーンを識別する。bitcoin-cli のように reverse した値ではない。
  • Channel:
    • 2 peer 間で高速に、オフチェーンで価値を交換する方法。コインを交換するために、peer は署名を互いに交換してコミットメントTx をアップデートする。
  • Closing transaction:
  • チャネルを閉じるためのトランザクション。コミットメントトランザクションと似ているが、pending せずすぐブロードキャストする。
// つないでみてくださいね。mainnetです
pubkey@ip => 03ea9ff985ced27ef36fb7fc77e71f476259ca437fffd3ed60481baf5688d056a0@128.199.112.17