Skip to content

Commit f61e711

Browse files
committed
Merge #133: Remove references to Simfony
4493b60 fix: code formatting (Simon Tennant) b393f7e change Simfony references to SimplicityHL (Simon Tennant) 4f91ecd update simfony references to SimplicityHL in README.md (Simon Tennant) Pull request description: AFAIK the only remaining reference is to https://github.com/uncomputable/simfony-as-rust (generates: https://docs.rs/simfony-as-rust/) in the file `SimplicityHL/book/src/function.md`. I would presume that this should be updated too. ACKs for top commit: apoelstra: ACK 4493b60; successfully ran local tests; thanks! Tree-SHA512: f582d24d8e92c3442c4fc3b9348a7ec25fb2f03a8cac9f67107bda2defece465e160740adf7b4a4839c73723bb68cfc1963f8c37c57c4a50af0803e4e4be4c0a
2 parents c8f6498 + 4493b60 commit f61e711

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+181
-179
lines changed

Cargo.lock

Lines changed: 19 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
[package]
2-
name = "simfony"
2+
name = "simplicityhl"
33
version = "0.1.0"
44
authors = ["sanket1729 <sanket1729@gmail.com>"]
55
license = "CC0-1.0"
6-
homepage = "https://github.com/BlockstreamResearch/simfony/"
7-
repository = "https://github.com/BlockstreamResearch/simfony/"
6+
homepage = "https://github.com/BlockstreamResearch/SimplicityHL"
7+
repository = "https://github.com/BlockstreamResearch/SimplicityHL"
88
description = "Rust-like language that compiles to Simplicity bytecode."
99
edition = "2021"
1010
rust-version = "1.78.0"
1111

1212
[lib]
13-
name = "simfony"
13+
name = "simplicityhl"
1414
path = "src/lib.rs"
1515

1616
[[bin]]

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
Simfony is a high-level language for writing Bitcoin smart contracts.
1+
SimplicityHL is a high-level language for writing Bitcoin smart contracts.
22

