lib/bitcoin.rb in bitcoin-ruby-0.0.2 vs lib/bitcoin.rb in bitcoin-ruby-0.0.3
- old
+ new
@@ -110,11 +110,19 @@
def sha256(hex)
Digest::SHA256.hexdigest([hex].pack("H*"))
end
def hash160_to_address(hex)
- hex = address_version + hex
+ encode_address hex, address_version
+ end
+
+ def hash160_to_p2sh_address(hex)
+ encode_address hex, p2sh_version
+ end
+
+ def encode_address(hex, version)
+ hex = version + hex
encode_base58(hex + checksum(hex))
end
def pubkey_to_address(pubkey)
hash160_to_address( hash160(pubkey) )
@@ -446,11 +454,11 @@
:protocol_version => 70001,
:coinbase_maturity => 100,
:retarget_interval => 2016,
:retarget_time => 1209600, # 2 weeks
:max_money => 21_000_000 * COIN,
- :min_tx_fee => 50_000,
+ :min_tx_fee => 10_000,
:min_relay_tx_fee => 10_000,
:dns_seeds => [
"seed.bitcoin.sipa.be",
"dnsseed.bluematt.me",
"dnsseed.bitcoin.dashjr.org",
@@ -490,11 +498,17 @@
:dns_seeds => [ "testseed.bitcoin.interesthings.de" ],
:genesis_hash => "00000007199508e34a9ff81e6ec0c477a4cccff2a4767a8eee39c11db367b008",
:proof_of_work_limit => 0x1d07fff8,
:alert_pubkeys => ["04302390343f91cc401d56d68b123028bf52e5fca1939df127f63c6467cdf9c8e2c14b61104cf817d0b780da337893ecc4aaff1309e536162dabbdb45200ca2b0a"],
:known_nodes => [],
- :checkpoints => {}
+ :checkpoints => {},
+ :coinbase_maturity => 100,
+ :retarget_interval => 2016,
+ :retarget_time => 1209600, # 2 weeks
+ :max_money => 21_000_000 * COIN,
+ :min_tx_fee => 10_000,
+ :min_relay_tx_fee => 10_000,
},
:testnet3 => {
:project => :bitcoin,
:magic_head => "\x0b\x11\x09\x07",
@@ -505,11 +519,11 @@
:protocol_version => 70001,
:coinbase_maturity => 100,
:retarget_interval => 2016,
:retarget_time => 1209600, # 2 weeks
:max_money => 21_000_000 * COIN,
- :min_tx_fee => 50_000,
+ :min_tx_fee => 10_000,
:min_relay_tx_fee => 10_000,
:dns_seeds => [
"testnet-seed.bitcoin.petertodd.org",
"testnet-seed.bluematt.me",
],
@@ -527,10 +541,10 @@
:litecoin => {
:project => :litecoin,
:magic_head => "\xfb\xc0\xb6\xdb",
:address_version => "30",
:p2sh_version => "05",
- :privkey_version => "ef",
+ :privkey_version => "b0",
:default_port => 9333,
:protocol_version => 60002,
:max_money => 84_000_000 * COIN,
:min_tx_fee => 2_000_000,
:coinbase_maturity => 100,