This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: "bitcoin" | |
suites: | |
- "lucid" | |
architectures: | |
- "i386" | |
- "amd64" | |
packages: | |
- "libdb4.8++-dev" | |
- "libxxf86vm-dev" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#create a 64 bit m1.large instance using ami-08f40561 | |
ssh -i key ubuntu@... | |
sudo apt-get update | |
sudo apt-get install python-vm-builder qemu-kvm apt-cacher git-core ruby | |
# turn it on | |
sudo vi /etc/default/apt-cacher | |
sudo service apt-cacher start | |
sudo chown ubuntu /mnt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MultiSigUtils { | |
public static void signInput(Transaction tx, int inputIndex, byte[] inputScript, ECKey key) throws AddressFormatException { | |
TransactionInput input = tx.getInput(inputIndex); | |
Script existingScriptSig = input.getScriptSig(); | |
int numSigs = Script.decodeFromOpN(inputScript[0]); | |
ScriptBuilder builder = new ScriptBuilder(); | |
Script redeemScript = new Script(inputScript); | |
List<ScriptChunk> redeemChunks = redeemScript.getChunks(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
int main () | |
{ | |
std::vector<int> first; | |
std::vector<int> second; | |
first.assign (7,100); // 7 ints with a value of 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class HDUtil { | |
private static final byte[] xprv = new byte[]{0x04, (byte) 0x88, (byte) 0xAD, (byte) 0xE4}; | |
private static final byte[] xpub = new byte[]{0x04, (byte) 0x88, (byte) 0xB2, (byte) 0x1E}; | |
private static final byte[] tprv = new byte[]{0x04, (byte) 0x35, (byte) 0x83, (byte) 0x94}; | |
private static final byte[] tpub = new byte[]{0x04, (byte) 0x35, (byte) 0x87, (byte) 0xCF}; | |
public static DeterministicKey parseDeterministicKey(String serialized) throws AddressFormatException { | |
byte[] data = Base58.decodeChecked(serialized); | |
if (data.length != 78) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Verifying that +devrandom is my openname (Bitcoin username). https://onename.com/devrandom |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.junit.Before | |
import org.junit.Test | |
import kotlin.test.fail | |
import org.bitcoinj.core.Transaction | |
import org.bitcoinj.params.MainNetParams | |
import org.bitcoinj.core.NetworkParameters | |
import org.bitcoinj.core.ECKey | |
import org.bitcoinj.core.Address | |
import org.bitcoinj.testing.FakeTxBuilder | |
import org.bitcoinj.core.Coin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.22; | |
contract SimpleMultiSig { | |
uint public nonce; // (only) mutable state | |
uint public threshold; // immutable state | |
mapping (address => bool) isOwner; // immutable state | |
address[] public ownersArr; // immutable state | |
// Note that owners_ must be strictly increasing, in order to prevent duplicates |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.22; | |
contract SimpleMultiSig { | |
uint public nonce; // (only) mutable state | |
uint public threshold; // immutable state | |
mapping (address => bool) isOwner; // immutable state | |
address[] public ownersArr; // immutable state | |
// Note that owners_ must be strictly increasing, in order to prevent duplicates |
OlderNewer