Skip to content

Remove mainnet seed phrases and build credential security framework#251

Merged
Mosas2000 merged 37 commits intomainfrom
fix/remove-mainnet-seed-phrases
Mar 11, 2026
Merged

Remove mainnet seed phrases and build credential security framework#251
Mosas2000 merged 37 commits intomainfrom
fix/remove-mainnet-seed-phrases

Conversation

@Mosas2000
Copy link
Copy Markdown
Owner

Summary

Comprehensive credential security hardening for the TipStream repository.
Ensures mainnet mnemonics are never committed, adds detection tooling at
multiple layers (local hook, CI pipeline, verification script), and creates
the missing project documentation.

Related Issue

Closes #222

Changes

Credential Templates

  • Add settings/Mainnet.toml.example and Testnet.toml.example with placeholder values
  • Improve .env.example with deployment-specific variables
  • Add cross-reference to example templates in Devnet.toml header

Secret Scanning

  • Add .gitleaks.toml configuration for BIP-39 mnemonic and key detection
  • Add scripts/hooks/pre-commit to block mnemonic patterns in staged files
  • Add GitHub Actions secret scanning workflow (.github/workflows/secret-scan.yml)
  • Add scripts/verify-no-secrets.sh for on-demand credential auditing

Deployment Safety

  • scripts/deploy.sh validates Mainnet.toml presence, placeholder removal, and git tracking
  • scripts/test-con- scripts/test-con- scripts/test-con- scripts/test-con- `scripts/utput sanitizes private keys from log messages

Documentation

  • Create SECURITY.md with vulnerability reporting and wallet rotation advisory
  • Create ARCHITECTURE.md with system design and data flow
  • Create CONTRIBUTING.md with setup and PR workflow
  • Create CHANGELOG.md following Keep a Changelog format
  • Create ROADMAP.md with phased milestone plan
  • Create docs/CONTRACT-UPGRADE- Create docs/CONTRACT-UPGRADE- Create docs/CONTRACT-UPGRADE- Cgs/- Create docs/scripts/README.md directory guides

Repository Configuration

  • Expand .- Expand .- Expand .- Expand .- Expand .- Expand .- Expand `.- ExPR template with security checklist
  • Add bug report, feature request, and security issue templates
  • Add CODEOWNERS for automatic review on security-sensitive paths

Testing

  • Frontend builds without errors (cd frontend && npm run build)
  • No changes to frontend source code (Vercel deployment unaffected)
  • scripts/verify-no-secrets.sh passes
  • settings/Mainnet.toml is not tracked by git

Securi## Securi## Securi## Securi## Securi## Securi## Securi## Securi## Securi## Securinditions are set to Deny on any new contract calls

  • Environment variables are documented in .env.example if added

Mosas2000 added 30 commits March 9, 2026 23:29
Provide a safe template so contributors can create their own
settings/Mainnet.toml without copying real mnemonics.  The
example includes guidance on keeping private keys out of
version control.
Mirrors the Mainnet example with testnet-specific settings and
a link to the Stacks testnet faucet for funding test accounts.
Explain the purpose of each configuration file, how to create
local copies from the templates, and the security rules that
prevent accidental mnemonic exposure.
Group the Clarinet credential entries with explanatory comments
and add catch-all patterns for PEM, key, p12, and secret files
that should never be committed.
Point contributors toward the .example files when they need
mainnet or testnet credentials, reducing the risk of copying
devnet keys to production.
Define rules that flag mnemonic phrases, Stacks private keys,
and generic high-entropy secrets while allowlisting the devnet
config and example templates.
Scan staged diffs for BIP-39 mnemonic patterns and run gitleaks
when available.  The hook can be installed by copying it into
.git/hooks/pre-commit.
Run gitleaks on every push and pull request to main, using the
project-level .gitleaks.toml configuration.  Catches secrets
that slip past the local pre-commit hook.
Add frontend network and URL variables, clarify the mnemonic
handling expectations, and note that the .env file is covered
by .gitignore.
Cover the disclosure process, smart contract and frontend
security controls, credential management expectations, and
the wallet rotation advisory for compromised mnemonics.
Check that settings/Mainnet.toml is present and does not still
contain placeholder text.  Print actionable instructions when
the file is missing or incomplete.
Add a safety check that refuses to proceed when the credential
file is under version control, preventing accidental pushes
of live mnemonics.
Reject mnemonics that are not 12 or 24 words, catching
truncated or malformed passphrases before they reach the
wallet derivation step.
Propagate the clarinet exit code so CI pipelines and operators
can distinguish a failed deployment from a successful one.
Include the deployment time in the output for audit trails
and post-mortem correlation.
Prevent .vercel/ and .netlify/ from being committed when
developers use the CLI tools locally.
Explain how to fork, install dependencies, configure network
credentials, and submit pull requests.  Reference the pre-commit
hook and security disclosure process.
Reflect the new scripts/hooks directory, example config files,
and the settings README so contributors can find the credential
setup documentation.
Document the gitignore strategy, pre-commit hook, gitleaks CI
scan, and timelock pause control.  Link to SECURITY.md for the
full policy.
Provide scripts/setup-hooks.sh so contributors can install the
pre-commit secret scanner without manual file copying.
Describe the smart contract layer, frontend structure, hosting
setup, wallet integration, and security boundaries referenced
by the README.
Record all credential security improvements made in this branch
under the Unreleased section.
Outline the five-phase development plan from core platform
through governance and advanced features, marking completed
items and current focus areas.
Prompt contributors to confirm no secrets are included,
post conditions are enforced, and environment variables are
documented before requesting review.
Standardize bug reports with reproduction steps, expected vs
actual behavior, and wallet/browser/network details.
Remind reporters to use private disclosure for sensitive issues
while providing a structured format for security reports.
Check that Mainnet.toml, Testnet.toml, and .env are not tracked,
scan tracked files for mnemonic and private-key patterns, and
verify gitignore entries are present.
Add a parallel job that checks gitignore rules and scans for
mnemonic patterns using the project verification script.
Explain the immutability constraint, extension contract pattern,
ownership transfer migration path, timelock mechanics, and
emergency response for compromised keys or vulnerabilities.
Document each script and hook, and highlight the security
expectations around mnemonic handling and credential validation.
Provide a structured format for feature proposals with problem
statement, proposed solution, and alternatives considered.
Require maintainer review on changes to credentials config,
gitignore, security docs, contracts, and CI workflows.
Reject RECIPIENT values that do not match the SP-prefixed
mainnet principal pattern, catching typos before they reach
the network.
Sanitize 64-character hex strings from error messages to prevent
accidental key exposure in terminal logs or CI output.
Provide a single entry point for the supplementary docs folder
and link back to all root-level documentation files.
# Conflicts:
#	.env.example
#	CHANGELOG.md
#	README.md
#	scripts/README.md
#	scripts/test-contract.cjs
…ed-phrases

# Conflicts:
#	CHANGELOG.md
#	README.md
#	SECURITY.md
#	docs/CONTRACT-UPGRADE-STRATEGY.md
@Mosas2000 Mosas2000 merged commit c637c6d into main Mar 11, 2026
4 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🔴 CRITICAL: Remove seed phrases from Mainnet.toml and add to .gitignore

1 participant