Skip to content

Instantly share code, notes, and snippets.

View visvirial's full-sized avatar
💭
On my way

Vis Virial (a.k.a. びりある) visvirial

💭
On my way
View GitHub Profile
import fetch from 'cross-fetch';
import { PublicKey, Connection, Keypair, Transaction } from '@solana/web3.js';
import * as anchor from '@project-serum/anchor';
import { QuarrySDK } from '@quarryprotocol/quarry-sdk';
import { SolanaProvider } from "@saberhq/solana-contrib";
import { Token } from '@saberhq/token-utils';
export default class Wallet {
@visvirial
visvirial / g^(a^2) incomputability.md
Last active April 19, 2021 06:24
Proof of computing (g^a => g^(a^2)) is impossible under the DH assumption.

Statement

We prove that g^(a^2) cannot be computed efficiently from g^a under the Diffie-Hellman (DH) assumption. More rigorously, the following statement holds:

Let G be a cyclic group and g be a generater of G.
Given an oracle which can compute g^(a^2) from a given g^a for any integer a,
there exists a polynomial time algorithm which computes g^(xy) from g^x and g^y for any integers x and y.

Keybase proof

I hereby claim:

  • I am visvirial on github.
  • I am mhyuga (https://keybase.io/mhyuga) on keybase.
  • I have a public key whose fingerprint is 4486 9F12 2BE4 6ED5 336E 6F68 EB94 6CB1 1439 4B39

To claim this, I am signing this object:

@visvirial
visvirial / Elliptic Curve Oblivious Transfer.md
Last active July 31, 2020 08:38
Oblivious transfer (OT) protocol that transfers points on an elliptic curve, instead of binary strings.

We propose an elliptic curve-version of oblivious transfer (ECOT) protocol which transfers points on an elliptic curve, instead of binary strings.

Oblivious transfer (OT)

Oblivious transfer (OT) is an important cryptographic primitive used in many cryptographic protocols as a building block. In the oblivious transfer protocols, the sender has messages m0 and m1 and the receiver wishes to retrieve one of the two messages

contract tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData); }
contract owned {
address public owner;
function owned() {
owner = msg.sender;
}
#!/usr/bin/env python
def jizoku(i):
if i < 10:
return 0
a = 1
while i > 0:
a *= i % 10
i /= 10
return jizoku(a) + 1
@visvirial
visvirial / bip-0342.ja.mediawiki
Last active March 12, 2020 04:31
BIP342「Validation of Taproot Scripts」の日本語版


  BIP&#58; 342
  Layer&#58; Consensus (soft fork)
  Title&#58; Validation of Taproot Scripts
  Author&#58; Pieter Wuille <[email protected]>
          Jonas Nick <[email protected]>
          Anthony Towns <[email protected]>
  Comments&#45;Summary&#58; No comments yet.
  Comments&#45;URI&#58; https&#58;//github.com/bitcoin/bips/wiki/Comments&#58;BIP&#45;0342
  Status&#58; Draft

@visvirial
visvirial / bip-0341.ja.mediawiki
Last active September 17, 2020 15:46
BIP 341「Taproot: SegWit version 1 spending rules」日本語版
const crypto = require('crypto');
const grpc = require('grpc');
const protoLoader = require('@grpc/proto-loader');
const protobufjs = require('protobufjs');
const ed25519 = require('ed25519');
const PROTO_DIR = __dirname + '/proto';
const privateKey = Buffer.from('fbcedfd8848bf097ca79a8248a26d929ebf7104c1fcc471a6c4fd87113798766', 'hex');