Skip to content

Instantly share code, notes, and snippets.

View jaoleal's full-sized avatar
🇧🇷

Shigeru Myamoto jaoleal

🇧🇷
  • São Paulo, Brazil
View GitHub Profile
@jaoleal
jaoleal / black_pearl.rs
Created February 13, 2025 14:04
This is the code used to solved the final part of the "As Relíquias de Schnorr".
use bip39::Mnemonic;
use bitcoin::absolute::LockTime;
use bitcoin::bip32::{DerivationPath, Xpriv};
use bitcoin::consensus::{deserialize, serialize};
use bitcoin::hashes::Hash;
use bitcoin::hex::{Case, DisplayHex, FromHex};
use bitcoin::transaction::Version;
use bitcoin::{secp256k1, Network, OutPoint, Psbt, Script, Sequence, Transaction, TxIn, TxOut};
use miniscript::psbt::PsbtExt;
use miniscript::{DefiniteDescriptorKey, Descriptor, DescriptorPublicKey};
@jaoleal
jaoleal / flake.nix
Last active November 20, 2024 20:24
{
description = "Nix flake for solving Vinteum challenges";
inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.*.tar.gz";
outputs = { self, nixpkgs }:
let
supportedSystems = [
"x86_64-linux"
];
/// Module to group all median-time-past related functions.
pub mod median_time_past {
extern crate alloc;
use alloc::vec;
/// New type to hold the Median-Time-Past value.
pub struct Mtp(u32);
impl Mtp {
/// Gets the MTP value.
pub const fn get_mtp(&self) -> u32 {