From c84ddc02d96212e75e272a318eeebe1206780df5 Mon Sep 17 00:00:00 2001 From: y Date: Wed, 6 Sep 2023 10:09:59 -0400 Subject: [PATCH 1/2] Add license headers to shell and python scripts --- contrib/add_missing_license_headers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/add_missing_license_headers.sh b/contrib/add_missing_license_headers.sh index a3e3c9faf3a3..80b1003e9d85 100755 --- a/contrib/add_missing_license_headers.sh +++ b/contrib/add_missing_license_headers.sh @@ -1,6 +1,6 @@ #!/bin/sh -files="$(find . -type f -name '*.rs' | grep -v 'target/')" +files="$(find . -regextype posix-extended -regex ".*\.(py|rs|sh)$" | grep -v 'target/')" echo "$files" | while read -r file ; do if ! grep -q '/* This file is part of DarkFi ' "$file"; then From addbaebb4169d118963b62fb494eed6d6b3b4be9 Mon Sep 17 00:00:00 2001 From: y Date: Wed, 6 Sep 2023 10:14:32 -0400 Subject: [PATCH 2/2] Add header to existing scripts --- bin/darkirc/script/bots/commitbot.py | 18 ++++++++++++++++++ bin/darkirc/script/bots/irc.py | 18 ++++++++++++++++++ bin/darkirc/script/bots/meetbot/meetbot.py | 18 ++++++++++++++++++ bin/darkirc/script/bots/meetbot/meetbot_cfg.py | 18 ++++++++++++++++++ bin/darkirc/script/bots/mirror-bot.py | 18 ++++++++++++++++++ bin/darkirc/script/bots/taubot.py | 18 ++++++++++++++++++ bin/darkirc/script/bots/titlebot.py | 18 ++++++++++++++++++ bin/darkirc/script/bots/tweetifier.py | 18 ++++++++++++++++++ .../script/tmux_session/tmux_sessions.sh | 18 ++++++++++++++++++ bin/genev/script/tmux_sessions.sh | 18 ++++++++++++++++++ contrib/clean_logs.py | 18 ++++++++++++++++++ contrib/dependency_setup.sh | 18 ++++++++++++++++++ contrib/localnet/darkfid-five-nodes/clean.sh | 18 ++++++++++++++++++ contrib/localnet/darkfid-five-nodes/logproc.py | 18 ++++++++++++++++++ .../darkfid-five-nodes/tmux_sessions.sh | 18 ++++++++++++++++++ contrib/localnet/darkfid-single-node/clean.sh | 18 ++++++++++++++++++ .../darkfid-single-node/run-dao-test.sh | 18 ++++++++++++++++++ .../darkfid-single-node/sync-wallet.sh | 18 ++++++++++++++++++ .../darkfid-single-node/tmux_sessions.sh | 18 ++++++++++++++++++ contrib/localnet/darkfid-small/clean.sh | 18 ++++++++++++++++++ .../localnet/darkfid-small/tmux_sessions.sh | 18 ++++++++++++++++++ contrib/localnet/darkfid/clean.sh | 18 ++++++++++++++++++ contrib/localnet/darkfid/tmux_sessions.sh | 18 ++++++++++++++++++ .../darkirc-four-nodes/tmux_sessions.sh | 18 ++++++++++++++++++ contrib/localnet/fud/clean.sh | 18 ++++++++++++++++++ contrib/localnet/fud/tmux_sessions.sh | 18 ++++++++++++++++++ .../ircd-nym-two-nodes/tmux_session.sh | 18 ++++++++++++++++++ contrib/privacy/purge_weechat_logs.py | 18 ++++++++++++++++++ contrib/privacy/scrub_username_from_file.sh | 18 ++++++++++++++++++ contrib/update_pkg_versions.py | 18 ++++++++++++++++++ doc/build_jsonrpc.py | 18 ++++++++++++++++++ doc/generate_seminar_ics.py | 18 ++++++++++++++++++ doc/ghp_push.py | 18 ++++++++++++++++++ example/p2pdebug/tmux_sessions.sh | 18 ++++++++++++++++++ fuzz/honggfuzz/script/binary-to-bytearray.py | 18 ++++++++++++++++++ .../honggfuzz/script/generate-binary-corpus.sh | 18 ++++++++++++++++++ .../crypsinous/linearindependence/main.py | 18 ++++++++++++++++++ .../research/crypsinous/ouroboros/__init__.py | 18 ++++++++++++++++++ .../crypsinous/ouroboros/ouroboros/__init__.py | 18 ++++++++++++++++++ .../crypsinous/ouroboros/ouroboros/beacon.py | 18 ++++++++++++++++++ .../crypsinous/ouroboros/ouroboros/block.py | 18 ++++++++++++++++++ .../ouroboros/ouroboros/blockchain.py | 18 ++++++++++++++++++ .../crypsinous/ouroboros/ouroboros/clock.py | 18 ++++++++++++++++++ .../crypsinous/ouroboros/ouroboros/consts.py | 18 ++++++++++++++++++ .../crypsinous/ouroboros/ouroboros/data.py | 18 ++++++++++++++++++ .../ouroboros/ouroboros/environment.py | 18 ++++++++++++++++++ .../crypsinous/ouroboros/ouroboros/epoch.py | 18 ++++++++++++++++++ .../crypsinous/ouroboros/ouroboros/hashtree.py | 18 ++++++++++++++++++ .../crypsinous/ouroboros/ouroboros/kes.py | 18 ++++++++++++++++++ .../crypsinous/ouroboros/ouroboros/logger.py | 18 ++++++++++++++++++ .../crypsinous/ouroboros/ouroboros/sig_test.py | 18 ++++++++++++++++++ .../ouroboros/ouroboros/stakeholder.py | 18 ++++++++++++++++++ .../crypsinous/ouroboros/ouroboros/utils.py | 18 ++++++++++++++++++ .../crypsinous/ouroboros/ouroboros/vrf.py | 18 ++++++++++++++++++ .../research/crypsinous/ouroboros/sig_test.py | 18 ++++++++++++++++++ .../crypsinous/ouroboros/simulation.py | 18 ++++++++++++++++++ .../research/crypsinous/ouroboros/vrf_test.py | 18 ++++++++++++++++++ script/research/dao/classnamespace.py | 18 ++++++++++++++++++ script/research/dao/crypto.py | 18 ++++++++++++++++++ script/research/dao/main.py | 18 ++++++++++++++++++ script/research/dao/money.py | 18 ++++++++++++++++++ script/research/ec/curve.py | 18 ++++++++++++++++++ script/research/ec/old/ag.py | 18 ++++++++++++++++++ script/research/ec/old/val2.py | 18 ++++++++++++++++++ script/research/ec/visual_zeropole.py | 18 ++++++++++++++++++ script/research/event_graph/main.py | 18 ++++++++++++++++++ .../research/finite_fields/euclidean-test.py | 18 ++++++++++++++++++ script/research/finite_fields/euclidean.py | 18 ++++++++++++++++++ .../research/finite_fields/finitefield-test.py | 18 ++++++++++++++++++ script/research/finite_fields/finitefield.py | 18 ++++++++++++++++++ script/research/finite_fields/modp-test.py | 18 ++++++++++++++++++ script/research/finite_fields/modp.py | 18 ++++++++++++++++++ script/research/finite_fields/numbertype.py | 18 ++++++++++++++++++ .../research/finite_fields/polynomial-test.py | 18 ++++++++++++++++++ script/research/finite_fields/polynomial.py | 18 ++++++++++++++++++ script/research/finite_fields/test.py | 18 ++++++++++++++++++ script/research/finite_fields/typecast-test.py | 18 ++++++++++++++++++ script/research/jubjub.py | 18 ++++++++++++++++++ script/research/lotterysim/__init__.py | 18 ++++++++++++++++++ .../research/lotterysim/acc_vs_staked_ratio.py | 18 ++++++++++++++++++ .../lotterysim/acc_vs_staked_ratio_pi.py | 18 ++++++++++++++++++ .../acc_vs_staked_ratio_pi_headstart.py | 18 ++++++++++++++++++ .../basefee_discrete_autocrawler_pi.py | 18 ++++++++++++++++++ .../plot_sim_vs_darkfi_distribution.py | 18 ++++++++++++++++++ .../blockchain_scripts/sigmas_test_samples.py | 18 ++++++++++++++++++ script/research/lotterysim/config.py | 18 ++++++++++++++++++ script/research/lotterysim/core/__init__.py | 18 ++++++++++++++++++ script/research/lotterysim/core/constants.py | 18 ++++++++++++++++++ script/research/lotterysim/core/darkie.py | 18 ++++++++++++++++++ script/research/lotterysim/core/lottery.py | 18 ++++++++++++++++++ script/research/lotterysim/core/strategy.py | 18 ++++++++++++++++++ script/research/lotterysim/core/utils.py | 18 ++++++++++++++++++ .../research/lotterysim/discrete_instance.py | 18 ++++++++++++++++++ .../discrete_instance_pi_headstart.py | 18 ++++++++++++++++++ script/research/lotterysim/draw.py | 18 ++++++++++++++++++ script/research/lotterysim/metrics.py | 18 ++++++++++++++++++ script/research/lotterysim/pid/__init__.py | 18 ++++++++++++++++++ script/research/lotterysim/pid/cascade.py | 18 ++++++++++++++++++ script/research/lotterysim/pid/pid_base.py | 18 ++++++++++++++++++ script/research/lotterysim/plot_darkies.py | 18 ++++++++++++++++++ script/research/lotterysim/pool_advantage.py | 18 ++++++++++++++++++ .../primary_discrete_auto_crawler.py | 18 ++++++++++++++++++ .../primary_discrete_auto_crawler_pi.py | 18 ++++++++++++++++++ script/research/lotterysim/reports/__init__.py | 18 ++++++++++++++++++ script/research/lotterysim/reports/elbow.py | 18 ++++++++++++++++++ .../lotterysim/reports/one_year_reward.py | 18 ++++++++++++++++++ .../lotterysim/reports/stake_reward.py | 18 ++++++++++++++++++ .../lotterysim/search_space/discrete.py | 18 ++++++++++++++++++ .../lotterysim/search_space/takahashi.py | 18 ++++++++++++++++++ .../secondary_discrete_auto_crawler.py | 18 ++++++++++++++++++ .../secondary_discrete_auto_crawler_pi.py | 18 ++++++++++++++++++ .../secondary_takahashi_auto_crawler.py | 18 ++++++++++++++++++ .../research/lotterysim/takahashi_instance.py | 18 ++++++++++++++++++ script/research/lotterysim/vesting.py | 18 ++++++++++++++++++ script/research/modp.py | 18 ++++++++++++++++++ script/research/poseidon/constants.py | 18 ++++++++++++++++++ script/research/poseidon/poseidon.py | 18 ++++++++++++++++++ script/research/pow/gen_wide_data.py | 18 ++++++++++++++++++ .../2-execution-model-and-definitions.py | 18 ++++++++++++++++++ .../streamlet/3.2-blocks-and-blockchain.py | 18 ++++++++++++++++++ .../streamlet/3.3-votes-and-notarization.py | 18 ++++++++++++++++++ script/research/streamlet/3.4-protocol.py | 18 ++++++++++++++++++ script/research/streamlet/block.py | 18 ++++++++++++++++++ script/research/streamlet/blockchain.py | 18 ++++++++++++++++++ script/research/streamlet/node.py | 18 ++++++++++++++++++ script/research/streamlet/utils.py | 18 ++++++++++++++++++ script/research/streamlet/vote.py | 18 ++++++++++++++++++ script/research/vm-db-types/export-table.py | 18 ++++++++++++++++++ script/research/zk/bootle16.py | 18 ++++++++++++++++++ .../zk/groth16/3.3-encrypted-polynomial.py | 18 ++++++++++++++++++ .../zk/groth16/3.4-restricted-polynomial.py | 18 ++++++++++++++++++ .../research/zk/groth16/3.5-zero-knowledge.py | 18 ++++++++++++++++++ .../research/zk/groth16/3.6-trusted-setup.py | 18 ++++++++++++++++++ .../zk/groth16/4.4-proof-of-operation.py | 18 ++++++++++++++++++ .../groth16/4.5.1-polynomial-interpolation.py | 18 ++++++++++++++++++ .../4.5.2-multi-operation-polynomials.py | 18 ++++++++++++++++++ .../4.6.2-multi-variable-operand-polynomial.py | 18 ++++++++++++++++++ .../zk/groth16/4.8-example-computation.py | 18 ++++++++++++++++++ script/research/zk/groth16/qap.py | 18 ++++++++++++++++++ script/research/zk/groth_poly_commit.py | 18 ++++++++++++++++++ script/research/zk/misc.py | 18 ++++++++++++++++++ script/research/zk/multipoly.py | 18 ++++++++++++++++++ script/research/zk/pasta.py | 18 ++++++++++++++++++ script/research/zk/polynomial_evalrep.py | 18 ++++++++++++++++++ script/research/zk/sonic.py | 18 ++++++++++++++++++ script/research/zk/test.py | 18 ++++++++++++++++++ 146 files changed, 2628 insertions(+) mode change 100755 => 100644 bin/darkirc/script/bots/meetbot/meetbot.py mode change 100755 => 100644 bin/darkirc/script/tmux_session/tmux_sessions.sh mode change 100755 => 100644 bin/genev/script/tmux_sessions.sh mode change 100755 => 100644 contrib/localnet/darkfid-five-nodes/clean.sh mode change 100755 => 100644 contrib/localnet/darkfid-five-nodes/tmux_sessions.sh mode change 100755 => 100644 contrib/localnet/darkfid-single-node/clean.sh mode change 100755 => 100644 contrib/localnet/darkfid-single-node/run-dao-test.sh mode change 100755 => 100644 contrib/localnet/darkfid-single-node/sync-wallet.sh mode change 100755 => 100644 contrib/localnet/darkfid-single-node/tmux_sessions.sh mode change 100755 => 100644 contrib/localnet/darkfid-small/clean.sh mode change 100755 => 100644 contrib/localnet/darkfid-small/tmux_sessions.sh mode change 100755 => 100644 contrib/localnet/darkfid/clean.sh mode change 100755 => 100644 contrib/localnet/darkfid/tmux_sessions.sh mode change 100755 => 100644 contrib/localnet/darkirc-four-nodes/tmux_sessions.sh mode change 100755 => 100644 contrib/localnet/fud/clean.sh mode change 100755 => 100644 contrib/localnet/fud/tmux_sessions.sh mode change 100755 => 100644 contrib/localnet/ircd-nym-two-nodes/tmux_session.sh mode change 100755 => 100644 contrib/privacy/purge_weechat_logs.py mode change 100755 => 100644 contrib/privacy/scrub_username_from_file.sh mode change 100755 => 100644 contrib/update_pkg_versions.py mode change 100755 => 100644 doc/build_jsonrpc.py mode change 100755 => 100644 doc/generate_seminar_ics.py mode change 100755 => 100644 doc/ghp_push.py mode change 100755 => 100644 example/p2pdebug/tmux_sessions.sh mode change 100755 => 100644 fuzz/honggfuzz/script/binary-to-bytearray.py mode change 100755 => 100644 fuzz/honggfuzz/script/generate-binary-corpus.sh mode change 100755 => 100644 script/research/pow/gen_wide_data.py diff --git a/bin/darkirc/script/bots/commitbot.py b/bin/darkirc/script/bots/commitbot.py index 60380c401d83..155d0f67527f 100644 --- a/bin/darkirc/script/bots/commitbot.py +++ b/bin/darkirc/script/bots/commitbot.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + # -*- coding: utf-8 -*- from http.server import BaseHTTPRequestHandler,HTTPServer diff --git a/bin/darkirc/script/bots/irc.py b/bin/darkirc/script/bots/irc.py index a9d8c0a3b158..49eaf721f59e 100644 --- a/bin/darkirc/script/bots/irc.py +++ b/bin/darkirc/script/bots/irc.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + import socket class IRC: diff --git a/bin/darkirc/script/bots/meetbot/meetbot.py b/bin/darkirc/script/bots/meetbot/meetbot.py old mode 100755 new mode 100644 index 69d77f22c925..f7e74456e583 --- a/bin/darkirc/script/bots/meetbot/meetbot.py +++ b/bin/darkirc/script/bots/meetbot/meetbot.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + #!/usr/bin/env python3 import asyncio import logging diff --git a/bin/darkirc/script/bots/meetbot/meetbot_cfg.py b/bin/darkirc/script/bots/meetbot/meetbot_cfg.py index 98df6cf9dfdf..326a47e6192b 100644 --- a/bin/darkirc/script/bots/meetbot/meetbot_cfg.py +++ b/bin/darkirc/script/bots/meetbot/meetbot_cfg.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + config = { # IRC server host "host": "127.0.0.1", diff --git a/bin/darkirc/script/bots/mirror-bot.py b/bin/darkirc/script/bots/mirror-bot.py index 11efa4649c7b..4d976ea04fe1 100644 --- a/bin/darkirc/script/bots/mirror-bot.py +++ b/bin/darkirc/script/bots/mirror-bot.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + # -*- coding: utf-8 -*- import irc diff --git a/bin/darkirc/script/bots/taubot.py b/bin/darkirc/script/bots/taubot.py index 75901c282516..832b6636856d 100644 --- a/bin/darkirc/script/bots/taubot.py +++ b/bin/darkirc/script/bots/taubot.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + import argparse import irc import json diff --git a/bin/darkirc/script/bots/titlebot.py b/bin/darkirc/script/bots/titlebot.py index 8b8e47c73ae9..473fb8518d8b 100644 --- a/bin/darkirc/script/bots/titlebot.py +++ b/bin/darkirc/script/bots/titlebot.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + # -*- coding: utf-8 -*- import re diff --git a/bin/darkirc/script/bots/tweetifier.py b/bin/darkirc/script/bots/tweetifier.py index 808925e324a7..79832489f243 100644 --- a/bin/darkirc/script/bots/tweetifier.py +++ b/bin/darkirc/script/bots/tweetifier.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + # -*- coding: utf-8 -*- import re diff --git a/bin/darkirc/script/tmux_session/tmux_sessions.sh b/bin/darkirc/script/tmux_session/tmux_sessions.sh old mode 100755 new mode 100644 index 6bfa4111a14a..46ade392754a --- a/bin/darkirc/script/tmux_session/tmux_sessions.sh +++ b/bin/darkirc/script/tmux_session/tmux_sessions.sh @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + #!/bin/sh # Start a tmux session of four darkirc nodes, and optionally four weechat clients. set -e diff --git a/bin/genev/script/tmux_sessions.sh b/bin/genev/script/tmux_sessions.sh old mode 100755 new mode 100644 index ad5879f595d9..c1e1fff59fd6 --- a/bin/genev/script/tmux_sessions.sh +++ b/bin/genev/script/tmux_sessions.sh @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + #!/bin/sh # Start a tmux session of 4 genev daemons, and 4 genev clis. set -e diff --git a/contrib/clean_logs.py b/contrib/clean_logs.py index b4ed7abdfdaa..c4e5200ff78b 100644 --- a/contrib/clean_logs.py +++ b/contrib/clean_logs.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + import glob, re, os.path, textwrap from colorama import Fore, Back, Style diff --git a/contrib/dependency_setup.sh b/contrib/dependency_setup.sh index ac81a78a47b4..be140f4a3a62 100644 --- a/contrib/dependency_setup.sh +++ b/contrib/dependency_setup.sh @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + #!/bin/sh set -e diff --git a/contrib/localnet/darkfid-five-nodes/clean.sh b/contrib/localnet/darkfid-five-nodes/clean.sh old mode 100755 new mode 100644 index 910cc80e9187..1d4062070394 --- a/contrib/localnet/darkfid-five-nodes/clean.sh +++ b/contrib/localnet/darkfid-five-nodes/clean.sh @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + #!/bin/sh rm -rf darkfid0 darkfid1 darkfid2 darkfid3 darkfid4 # clean log files diff --git a/contrib/localnet/darkfid-five-nodes/logproc.py b/contrib/localnet/darkfid-five-nodes/logproc.py index 0543184485c5..6226928e3a5f 100644 --- a/contrib/localnet/darkfid-five-nodes/logproc.py +++ b/contrib/localnet/darkfid-five-nodes/logproc.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + import matplotlib.pyplot as plt import numpy as np diff --git a/contrib/localnet/darkfid-five-nodes/tmux_sessions.sh b/contrib/localnet/darkfid-five-nodes/tmux_sessions.sh old mode 100755 new mode 100644 index a577fc2d5510..2d48663c5c7c --- a/contrib/localnet/darkfid-five-nodes/tmux_sessions.sh +++ b/contrib/localnet/darkfid-five-nodes/tmux_sessions.sh @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + #!/bin/sh set -e diff --git a/contrib/localnet/darkfid-single-node/clean.sh b/contrib/localnet/darkfid-single-node/clean.sh old mode 100755 new mode 100644 index 6f57c9778300..90a045bf1fa2 --- a/contrib/localnet/darkfid-single-node/clean.sh +++ b/contrib/localnet/darkfid-single-node/clean.sh @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + #!/bin/sh rm -rf darkfid0 faucetd/blockchain git checkout faucetd/wallet.db diff --git a/contrib/localnet/darkfid-single-node/run-dao-test.sh b/contrib/localnet/darkfid-single-node/run-dao-test.sh old mode 100755 new mode 100644 index e7cffb32081e..583f9a092c20 --- a/contrib/localnet/darkfid-single-node/run-dao-test.sh +++ b/contrib/localnet/darkfid-single-node/run-dao-test.sh @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + #!/bin/sh set -e set -x diff --git a/contrib/localnet/darkfid-single-node/sync-wallet.sh b/contrib/localnet/darkfid-single-node/sync-wallet.sh old mode 100755 new mode 100644 index 1799d0d89458..9b8d92924c37 --- a/contrib/localnet/darkfid-single-node/sync-wallet.sh +++ b/contrib/localnet/darkfid-single-node/sync-wallet.sh @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + #!/bin/sh set -e set -x diff --git a/contrib/localnet/darkfid-single-node/tmux_sessions.sh b/contrib/localnet/darkfid-single-node/tmux_sessions.sh old mode 100755 new mode 100644 index 867305bb9f05..f95c6fdbcc65 --- a/contrib/localnet/darkfid-single-node/tmux_sessions.sh +++ b/contrib/localnet/darkfid-single-node/tmux_sessions.sh @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + #!/bin/sh set -e diff --git a/contrib/localnet/darkfid-small/clean.sh b/contrib/localnet/darkfid-small/clean.sh old mode 100755 new mode 100644 index d8f18a65adad..287aee99522b --- a/contrib/localnet/darkfid-small/clean.sh +++ b/contrib/localnet/darkfid-small/clean.sh @@ -1,2 +1,20 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + #!/bin/sh rm -rf darkfid0 darkfid1 darkfid2 diff --git a/contrib/localnet/darkfid-small/tmux_sessions.sh b/contrib/localnet/darkfid-small/tmux_sessions.sh old mode 100755 new mode 100644 index 2a5a0e802c31..5b106201056b --- a/contrib/localnet/darkfid-small/tmux_sessions.sh +++ b/contrib/localnet/darkfid-small/tmux_sessions.sh @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + #!/bin/sh set -e diff --git a/contrib/localnet/darkfid/clean.sh b/contrib/localnet/darkfid/clean.sh old mode 100755 new mode 100644 index a5eb35b43714..148c73c00256 --- a/contrib/localnet/darkfid/clean.sh +++ b/contrib/localnet/darkfid/clean.sh @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + #!/bin/sh rm -rf darkfid0 darkfid1 darkfid2 faucetd/blockchain lilith_hosts.tsv git checkout faucetd/wallet.db diff --git a/contrib/localnet/darkfid/tmux_sessions.sh b/contrib/localnet/darkfid/tmux_sessions.sh old mode 100755 new mode 100644 index 0b2168a3118d..ef7af77456cd --- a/contrib/localnet/darkfid/tmux_sessions.sh +++ b/contrib/localnet/darkfid/tmux_sessions.sh @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + #!/bin/sh set -e diff --git a/contrib/localnet/darkirc-four-nodes/tmux_sessions.sh b/contrib/localnet/darkirc-four-nodes/tmux_sessions.sh old mode 100755 new mode 100644 index 6bfa4111a14a..46ade392754a --- a/contrib/localnet/darkirc-four-nodes/tmux_sessions.sh +++ b/contrib/localnet/darkirc-four-nodes/tmux_sessions.sh @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + #!/bin/sh # Start a tmux session of four darkirc nodes, and optionally four weechat clients. set -e diff --git a/contrib/localnet/fud/clean.sh b/contrib/localnet/fud/clean.sh old mode 100755 new mode 100644 index 8f22a8640e41..29ad9d738a51 --- a/contrib/localnet/fud/clean.sh +++ b/contrib/localnet/fud/clean.sh @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + #!/bin/sh rm -rf fud0 fud1 lilith_hosts.tsv mkdir fud0 diff --git a/contrib/localnet/fud/tmux_sessions.sh b/contrib/localnet/fud/tmux_sessions.sh old mode 100755 new mode 100644 index 00f022b76e28..7da9e6048acb --- a/contrib/localnet/fud/tmux_sessions.sh +++ b/contrib/localnet/fud/tmux_sessions.sh @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + #!/bin/sh set -e diff --git a/contrib/localnet/ircd-nym-two-nodes/tmux_session.sh b/contrib/localnet/ircd-nym-two-nodes/tmux_session.sh old mode 100755 new mode 100644 index 8528747a2e9f..f4c6cb938916 --- a/contrib/localnet/ircd-nym-two-nodes/tmux_session.sh +++ b/contrib/localnet/ircd-nym-two-nodes/tmux_session.sh @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + #!/bin/sh # Start a tmux session of five ircd nodes, and optionally 5 weechat clients. set -e diff --git a/contrib/privacy/purge_weechat_logs.py b/contrib/privacy/purge_weechat_logs.py old mode 100755 new mode 100644 index 8a4fdb4de303..65ffc02b1a71 --- a/contrib/privacy/purge_weechat_logs.py +++ b/contrib/privacy/purge_weechat_logs.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + #!/usr/bin/env python3 # # This script is supposed to be executed with cron diff --git a/contrib/privacy/scrub_username_from_file.sh b/contrib/privacy/scrub_username_from_file.sh old mode 100755 new mode 100644 index 5689bc757c88..fd9499e49662 --- a/contrib/privacy/scrub_username_from_file.sh +++ b/contrib/privacy/scrub_username_from_file.sh @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + #/usr/bin/env bash : ' diff --git a/contrib/update_pkg_versions.py b/contrib/update_pkg_versions.py old mode 100755 new mode 100644 index 6db33db74aca..aebc67dcb90b --- a/contrib/update_pkg_versions.py +++ b/contrib/update_pkg_versions.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + #!/usr/bin/env python3 # Update the version in the toplevel Cargo.toml for DarkFi, and then run this # script to update all the other Cargo.toml files. diff --git a/doc/build_jsonrpc.py b/doc/build_jsonrpc.py old mode 100755 new mode 100644 index 23e86b0645c2..ad06f6b32820 --- a/doc/build_jsonrpc.py +++ b/doc/build_jsonrpc.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + #!/usr/bin/env python3 from sys import argv diff --git a/doc/generate_seminar_ics.py b/doc/generate_seminar_ics.py old mode 100755 new mode 100644 index 003d97cec0e4..650c3a87afd6 --- a/doc/generate_seminar_ics.py +++ b/doc/generate_seminar_ics.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + #!/usr/bin/env python3 import uuid import hashlib diff --git a/doc/ghp_push.py b/doc/ghp_push.py old mode 100755 new mode 100644 index b633981dd84c..72516256e41e --- a/doc/ghp_push.py +++ b/doc/ghp_push.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + #!/usr/bin/env python3 from ghp_import import ghp_import ghp_import("book", branch="gh-pages", no_history=True, mesg="Generate mdbook") diff --git a/example/p2pdebug/tmux_sessions.sh b/example/p2pdebug/tmux_sessions.sh old mode 100755 new mode 100644 index becc106f0bb9..8a6a07e7f573 --- a/example/p2pdebug/tmux_sessions.sh +++ b/example/p2pdebug/tmux_sessions.sh @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + #!/bin/sh tmux new-session -d './target/release/p2pdebug' diff --git a/fuzz/honggfuzz/script/binary-to-bytearray.py b/fuzz/honggfuzz/script/binary-to-bytearray.py old mode 100755 new mode 100644 index 169ed96fcb0f..04f13d766c6e --- a/fuzz/honggfuzz/script/binary-to-bytearray.py +++ b/fuzz/honggfuzz/script/binary-to-bytearray.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + #!/usr/bin/env python3 """ diff --git a/fuzz/honggfuzz/script/generate-binary-corpus.sh b/fuzz/honggfuzz/script/generate-binary-corpus.sh old mode 100755 new mode 100644 index 94230e9a4920..1bdbe3b9f44d --- a/fuzz/honggfuzz/script/generate-binary-corpus.sh +++ b/fuzz/honggfuzz/script/generate-binary-corpus.sh @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + #/usr/bin/env bash : ' Copies all ZK binary files (.zk.bin) from the main repository into a destination folder diff --git a/script/research/crypsinous/linearindependence/main.py b/script/research/crypsinous/linearindependence/main.py index 389c899ea7b1..ed170dad146c 100644 --- a/script/research/crypsinous/linearindependence/main.py +++ b/script/research/crypsinous/linearindependence/main.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + import math import numpy as np import matplotlib.pyplot as plt diff --git a/script/research/crypsinous/ouroboros/__init__.py b/script/research/crypsinous/ouroboros/__init__.py index 3eb297a655bc..6731cd902748 100644 --- a/script/research/crypsinous/ouroboros/__init__.py +++ b/script/research/crypsinous/ouroboros/__init__.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + #dynamic proof of stake blockchain from dpos import ouroboros from dpos.ouroboros.vrf import VRF diff --git a/script/research/crypsinous/ouroboros/ouroboros/__init__.py b/script/research/crypsinous/ouroboros/ouroboros/__init__.py index f8a17ee268db..e66c087f350f 100644 --- a/script/research/crypsinous/ouroboros/ouroboros/__init__.py +++ b/script/research/crypsinous/ouroboros/ouroboros/__init__.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from ouroboros.vrf import VRF from ouroboros.environment import Z from ouroboros.stakeholder import Stakeholder diff --git a/script/research/crypsinous/ouroboros/ouroboros/beacon.py b/script/research/crypsinous/ouroboros/ouroboros/beacon.py index 0d7085bcb14e..b1e624ff0f2b 100644 --- a/script/research/crypsinous/ouroboros/ouroboros/beacon.py +++ b/script/research/crypsinous/ouroboros/ouroboros/beacon.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + import threading from ouroboros.clock import SynchedNTPClock from ouroboros.vrf import VRF diff --git a/script/research/crypsinous/ouroboros/ouroboros/block.py b/script/research/crypsinous/ouroboros/ouroboros/block.py index ece08c1247bc..161bb1ca7855 100644 --- a/script/research/crypsinous/ouroboros/ouroboros/block.py +++ b/script/research/crypsinous/ouroboros/ouroboros/block.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + import json import time from ouroboros.utils import encode_genesis_data, decode_gensis_data, state_hash diff --git a/script/research/crypsinous/ouroboros/ouroboros/blockchain.py b/script/research/crypsinous/ouroboros/ouroboros/blockchain.py index 2af22a6dabe4..503983171042 100644 --- a/script/research/crypsinous/ouroboros/ouroboros/blockchain.py +++ b/script/research/crypsinous/ouroboros/ouroboros/blockchain.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + import math from ouroboros.logger import Logger diff --git a/script/research/crypsinous/ouroboros/ouroboros/clock.py b/script/research/crypsinous/ouroboros/ouroboros/clock.py index eda8cd59d54d..9be5ba3d4f2a 100644 --- a/script/research/crypsinous/ouroboros/ouroboros/clock.py +++ b/script/research/crypsinous/ouroboros/ouroboros/clock.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + ''' synchronized NTP clock ''' diff --git a/script/research/crypsinous/ouroboros/ouroboros/consts.py b/script/research/crypsinous/ouroboros/ouroboros/consts.py index 13e64470ecf6..0615ce762afe 100644 --- a/script/research/crypsinous/ouroboros/ouroboros/consts.py +++ b/script/research/crypsinous/ouroboros/ouroboros/consts.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + STAKEHOLDERS_DISTRIBUTIONS='distributions' STAKEHOLDERS='stakeholders' SEED='seed' diff --git a/script/research/crypsinous/ouroboros/ouroboros/data.py b/script/research/crypsinous/ouroboros/ouroboros/data.py index 5f470c9e1cba..a3543127a9b5 100644 --- a/script/research/crypsinous/ouroboros/ouroboros/data.py +++ b/script/research/crypsinous/ouroboros/ouroboros/data.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + import time from ouroboros.logger import Logger diff --git a/script/research/crypsinous/ouroboros/ouroboros/environment.py b/script/research/crypsinous/ouroboros/ouroboros/environment.py index d4a07de7d1ec..ee008f3fed77 100644 --- a/script/research/crypsinous/ouroboros/ouroboros/environment.py +++ b/script/research/crypsinous/ouroboros/ouroboros/environment.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + import numpy as np import math import random diff --git a/script/research/crypsinous/ouroboros/ouroboros/epoch.py b/script/research/crypsinous/ouroboros/ouroboros/epoch.py index 1a90858306d6..872dce097486 100644 --- a/script/research/crypsinous/ouroboros/ouroboros/epoch.py +++ b/script/research/crypsinous/ouroboros/ouroboros/epoch.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from ouroboros.utils import state_hash from ouroboros.logger import Logger diff --git a/script/research/crypsinous/ouroboros/ouroboros/hashtree.py b/script/research/crypsinous/ouroboros/ouroboros/hashtree.py index a7755fa08d27..19cce1439028 100644 --- a/script/research/crypsinous/ouroboros/ouroboros/hashtree.py +++ b/script/research/crypsinous/ouroboros/ouroboros/hashtree.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from ouroboros.data import Data ''' diff --git a/script/research/crypsinous/ouroboros/ouroboros/kes.py b/script/research/crypsinous/ouroboros/ouroboros/kes.py index 1bfb8a8b98ff..6e18830303a8 100644 --- a/script/research/crypsinous/ouroboros/ouroboros/kes.py +++ b/script/research/crypsinous/ouroboros/ouroboros/kes.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + ''' forward secure signature scheme by key evolving ''' diff --git a/script/research/crypsinous/ouroboros/ouroboros/logger.py b/script/research/crypsinous/ouroboros/ouroboros/logger.py index 955298ffcafa..bafd43fe8b4c 100644 --- a/script/research/crypsinous/ouroboros/ouroboros/logger.py +++ b/script/research/crypsinous/ouroboros/ouroboros/logger.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + import time import os os.system("color") diff --git a/script/research/crypsinous/ouroboros/ouroboros/sig_test.py b/script/research/crypsinous/ouroboros/ouroboros/sig_test.py index 201b70d8cbe9..4bbf5d01642f 100644 --- a/script/research/crypsinous/ouroboros/ouroboros/sig_test.py +++ b/script/research/crypsinous/ouroboros/ouroboros/sig_test.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from ouroboros.utils import * from ouroboros.block import Block, EmptyBlock diff --git a/script/research/crypsinous/ouroboros/ouroboros/stakeholder.py b/script/research/crypsinous/ouroboros/ouroboros/stakeholder.py index 4b0a5266a659..bb56d22620f8 100644 --- a/script/research/crypsinous/ouroboros/ouroboros/stakeholder.py +++ b/script/research/crypsinous/ouroboros/ouroboros/stakeholder.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from copy import deepcopy import time import numpy as np diff --git a/script/research/crypsinous/ouroboros/ouroboros/utils.py b/script/research/crypsinous/ouroboros/ouroboros/utils.py index d2081ef62f09..e11b68d4049e 100644 --- a/script/research/crypsinous/ouroboros/ouroboros/utils.py +++ b/script/research/crypsinous/ouroboros/ouroboros/utils.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from cryptography.hazmat.primitives import serialization, hashes from cryptography.hazmat.primitives.asymmetric import rsa, padding from cryptography.hazmat.backends import default_backend diff --git a/script/research/crypsinous/ouroboros/ouroboros/vrf.py b/script/research/crypsinous/ouroboros/ouroboros/vrf.py index cfea2794ada0..45ded07d4c20 100644 --- a/script/research/crypsinous/ouroboros/ouroboros/vrf.py +++ b/script/research/crypsinous/ouroboros/ouroboros/vrf.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from ouroboros.logger import Logger import random as rnd from tate_bilinear_pairing import eta, ecc diff --git a/script/research/crypsinous/ouroboros/sig_test.py b/script/research/crypsinous/ouroboros/sig_test.py index ee90902b9470..627dabba2865 100644 --- a/script/research/crypsinous/ouroboros/sig_test.py +++ b/script/research/crypsinous/ouroboros/sig_test.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from ouroboros.utils import * from ouroboros.block import Block, EmptyBlock diff --git a/script/research/crypsinous/ouroboros/simulation.py b/script/research/crypsinous/ouroboros/simulation.py index b6ed69251d0f..5d3c40a6301b 100644 --- a/script/research/crypsinous/ouroboros/simulation.py +++ b/script/research/crypsinous/ouroboros/simulation.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + import time from ouroboros import Stakeholder from ouroboros import Z diff --git a/script/research/crypsinous/ouroboros/vrf_test.py b/script/research/crypsinous/ouroboros/vrf_test.py index 3e478a381d10..95629a545148 100644 --- a/script/research/crypsinous/ouroboros/vrf_test.py +++ b/script/research/crypsinous/ouroboros/vrf_test.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from ouroboros.vrf import VRF, verify seed='seed' diff --git a/script/research/dao/classnamespace.py b/script/research/dao/classnamespace.py index 858a888d6ddd..18f943944393 100644 --- a/script/research/dao/classnamespace.py +++ b/script/research/dao/classnamespace.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from types import SimpleNamespace class ClassNamespace(SimpleNamespace): diff --git a/script/research/dao/crypto.py b/script/research/dao/crypto.py index e90ace85825e..caf554b75841 100644 --- a/script/research/dao/crypto.py +++ b/script/research/dao/crypto.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + import hashlib import random diff --git a/script/research/dao/main.py b/script/research/dao/main.py index ca3e16974f60..56a434f2e777 100644 --- a/script/research/dao/main.py +++ b/script/research/dao/main.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + import sys from classnamespace import ClassNamespace diff --git a/script/research/dao/money.py b/script/research/dao/money.py index ec62934c90ca..c75cf828e954 100644 --- a/script/research/dao/money.py +++ b/script/research/dao/money.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from classnamespace import ClassNamespace from crypto import ff_hash, pedersen_encrypt, sign, verify diff --git a/script/research/ec/curve.py b/script/research/ec/curve.py index db6cafd44088..c3816105425e 100644 --- a/script/research/ec/curve.py +++ b/script/research/ec/curve.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from finite_fields import finitefield def add(x_1, y_1, x_2, y_2): diff --git a/script/research/ec/old/ag.py b/script/research/ec/old/ag.py index f878c1cc2416..7f94f2d38de3 100644 --- a/script/research/ec/old/ag.py +++ b/script/research/ec/old/ag.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + import numpy as np add_tuple = lambda a, b: tuple(a_i + b_i for a_i, b_i in zip(a, b)) diff --git a/script/research/ec/old/val2.py b/script/research/ec/old/val2.py index 5efd76845fbf..9329a51a4d0e 100644 --- a/script/research/ec/old/val2.py +++ b/script/research/ec/old/val2.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + import itertools import numpy as np import pickle diff --git a/script/research/ec/visual_zeropole.py b/script/research/ec/visual_zeropole.py index 28f978fd2985..5579830250ed 100644 --- a/script/research/ec/visual_zeropole.py +++ b/script/research/ec/visual_zeropole.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + import matplotlib.pyplot as plt a = [] diff --git a/script/research/event_graph/main.py b/script/research/event_graph/main.py index 6f0af0809ea9..1fa26302562f 100644 --- a/script/research/event_graph/main.py +++ b/script/research/event_graph/main.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from hashlib import sha256 from random import randint, random, getrandbits from collections import Counter diff --git a/script/research/finite_fields/euclidean-test.py b/script/research/finite_fields/euclidean-test.py index f9551be96ce9..365ffb629a1d 100644 --- a/script/research/finite_fields/euclidean-test.py +++ b/script/research/finite_fields/euclidean-test.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from test import test from euclidean import * diff --git a/script/research/finite_fields/euclidean.py b/script/research/finite_fields/euclidean.py index f4d75a41dd33..c4a9f6b57dc7 100644 --- a/script/research/finite_fields/euclidean.py +++ b/script/research/finite_fields/euclidean.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + # a general Euclidean algorithm for any number type with # a divmod and a valuation abs() whose minimum value is zero diff --git a/script/research/finite_fields/finitefield-test.py b/script/research/finite_fields/finitefield-test.py index ab3a9537a0a5..3f0fe39c5333 100644 --- a/script/research/finite_fields/finitefield-test.py +++ b/script/research/finite_fields/finitefield-test.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from test import test from finitefield import * from polynomial import * diff --git a/script/research/finite_fields/finitefield.py b/script/research/finite_fields/finitefield.py index e922122f2af4..c2c77fcf5f7c 100644 --- a/script/research/finite_fields/finitefield.py +++ b/script/research/finite_fields/finitefield.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + import random from .polynomial import polynomialsOver from .modp import * diff --git a/script/research/finite_fields/modp-test.py b/script/research/finite_fields/modp-test.py index db390fa2ad56..289c3a023089 100644 --- a/script/research/finite_fields/modp-test.py +++ b/script/research/finite_fields/modp-test.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from modp import * from test import test diff --git a/script/research/finite_fields/modp.py b/script/research/finite_fields/modp.py index 164927b34dc0..468e4378dfb3 100644 --- a/script/research/finite_fields/modp.py +++ b/script/research/finite_fields/modp.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from .euclidean import * from .numbertype import * diff --git a/script/research/finite_fields/numbertype.py b/script/research/finite_fields/numbertype.py index 313c6e703782..d77ad7222127 100644 --- a/script/research/finite_fields/numbertype.py +++ b/script/research/finite_fields/numbertype.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + # memoize calls to the class constructors for fields # this helps typechecking by never creating two separate # instances of a number class. diff --git a/script/research/finite_fields/polynomial-test.py b/script/research/finite_fields/polynomial-test.py index d006394d9ea4..c8ca45754ed2 100644 --- a/script/research/finite_fields/polynomial-test.py +++ b/script/research/finite_fields/polynomial-test.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from __future__ import division from test import test from fractions import Fraction diff --git a/script/research/finite_fields/polynomial.py b/script/research/finite_fields/polynomial.py index d10c35407871..fd8853285ee5 100644 --- a/script/research/finite_fields/polynomial.py +++ b/script/research/finite_fields/polynomial.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + try: from itertools import zip_longest except ImportError: diff --git a/script/research/finite_fields/test.py b/script/research/finite_fields/test.py index ab728cdbef60..c210ac36074f 100644 --- a/script/research/finite_fields/test.py +++ b/script/research/finite_fields/test.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + def test(expected, actual): if expected != actual: import sys, traceback diff --git a/script/research/finite_fields/typecast-test.py b/script/research/finite_fields/typecast-test.py index ed3b5991086f..a9a38e8becc9 100644 --- a/script/research/finite_fields/typecast-test.py +++ b/script/research/finite_fields/typecast-test.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from modp import * from polynomial import * diff --git a/script/research/jubjub.py b/script/research/jubjub.py index d701482c8037..11477c86e683 100644 --- a/script/research/jubjub.py +++ b/script/research/jubjub.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from finite_fields.modp import IntegersModP q = 0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001 diff --git a/script/research/lotterysim/__init__.py b/script/research/lotterysim/__init__.py index cd01ab49a291..0dd69e0db14c 100644 --- a/script/research/lotterysim/__init__.py +++ b/script/research/lotterysim/__init__.py @@ -1 +1,19 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from lottery import DarkfiTable diff --git a/script/research/lotterysim/acc_vs_staked_ratio.py b/script/research/lotterysim/acc_vs_staked_ratio.py index e65392ef122e..e5b1eb9e4486 100644 --- a/script/research/lotterysim/acc_vs_staked_ratio.py +++ b/script/research/lotterysim/acc_vs_staked_ratio.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from core.lottery import * import os import numpy diff --git a/script/research/lotterysim/acc_vs_staked_ratio_pi.py b/script/research/lotterysim/acc_vs_staked_ratio_pi.py index 8fced640fe8c..ed3823a22f9d 100644 --- a/script/research/lotterysim/acc_vs_staked_ratio_pi.py +++ b/script/research/lotterysim/acc_vs_staked_ratio_pi.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from core.lottery import * import os import numpy diff --git a/script/research/lotterysim/acc_vs_staked_ratio_pi_headstart.py b/script/research/lotterysim/acc_vs_staked_ratio_pi_headstart.py index 8797cdb116d5..307cc0842b17 100644 --- a/script/research/lotterysim/acc_vs_staked_ratio_pi_headstart.py +++ b/script/research/lotterysim/acc_vs_staked_ratio_pi_headstart.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from core.lottery import * import os import numpy diff --git a/script/research/lotterysim/basefee_discrete_autocrawler_pi.py b/script/research/lotterysim/basefee_discrete_autocrawler_pi.py index c4489489e2bd..bdb1491e623f 100644 --- a/script/research/lotterysim/basefee_discrete_autocrawler_pi.py +++ b/script/research/lotterysim/basefee_discrete_autocrawler_pi.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from argparse import ArgumentParser from core.lottery import DarkfiTable from core.utils import * diff --git a/script/research/lotterysim/blockchain_scripts/plot_sim_vs_darkfi_distribution.py b/script/research/lotterysim/blockchain_scripts/plot_sim_vs_darkfi_distribution.py index 40c3f553395b..c79c58ddc02c 100644 --- a/script/research/lotterysim/blockchain_scripts/plot_sim_vs_darkfi_distribution.py +++ b/script/research/lotterysim/blockchain_scripts/plot_sim_vs_darkfi_distribution.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from lottery import * from matplotlib import pyplot as plt diff --git a/script/research/lotterysim/blockchain_scripts/sigmas_test_samples.py b/script/research/lotterysim/blockchain_scripts/sigmas_test_samples.py index ed4619c8d5c6..c3a863e0fcfb 100644 --- a/script/research/lotterysim/blockchain_scripts/sigmas_test_samples.py +++ b/script/research/lotterysim/blockchain_scripts/sigmas_test_samples.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + ''' generating a test case for sigmas in pallas field. diff --git a/script/research/lotterysim/config.py b/script/research/lotterysim/config.py index 79706923c96a..6608def07612 100644 --- a/script/research/lotterysim/config.py +++ b/script/research/lotterysim/config.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + # Running time measured in slots. Set to 0 to run for the whole vesting period. running_time = 1000 diff --git a/script/research/lotterysim/core/__init__.py b/script/research/lotterysim/core/__init__.py index e69de29bb2d1..7c38b1b9516a 100644 --- a/script/research/lotterysim/core/__init__.py +++ b/script/research/lotterysim/core/__init__.py @@ -0,0 +1,18 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + diff --git a/script/research/lotterysim/core/constants.py b/script/research/lotterysim/core/constants.py index 92f71c711c91..b7ddcc42e574 100644 --- a/script/research/lotterysim/core/constants.py +++ b/script/research/lotterysim/core/constants.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from decimal import Decimal as Num # number approximation terms diff --git a/script/research/lotterysim/core/darkie.py b/script/research/lotterysim/core/darkie.py index 8e3cb94800cb..d0d89796a920 100644 --- a/script/research/lotterysim/core/darkie.py +++ b/script/research/lotterysim/core/darkie.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from core.utils import * from core.strategy import * diff --git a/script/research/lotterysim/core/lottery.py b/script/research/lotterysim/core/lottery.py index 4ef50c00ad95..e5532096ebaa 100644 --- a/script/research/lotterysim/core/lottery.py +++ b/script/research/lotterysim/core/lottery.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + import matplotlib.pyplot as plt from tqdm import tqdm import time diff --git a/script/research/lotterysim/core/strategy.py b/script/research/lotterysim/core/strategy.py index 55051dc6a78a..12e70644b125 100644 --- a/script/research/lotterysim/core/strategy.py +++ b/script/research/lotterysim/core/strategy.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + import math from core.utils import * diff --git a/script/research/lotterysim/core/utils.py b/script/research/lotterysim/core/utils.py index ca7fd5239fe7..67ef84268a16 100644 --- a/script/research/lotterysim/core/utils.py +++ b/script/research/lotterysim/core/utils.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + import random import math import numpy as np diff --git a/script/research/lotterysim/discrete_instance.py b/script/research/lotterysim/discrete_instance.py index bef362d09d08..daa6d53e9b56 100644 --- a/script/research/lotterysim/discrete_instance.py +++ b/script/research/lotterysim/discrete_instance.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + import os import numpy from core.strategy import * diff --git a/script/research/lotterysim/discrete_instance_pi_headstart.py b/script/research/lotterysim/discrete_instance_pi_headstart.py index 4970ffa739ed..e7bd58f49004 100644 --- a/script/research/lotterysim/discrete_instance_pi_headstart.py +++ b/script/research/lotterysim/discrete_instance_pi_headstart.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + import os import numpy from core.strategy import * diff --git a/script/research/lotterysim/draw.py b/script/research/lotterysim/draw.py index 22d0bafff7a4..8212d41e6bb0 100644 --- a/script/research/lotterysim/draw.py +++ b/script/research/lotterysim/draw.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + import matplotlib.pyplot as plt import numpy as np import os diff --git a/script/research/lotterysim/metrics.py b/script/research/lotterysim/metrics.py index 4227994f48fd..964528e88846 100644 --- a/script/research/lotterysim/metrics.py +++ b/script/research/lotterysim/metrics.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from core.constants import * import config diff --git a/script/research/lotterysim/pid/__init__.py b/script/research/lotterysim/pid/__init__.py index e69de29bb2d1..7c38b1b9516a 100644 --- a/script/research/lotterysim/pid/__init__.py +++ b/script/research/lotterysim/pid/__init__.py @@ -0,0 +1,18 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + diff --git a/script/research/lotterysim/pid/cascade.py b/script/research/lotterysim/pid/cascade.py index 7ecbd0cbb3e3..4d28d38b7e3c 100644 --- a/script/research/lotterysim/pid/cascade.py +++ b/script/research/lotterysim/pid/cascade.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from core.utils import * from pid.pid_base import BasePID diff --git a/script/research/lotterysim/pid/pid_base.py b/script/research/lotterysim/pid/pid_base.py index 444d068e01c9..4d14f310b288 100644 --- a/script/research/lotterysim/pid/pid_base.py +++ b/script/research/lotterysim/pid/pid_base.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from core.utils import * import os diff --git a/script/research/lotterysim/plot_darkies.py b/script/research/lotterysim/plot_darkies.py index 2f5c94f30f19..2496a09303b0 100644 --- a/script/research/lotterysim/plot_darkies.py +++ b/script/research/lotterysim/plot_darkies.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + import matplotlib.pyplot as plt import numpy as np import os diff --git a/script/research/lotterysim/pool_advantage.py b/script/research/lotterysim/pool_advantage.py index 99d1cd363abc..17cf96dbd5bd 100644 --- a/script/research/lotterysim/pool_advantage.py +++ b/script/research/lotterysim/pool_advantage.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + import os import numpy from core.strategy import * diff --git a/script/research/lotterysim/primary_discrete_auto_crawler.py b/script/research/lotterysim/primary_discrete_auto_crawler.py index 46fc9e52b602..adc7d6c93896 100644 --- a/script/research/lotterysim/primary_discrete_auto_crawler.py +++ b/script/research/lotterysim/primary_discrete_auto_crawler.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from argparse import ArgumentParser from core.lottery import DarkfiTable from core.utils import * diff --git a/script/research/lotterysim/primary_discrete_auto_crawler_pi.py b/script/research/lotterysim/primary_discrete_auto_crawler_pi.py index 5e7cbe3a1c77..d24997f908dc 100644 --- a/script/research/lotterysim/primary_discrete_auto_crawler_pi.py +++ b/script/research/lotterysim/primary_discrete_auto_crawler_pi.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from argparse import ArgumentParser from core.lottery import DarkfiTable from core.utils import * diff --git a/script/research/lotterysim/reports/__init__.py b/script/research/lotterysim/reports/__init__.py index e69de29bb2d1..7c38b1b9516a 100644 --- a/script/research/lotterysim/reports/__init__.py +++ b/script/research/lotterysim/reports/__init__.py @@ -0,0 +1,18 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + diff --git a/script/research/lotterysim/reports/elbow.py b/script/research/lotterysim/reports/elbow.py index 55d42bd59961..10d85e07ff7c 100644 --- a/script/research/lotterysim/reports/elbow.py +++ b/script/research/lotterysim/reports/elbow.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D diff --git a/script/research/lotterysim/reports/one_year_reward.py b/script/research/lotterysim/reports/one_year_reward.py index be0862d4e9c4..d7f6b03841c3 100644 --- a/script/research/lotterysim/reports/one_year_reward.py +++ b/script/research/lotterysim/reports/one_year_reward.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from lottery import * import os import numpy diff --git a/script/research/lotterysim/reports/stake_reward.py b/script/research/lotterysim/reports/stake_reward.py index 96bd74f30dd9..7ab4163e0c41 100644 --- a/script/research/lotterysim/reports/stake_reward.py +++ b/script/research/lotterysim/reports/stake_reward.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + # running time ONE_YEAR #network airdrop: 2100000000.0, staked token: 2099815635.398858/99.99122073327895% on 1000 nodes #acc: 35.66458096862327, reward: 0.005966962921188361850310030975% with instant finality: 0.01673078095726943897690808440% diff --git a/script/research/lotterysim/search_space/discrete.py b/script/research/lotterysim/search_space/discrete.py index d6ad64c2d7bc..506fd56f000b 100644 --- a/script/research/lotterysim/search_space/discrete.py +++ b/script/research/lotterysim/search_space/discrete.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from lottery import * from threading import Thread diff --git a/script/research/lotterysim/search_space/takahashi.py b/script/research/lotterysim/search_space/takahashi.py index a5445c1c22d0..691092963c9d 100644 --- a/script/research/lotterysim/search_space/takahashi.py +++ b/script/research/lotterysim/search_space/takahashi.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from lottery import * AVG_LEN = 3 diff --git a/script/research/lotterysim/secondary_discrete_auto_crawler.py b/script/research/lotterysim/secondary_discrete_auto_crawler.py index 3fc6b15b8f82..9eb607d392e9 100644 --- a/script/research/lotterysim/secondary_discrete_auto_crawler.py +++ b/script/research/lotterysim/secondary_discrete_auto_crawler.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from argparse import ArgumentParser from core.lottery import DarkfiTable from core.utils import * diff --git a/script/research/lotterysim/secondary_discrete_auto_crawler_pi.py b/script/research/lotterysim/secondary_discrete_auto_crawler_pi.py index 8b1308a91ce3..bf5f20eeefd1 100644 --- a/script/research/lotterysim/secondary_discrete_auto_crawler_pi.py +++ b/script/research/lotterysim/secondary_discrete_auto_crawler_pi.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from argparse import ArgumentParser from core.lottery import DarkfiTable from core.utils import * diff --git a/script/research/lotterysim/secondary_takahashi_auto_crawler.py b/script/research/lotterysim/secondary_takahashi_auto_crawler.py index 4e75e8c1992e..3546406fb5c9 100644 --- a/script/research/lotterysim/secondary_takahashi_auto_crawler.py +++ b/script/research/lotterysim/secondary_takahashi_auto_crawler.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from argparse import ArgumentParser from core.lottery import DarkfiTable from core.utils import * diff --git a/script/research/lotterysim/takahashi_instance.py b/script/research/lotterysim/takahashi_instance.py index 7dfede345704..d6a9521ddcc7 100644 --- a/script/research/lotterysim/takahashi_instance.py +++ b/script/research/lotterysim/takahashi_instance.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from core.lottery import * from core.utils import * from core.strategy import * diff --git a/script/research/lotterysim/vesting.py b/script/research/lotterysim/vesting.py index e7ce7faeb9b1..a70b95b808cb 100644 --- a/script/research/lotterysim/vesting.py +++ b/script/research/lotterysim/vesting.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from core.lottery import * from core.strategy import random_strategy from core.constants import * diff --git a/script/research/modp.py b/script/research/modp.py index 91606a45824a..311b881d2bb1 100644 --- a/script/research/modp.py +++ b/script/research/modp.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from finite_fields.modp import IntegersModP q = 0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001 diff --git a/script/research/poseidon/constants.py b/script/research/poseidon/constants.py index 605628a296a8..2d663c776761 100644 --- a/script/research/poseidon/constants.py +++ b/script/research/poseidon/constants.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + round_constants = [ [ 0x360d7470611e473d353f628f76d110f34e71162f31003b7057538c2596426303, diff --git a/script/research/poseidon/poseidon.py b/script/research/poseidon/poseidon.py index fa6c6e538ded..a40371f14e1a 100644 --- a/script/research/poseidon/poseidon.py +++ b/script/research/poseidon/poseidon.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + #!/usr/bin/env python3 import numpy from finite_fields.finitefield import IntegersModP diff --git a/script/research/pow/gen_wide_data.py b/script/research/pow/gen_wide_data.py old mode 100755 new mode 100644 index 74fd311f9b62..cc49e4cf726b --- a/script/research/pow/gen_wide_data.py +++ b/script/research/pow/gen_wide_data.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + #!/usr/bin/env python3 # Copyright (c) 2014-2023, The Monero Project # diff --git a/script/research/streamlet/2-execution-model-and-definitions.py b/script/research/streamlet/2-execution-model-and-definitions.py index 8b42c80b2e8d..06b3bd9758e7 100644 --- a/script/research/streamlet/2-execution-model-and-definitions.py +++ b/script/research/streamlet/2-execution-model-and-definitions.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + # Section 2 from "Streamlet: Textbook Streamlined Blockchains" class Node: diff --git a/script/research/streamlet/3.2-blocks-and-blockchain.py b/script/research/streamlet/3.2-blocks-and-blockchain.py index fd436806549a..5d83bfada2e2 100644 --- a/script/research/streamlet/3.2-blocks-and-blockchain.py +++ b/script/research/streamlet/3.2-blocks-and-blockchain.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + # Section 3.2 from "Streamlet: Textbook Streamlined Blockchains" class Block: diff --git a/script/research/streamlet/3.3-votes-and-notarization.py b/script/research/streamlet/3.3-votes-and-notarization.py index 818e05a0b495..6910af72441a 100644 --- a/script/research/streamlet/3.3-votes-and-notarization.py +++ b/script/research/streamlet/3.3-votes-and-notarization.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + # Section 3.3 from "Streamlet: Textbook Streamlined Blockchains" from cryptography.hazmat.primitives import serialization, hashes diff --git a/script/research/streamlet/3.4-protocol.py b/script/research/streamlet/3.4-protocol.py index b3b65836d1ca..f5b60b314dcd 100644 --- a/script/research/streamlet/3.4-protocol.py +++ b/script/research/streamlet/3.4-protocol.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + # Section 3.4 from "Streamlet: Textbook Streamlined Blockchains" from block import Block diff --git a/script/research/streamlet/block.py b/script/research/streamlet/block.py index b3e3fed7e0f9..f53128f757d4 100644 --- a/script/research/streamlet/block.py +++ b/script/research/streamlet/block.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + class Block: ''' This class represents a tuple of the form (h, e, txs). Each blocks parent hash h may be computed simply as a hash of the parent block. ''' diff --git a/script/research/streamlet/blockchain.py b/script/research/streamlet/blockchain.py index 66e5d7d02a8c..5ae7dd3ce5f9 100644 --- a/script/research/streamlet/blockchain.py +++ b/script/research/streamlet/blockchain.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + class Blockchain: ''' This class represents a sequence of blocks starting with the genesis block. ''' diff --git a/script/research/streamlet/node.py b/script/research/streamlet/node.py index 8b7418db6ee0..cd53c69f22b9 100644 --- a/script/research/streamlet/node.py +++ b/script/research/streamlet/node.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + import copy import utils from block import Block diff --git a/script/research/streamlet/utils.py b/script/research/streamlet/utils.py index f9cd5c465f62..0699f03966d3 100644 --- a/script/research/streamlet/utils.py +++ b/script/research/streamlet/utils.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from cryptography.hazmat.primitives import serialization, hashes from cryptography.hazmat.primitives.asymmetric import rsa, padding from cryptography.hazmat.backends import default_backend diff --git a/script/research/streamlet/vote.py b/script/research/streamlet/vote.py index 3d900adf5d1b..e920bec8aa27 100644 --- a/script/research/streamlet/vote.py +++ b/script/research/streamlet/vote.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + class Vote: ''' This class represents a tuple of the form (vote, B, id). ''' diff --git a/script/research/vm-db-types/export-table.py b/script/research/vm-db-types/export-table.py index 97ffc0de5788..7b091ff9b3ff 100644 --- a/script/research/vm-db-types/export-table.py +++ b/script/research/vm-db-types/export-table.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from tabulate import tabulate headers = [ diff --git a/script/research/zk/bootle16.py b/script/research/zk/bootle16.py index 52b6264c302b..5b754f72fb4d 100644 --- a/script/research/zk/bootle16.py +++ b/script/research/zk/bootle16.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + # Notes from paper: # "Efficient Zero-Knowledge Arguments for Arithmetic Circuits in the # Discrete Log Setting" by Bootle and others (EUROCRYPT 2016) diff --git a/script/research/zk/groth16/3.3-encrypted-polynomial.py b/script/research/zk/groth16/3.3-encrypted-polynomial.py index af98250def85..aecaf739ffa7 100644 --- a/script/research/zk/groth16/3.3-encrypted-polynomial.py +++ b/script/research/zk/groth16/3.3-encrypted-polynomial.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from bls_py import bls12381 from bls_py import pairing from bls_py import ec diff --git a/script/research/zk/groth16/3.4-restricted-polynomial.py b/script/research/zk/groth16/3.4-restricted-polynomial.py index 15200640afd4..493360d8ba0d 100644 --- a/script/research/zk/groth16/3.4-restricted-polynomial.py +++ b/script/research/zk/groth16/3.4-restricted-polynomial.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from bls_py import bls12381 from bls_py import pairing from bls_py import ec diff --git a/script/research/zk/groth16/3.5-zero-knowledge.py b/script/research/zk/groth16/3.5-zero-knowledge.py index d440a2b1a2f2..45d4632290d7 100644 --- a/script/research/zk/groth16/3.5-zero-knowledge.py +++ b/script/research/zk/groth16/3.5-zero-knowledge.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from bls_py import bls12381 from bls_py import pairing from bls_py import ec diff --git a/script/research/zk/groth16/3.6-trusted-setup.py b/script/research/zk/groth16/3.6-trusted-setup.py index 42651782989a..3b63747c08e7 100644 --- a/script/research/zk/groth16/3.6-trusted-setup.py +++ b/script/research/zk/groth16/3.6-trusted-setup.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from bls_py import bls12381 from bls_py import pairing from bls_py import ec diff --git a/script/research/zk/groth16/4.4-proof-of-operation.py b/script/research/zk/groth16/4.4-proof-of-operation.py index 83881715808b..d9b5217bd823 100644 --- a/script/research/zk/groth16/4.4-proof-of-operation.py +++ b/script/research/zk/groth16/4.4-proof-of-operation.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from bls_py import bls12381 from bls_py import pairing from bls_py import ec diff --git a/script/research/zk/groth16/4.5.1-polynomial-interpolation.py b/script/research/zk/groth16/4.5.1-polynomial-interpolation.py index cd6f0f77c81b..ba8b97b92b74 100644 --- a/script/research/zk/groth16/4.5.1-polynomial-interpolation.py +++ b/script/research/zk/groth16/4.5.1-polynomial-interpolation.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + import numpy as np def lagrange(points): diff --git a/script/research/zk/groth16/4.5.2-multi-operation-polynomials.py b/script/research/zk/groth16/4.5.2-multi-operation-polynomials.py index 4436a2b877e3..7acaabaf39a5 100644 --- a/script/research/zk/groth16/4.5.2-multi-operation-polynomials.py +++ b/script/research/zk/groth16/4.5.2-multi-operation-polynomials.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from bls_py import bls12381 from bls_py import pairing from bls_py import ec diff --git a/script/research/zk/groth16/4.6.2-multi-variable-operand-polynomial.py b/script/research/zk/groth16/4.6.2-multi-variable-operand-polynomial.py index 992444881c89..2e8c2b856d91 100644 --- a/script/research/zk/groth16/4.6.2-multi-variable-operand-polynomial.py +++ b/script/research/zk/groth16/4.6.2-multi-variable-operand-polynomial.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from bls_py import bls12381 from bls_py import pairing from bls_py import ec diff --git a/script/research/zk/groth16/4.8-example-computation.py b/script/research/zk/groth16/4.8-example-computation.py index 45bd7106c7d9..81609333dbdb 100644 --- a/script/research/zk/groth16/4.8-example-computation.py +++ b/script/research/zk/groth16/4.8-example-computation.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + # Algorithm: # if w { a * b } else { a + b } diff --git a/script/research/zk/groth16/qap.py b/script/research/zk/groth16/qap.py index b9ec691f3cfd..2b8e35c781f0 100644 --- a/script/research/zk/groth16/qap.py +++ b/script/research/zk/groth16/qap.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + import numpy as np # Lets prove we know the answer to x**3 + x + 5 == 35 (x = 5) diff --git a/script/research/zk/groth_poly_commit.py b/script/research/zk/groth_poly_commit.py index c121552a4d0a..3ae36ccf248c 100644 --- a/script/research/zk/groth_poly_commit.py +++ b/script/research/zk/groth_poly_commit.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + # This file was *autogenerated* from the file groth_poly_commit.sage diff --git a/script/research/zk/misc.py b/script/research/zk/misc.py index ca205ac1a4b2..c593c16a7614 100644 --- a/script/research/zk/misc.py +++ b/script/research/zk/misc.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + import random def sample_random(fp, seed=None): diff --git a/script/research/zk/multipoly.py b/script/research/zk/multipoly.py index b16910a2e5c4..98ab67fe0197 100644 --- a/script/research/zk/multipoly.py +++ b/script/research/zk/multipoly.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + import numpy as np from finite_fields import finitefield diff --git a/script/research/zk/pasta.py b/script/research/zk/pasta.py index d64ef35235d4..08ce193a96c3 100644 --- a/script/research/zk/pasta.py +++ b/script/research/zk/pasta.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + from finite_fields import finitefield q = 0x40000000000000000000000000000000224698fc094cf91b992d30ed00000001 diff --git a/script/research/zk/polynomial_evalrep.py b/script/research/zk/polynomial_evalrep.py index ade86be8a937..386a001e9311 100644 --- a/script/research/zk/polynomial_evalrep.py +++ b/script/research/zk/polynomial_evalrep.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + #| # Evaluation Representation of Polynomials and FFT optimizations #| In addition to the coefficient-based representation of polynomials used #| in babysnark.py, for performance we will also use an alternative diff --git a/script/research/zk/sonic.py b/script/research/zk/sonic.py index a7b6bbcd56ed..c599f6cae92b 100644 --- a/script/research/zk/sonic.py +++ b/script/research/zk/sonic.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + # From the Sonic paper from finite_fields import finitefield diff --git a/script/research/zk/test.py b/script/research/zk/test.py index a062b0a16073..36b0a9df18e6 100644 --- a/script/research/zk/test.py +++ b/script/research/zk/test.py @@ -1,3 +1,21 @@ +/* This file is part of DarkFi (https://dark.fi) + * + * Copyright (C) 2020-2023 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 . + */ + import random import misc import pasta