3-
Simfony looks and feels like [Rust](https://www.rust-lang.org). Just how Rust compiles down to assembly language, Simfony compiles down to [Simplicity](https://github.com/BlockstreamResearch/simplicity) bytecode. Developers write Simfony, full nodes execute Simplicity.
3+
SimplicityHL looks and feels like [Rust](https://www.rust-lang.org). Just how Rust compiles down to assembly language, SimplicityHL compiles down to [Simplicity](https://github.com/BlockstreamResearch/simplicity) bytecode. Developers write SimplicityHL, full nodes execute Simplicity.
44

5-
**Simfony is a work in progress and is not yet ready for production use.**
5+
**SimplicityHL is a work in progress and is not yet ready for production use.**
66

77
```rust
88
let a: u32 = 10;
@@ -16,49 +16,49 @@ let b = {
1616
assert!(jet::eq_32(b, 7));
1717
```
1818

19-
Take a look at the [example programs](https://github.com/BlockstreamResearch/simfony/tree/master/examples).
19+
Take a look at the [example programs](https://github.com/BlockstreamResearch/SimplicityHL/tree/master/examples).
2020

2121
## MSRV
2222

2323
This crate should compile with any feature combination on **Rust 1.78.0** or higher.
2424

2525
## Simplicity's need for a high-level language
2626

27-
Simplicity introduces a groundbreaking low-level programming language and machine model meticulously crafted for blockchain-based smart contracts. The primary goal is to provide a streamlined and comprehensible foundation that facilitates static analysis and encourages reasoning through formal methods. While the elegance of the language itself is distilled into something as succinct as fitting onto a T-shirt, it's important to note that the simplicity of the language doesn't directly equate to simplicity in the development process. Simfony revolves around demystifying and simplifying the complexities involved in this ecosystem.
27+
Simplicity introduces a groundbreaking low-level programming language and machine model meticulously crafted for blockchain-based smart contracts. The primary goal is to provide a streamlined and comprehensible foundation that facilitates static analysis and encourages reasoning through formal methods. While the elegance of the language itself is distilled into something as succinct as fitting onto a T-shirt, it's important to note that the simplicity of the language doesn't directly equate to simplicity in the development process. SimplicityHL revolves around demystifying and simplifying the complexities involved in this ecosystem.
2828

2929
The distinguishing aspects that set Simplicity apart from conventional programming languages are:
3030

3131
- **Distinct Programming Paradigm**: Simplicity's programming model requires a paradigm shift from conventional programming. It hinges on reasoning about programs in a functional sense with a focus on combinators. This intricacy surpasses even popular functional languages like Haskell, with its own unique challenges.
3232
- **Exceptional Low-Level Nature**: Unlike high-level languages such as JavaScript or Python, Simplicity operates at an extremely low level, resembling assembly languages. This design choice enables easier reasoning about the formal semantics of programs, but is really work on directly.
3333

34-
## Simfony
34+
## SimplicityHL
3535

36-
Simfony is a high-level language that compiles to Simplicity. It maps programming concepts from Simplicity onto programming concepts that developers are more familar with. In particular, Rust is a popular language whose functional aspects fit Simplicity well. Simfony aims to closely resemble Rust.
36+
SimplicityHL is a high-level language that compiles to Simplicity. It maps programming concepts from Simplicity onto programming concepts that developers are more familar with. In particular, Rust is a popular language whose functional aspects fit Simplicity well. SimplicityHL aims to closely resemble Rust.
3737

38-
Just how Rust is compiled to assembly language, Simfony is compiled to Simplicity. Just how writing Rust doesn't necessarily produce the most efficient assembly, writing Simfony doesn't necessarily produce the most efficient Simplicity code. The compilers try to optimize the target code they produce, but manually written target code can be more efficient. On the other hand, a compiled language is much easier to read, write and reason about. Assembly is meant to be consumed by machines while Rust is meant to be consumed by humans. Simplicity is meant to be consumed by Bitcoin full nodes while Simfony is meant to be consumed by Bitcoin developers.
38+
Just how Rust is compiled to assembly language, SimplicityHL is compiled to Simplicity. Just how writing Rust doesn't necessarily produce the most efficient assembly, writing SimplicityHL doesn't necessarily produce the most efficient Simplicity code. The compilers try to optimize the target code they produce, but manually written target code can be more efficient. On the other hand, a compiled language is much easier to read, write and reason about. Assembly is meant to be consumed by machines while Rust is meant to be consumed by humans. Simplicity is meant to be consumed by Bitcoin full nodes while SimplicityHL is meant to be consumed by Bitcoin developers.
3939

4040
## Installation
4141

42-
Clone the repo and build the Simfony compiler using cargo.
42+
Clone the repo and build the SimplicityHL compiler using cargo.
4343

4444
```bash
45-
git clone https://github.com/BlockstreamResearch/simfony.git
46-
cd simfony
45+
git clone https://github.com/BlockstreamResearch/SimplicityHL.git
46+
cd SimplicityHL
4747
cargo build
4848
```
4949

50-
Optionally, install the Simfony compiler using cargo.
50+
Optionally, install the SimplicityHL compiler using cargo.
5151

5252
```bash
5353
cargo install --path .
5454
```
5555

5656
## Usage
5757

58-
The Simfony compiler takes two arguments:
58+
The SimplicityHL compiler takes two arguments:
5959

60-
1. A path to a Simfony program file (`.simf`)
61-
1. A path to a Simfony witness file (`.wit`, optional)
60+
1. A path to a SimplicityHL program file (`.simf`)
61+
1. A path to a SimplicityHL witness file (`.wit`, optional)
6262

6363
The compiler produces a base64-encoded Simplicity program. Witness data will be included if a witness file is provided.
6464

bitcoind-tests/Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bitcoind-tests/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ authors = ["sanket1729 <sanket1729@gmail.com>"]
55
edition = "2021"
66

77
[dependencies]
8-
simfony = { path = ".." }
8+
simplicityhl = { path = ".." }
99
elementsd = { version = "0.11.0" }
1010
actual-rand = { package = "rand", version = "0.8.4" }
1111
secp256k1 = { version = "0.29.0", features = ["rand-std"] }

bitcoind-tests/tests/common/daemon.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use elements::hex::FromHex;
55
use elementsd::bitcoincore_rpc::jsonrpc::serde_json::{json, Value};
66
use elementsd::bitcoind::bitcoincore_rpc::RpcApi;
77
use elementsd::ElementsD;
8-
use simfony::elements;
8+
use simplicityhl::elements;
99

1010
// We are not using pegins right now, but it might be required in case in future
1111
// if we extend the tests to check pegins etc.

bitcoind-tests/tests/common/test.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@ use elements::pset::PartiallySignedTransaction as Psbt;
55
use elements::{confidential, secp256k1_zkp as secp256k1};
66
use elementsd::ElementsD;
77
use secp256k1::XOnlyPublicKey;
8-
use simfony::{elements, simplicity};
98
use simplicity::jet::elements::{ElementsEnv, ElementsUtxo};
9+
use simplicityhl::{elements, simplicity};
1010

1111
use crate::common::daemon::Call;
1212

13-
type FnWitness = fn([u8; 32]) -> simfony::WitnessValues;
13+
type FnWitness = fn([u8; 32]) -> simplicityhl::WitnessValues;
1414

1515
#[derive(Clone)]
1616
pub struct TestCase<'a> {
1717
pub name: &'static str,
18-
template: Option<simfony::TemplateProgram>,
19-
compiled: Option<simfony::CompiledProgram>,
18+
template: Option<simplicityhl::TemplateProgram>,
19+
compiled: Option<simplicityhl::CompiledProgram>,
2020
witness: FnWitness,
2121
lock_time: elements::LockTime,
2222
sequence: elements::Sequence,
@@ -53,7 +53,7 @@ impl<'a> TestCase<'a> {
5353

5454
pub fn program_path<P: AsRef<std::path::Path>>(mut self, path: P) -> Self {
5555
let text = std::fs::read_to_string(path).expect("path should be readable");
56-
let compiled = simfony::CompiledProgram::new(text.as_str(), simfony::Arguments::default(), false)
56+
let compiled = simplicityhl::CompiledProgram::new(text.as_str(), simplicityhl::Arguments::default(), false)
5757
.expect("program should compile");
5858
self.compiled = Some(compiled);
5959
self
@@ -62,12 +62,12 @@ impl<'a> TestCase<'a> {
6262
pub fn template_path<P: AsRef<std::path::Path>>(mut self, path: P) -> Self {
6363
let text = std::fs::read_to_string(path).expect("path should be readable");
6464
let template =
65-
simfony::TemplateProgram::new(text.as_str()).expect("program should compile");
65+
simplicityhl::TemplateProgram::new(text.as_str()).expect("program should compile");
6666
self.template = Some(template);
6767
self
6868
}
6969

70-
pub fn arguments(mut self, arguments: simfony::Arguments) -> Self {
70+
pub fn arguments(mut self, arguments: simplicityhl::Arguments) -> Self {
7171
let compiled = self
7272
.template
7373
.as_ref()
@@ -220,6 +220,6 @@ impl<'a> TestCase<'a> {
220220
}
221221
}
222222

223-
fn empty_witness(_sighash_all: [u8; 32]) -> simfony::WitnessValues {
224-
simfony::WitnessValues::default()
223+
fn empty_witness(_sighash_all: [u8; 32]) -> simplicityhl::WitnessValues {
224+
simplicityhl::WitnessValues::default()
225225
}

bitcoind-tests/tests/common/util.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ pub fn sign_schnorr(secret_key: u32, message: [u8; 32]) -> [u8; 64] {
1111
key_pair.sign_schnorr(message).serialize()
1212
}
1313

14-
pub fn xonly_public_key(secret_key: u32) -> simfony::num::U256 {
14+
pub fn xonly_public_key(secret_key: u32) -> simplicityhl::num::U256 {
1515
let key_pair = key_pair(secret_key);
1616
let bytes = key_pair.x_only_public_key().0.serialize();
17-
simfony::num::U256::from_byte_array(bytes)
17+
simplicityhl::num::U256::from_byte_array(bytes)
1818
}

bitcoind-tests/tests/spend_utxo.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ use std::collections::HashMap;
33
use elements::hashes::Hash;
44
use elements::secp256k1_zkp as secp256k1;
55
use secp256k1::hashes::{sha256, HashEngine};
6-
use simfony::str::WitnessName;
7-
use simfony::types::TypeConstructible;
8-
use simfony::value::ValueConstructible;
9-
use simfony::{elements, ResolvedType, Value};
6+
use simplicityhl::str::WitnessName;
7+
use simplicityhl::types::TypeConstructible;
8+
use simplicityhl::value::ValueConstructible;
9+
use simplicityhl::{elements, ResolvedType, Value};
1010

1111
mod common;
1212
use common::daemon::{self, Call};
@@ -49,7 +49,7 @@ fn spend_utxo() {
4949
}
5050
}
5151

52-
fn hodl_vault(sighash_all: [u8; 32]) -> simfony::WitnessValues {
52+
fn hodl_vault(sighash_all: [u8; 32]) -> simplicityhl::WitnessValues {
5353
let mut witness_values = HashMap::new();
5454
let oracle_height = 1000;
5555
witness_values.insert(
@@ -73,24 +73,24 @@ fn hodl_vault(sighash_all: [u8; 32]) -> simfony::WitnessValues {
7373
WitnessName::from_str_unchecked("OWNER_SIG"),
7474
Value::byte_array(util::sign_schnorr(2, sighash_all)),
7575
);
76-
simfony::WitnessValues::from(witness_values)
76+
simplicityhl::WitnessValues::from(witness_values)
7777
}
7878

79-
fn p2pk_args() -> simfony::Arguments {
80-
simfony::Arguments::from(HashMap::from([(
79+
fn p2pk_args() -> simplicityhl::Arguments {
80+
simplicityhl::Arguments::from(HashMap::from([(
8181
WitnessName::from_str_unchecked("ALICE_PUBLIC_KEY"),
8282
Value::u256(util::xonly_public_key(1)),
8383
)]))
8484
}
8585

86-
fn p2pk(sighash_all: [u8; 32]) -> simfony::WitnessValues {
87-
simfony::WitnessValues::from(HashMap::from([(
86+
fn p2pk(sighash_all: [u8; 32]) -> simplicityhl::WitnessValues {
87+
simplicityhl::WitnessValues::from(HashMap::from([(
8888
WitnessName::from_str_unchecked("ALICE_SIGNATURE"),
8989
Value::byte_array(util::sign_schnorr(1, sighash_all)),
9090
)]))
9191
}
9292

93-
fn p2pkh(sighash_all: [u8; 32]) -> simfony::WitnessValues {
93+
fn p2pkh(sighash_all: [u8; 32]) -> simplicityhl::WitnessValues {
9494
let mut witness_values = HashMap::new();
9595
witness_values.insert(
9696
WitnessName::from_str_unchecked("PK"),
@@ -100,16 +100,16 @@ fn p2pkh(sighash_all: [u8; 32]) -> simfony::WitnessValues {
100100
WitnessName::from_str_unchecked("SIG"),
101101
Value::byte_array(util::sign_schnorr(1, sighash_all)),
102102
);
103-
simfony::WitnessValues::from(witness_values)
103+
simplicityhl::WitnessValues::from(witness_values)
104104
}
105105

106-
fn p2ms(sighash_all: [u8; 32]) -> simfony::WitnessValues {
106+
fn p2ms(sighash_all: [u8; 32]) -> simplicityhl::WitnessValues {
107107
let mut witness_values = HashMap::new();
108108
let sig1 = Value::some(Value::byte_array(util::sign_schnorr(1, sighash_all)));
109109
let sig2 = Value::none(ResolvedType::byte_array(64));
110110
let sig3 = Value::some(Value::byte_array(util::sign_schnorr(3, sighash_all)));
111111
let ty = sig1.ty().clone();
112112
let maybe_sigs = Value::array([sig1, sig2, sig3], ty);
113113
witness_values.insert(WitnessName::from_str_unchecked("MAYBE_SIGS"), maybe_sigs);
114-
simfony::WitnessValues::from(witness_values)
114+
simplicityhl::WitnessValues::from(witness_values)
115115
}

book/book.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ authors = ["Christian Lewe"]
33
language = "en"
44
multilingual = false
55
src = "src"
6-
title = "The Simfony Programming Language"
6+
title = "The SimplicityHL Programming Language"

0 commit comments

Comments
 (0)