Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/cron-daily-kani.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ jobs:
- name: 'Run Kani on your code.'
uses: model-checking/[email protected]
with:
args: "--package bitcoin --package bitcoin-units"
args: "--package bitcoin-dogecoin --package bitcoin-units"
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -302,4 +302,4 @@ jobs:
- name: "Build Kani proofs"
uses: model-checking/[email protected]
with:
args: "--only-codegen --package bitcoin --package bitcoin-units"
args: "--only-codegen --package bitcoin-dogecoin --package bitcoin-units"
4 changes: 2 additions & 2 deletions Cargo-minimal.lock
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ dependencies = [
]

[[package]]
name = "bitcoin"
name = "bitcoin-dogecoin"
version = "0.32.5-doge.0"
dependencies = [
"base58ck",
Expand All @@ -73,7 +73,7 @@ dependencies = [
name = "bitcoin-fuzz"
version = "0.0.1"
dependencies = [
"bitcoin",
"bitcoin-dogecoin",
"honggfuzz",
"serde",
"serde_cbor",
Expand Down
4 changes: 2 additions & 2 deletions Cargo-recent.lock
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ dependencies = [
]

[[package]]
name = "bitcoin"
name = "bitcoin-dogecoin"
version = "0.32.5-doge.0"
dependencies = [
"base58ck",
Expand All @@ -72,7 +72,7 @@ dependencies = [
name = "bitcoin-fuzz"
version = "0.0.1"
dependencies = [
"bitcoin",
"bitcoin-dogecoin",
"honggfuzz",
"serde",
"serde_cbor",
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ resolver = "2"
[patch.crates-io.base58ck]
path = "base58"

[patch.crates-io.bitcoin]
[patch.crates-io.bitcoin-dogecoin]
path = "bitcoin"

[patch.crates-io.bitcoin_hashes]
Expand Down
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
<div align="center">
<h1>Rust Dogecoin</h1>

<img alt="Rust Bitcoin logo by Hunter Trujillo, see license and source files under /logo" src="./logo/rust-bitcoin.png" width="300" />
<img alt="Rust Dogecoin logo by DFINITY Foundation, see license and source files under /logo" src="./logo/rust-btc+doge@4x.png" width="720" />

<p>Library with support for de/serialization, parsing and executing on data-structures
and network messages related to Dogecoin.
and network messages related to Bitcoin and Dogecoin.
</p>

<p>
<a href="https://crates.io/crates/bitcoin"><img alt="Crate Info" src="https://img.shields.io/crates/v/bitcoin.svg"/></a>
<a href="https://crates.io/crates/bitcoin-dogecoin"><img alt="Crate Info" src="https://img.shields.io/crates/v/bitcoin-dogecoin.svg"/></a>
<a href="https://github.com/rust-dogecoin/rust-dogecoin/blob/doge-master/LICENSE"><img alt="Apache License 2.0" src="https://img.shields.io/badge/license-Apache--2.0-blue.svg"/></a>
<a href="https://github.com/rust-bitcoin/rust-bitcoin/actions?query=workflow%3AContinuous%20integration"><img alt="CI Status" src="https://github.com/rust-bitcoin/rust-bitcoin/workflows/Continuous%20integration/badge.svg"></a>
<a href="https://docs.rs/bitcoin"><img alt="API Docs" src="https://img.shields.io/badge/docs.rs-bitcoin-green"/></a>
<a href="https://github.com/rust-bitcoin/rust-bitcoin/actions?query=workflow%3AContinuous%20integration"><img alt="CI Status" src="https://github.com/dfinity/rust-dogecoin/workflows/Continuous%20integration/badge.svg"></a>
<a href="https://docs.rs/bitcoin-dogecoin"><img alt="API Docs" src="https://img.shields.io/badge/docs.rs-bitcoin-dogecoin-green"/></a>
<a href="https://blog.rust-lang.org/2021/11/01/Rust-1.56.1.html"><img alt="Rustc Version 1.56.1+" src="https://img.shields.io/badge/rustc-1.56.1%2B-lightgrey.svg"/></a>
<a href="https://github.com/model-checking/kani"><img alt="kani" src="https://github.com/rust-bitcoin/rust-bitcoin/workflows/Kani%20CI/badge.svg"></a>
</p>
</div>

Expand Down
43 changes: 40 additions & 3 deletions bitcoin/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,46 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

# 0.32.5-doge.0 - Unreleased

Planned initial release of the Dogecoin crate. Not yet available.
# 0.32.5-doge.0 - 2025-11-03

Initial release of the rust-dogecoin crate, a fork of rust-bitcoin adapted for Dogecoin.

### rust-bitcoin v0.32.5 modifications

- **Scrypt Proof-of-Work**: Add scrypt-based PoW validation (`block_hash_with_scrypt()` and `validate_pow_with_scrypt()`) to support Dogecoin's PoW algorithm.
- **Difficulty Adjustment Algorithms**:
- Pre-Digishield algorithm (blocks 0-144,999) with variable transition thresholds based on block height ranges
- Digishield algorithm (blocks 145,000+)
- Methods `min_transition_threshold_dogecoin()` and `max_transition_threshold_dogecoin()`
- **Generic Network Messages**: Make `RawNetworkMessage` and `NetworkMessage` generic over `Header` and `Block` types to support AuxPoW blocks
- Updated license to Apache-2.0 for new Dogecoin-specific code

### New Dogecoin module (`bitcoin/src/dogecoin/`)

- **Core Types** (`mod.rs`):
- `Header`: Dogecoin block header with optional AuxPoW data
- `Block`: Block structure supporting both legacy and AuxPoW blocks
- `Network`: Dogecoin mainnet, Testnet, Regtest
- Helper methods for AuxPoW bit detection, chain ID extraction, and legacy block identification

- **AuxPoW Support** (`auxpow.rs`):
- AuxPow validation (coinbase script validation, merkle branch verification, chain ID checks)
- Error types for AuxPow validation failures

- **Consensus Parameters** (`params.rs`):
- Dogecoin PoW parameters and methods: target spacing, max attainable target, pow target timespan
- Digishield and AuxPoW activation height
- Chain ID for merged mining
- BIP activation heights

- **Constants** (`constants.rs`):
- Genesis block definitions for mainnet, testnet, and regtest
- Prefixes for P2PKH and P2SH addresses

- **Address Handling** (`address/`):
- Base58 address encoding/decoding with Dogecoin-specific prefixes
- Support for P2PKH and P2SH address types
- Network validation and address parsing

# 0.32.5 - 2024-11-27

Expand Down
9 changes: 6 additions & 3 deletions bitcoin/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "bitcoin"
name = "bitcoin-dogecoin"
version = "0.32.5-doge.0"
license = "CC0-1.0"
repository = "https://github.com/rust-dogecoin/rust-dogecoin/"
license = "Apache-2.0 OR CC0-1.0"
repository = "https://github.com/dfinity/rust-dogecoin"
description = "General purpose library for using and interoperating with Bitcoin and Dogecoin."
categories = ["cryptography::cryptocurrencies"]
keywords = [ "crypto", "bitcoin", "dogecoin"]
Expand All @@ -11,6 +11,9 @@ edition = "2021"
rust-version = "1.56.1"
exclude = ["tests", "contrib"]

[lib]
name = "bitcoin"

[features]
default = [ "std", "secp-recovery" ]
std = ["base58/std", "bech32/std", "hashes/std", "hex/std", "internals/std", "io/std", "secp256k1/std", "units/std"]
Expand Down
2 changes: 1 addition & 1 deletion bitcoin/embedded/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ cortex-m-rt = "0.6.10"
cortex-m-semihosting = "0.3.3"
panic-halt = "0.2.0"
alloc-cortex-m = "0.4.1"
bitcoin = { path="../", default-features = false, features = ["secp-lowmemory"] }
bitcoin = { package = "bitcoin-dogecoin", path="../", default-features = false, features = ["secp-lowmemory"] }

[[bin]]
name = "embedded"
Expand Down
8 changes: 4 additions & 4 deletions bitcoin/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// SPDX-License-Identifier: CC0-1.0

//! # Rust Bitcoin Library
//! # Rust Dogecoin Library
//!
//! This is a library that supports the Bitcoin network protocol and associated
//! primitives. It is designed for Rust programs built to work with the Bitcoin
//! network.
//! This is a library that supports both the Bitcoin and Dogecoin network protocol
//! and associated primitives. It is designed for Rust programs built to work with
//! the Bitcoin and Dogecoin network.
//!
//! Except for its dependency on libsecp256k1 (and optionally libbitcoinconsensus),
//! this library is written entirely in Rust. It illustrates the benefits of
Expand Down
2 changes: 1 addition & 1 deletion fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ cargo-fuzz = true

[dependencies]
honggfuzz = { version = "0.5.55", default-features = false }
bitcoin = { path = "../bitcoin", features = [ "serde" ] }
bitcoin = { package = "bitcoin-dogecoin", path = "../bitcoin", features = [ "serde" ] }

serde = { version = "1.0.103", features = [ "derive" ] }
serde_json = "1.0"
Expand Down
27 changes: 7 additions & 20 deletions logo/README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,19 @@
# Rust Bitcoin Logo
# Rust Dogecoin Logo

This logo is based on the [rust-bitcoin logo](https://github.com/rust-bitcoin/rust-bitcoin/tree/master/logo) and incorporates the Dogecoin "Ð" sign inside the Rust meshed gear.

## Files

Included are:

- [rust-bitcoin-inkscape.svg](./rust-bitcoin-inkscape.svg) - The Inkscape source file with the things used to make the logo in case adjustments are desired
- [rust-bitcoin-optimized.svg](./rust-bitcoin-optimized.svg) - An optimized SVG for embedding or rendering at any size desired
- [rust-bitcoin.png](./rust-bitcoin.png) - The PNG logo rendered at 300px used by this project
- [rust-bitcoin-large.png](./rust-bitcoin-large.png) - A larger size 1024px x 1024px for convenience for embedding in presentations

## Author

Hunter Trujillo, @cryptoquick on [Twitter](https://twitter.com/cryptoquick), [GitHub](https://github.com/cryptoquick), and Telegram.
- [rust-doge.svg](./rust-doge.svg) - An SVG of the Rust Dogecoin logo for embedding or rendering at any size desired
- [[email protected]](./[email protected]) - A high-resolution PNG of the Rust Dogecoin logo render at 600px x 600px
- [rust-btc+doge.svg](./rust-btc+doge.svg) - An SVG of the Rust Bitcoin logo together with the Rust Dogecoin logo
- [[email protected]](./[email protected]) - A high-resolution PNG of the Rust Bitcoin + Dogecoin logo render at 1440px x 680px

## License

Licensed in the public domain under [CC0 1.0 Universal Public Domain Dedication](https://creativecommons.org/publicdomain/zero/1.0/), and the author of this work rescinds all claims to copyright or coercion or acts of force from any nation state over this work for any purpose

Bitcoin Logo is licensed under the CC Public Domain Dedication: <https://bitcoin.stackexchange.com/a/53422> and <https://bitcointalk.org/index.php?topic=1631.0>

Rust Logo is licensed under CC-BY, which allows reuse and modifications for any purpose, as long as distributors give appropriate credit and indicate changes have been made. See here: <https://www.rust-lang.org/policies/media-guide>

## Acknowledgements

Acknowledgement for the runners up in this PR: https://github.com/rust-bitcoin/rust-bitcoin/pull/891#issuecomment-1074476858

In particular, the Rust Bitcoin Wizard gear was an incredibly inspired piece of art. Also, the meshed gears design was beloved by some but not all.

Thank you to the Rust Bitcoin maintainers and community, your timely responses and guidance was appreciated.

Also, thank you to the voters on the Rust in Bitcoin Telegram group: <https://t.me/rust_in_bitcoin/321>.
244 changes: 0 additions & 244 deletions logo/rust-bitcoin-inkscape.svg

This file was deleted.

Binary file removed logo/rust-bitcoin-large.png
Binary file not shown.
Loading