diff --git a/contrib/add_missing_license_headers.sh b/contrib/add_missing_license_headers.sh
new file mode 100755
index 000000000..a3e3c9faf
--- /dev/null
+++ b/contrib/add_missing_license_headers.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+files="$(find . -type f -name '*.rs' | grep -v 'target/')"
+
+echo "$files" | while read -r file ; do
+ if ! grep -q '/* This file is part of DarkFi ' "$file"; then
+ tmp="$(mktemp)"
+ cat contrib/license.header "$file" > "$tmp"
+ mv -v "$tmp" "$file"
+ fi
+done
diff --git a/example/dao2/contract/dao/src/lib.rs b/example/dao2/contract/dao/src/lib.rs
index dca3a9142..b7296ece2 100644
--- a/example/dao2/contract/dao/src/lib.rs
+++ b/example/dao2/contract/dao/src/lib.rs
@@ -1,3 +1,21 @@
+/* This file is part of DarkFi (https://dark.fi)
+ *
+ * Copyright (C) 2020-2022 Dyne.org foundation
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
+ */
+
use darkfi_sdk::{
crypto::{ContractId, MerkleNode, MerkleTree},
db::{db_init, db_lookup, db_set},
diff --git a/example/dao2/contract/money/src/lib.rs b/example/dao2/contract/money/src/lib.rs
index df4c4f00d..a8a8460ef 100644
--- a/example/dao2/contract/money/src/lib.rs
+++ b/example/dao2/contract/money/src/lib.rs
@@ -1,3 +1,21 @@
+/* This file is part of DarkFi (https://dark.fi)
+ *
+ * Copyright (C) 2020-2022 Dyne.org foundation
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
+ */
+
use darkfi_sdk::{
crypto::{ContractId, MerkleNode, MerkleTree, PublicKey},
db::{db_init, db_lookup, db_set},
diff --git a/example/dao2/src/main.rs b/example/dao2/src/main.rs
index 01289430f..da708e500 100644
--- a/example/dao2/src/main.rs
+++ b/example/dao2/src/main.rs
@@ -1,3 +1,21 @@
+/* This file is part of DarkFi (https://dark.fi)
+ *
+ * Copyright (C) 2020-2022 Dyne.org foundation
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
+ */
+
use darkfi::{
blockchain::Blockchain,
consensus::{TESTNET_GENESIS_HASH_BYTES, TESTNET_GENESIS_TIMESTAMP},
diff --git a/example/dao2/src/tx.rs b/example/dao2/src/tx.rs
index 87db92692..1ea21bd26 100644
--- a/example/dao2/src/tx.rs
+++ b/example/dao2/src/tx.rs
@@ -1,3 +1,21 @@
+/* This file is part of DarkFi (https://dark.fi)
+ *
+ * Copyright (C) 2020-2022 Dyne.org foundation
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
+ */
+
use darkfi::{crypto::Proof, Result, VerifyFailed::ProofVerifyFailed};
use darkfi_sdk::{
crypto::{
diff --git a/example/smart-contract/src/lib.rs b/example/smart-contract/src/lib.rs
index 8a7628e04..7bc536621 100644
--- a/example/smart-contract/src/lib.rs
+++ b/example/smart-contract/src/lib.rs
@@ -1,3 +1,21 @@
+/* This file is part of DarkFi (https://dark.fi)
+ *
+ * Copyright (C) 2020-2022 Dyne.org foundation
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
+ */
+
use darkfi_sdk::{
crypto::ContractId,
db::{db_get, db_init, db_lookup, db_set},
diff --git a/src/runtime/import/merkle.rs b/src/runtime/import/merkle.rs
index bffe1556f..8e2bf9274 100644
--- a/src/runtime/import/merkle.rs
+++ b/src/runtime/import/merkle.rs
@@ -1,3 +1,21 @@
+/* This file is part of DarkFi (https://dark.fi)
+ *
+ * Copyright (C) 2020-2022 Dyne.org foundation
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
+ */
+
use std::io::Cursor;
use darkfi_sdk::{