This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| 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" | |
| ]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /// 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 { |